Skip to content

POST   /tickets

Create a new ticket

Create a new ticket with the provided data. If the ticket type has auto-assignment enabled and a rotation configured, the ticket will be automatically assigned to the next user in the rotation based on weighted round-robin logic.

Authentication Required

Authorization: Bearer {token}   header string

This header is required to access this endpoint

Required Parameters

x-account-id   header string

Account ID for the request

Request Body

{
"subject": "string",
"description": "string",
"category": "string",
"source": "string",
"requesterId": "string",
"requesterType": "string"
}

Try it out

Loading...

Output:

Responses

Description

Ticket created successfully

{
"id": 0,
"uniqueId": "string",
"accountId": "string",
"ticketNumber": "string",
"ticketTypeId": "string",
"subject": "string",
"description": "string",
"status": "string",
"priority": "string",
"category": "string",
"source": "string",
"requesterId": "string",
"requesterName": "string",
"requesterEmail": "string",
"requesterPhone": "string",
"requesterType": "string",
"assignedTo": "string",
"assignedTeamId": 0,
"merchantId": 0,
"merchantName": "string",
"leadId": 0,
"applicationId": "string",
"midId": 0,
"createdAt": "string",
"updatedAt": "string",
"resolvedAt": "string",
"closedAt": "string",
"lastResponseAt": "string",
"lastCustomerResponseAt": "string",
"slaStatus": "string",
"slaFirstResponseDue": "string",
"slaFirstResponseMet": false,
"slaResolutionDue": "string",
"slaResolutionMet": false,
"slaBreachedAt": "string",
"slaPausedAt": "string",
"slaTotalPausedTime": 0,
"responseCount": 0,
"internalNoteCount": 0,
"attachmentCount": 0,
"reopenCount": 0,
"escalationCount": 0,
"firstResponseTime": 0,
"resolutionTime": 0,
"customFields": {},
"tags": [
"string"
],
"metaData": {}
}

References

#/components/parameters/xAccountIdHeader

in: header
name: x-account-id
schema:
type: string
description: Account ID for the request
required: true
example: "2311"

#/components/schemas/TicketInput

type: object
description: Input for creating a new ticket
properties:
ticketTypeId:
type: string
description: ID of the ticket type. If the ticket type has auto-assignment
enabled, the ticket will be automatically assigned.
subject:
type: string
description: Subject line of the ticket
description:
type: string
description: Detailed description of the ticket
status:
type: string
enum:
- open
- in_progress
- waiting_customer
- waiting_internal
- resolved
- closed
default: open
description: Initial status of the ticket
priority:
type: string
enum:
- low
- medium
- high
- urgent
default: medium
description: Priority level of the ticket
category:
type: string
enum:
- technical
- billing
- account
- compliance
- feature_request
- underwriting
- general_support
- general_forms
- retention
- activations
- fee_change_forms
- bank_submissions
description: Category of the ticket
source:
type: string
enum:
- email
- phone
- portal
- internal
- api
description: Source where the ticket was created
requesterId:
type: string
description: >
ID of the person/entity who requested the ticket. For
application/lead/merchant/mid types, this should be the unique ID or
integer ID of the entity. For user type, this should be the user's email.
For external type, this can be any identifier.
requesterName:
type: string
description: >
Name of the requester. REQUIRED ONLY for requesterType='external'. For all
other types, this will be automatically derived from the related entity
and any provided value will be ignored.
requesterEmail:
type: string
description: >
Email of the requester. REQUIRED ONLY for requesterType='external'. For
all other types, this will be automatically derived from the related
entity and any provided value will be ignored.
requesterPhone:
type: string
description: >
Phone number of the requester. Optional for requesterType='external'. For
all other types, this will be automatically derived from the related
entity and any provided value will be ignored.
requesterType:
type: string
enum:
- application
- lead
- user
- merchant
- merchant-internal
- mid
- external
description: >
Type of requester. 'application' pulls data from application DBA
name/email/phone. 'lead' pulls from lead name/email/phone. 'user' pulls
from user name/email. 'merchant' and 'merchant-internal' pull from
merchant DBA and principal contact. 'mid' pulls from MID descriptor and
merchant principal. 'external' requires requesterName and requesterEmail
to be provided.
assignedTo:
type: string
description: User ID to manually assign the ticket to (overrides auto-assignment)
assignedTeamId:
type: integer
description: Team ID to assign the ticket to
merchantId:
type: integer
description: ID of the related merchant
leadId:
type: integer
description: ID of the related lead
applicationId:
type: string
description: ID of the related application
midId:
type: integer
description: ID of the related MID
customFields:
type: object
description: Custom fields specific to the ticket type
tags:
type: array
items:
type: string
description: Tags to associate with the ticket
required:
- subject
- description
- category
- source
- requesterId
- requesterType

