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

# Create a new ticket with an optional initial message

> Create a new ticket and optionally post an initial message in a single request.
Provide either a session (contact ID) or email to associate the ticket with a contact.
If an email is provided and no contact exists, one will be created automatically.



## OpenAPI

````yaml https://api.gleap.io/api-docs.json post /tickets/compose
openapi: 3.0.0
info:
  title: gleap-server
  version: 14.0.0
  contact: {}
servers:
  - url: https://api.gleap.io/v3
security: []
paths:
  /tickets/compose:
    post:
      tags:
        - Ticket
      summary: Create a new ticket with an optional initial message
      description: >-
        Create a new ticket and optionally post an initial message in a single
        request.

        Provide either a session (contact ID) or email to associate the ticket
        with a contact.

        If an email is provided and no contact exists, one will be created
        automatically.
      operationId: CreateTicketWithMessage
      parameters:
        - in: header
          name: project
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTicketWithMessageDto'
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema: {}
      security:
        - jwt: []
components:
  schemas:
    CreateTicketWithMessageDto:
      properties:
        type:
          type: string
        title:
          type: string
        message:
          type: string
        priority:
          type: string
        status:
          type: string
        processingUser:
          type: string
        processingTeam:
          type: string
        tags:
          items:
            type: string
          type: array
        session:
          type: string
        email:
          type: string
        formData: {}
        preventAutoReply:
          type: boolean
        pipelineEntry:
          items:
            type: string
          type: array
          description: >-
            CRM pipeline entries to link this ticket to (see CreateTicketDto).
            The

            pipeline create-ticket automation passes the entry that triggered
            it.
      required:
        - type
        - title
      type: object
      additionalProperties: false
  securitySchemes:
    jwt:
      type: http
      scheme: bearer
      bearerFormat: JWT

````