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

# Creates a ticket for the authenticated service provider.



## OpenAPI

````yaml /api-reference/openapi.json post /v1/tickets
openapi: 3.0.4
info:
  title: Public API
  description: Gorelo Public API documentation.
  version: 1.0.0
servers:
  - url: https://api.usw.gorelo.io
    description: US
  - url: https://api.aue.gorelo.io
    description: Australia
security:
  - ApiKeyAuth: []
tags:
  - name: Attachments
    description: "Uploading a file, for anything that can carry one. One endpoint rather than one per record\r\ntype, because the upload itself is identical - only the record it is checked against differs."
  - name: Alerts
    description: Alerts management operations
  - name: Assets
    description: Assets management operations
  - name: Billing
    description: Billing management operations
  - name: Tickets
    description: Tickets management operations
  - name: Clients
    description: Clients management operations
  - name: Contacts
    description: Contacts management operations
  - name: Deletions
    description: Deletions management operations
  - name: Documents
    description: Documents management operations
  - name: Forms
    description: Forms management operations
  - name: Organization
    description: Organization management operations
  - name: Projects
    description: Projects management operations
paths:
  /v1/tickets:
    post:
      tags:
        - Tickets
      summary: Creates a ticket for the authenticated service provider.
      operationId: post_v1_tickets
      requestBody:
        description: Ticket details.
        content:
          application/json-patch+json:
            schema:
              $ref: '#/components/schemas/CreateTicketCommand'
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTicketCommand'
          text/json:
            schema:
              $ref: '#/components/schemas/CreateTicketCommand'
          application/*+json:
            schema:
              $ref: '#/components/schemas/CreateTicketCommand'
      responses:
        '200':
          description: OK
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/CreateTicketResultBaseResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/CreateTicketResultBaseResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/CreateTicketResultBaseResponse'
        '400':
          description: Bad Request
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
        '401':
          description: Unauthorized
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
        '500':
          description: Internal Server Error
          content:
            text/plain:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
            text/json:
              schema:
                $ref: '#/components/schemas/ObjectBaseResponse'
components:
  schemas:
    CreateTicketCommand:
      required:
        - GroupId
        - StatusId
        - Title
        - TypeId
      type: object
      properties:
        Title:
          minLength: 1
          type: string
          description: Ticket title/subject. Required. Maximum 250 characters.
          example: Printer on 3rd floor is offline
        CreatedByName:
          type: string
          description: >-
            Display name to record as the ticket creator when no contact is
            resolved. Omitted or blank, it is recorded as `API`.
          nullable: true
        CreatedOn:
          type: string
          description: "Backdate the ticket's creation timestamp — for importing tickets from another system.\r\nMust not be in the future. Omit to use the current time. Required when ClosedOn or\r\nUpdatedOn is supplied. A caller migrating a ticket sends CreatedOn, ClosedOn and UpdatedOn\r\ntogether, so the ticket keeps the dates it had in the other system.\r\nSend only when importing history. A record with this field set sends no emails or notifications."
          format: date-time
          nullable: true
        ClosedOn:
          type: string
          description: "The date the ticket was closed, for importing already-closed tickets from another system.\r\nRequires CreatedOn to be supplied. Only valid when the ticket is created in a closed status.\r\nMust not be in the future or earlier than CreatedOn. Omit to have a ticket created in a\r\nclosed status closed as of its creation time.\r\nSend only when importing history. A record with this field set sends no emails or notifications."
          format: date-time
          nullable: true
        UpdatedOn:
          type: string
          description: "Backdate the ticket's last-activity timestamp so an imported ticket does not sort above\r\nlive work. Requires CreatedOn to be supplied. Must not be in the future or earlier than\r\nCreatedOn. Defaults to ClosedOn when supplied, otherwise to CreatedOn."
          format: date-time
          nullable: true
        ClientId:
          type: integer
          description: Identifier of the client the ticket belongs to.
          format: int64
          nullable: true
        LocationId:
          type: integer
          description: >-
            Identifier of the client location the ticket belongs to. Requires
            ClientId.
          format: int64
          nullable: true
        ContactId:
          type: integer
          description: "Identifier of the primary contact for the ticket. With a ClientId it may be a contact of any\r\nclient; without one it must be a temporary contact (IsTemporaryContact true)."
          format: int64
          nullable: true
        CcContactIds:
          type: array
          items:
            type: integer
            format: int64
          description: "Identifiers of additional (CC) contacts. At most 100. Same rule as ContactId: contacts of\r\nany client, or temporary contacts when the ticket has no client."
          nullable: true
        StatusId:
          type: integer
          description: >-
            Initial status identifier. Required; must be an existing status for
            the service provider.
          format: int64
          example: 1
        GroupId:
          type: integer
          description: >-
            Identifier of the technician group the ticket is assigned to.
            Required.
          format: int64
          example: 101
        Description:
          type: string
          description: "Ticket description / body, as HTML. Text without markup is wrapped in a paragraph. A literal < or >\r\nin the text must be sent as `&lt;` / `&gt;`."
          nullable: true
        PriorityId:
          $ref: '#/components/schemas/TicketPriority'
        SourceId:
          $ref: '#/components/schemas/TicketSource'
        TypeId:
          type: integer
          description: Ticket type identifier. Required.
          format: int64
          example: 1
        LeadAssigneeId:
          type: integer
          description: Identifier of the lead assignee (technician).
          format: int64
          nullable: true
        AssistingAssigneeIds:
          type: array
          items:
            type: integer
            format: int64
          description: Identifiers of assisting assignees (technicians).
          nullable: true
        WatcherIds:
          type: array
          items:
            type: integer
            format: int64
          description: Identifiers of technicians watching the ticket.
          nullable: true
        TagIds:
          type: array
          items:
            type: integer
            format: int64
          description: Identifiers of tags to apply to the ticket.
          nullable: true
        AgentAssetIds:
          type: array
          items:
            type: string
            format: uuid
          description: Identifiers of agent (managed device) assets to link to the ticket.
          nullable: true
        CustomAssetIds:
          type: array
          items:
            type: string
            format: uuid
          description: Identifiers of custom assets to link to the ticket.
          nullable: true
        UptimeIds:
          type: array
          items:
            type: string
            format: uuid
          description: Identifiers of uptime monitors to link to the ticket.
          nullable: true
        SendTicketCreatedEmail:
          type: boolean
          description: "When true, sends a \"ticket created\" email to the contact. Defaults to false. Ignored when\r\nCreatedOn or ClosedOn is supplied."
          nullable: true
        IsUnread:
          type: boolean
          description: "Whether the ticket is created in an unread state. Defaults to true. Ignored when CreatedOn\r\nor ClosedOn is supplied: the ticket is created read."
          nullable: true
      additionalProperties: false
      description: "Request body for creating a ticket. The owning service provider is resolved from the\r\nrequest context, not from the body."
    CreateTicketResultBaseResponse:
      type: object
      properties:
        StatusCode:
          $ref: '#/components/schemas/HttpStatusCode'
        IsSuccess:
          type: boolean
        Data:
          $ref: '#/components/schemas/CreateTicketResult'
        DataContext:
          type: object
          additionalProperties: false
          nullable: true
          example: null
        Notifications:
          type: array
          items:
            $ref: '#/components/schemas/Error'
      additionalProperties: false
    ObjectBaseResponse:
      type: object
      properties:
        StatusCode:
          $ref: '#/components/schemas/HttpStatusCode'
        IsSuccess:
          type: boolean
        Data:
          nullable: true
        DataContext:
          $ref: '#/components/schemas/ErrorDataContext'
        Notifications:
          type: array
          items:
            $ref: '#/components/schemas/Error'
      additionalProperties: false
    TicketPriority:
      enum:
        - 0
        - 1
        - 2
        - 3
        - 4
      type: integer
      format: int32
    TicketSource:
      enum:
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
      type: integer
      format: int32
    HttpStatusCode:
      enum:
        - 100
        - 101
        - 102
        - 103
        - 200
        - 201
        - 202
        - 203
        - 204
        - 205
        - 206
        - 207
        - 208
        - 226
        - 300
        - 301
        - 302
        - 303
        - 304
        - 305
        - 306
        - 307
        - 308
        - 400
        - 401
        - 402
        - 403
        - 404
        - 405
        - 406
        - 407
        - 408
        - 409
        - 410
        - 411
        - 412
        - 413
        - 414
        - 415
        - 416
        - 417
        - 421
        - 422
        - 423
        - 424
        - 426
        - 428
        - 429
        - 431
        - 451
        - 500
        - 501
        - 502
        - 503
        - 504
        - 505
        - 506
        - 507
        - 508
        - 510
        - 511
      type: integer
      format: int32
    CreateTicketResult:
      type: object
      properties:
        Id:
          type: string
          description: Identifier of the newly created ticket.
          format: uuid
          nullable: true
      additionalProperties: false
      description: Result of a create-ticket request.
    Error:
      type: object
      properties:
        Code:
          pattern: ^[0-9]{6}$
          type: string
          description: 6-digit MMTTNN error code. See the Public API error-code registry.
          example: '070101'
        Message:
          type: string
        PropertyName:
          type: string
          nullable: true
        ActionHint:
          type: string
          nullable: true
        DocUrl:
          type: string
          nullable: true
      additionalProperties: false
    ErrorDataContext:
      type: object
      properties:
        TraceId:
          type: string
          description: Request correlation id. Quote this when reporting a problem.
          nullable: true
      additionalProperties: false
      description: "The `DataContext` of an error response: carries the correlation id for the failed\r\nrequest."
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      description: >-
        Your Gorelo API key. See [Generate API key](/generate-api-key). If your
        data is hosted in Australia, click the base URL at the top of this page
        and select `https://api.aue.gorelo.io`.
      name: X-API-Key
      in: header

````

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