#/components/schemas/Ticket

type: object
description: Ticket object representing a customer support ticket
properties:
id:
type: integer
description: Internal database ID
uniqueId:
type: string
description: Unique identifier for the ticket
accountId:
type: string
description: ID of the account that owns this ticket
ticketNumber:
type: string
description: Human-readable ticket number (e.g., TKT-12345)
ticketTypeId:
type: string
description: ID of the ticket type
subject:
type: string
description: Subject line of the ticket
description:
type: string
description: Detailed description of the ticket
status:
type: string
enum:
- open
- in_progress
- waiting_customer
- waiting_internal
- resolved
- closed
description: Current status of the ticket
priority:
type: string
enum:
- low
- medium
- high
- urgent
description: Priority level of the ticket
category:
type: string
enum:
- technical
- billing
- account
- compliance
- feature_request
- underwriting
- general_support
- general_forms
- retention
- activations
- fee_change_forms
- bank_submissions
description: Category of the ticket
source:
type: string
enum:
- email
- phone
- portal
- internal
- api
description: Source where the ticket was created
requesterId:
type: string
description: ID of the person/entity who requested the ticket
requesterName:
type: string
description: Name of the requester (auto-derived for non-external types)
requesterEmail:
type: string
description: Email of the requester (auto-derived for non-external types)
requesterPhone:
type: string
description: Phone number of the requester (auto-derived for non-external types)
requesterType:
type: string
enum:
- application
- lead
- user
- merchant
- merchant-internal
- mid
- external
description: >
Type of requester. For types other than 'external', name/email/phone are
automatically derived from the related entity. For 'external', these
fields must be provided in the request.
assignedTo:
type: string
description: User ID of the person assigned to this ticket
assignedTeamId:
type: integer
description: Team ID assigned to this ticket
merchantId:
type: integer
description: ID of the related merchant
merchantName:
type: string
description: Name of the related merchant
leadId:
type: integer
description: ID of the related lead
applicationId:
type: string
description: ID of the related application
midId:
type: integer
description: ID of the related MID
createdAt:
type: string
format: date-time
description: When the ticket was created
updatedAt:
type: string
format: date-time
description: When the ticket was last updated
resolvedAt:
type: string
format: date-time
description: When the ticket was resolved
closedAt:
type: string
format: date-time
description: When the ticket was closed
lastResponseAt:
type: string
format: date-time
description: When the last response was added
lastCustomerResponseAt:
type: string
format: date-time
description: When the last customer response was added
slaStatus:
type: string
enum:
- on_time
- at_risk
- breached
- paused
description: SLA status of the ticket
slaFirstResponseDue:
type: string
format: date-time
description: When the first response is due per SLA
slaFirstResponseMet:
type: boolean
description: Whether the first response SLA was met
slaResolutionDue:
type: string
format: date-time
description: When the resolution is due per SLA
slaResolutionMet:
type: boolean
description: Whether the resolution SLA was met
slaBreachedAt:
type: string
format: date-time
description: When the SLA was breached
slaPausedAt:
type: string
format: date-time
description: When the SLA was paused
slaTotalPausedTime:
type: integer
description: Total time SLA was paused (in minutes)
responseCount:
type: integer
description: Number of responses on this ticket
internalNoteCount:
type: integer
description: Number of internal notes on this ticket
attachmentCount:
type: integer
description: Number of attachments on this ticket
reopenCount:
type: integer
description: Number of times this ticket was reopened
escalationCount:
type: integer
description: Number of times this ticket was escalated
firstResponseTime:
type: integer
description: Time to first response (in minutes)
resolutionTime:
type: integer
description: Time to resolution (in minutes)
customFields:
type: object
description: Custom fields specific to the ticket type
tags:
type: array
items:
type: string
description: Tags associated with the ticket
metaData:
type: object
description: Additional metadata
required:
- id
- uniqueId
- accountId
- ticketNumber
- subject
- description
- status
- priority
- category
- source
- requesterId
- requesterName
- requesterEmail
- requesterType

Route Source Code

Check out the source code for this route entrypoint here: /tickets/route.ts

Or the swagger.yaml spec this documentation was generated from: /tickets/swagger.yaml