Skip to main content
POST
Create a comment for a ticket
Replace {your-subdomain} with your workspace’s subdomain.
Learn how to find your subdomain in Workspace subdomain.

Headers

X-Api-Key
string
default:your-api-key
required

Use the X-Api-Key header to provide your workspace API key. Refer to Authentication for more information.

Path Parameters

ticket_id
string
required

ID of the ticket. You can use either the ticket ID (UUID) or ticket number (sequential number) interchangeably. Refer to Getting Ticket ID section for detailed instructions.

Body

application/json
author_email
string
required

Email address to attribute the comment to. Matching is case-insensitive. How it resolves depends on author_type:

  • agent — matches an existing team member only. A team member is never created, because that would mean a seat, an invitation and a billing change. An unknown address is rejected.
  • customer — matches an existing customer, and creates one if there is none. This is what an import uses, since a historical thread is full of people who have since left.
  • omitted — matches an existing team member, then an existing customer, and creates nothing. An unknown address is rejected.
Example:

"lenor@example.com"

content
string
required

Content for the comment.

Example:

"We are looking into the issue."

author_type
enum<string>

Which kind of author author_email refers to, for addresses that could be either. Also the switch that allows a customer to be created on demand; see author_email.

Available options:
agent,
customer
Example:

"customer"

comment_type
enum<string>

The type of the comment. Defaults to reply.

Available options:
reply,
note
Example:

"note"

created_at
string<date-time>

Original time the comment was written, for importing a historical thread. ISO 8601. The ticket's updated_at becomes the later of its current value and this date, so posting a thread in order leaves the ticket dated by its newest comment and posting one out of order never drags it backwards. A value that cannot be parsed is rejected.

Example:

"2021-06-09T12:00:00Z"

message_id
string

Caller-supplied identifier, unique per ticket. Posting the same message_id twice returns the comment already created rather than a duplicate, which makes an interrupted import safe to re-run. The repeat also answers 201, so a re-run cannot be told apart from a first write by status code alone.

Example:

"cp-worklog-9912@example.com"

attachments
string[]

Signed ids returned by Upload attachment. A signed id minted in another workspace is rejected. Attachments are all-or-nothing: if any id in the array is unknown, malformed or from another workspace, the whole request fails and no comment is created.

Example:
mentions
object[]

Optional list of users to mention in the comment. Mentions are only supported when comment_type is note. For inline placement, include @Full Name for each mentioned user in content.

Response

201 - application/json

Created - Comment created successfully

comment
object