addCaseMessage
mutation · in the family Selling
What it does
Add a reply to a customer-service case, as staff.
Staff: append ONE message to a case's thread: visibility is the author's choice; the acting User stamps as the author. A terminal (closed/cancelled) case refuses CONFLICT/IMMUTABLE — frozen history. The append is evented (at.cs.case_message.append.ok.v1 rides the record-change lake). Requires the unrestricted capability. Template class (the capture tier — hand-derived v21).
Before you call
A signed-in user’s session — the call refuses an API key (AUTHZ/FORBIDDEN).
Capability area: Selling — Ringing sales, serving customers and issuing invoices.
Roles that may call it:
- Owner
- Manager
- Associate Manager
- Sales Associate
- Cashier
What happens
You choose whether the customer sees it (visible reply) or only staff do (internal note). Messages are permanent once written.
Careful
A customer-visible message cannot be edited or unsent — a typo needs a follow-up message.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
input | NewCaseMessageInput NewCaseMessageInput! | yes | The fields to write — see the input type. |
Returns
CaseMessage CaseMessage! — One CS-case thread message. internal_note rows never serialize to the consumer face.
Example request
mutation ExampleAddCaseMessage($input: NewCaseMessageInput!) {
addCaseMessage(input: $input) {
id
type
caption
status
parentId
rootId
createdAt
updatedAt
revisionNum
revision
authorKind
authorId
visibility
body
}
}Variables:
{
"input": {
"caseId": "01900000-0000-7000-8000-1b5184d10000",
"body": "Restock before the weekend.",
"visibility": "<visibility>"
}
}Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.
Example response
{
"data": {
"addCaseMessage": {
"id": "01900000-0000-7000-8000-37386ae00000",
"type": "<type>",
"caption": "Blue jeans",
"status": "<status>",
"parentId": "01900000-0000-7000-8000-eacdfcfd0000",
"rootId": "01900000-0000-7000-8000-a1295a650000",
"createdAt": "2027-01-31T00:00:00.000Z",
"updatedAt": "2027-01-31T00:00:00.000Z",
"revisionNum": 1,
"revision": "01900000-0000-7000-8000-53c6eea90000",
"authorKind": "<author kind>",
"authorId": "01900000-0000-7000-8000-958fc7760000",
"visibility": "<visibility>",
"body": "Restock before the weekend."
}
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": {
"name": "genesis",
"number": 0
},
"serviced": {
"name": "genesis",
"number": 0
}
}
}
}
}Errors this call can answer
VALIDATION/INVALID— Something in the request is not valid. Retry: no. (VALIDATION)AUTHN/REQUIRED— Sign in to do this. Retry: no. (AUTHN)AUTHZ/FORBIDDEN— Your role does not allow this action. Retry: no. (AUTHZ)RATE_LIMIT/THROTTLED— Too many requests in a short time. Retry: yes. (RATE_LIMIT)NOT_FOUND/*— That record could not be found. Retry: no. (NOT_FOUND)CONFLICT/*— The record’s state, or a change made in the meantime, does not allow this; the codes are on the CONFLICT page. (CONFLICT)VALIDATION/VERSION_REQUIRED— The request did not say which app version it came from. Retry: no. (VALIDATION)