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

# Create ticket

> Creates a new ticket.

<Info>Replace `{your-subdomain}` with your workspace's subdomain. <br /> Learn how to find your subdomain in [Workspace subdomain](/api/workspace-subdomain).</Info>


## OpenAPI

````yaml bundled/tickets.yaml POST /tickets
openapi: 3.0.3
info:
  title: NeetoDesk APIs
  version: 2.0.0
servers:
  - description: NeetoDesk APIs
    url: https://{your-subdomain}.neetodesk.com/api/external/v2
    variables:
      your-subdomain:
        default: spinkart
        description: >-
          Replace **spinkart** with your [workspace's
          subdomain](/api/workspace-subdomain).
security: []
paths:
  /tickets:
    post:
      summary: Create a ticket
      description: Creates a new ticket.
      parameters:
        - $ref: '#/components/parameters/api_key_header'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTicketRequest'
      responses:
        '201':
          description: Created - Ticket created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  ticket:
                    $ref: '#/components/schemas/CreatedTicket'
components:
  parameters:
    api_key_header:
      in: header
      name: X-Api-Key
      description: >-
        Use the X-Api-Key header to provide your workspace API key. Refer to
        [Authentication](/api/authentication) for more information.
      required: true
      schema:
        type: string
        default: your-api-key
  schemas:
    CreateTicketRequest:
      allOf:
        - $ref: '#/components/schemas/BaseTicketFields'
        - type: object
          required:
            - email
            - subject
            - description
          properties:
            name:
              type: string
              description: Name of the customer.
              example: John Luther
            channel:
              type: string
              enum:
                - email
                - ui
                - twitter
                - chat
                - form
                - api
                - whatsapp
                - telephony
              description: >-
                Source of the ticket. Defaults to api if not specified or if an
                invalid channel is provided.
              example: email
            to:
              type: string
              description: >-
                Array of additional emails to be added to the `to` field of any
                responses from the ticket.
              example: '["eve@example.com","kevin@example.com"]'
            cc:
              type: string
              description: >-
                Array of emails to be added to the `cc` field of any responses
                from the ticket.
              example: '["eve@example.com","kevin@example.com"]'
            group:
              type: string
              description: >-
                Name of an existing
                [group](https://help.neetodesk.com/articles/group).
              example: sales
            assignee_email:
              type: string
              format: email
              description: Email address belonging to a team member.
              example: oliver@example.com
            status:
              type: string
              description: >
                Status for the ticket. Default statuses are `new`, `open`,
                `on_hold`,

                `waiting_on_customer`, `closed`, `spam` and `trash`. Custom
                statuses are also

                supported. There is no `resolved` status, so a source ticket
                that was resolved

                maps to `closed`, paired with `closed_at`. `trash` cannot be set
                at creation.
              example: open
            priority:
              type: string
              description: Priority for the ticket.
              enum:
                - low
                - medium
                - high
                - urgent
              example: low
            category:
              type: string
              description: >-
                Category for the ticket. Default categories include `None`,
                `Questions`, `Incident`, `Problem`, `Feature request`, `Refund`.
                Custom categories are also supported.
              example: Questions
            sub_category_one:
              type: string
              description: Sub-category for the ticket.
              example: Billing
            sub_category_two:
              type: string
              description: Second-level sub-category for the ticket.
              example: Refund
            tags:
              type: array
              items:
                type: string
              description: Tags to assign to the ticket.
              example:
                - refund
                - urgent
            created_at:
              type: string
              format: date-time
              description: >
                Original creation time, for importing a historical ticket. ISO
                8601.

                Supplying any of `created_at`, `updated_at` or `closed_at` marks
                the

                request as an import. A value that cannot be parsed is rejected
                rather

                than quietly stored as the time of the request.
              example: '2021-03-04T10:00:00Z'
            updated_at:
              type: string
              format: date-time
              description: >
                Original time of last activity. ISO 8601. Comments added
                afterwards with

                their own `created_at` carry this forward to the latest
                comment's date,

                and never move it backwards.
              example: '2021-06-09T12:00:00Z'
            closed_at:
              type: string
              format: date-time
              description: >
                Original close time, used together with `status: closed`. ISO
                8601. It also

                sets the resolution timestamp and the resolution time that agent
                and team

                performance reports average. Omit it on a ticket created closed
                and the

                ticket's own `created_at` is recorded, giving a zero resolution
                time rather

                than inventing the whole gap up to today.
              example: '2021-03-07T10:00:00Z'
            skip_notifications:
              type: boolean
              description: >
                Suppresses everything creating a ticket would otherwise set off:
                automation

                rules and any email they send, webhooks, agent push
                notifications, Zapier,

                Google Sheets, product analytics, the timeline entry, and SLA
                escalation for

                a due date that has already passed. Defaults to `true` when any
                of

                `created_at`, `updated_at` or `closed_at` is supplied, because
                backdating

                implies an import. Send `false` to backdate and still notify.


                Because webhooks and Zapier are among the things it suppresses,
                anything

                downstream that mirrors your tickets will not see the imported
                ones and has

                to be reconciled separately.
              example: true
            external_id:
              type: string
              description: >
                Identifier for this ticket in the system it came from. Stored,
                returned on

                the ticket, and filterable through `GET /tickets?external_id=`,
                so a repeated

                import can find what it already created instead of duplicating
                it.
              example: CP-1234
            source:
              type: string
              description: >-
                Name of the system `external_id` refers to. Only meaningful
                alongside `external_id`.
              example: concierge_plus
            attachments:
              type: array
              items:
                type: string
              description: >
                Signed ids returned by [Upload
                attachment](/api/attachments/create).

                The files are attached to the ticket's opening message. A signed
                id minted in

                another workspace is rejected. Attachments are all-or-nothing:
                if any id in

                the array is unknown, malformed or from another workspace, the
                whole request

                fails and no ticket is created.
              example:
                - eyJfcmFpbHMiOnsiZGF0YSI6IjEyMyJ9fQ==
    CreatedTicket:
      type: object
      properties:
        id:
          type: string
          example: aaaabbbb-cccc-dddd-eeee-ffff00003333
        number:
          type: integer
          example: 42
        url:
          type: string
          example: https://example.neetodesk.com/admin/tickets/42
    BaseTicketFields:
      type: object
      properties:
        email:
          type: string
          description: Email address of the customer.
          example: john@example.com
        subject:
          type: string
          description: Subject for the ticket.
          example: How to resolve the pending payments
        description:
          type: string
          description: Description for the ticket.
          example: I need your help in resolving the pending payments.
        ticket_fields:
          type: object
          description: >-
            Custom ticket fields. Refer to the [ticket
            fields](https://help.neetodesk.com/articles/ticket-fields) article
            for more details.
          example:
            Country: USA

````