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

# Open a ticket

> Opens a ticket on a conversation: the agent of its channel owns it. Its members are notified.



## OpenAPI

````yaml /api-reference/v2.0/openapi.json post /tickets
openapi: 3.1.0
info:
  title: Shortext API
  description: >-
    **Versioning**: every version is a frozen contract. A released version only
    receives additive changes

    (new endpoints, new optional fields, new response fields); anything breaking
    ships in a new version.

    Responses carry `X-Shortext-Api-Version`. When a version is scheduled for
    removal, responses also carry

    `Deprecation` and `Sunset` headers; after the sunset date the version
    answers HTTP 410.

    The list of versions and their status is available at `GET /api/versions`.


    **Responses**: always HTTP 200. Check `success` and `code` (`1000` =
    success), see `ApiEnvelope`.

    On failure, `trace_id` identifies the request for support.


    **Rate limit**: 300 requests per minute per company, shared by all its keys
    and by every API version.

    Responses carry `X-RateLimit-Limit` and `X-RateLimit-Remaining`; beyond the
    limit the API answers

    HTTP 429 with `Retry-After` (seconds) and the usual envelope. Prefer
    webhooks to polling.
  version: '2.0'
servers:
  - url: https://shortext.ny-corp.io/api/v2.0
security: []
tags:
  - name: Agents
    description: Agents
  - name: Knowledge
    description: Knowledge
  - name: Dynamic links
    description: Dynamic links
  - name: Billing
    description: Billing
  - name: Channels
    description: Channels
  - name: Conversations
    description: Conversations
  - name: Account
    description: Account
  - name: Tickets
    description: Tickets
  - name: Templates
    description: Templates
  - name: Hosted sessions
    description: Hosted sessions
  - name: Webhooks
    description: Webhooks
paths:
  /tickets:
    post:
      tags:
        - Tickets
      summary: Open a ticket
      description: >-
        Opens a ticket on a conversation: the agent of its channel owns it. Its
        members are notified.
      operationId: createTicket
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TicketInput'
      responses:
        '200':
          description: >-
            Always HTTP 200: the outcome is in `success` and `code` (absolute
            value of the response code).
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/ApiEnvelope'
                  - properties:
                      body:
                        $ref: '#/components/schemas/Ticket'
                    type: object
      security:
        - bearerAuth: []
components:
  schemas:
    TicketInput:
      properties:
        conversation_id:
          description: >-
            Required on creation: the ticket follows the contact of this
            conversation and the agent of its channel
          type: string
        subject:
          description: Required on creation
          type: string
          maxLength: 255
        description:
          type:
            - string
            - 'null'
          maxLength: 10000
        status:
          description: >-
            Status code of the agent; on creation, its first open status by
            default. A resolved or terminal status resolves or closes the
            ticket, an open one reopens it.
          type: string
          example: in_progress
        priority:
          description: 'SLA policy code of the agent: sets the due dates; null removes it'
          type:
            - string
            - 'null'
          example: high
      type: object
    ApiEnvelope:
      properties:
        success:
          type: boolean
          example: true
        code:
          type: integer
          example: 1000
        message:
          type: string
          example: Request success.
        body:
          description: Endpoint payload, null when there is none
        token:
          description: Present only on authentication routes
          type:
            - string
            - 'null'
        trace_id:
          description: Present only when success is false
          type:
            - string
            - 'null'
      type: object
    Ticket:
      properties:
        id:
          description: >-
            Public representation of tickets, their statuses, priorities and
            activity (API v2.0)
          type: string
          example: STT-XXXXX
        subject:
          type: string
        description:
          type:
            - string
            - 'null'
        status:
          $ref: '#/components/schemas/TicketStatus'
        priority:
          oneOf:
            - $ref: '#/components/schemas/SlaPolicy'
            - type: 'null'
        agent:
          properties:
            id:
              type: string
            name:
              type: string
          type: object
        conversation_id:
          description: Conversation of the contact the ticket is about
          type:
            - string
            - 'null'
        contact:
          description: Same block as in a Conversation
          type:
            - object
            - 'null'
        response_due_at:
          description: Set by the priority (SLA)
          type:
            - string
            - 'null'
          format: date-time
        resolve_due_at:
          description: Set by the priority (SLA)
          type:
            - string
            - 'null'
          format: date-time
        responded_at:
          type:
            - string
            - 'null'
          format: date-time
        resolved_at:
          type:
            - string
            - 'null'
          format: date-time
        closed_at:
          type:
            - string
            - 'null'
          format: date-time
        response_breached:
          description: Answered after response_due_at
          type: boolean
        resolve_breached:
          description: Resolved after resolve_due_at
          type: boolean
        satisfaction_rating:
          type:
            - integer
            - 'null'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      type: object
    TicketStatus:
      properties:
        code:
          description: 'Slug of the name: what tickets refer to'
          type: string
          example: in_progress
        name:
          type: string
          example: In progress
        position:
          description: Order on the tickets board
          type: integer
        active:
          type: boolean
        resolved:
          description: Tickets moved here are resolved
          type: boolean
        terminal:
          description: Tickets moved here are closed
          type: boolean
      type: object
    SlaPolicy:
      properties:
        priority:
          description: 'Slug of the label: what tickets refer to'
          type: string
          example: high
        label:
          type: string
          example: High
        response_time:
          description: Working minutes to answer (Monday to Friday, 8:00 to 18:00)
          type: integer
          example: 60
        resolve_time:
          description: Working minutes to resolve
          type: integer
          example: 480
      type: object
  securitySchemes:
    bearerAuth:
      type: http
      description: >-
        Company API key, sent as `Authorization: Bearer <key>`. Create it in the
        dashboard (Developer > API Keys) with the permissions the integration
        needs.
      scheme: bearer

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.