POST /tickets/{ticketId}/comments
Add a comment to a ticket
Add a new comment to a ticket. Automatically increments the ticket's responseCount.
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
Request Body
{ "content": "string"}{ "content": "string", "isInternal": false, "mentions": [ "string" ]}Try it out
Loading...
Output:
Responses
Description
Comment added successfully
{ "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"}Description
Bad Request - Invalid input data
Description
Unauthorized - User not authenticated
Description
Forbidden - User does not have permission to comment on this ticket
Description
Ticket not found
Description
Internal server error
References
#/components/parameters/xAccountIdHeader#/components/schemas/TicketCommentInput#/components/schemas/TicketComment
#/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/TicketCommentInput
type: objectdescription: Input for creating a ticket commentproperties: content: type: string description: Content of the comment (plain text or markdown) isInternal: type: boolean default: false description: Whether this is an internal note (not visible to customers) mentions: type: array items: type: string description: User IDs to mention in the commentrequired: - content|export interface TicketCommentInput { /** Content of the comment (plain text or markdown) */ content: string; /** Whether this is an internal note (not visible to customers) */ isInternal?: boolean; /** User IDs to mention in the comment */ mentions?: string[];}#/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;}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