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

# Create a ticket

> Opens a conversation. There is no subject: a ticket is described by its first message.

Supplying `requester.external_id` asserts that **you** authenticated this person, so the requester is stored verified. An email address alone is not proof and stores unverified.

Accepts an `Idempotency-Key` header. A repeat within 24 hours returns the original response rather than opening a second ticket.



## OpenAPI

````yaml /api-reference/openapi.json post /tickets
openapi: 3.1.0
info:
  title: miniDesk API
  version: 1.0.0
  description: >-
    Create and work support tickets from your own systems. Every response
    carries an `X-Request-Id`; quote it when reporting a problem.
servers:
  - url: https://api.minidesk.ai/v1
security:
  - bearerAuth: []
paths:
  /tickets:
    post:
      tags:
        - Tickets
      summary: Create a ticket
      description: >-
        Opens a conversation. There is no subject: a ticket is described by its
        first message.


        Supplying `requester.external_id` asserts that **you** authenticated
        this person, so the requester is stored verified. An email address alone
        is not proof and stores unverified.


        Accepts an `Idempotency-Key` header. A repeat within 24 hours returns
        the original response rather than opening a second ticket.
      operationId: createTicket
      parameters:
        - name: Idempotency-Key
          in: header
          required: false
          description: >-
            Any unique string. Replays within 24 hours return the first
            response.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                body:
                  type: string
                  minLength: 1
                  maxLength: 50000
                requester:
                  type: object
                  properties:
                    email:
                      type: string
                      maxLength: 254
                      format: email
                      pattern: >-
                        ^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
                    name:
                      type: string
                      minLength: 1
                      maxLength: 120
                    external_id:
                      type: string
                      minLength: 1
                      maxLength: 200
                priority:
                  type: string
                  enum:
                    - low
                    - normal
                    - high
                    - urgent
                category:
                  type: string
                  minLength: 1
                  maxLength: 60
                language:
                  type: string
                  minLength: 2
                  maxLength: 35
                  pattern: ^[A-Za-z]{2,8}(-[A-Za-z0-9]{1,8})*$
              required:
                - body
                - requester
      responses:
        '201':
          description: The ticket was created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Ticket'
        '400':
          description: The body failed validation. `field` names the offending property.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing, malformed, or revoked credential.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '402':
          description: >-
            Out of conversations for this period. Reads and internal notes still
            work.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: Over the rate limit. See the `Retry-After` header.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Ticket:
      type: object
      properties:
        id:
          type: string
          format: uuid
          pattern: >-
            ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        reference:
          type: string
        status:
          type: string
          enum:
            - new
            - open
            - pending
            - resolved
            - closed
        priority:
          type: string
          enum:
            - low
            - normal
            - high
            - urgent
        category:
          anyOf:
            - type: string
            - type: 'null'
        source:
          type: string
          enum:
            - agent
            - widget
            - email
            - api
        language:
          anyOf:
            - type: string
            - type: 'null'
        requester:
          anyOf:
            - type: object
              properties:
                id:
                  type: string
                  format: uuid
                  pattern: >-
                    ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                email:
                  anyOf:
                    - type: string
                    - type: 'null'
                name:
                  anyOf:
                    - type: string
                    - type: 'null'
                is_verified:
                  type: boolean
              required:
                - id
                - email
                - name
                - is_verified
            - type: 'null'
        created_at:
          type: string
        updated_at:
          type: string
      required:
        - id
        - reference
        - status
        - priority
        - category
        - source
        - language
        - requester
        - created_at
        - updated_at
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - validation_failed
                - invalid_credential
                - identity_required
                - identity_invalid
                - quota_exhausted
                - forbidden
                - not_found
                - conflict
                - invalid_transition
                - rate_limited
                - internal_error
                - service_unavailable
            message:
              type: string
            field:
              type: string
          required:
            - code
            - message
      required:
        - error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        An API credential from **Settings → API**, sent as `Authorization:
        Bearer mdsk_api_...`. Issued per workspace and shown once.

````