LemuAIDocs

Tickets · 3 min read

Add a Comment

Reply to the requester on their channel or add an internal note to a LemuTickets ticket

Open in ChatGPTOpen in ClaudeMarkdown

Adds a comment to a ticket. A comment is either:

  • a public reply, sent to the requester on the ticket's channel (email, WhatsApp, the portal), or
  • an internal note, seen only by your team.
POST/v1/tickets/{ref}/comments

A public reply needs the tickets.write scope. An internal note needs comments.internal.

Path parameters#

NameTypeRequiredDescription
refstringYesThe ticket key (SUP-1042) or id.

Headers#

NameRequiredDescription
Idempotency-KeyNo, but recommendedA unique value for this comment. Sending the same request again returns the first comment instead of posting twice. See idempotency keys.

Request body#

FieldTypeRequiredDescription
bodystringYesThe text. Plain text or simple HTML.
visibilitystringNointernal (default) or public.
channelstringNoFor public replies: email, whatsapp, portal, slack or voice. Defaults to the channel the ticket came in on.
mentionsarray of UUIDsNoUsers to mention. They are notified and become watchers.
attachment_idsarray of UUIDsNoFiles from Upload an attachment to attach to this comment.
whatsapp_templateobjectNoAn approved WhatsApp template (name, language, variables) to send instead of free text. WhatsApp only allows free text within 24 hours of the customer's last message.

Public replies on WhatsApp go out through Lemu AI, so your organization needs the Lemu AI connection set up in LemuTickets. A ticket that came from a phone call has no channel to reply on: the reply is saved on the ticket but not sent.

Example request:

cURL
curl -X POST https://api.tickets.lemuai.com/v1/tickets/SUP-1042/comments \
  -H "Authorization: Bearer ltk_live_your_api_key" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: erp-note-77812" \
  -d '{
    "body": "Finance confirmed the refund was approved. Reference RF-99120.",
    "visibility": "internal",
    "mentions": ["0e2a4c6b-8d1f-4a3e-9b5c-7d9f1a3c5e7b"]
  }'

Response#

201

JSON
{
  "id": "c5e7a9b1-d3f2-4c6e-8a0b-2e4c6a8b0d1f",
  "ticket_id": "2f9c7e1a-5b3d-4c8e-9a6f-1d0e2b4c6a8f",
  "visibility": "internal",
  "body": "Finance confirmed the refund was approved. Reference RF-99120.",
  "body_text": "Finance confirmed the refund was approved. Reference RF-99120.",
  "author_type": "user",
  "author": {
    "type": "user",
    "id": "d1f3b5a7-c9e2-4b4d-8f6a-0c2e4a6b8d0f",
    "name": "API: ERP sync",
    "avatar_url": null
  },
  "channel": "none",
  "delivery_status": null,
  "delivery_error": null,
  "mentions": ["0e2a4c6b-8d1f-4a3e-9b5c-7d9f1a3c5e7b"],
  "meta": {},
  "attachments": [],
  "created_at": "2026-11-25T09:52:11.018000+00:00",
  "edited_at": null
}
FieldTypeDescription
idstringThe comment's id.
ticket_idstringThe ticket.
visibilitystringpublic or internal.
bodystringThe text as sent.
body_textstringThe text without HTML.
author_typestringuser, requester, ai or system.
authorobjecttype, id and name of the author (avatar_url for users).
channelstringWhere a public reply was sent: email, whatsapp, portal, slack, voice, or none for internal notes and replies with no channel.
delivery_statusstring or nullFor public replies sent on a channel: queued at first, then for example sent, delivered, read or failed. null when nothing is sent.
delivery_errorstring or nullWhy delivery failed.
mentionsarray of stringsMentioned user ids.
metaobjectExtra details, such as the WhatsApp template used.
attachmentsarrayFiles on the comment: id, filename, content_type, size_bytes.
created_atstringWhen it was added.
edited_atstring or nullWhen it was last edited.

Delivery happens after the response. Listen for the comment.delivery_updated webhook, or read the comment again with List comments, to see whether it arrived.

The first public reply on a ticket sets its first_response_at, which meets the first response SLA.

Errors#

StatuscodeWhen
403missing_capabilityThe key cannot write internal notes, or cannot reply to requesters
404ticket_not_foundNo ticket with this key or id, or you cannot see it
409idempotency_mismatchThe Idempotency-Key was used before with a different body
422invalid_fieldsbody is missing or visibility is not public or internal
422empty_commentbody only has spaces