Skip to content

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
}

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/TicketComment

type: object
description: Comment on a ticket
properties:
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 updated
required:
- id
- uniqueId
- ticketId
- content
- authorId
- authorName
- authorEmail
- authorType
- isInternal

#/components/schemas/TicketCommentList

type: object
properties:
data:
type: array
items:
$ref: "#/components/schemas/TicketComment"
totalCount:
type: integer
totalPages:
type: integer
currentPage:
type: integer

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