create-ticket-comment
dci create-ticket-comment <ticketId> [body]
Adds a comment to an existing support request. For customers and
service-account callers, comments are always public, even when
private is true. Callers authenticated with DoiT employee privileges
can create private internal notes by setting private to true.
The response always includes public, reflecting the effective
visibility after these rules are applied, not merely the requested
privacy. Existing authentication and ticket authorization are unchanged.
ticketId— The unique identifier of the support request.
Pass the request body as name: value arguments or pipe JSON on stdin — see Command structure.
Examples
# Reply on a ticket.
dci create-ticket-comment <ticket-id> body: "We rotated the service-account key and the job now succeeds."
# Leave an internal note (DoiT employees only; `private` is ignored for customers).
dci create-ticket-comment <ticket-id> body: "Escalated to the BigQuery team.", private: true
# Post a longer comment from a file and capture the new comment's ID.
dci create-ticket-comment <ticket-id> --fields id,created --output json < comment.json
# comment.json
{"body": "Timeline: 09:00 job submitted, 09:05 stuck in PENDING, 12:10 cancelled and resubmitted."}
Request
Content-Type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
body | string | yes | The text content of the comment. Must not be empty. |
private | boolean | If true, creates a private internal note. Only honored for DoiT employees; ignored for customers. Default: false. |
Raw JSON schema
{
"type": "object",
"description": "Request body for adding a comment to a support ticket.",
"required": [
"body"
],
"properties": {
"body": {
"type": "string",
"description": "The text content of the comment. Must not be empty."
},
"private": {
"type": "boolean",
"description": "If true, creates a private internal note. Only honored for DoiT employees; ignored for customers.",
"default": false
}
}
}
Output
Created - Comment added to the support request.
By default dci renders the result as a table. Use --output json to get the full structure described below — see Output formats.
| Field | Type | Description |
|---|---|---|
id | integer (int64) | Comment ID. |
body | string | The text content of the comment. |
public | boolean | Whether the comment is public. Always present in new responses, including false for private internal notes. GET reports Zendesk visibility; POST reports the effective visibility of the created comment. Missing metadata in legacy responses or snapshots means unknown and must not be interpreted as false. |
author | string | Stable comment-author attribution. User callers are represented by their verified email address; service-account callers use sa:<serviceAccountId>. |
created | integer (int64) | The time when this comment was created, in milliseconds since the epoch. |
attachments | array of object | File attachments on the comment. |
attachments[].id | integer (int64) | |
attachments[].file_name | string | |
attachments[].content_url | string |
Example response (--output json)
{
"id": 0,
"body": "Additional information for the support request.",
"public": true,
"created": 1788912000000
}
Raw JSON schema
{
"type": "object",
"description": "A comment on a support ticket.",
"required": [
"public"
],
"properties": {
"id": {
"type": "integer",
"description": "Comment ID.",
"format": "int64"
},
"body": {
"type": "string",
"description": "The text content of the comment."
},
"public": {
"type": "boolean",
"description": "Whether the comment is public. Always present in new responses,\nincluding false for private internal notes. GET reports Zendesk\nvisibility; POST reports the effective visibility of the created\ncomment. Missing metadata in legacy responses or snapshots means\nunknown and must not be interpreted as false."
},
"author": {
"type": "string",
"description": "Stable comment-author attribution. User callers are represented by\ntheir verified email address; service-account callers use\n`sa:<serviceAccountId>`."
},
"created": {
"type": "integer",
"description": "The time when this comment was created, in milliseconds since the epoch.",
"format": "int64"
},
"attachments": {
"type": "array",
"description": "File attachments on the comment.",
"items": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"file_name": {
"type": "string"
},
"content_url": {
"type": "string"
}
}
}
}
}
}
Errors
On failure, dci prints a single error message — with a hint when one is available — and exits with a typed code your scripts can branch on. See Errors and exit codes for the full contract.
HTTP status to exit code mapping
| HTTP status | Exit code | Error code | Meaning |
|---|---|---|---|
| 400 | 30 | VALIDATION_ERROR | The arguments or request body were rejected. Review the command's flags and payload. |
| 401 | 10 | AUTHENTICATION_FAILED | Not signed in, or the API token is invalid. Run dci login or check DCI_API_KEY. |
| 403 | 11 | PERMISSION_DENIED | The DoiT user or the active customer context does not have access. |
| 404 | 20 | RESOURCE_NOT_FOUND | The requested resource does not exist. Check the identifier argument. |
Related
- list-ticket-comments — List request comments
- get-ticket — Get a request
- create-ticket — Create a request
- update-ticket — Update a request
- API reference: POST /support/v1/tickets/{ticketId}/comments
Aliases: id-of-ticket-comments-post