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

# Create tickets in bulk



## OpenAPI

````yaml post /v1/tickets/bulk
openapi: 3.0.0
info:
  title: Thena Platform
  description: The Thena Platform API description
  version: 1.0.0
  contact: {}
servers:
  - url: https://platform.thena.ai
    description: Platform
  - url: http://localhost:8000
    description: Local
security:
  - ApiKey: []
tags: []
paths:
  /v1/tickets/bulk:
    post:
      tags:
        - Tickets
      description: This endpoint is only available for enterprise tier organizations.
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTicketsBulkDto'
      responses:
        '201':
          description: Operation successful
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetAllTicketsBulkResponse'
        '401':
          description: User is not authenticated!
        '403':
          description: User does not have access to this resource!
        '404':
          description: Resource not found!
        '429':
          description: Too many requests!
        '500':
          description: Something went wrong!
        '503':
          description: This service/resource is currently unavailable.
components:
  schemas:
    CreateTicketsBulkDto:
      type: object
      properties:
        tickets:
          description: The tickets to create
          type: array
          items:
            $ref: '#/components/schemas/CreateTicketBody'
        options:
          description: The options for creating tickets in bulk
          allOf:
            - $ref: '#/components/schemas/CreateBulkTicketsOptions'
      required:
        - tickets
    GetAllTicketsBulkResponse:
      type: object
      properties:
        status:
          type: boolean
          default: true
          description: The status of the response
        message:
          type: string
          default: Success
          description: The message of the response
        timestamp:
          format: date-time
          type: string
          default: '2024-01-01T00:00:00.000Z'
          description: The timestamp of the response
        data:
          description: The tickets fetched
          type: array
          items:
            $ref: '#/components/schemas/TicketBulkResponseDto'
      required:
        - status
        - message
        - timestamp
        - data
    CreateTicketBody:
      type: object
      properties:
        assignedAgentId:
          type: string
          description: The ID of the assigned agent
        accountId:
          type: string
          description: The ID of the account
        assignedAgentEmail:
          type: string
          description: The email of the assigned agent
        description:
          type: string
          description: The description of the ticket
        dueDate:
          format: date-time
          type: string
          description: The due date of the ticket
        submitterEmail:
          type: string
          description: The email of the submitter
        statusId:
          type: string
          description: The ID of the status, status id if provided is used over status name
        statusName:
          type: string
          description: The name of the status to match against
        priorityId:
          type: string
          description: >-
            The ID of the priority, priority id if provided is used over
            priority name
        priorityName:
          type: string
          description: The name of the priority to match against
        sentimentId:
          type: string
          description: The ID of the sentiment
        metadata:
          type: object
          description: The metadata of the ticket
        typeId:
          type: string
          description: The ID of the type
        isPrivate:
          type: boolean
          description: Whether the ticket is private
        source:
          type: string
          description: The source of the ticket
        aiGeneratedTitle:
          type: string
          description: The AI generated title of the ticket
        aiGeneratedSummary:
          type: string
          description: The AI generated summary of the ticket
        attachmentUrls:
          description: The attachment URLs
          type: array
          items:
            type: string
        customFieldValues:
          description: The custom field values
          type: array
          items:
            $ref: '#/components/schemas/ExternalCustomFieldValuesDto'
        isProactive:
          type: boolean
          description: Whether the ticket is proactive
          default: false
        closedAt:
          format: date-time
          type: string
          description: The closed date of the ticket
        closedById:
          type: string
          description: The ID of the user who closed the ticket
        proactiveChannels:
          type: array
          description: The proactive channels associated with the ticket
          items:
            type: string
            enum:
              - email
              - web-chat
              - slack
        title:
          type: string
          description: The title of the ticket
        requestorEmail:
          type: string
          description: The email of the requestor
        performRouting:
          type: boolean
          description: Whether to perform routing
        teamId:
          type: string
          description: The ID of the team
        formId:
          type: string
          description: The ID of the form
        commentContent:
          type: string
          description: The content of the customer comment
        commentContentHtml:
          type: string
          description: The HTML content of the customer comment
        commentContentJson:
          type: string
          description: The JSON content of the customer comment
        commentAttachmentIds:
          description: The attachment IDs for the customer comment
          type: array
          items:
            type: string
        commentMetadata:
          type: object
          description: The metadata for the customer comment
        commentImpersonatedUserName:
          type: string
          description: The impersonated user name for the customer comment
        commentImpersonatedUserEmail:
          type: string
          description: The impersonated user email for the customer comment
        commentImpersonatedUserAvatar:
          type: string
          description: The impersonated user avatar for the customer comment
        deDuplicationKey:
          type: string
          description: >-
            A deduplication key provided by an external application. The
            platform uses this key to prevent the creation of duplicate tickets.
          maxLength: 255
      required:
        - title
        - requestorEmail
        - teamId
    CreateBulkTicketsOptions:
      type: object
      properties:
        stopOnError:
          type: boolean
          description: Whether to stop on error
    TicketBulkResponseDto:
      type: object
      properties:
        id:
          type: string
          description: The ticket id
        title:
          type: string
          description: The ticket title
      required:
        - id
        - title
    ExternalCustomFieldValuesDto:
      type: object
      properties: {}
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: x-api-key
      description: 'Enter your API key '

````