> ## Documentation Index
> Fetch the complete documentation index at: https://failfast.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a ticket

> Create a new record with optional child records.



## OpenAPI

````yaml /api-reference/openapi.json post /crm/ticket/
openapi: 3.0.3
info:
  title: Fail Fast API
  version: v1
  description: >-
    REST API for the Fail Fast platform. Authenticate with a workspace API key
    sent as a bearer token. Every response uses the `{message, error, data}`
    envelope.
servers:
  - url: https://api.failfast.ai
security: []
paths:
  /crm/ticket/:
    post:
      tags:
        - CRM
      summary: Create a ticket
      description: Create a new record with optional child records.
      operationId: crm_ticket_create
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Ticket'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/Ticket'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/Ticket'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                type: object
                required:
                  - message
                  - error
                  - data
                properties:
                  message:
                    type: string
                    description: Human-readable outcome of the request.
                  error:
                    type: boolean
                    description: true when the request failed.
                    example: false
                  data:
                    $ref: '#/components/schemas/Ticket'
          description: ''
      security:
        - apiKey: []
components:
  schemas:
    Ticket:
      type: object
      description: |-
        A ModelSerializer that takes an additional `fields` argument that
        controls which fields should be displayed.
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        custom_fields:
          nullable: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        deleted_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        audit_status:
          allOf:
            - $ref: '#/components/schemas/AuditStatusEnum'
          readOnly: true
        consecutive_code:
          type: string
          nullable: true
          maxLength: 30
        channel:
          $ref: '#/components/schemas/ChannelEnum'
        subject:
          type: string
        description:
          type: string
          nullable: true
        status:
          $ref: '#/components/schemas/TicketStatusEnum'
        priority:
          $ref: '#/components/schemas/PriorityEnum'
        due_at:
          type: string
          format: date-time
          nullable: true
        resolved_at:
          type: string
          format: date-time
          nullable: true
        tags:
          nullable: true
        member:
          type: string
          format: uuid
          readOnly: true
        created_by:
          type: string
          format: uuid
          readOnly: true
        updated_by:
          type: string
          format: uuid
          readOnly: true
          nullable: true
        deleted_by:
          type: string
          format: uuid
          readOnly: true
          nullable: true
        stakeholder:
          type: string
          format: uuid
        assigned_to_user:
          type: string
          format: uuid
          nullable: true
      required:
        - audit_status
        - channel
        - created_at
        - created_by
        - deleted_at
        - deleted_by
        - id
        - member
        - stakeholder
        - subject
        - updated_at
        - updated_by
    AuditStatusEnum:
      enum:
        - C
        - U
        - D
      type: string
      description: |-
        * `C` - Created
        * `U` - Updated
        * `D` - Deleted
    ChannelEnum:
      enum:
        - WA
        - EM
        - PH
        - WB
      type: string
      description: |-
        * `WA` - WhatsApp
        * `EM` - Email
        * `PH` - Phone
        * `WB` - Web
    TicketStatusEnum:
      enum:
        - O
        - IP
        - WC
        - RE
        - CL
      type: string
      description: |-
        * `O` - Open
        * `IP` - In Progress
        * `WC` - Waiting Customer
        * `RE` - Resolved
        * `CL` - Closed
    PriorityEnum:
      enum:
        - L
        - M
        - H
        - U
      type: string
      description: |-
        * `L` - Low
        * `M` - Medium
        * `H` - High
        * `U` - Urgent
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: >-
        Workspace API key sent as a bearer token: `Authorization: Bearer
        failfast_...`. Create keys in Settings -> Workspace -> API Keys.

````