DELETE /tickets/{ticketId}
Delete a ticket by ID
Deletes a specific ticket by its ID. The user must have access to the account that owns the ticket.
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
ticketId
path string The unique ID of the ticket to delete
Try it out
Loading...
Output:
Responses
Description
Ticket deleted 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
Unauthorized - User not authenticated
Description
Forbidden - User does not have permission to delete this ticket
Description
Ticket not found
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/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/[ticketId]/route.ts
Or the swagger.yaml spec this documentation was generated from:
/tickets/swagger.yaml