GET /tickets/{ticketId}/comments
Get ticket comments
Retrieves all comments for a specific ticket with pagination. 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
Optional Parameters
Click here to view an exhaustive list of all available parameters
page
query integer Page number
pageSize
query integer Number of comments per page
Try it out
Loading...
Output:
Responses
Description
Successful response
{ "data": [ { "id": 0, "uniqueId": "string", "ticketId": "string", "content": "string", "contentHtml": "string", "authorId": "string", "authorName": "string", "authorEmail": "string", "authorType": "string", "isInternal": false, "mentions": [ "string" ], "createdAt": "string", "updatedAt": "string" } ], "totalCount": 0, "totalPages": 0, "currentPage": 0}Description
Unauthorized - User not authenticated
Description
Forbidden - User does not have permission to access this ticket
Description
Ticket not found
Description
Internal server error
References
#/components/parameters/xAccountIdHeader#/components/schemas/TicketComment#/components/schemas/TicketCommentList
#/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/TicketComment
type: objectdescription: Comment on a ticketproperties: id: type: integer description: Internal database ID uniqueId: type: string description: Unique identifier for the comment ticketId: type: string description: ID of the ticket this comment belongs to content: type: string description: Content of the comment (plain text or markdown) contentHtml: type: string description: HTML-rendered version of the content authorId: type: string description: ID of the comment author authorName: type: string description: Name of the comment author authorEmail: type: string description: Email of the comment author authorType: type: string description: Type of author (agent, customer, system) isInternal: type: boolean description: Whether this is an internal note (not visible to customers) mentions: type: array items: type: string description: User IDs mentioned in the comment createdAt: type: string format: date-time description: When the comment was created updatedAt: type: string format: date-time description: When the comment was last updatedrequired: - id - uniqueId - ticketId - content - authorId - authorName - authorEmail - authorType - isInternal|export interface TicketComment { /** Internal database ID */ id: number; /** Unique identifier for the comment */ uniqueId: string; /** ID of the ticket this comment belongs to */ ticketId: string; /** Content of the comment (plain text or markdown) */ content: string; /** HTML-rendered version of the content */ contentHtml?: string; /** ID of the comment author */ authorId: string; /** Name of the comment author */ authorName: string; /** Email of the comment author */ authorEmail: string; /** Type of author (agent, customer, system) */ authorType: string; /** Whether this is an internal note (not visible to customers) */ isInternal: boolean; /** User IDs mentioned in the comment */ mentions?: string[]; /** When the comment was created */ createdAt?: Date; /** When the comment was last updated */ updatedAt?: Date;}#/components/schemas/TicketCommentList
type: objectproperties: data: type: array items: $ref: "#/components/schemas/TicketComment" totalCount: type: integer totalPages: type: integer currentPage: type: integer|export interface TicketCommentList { data?: TicketComment[]; totalCount?: number; totalPages?: number; currentPage?: number;}Route Source Code
Check out the source code for this route entrypoint here: /tickets/[ticketId]/comments/route.ts
Or the swagger.yaml spec this documentation was generated from:
/tickets/swagger.yaml