Skip to content

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"
}

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"
}

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

type: object
description: Input for creating a ticket comment
properties:
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 comment
required:
- content

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

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