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"}{ "ticketTypeId": "string", "subject": "string", "description": "string", "status": "open", "priority": "medium", "category": "string", "source": "string", "requesterId": "string", "requesterName": "string", "requesterEmail": "string", "requesterPhone": "string", "requesterType": "string", "assignedTo": "string", "assignedTeamId": 0, "merchantId": 0, "leadId": 0, "applicationId": "string", "midId": 0, "customFields": {}, "tags": [ "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": {}}Description
Bad Request - Invalid input data
Description
Unauthorized - User not authenticated
Description
Forbidden - User does not have the required permissions
Description
Internal server error
References
#/components/parameters/xAccountIdHeader
in: headername: x-account-idschema: type: stringdescription: Account ID for the requestrequired: trueexample: "2311"|export type xAccountIdHeader = any; // Schema type not fully supported#/components/schemas/TicketInput
type: objectdescription: Input for creating a new ticketproperties: 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 ticketrequired: - subject - description - category - source - requesterId - requesterType>export interface TicketInput { /** ID of the ticket type. If the ticket type has auto-assignment enabled, the ticket will be automatically assigned. */ ticketTypeId?: string; /** Subject line of the ticket */ subject: string; /** Detailed description of the ticket */ description: string; /** Initial status of the ticket */ status?: | "open" | "in_progress" | "waiting_customer" | "waiting_internal" | "resolved" | "closed"; /** Priority level of the ticket */ priority?: "low" | "medium" | "high" | "urgent"; /** Category of the ticket */ category: | "technical" | "billing" | "account" | "compliance" | "feature_request" | "underwriting" | "general_support" | "general_forms" | "retention" | "activations" | "fee_change_forms" | "bank_submissions"; /** Source where the ticket was created */ source: "email" | "phone" | "portal" | "internal" | "api"; /** 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. */ requesterId: string; /** 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. */ requesterName?: string; /** 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. */ requesterEmail?: string; /** 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. */ requesterPhone?: string; /** 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. */ requesterType: | "application" | "lead" | "user" | "merchant" | "merchant-internal" | "mid" | "external"; /** User ID to manually assign the ticket to (overrides auto-assignment) */ assignedTo?: string; /** Team ID to assign the ticket to */ assignedTeamId?: number; /** ID of the related merchant */ merchantId?: number; /** ID of the related lead */ leadId?: number; /** ID of the related application */ applicationId?: string; /** ID of the related MID */ midId?: number; /** Custom fields specific to the ticket type */ customFields?: {}; /** Tags to associate with the ticket */ tags?: string[];}#/components/schemas/Ticket
type: objectdescription: Ticket object representing a customer support ticketproperties: 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 metadatarequired: - id - uniqueId - accountId - ticketNumber - subject - description - status - priority - category - source - requesterId - requesterName - requesterEmail - requesterType>export interface Ticket { /** Internal database ID */ id: number; /** Unique identifier for the ticket */ uniqueId: string; /** ID of the account that owns this ticket */ accountId: string; /** Human-readable ticket number (e.g., TKT-12345) */ ticketNumber: string; /** ID of the ticket type */ ticketTypeId?: string; /** Subject line of the ticket */ subject: string; /** Detailed description of the ticket */ description: string; /** Current status of the ticket */ status: | "open" | "in_progress" | "waiting_customer" | "waiting_internal" | "resolved" | "closed"; /** Priority level of the ticket */ priority: "low" | "medium" | "high" | "urgent"; /** Category of the ticket */ category: | "technical" | "billing" | "account" | "compliance" | "feature_request" | "underwriting" | "general_support" | "general_forms" | "retention" | "activations" | "fee_change_forms" | "bank_submissions"; /** Source where the ticket was created */ source: "email" | "phone" | "portal" | "internal" | "api"; /** ID of the person/entity who requested the ticket */ requesterId: string; /** Name of the requester (auto-derived for non-external types) */ requesterName: string; /** Email of the requester (auto-derived for non-external types) */ requesterEmail: string; /** Phone number of the requester (auto-derived for non-external types) */ requesterPhone?: string; /** 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. */ requesterType: | "application" | "lead" | "user" | "merchant" | "merchant-internal" | "mid" | "external"; /** User ID of the person assigned to this ticket */ assignedTo?: string; /** Team ID assigned to this ticket */ assignedTeamId?: number; /** ID of the related merchant */ merchantId?: number; /** Name of the related merchant */ merchantName?: string; /** ID of the related lead */ leadId?: number; /** ID of the related application */ applicationId?: string; /** ID of the related MID */ midId?: number; /** When the ticket was created */ createdAt?: Date; /** When the ticket was last updated */ updatedAt?: Date; /** When the ticket was resolved */ resolvedAt?: Date; /** When the ticket was closed */ closedAt?: Date; /** When the last response was added */ lastResponseAt?: Date; /** When the last customer response was added */ lastCustomerResponseAt?: Date; /** SLA status of the ticket */ slaStatus?: "on_time" | "at_risk" | "breached" | "paused"; /** When the first response is due per SLA */ slaFirstResponseDue?: Date; /** Whether the first response SLA was met */ slaFirstResponseMet?: boolean; /** When the resolution is due per SLA */ slaResolutionDue?: Date; /** Whether the resolution SLA was met */ slaResolutionMet?: boolean; /** When the SLA was breached */ slaBreachedAt?: Date; /** When the SLA was paused */ slaPausedAt?: Date; /** Total time SLA was paused (in minutes) */ slaTotalPausedTime?: number; /** Number of responses on this ticket */ responseCount?: number; /** Number of internal notes on this ticket */ internalNoteCount?: number; /** Number of attachments on this ticket */ attachmentCount?: number; /** Number of times this ticket was reopened */ reopenCount?: number; /** Number of times this ticket was escalated */ escalationCount?: number; /** Time to first response (in minutes) */ firstResponseTime?: number; /** Time to resolution (in minutes) */ resolutionTime?: number; /** Custom fields specific to the ticket type */ customFields?: {}; /** Tags associated with the ticket */ tags?: string[]; /** Additional metadata */ metaData?: {};}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