# addCaseMessage

mutation · in the family [Selling](/reference/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 (an internal_note NEVER crosses the consumer face — ruling); 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).

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

## Who may call it

Capability area: **Selling** — Ringing sales, serving customers and issuing invoices.

- Owner
- Manager
- Associate Manager
- Sales Associate
- Cashier
- An API key whose scope allows `api:addCaseMessage`

## Arguments

| Name | Type | Required | Notes |
| --- | --- | --- | --- |
| `input` | [NewCaseMessageInput](/types/NewCaseMessageInput/) `NewCaseMessageInput!` | yes | No further notes. |

## Returns

[CaseMessage](/types/CaseMessage/) `CaseMessage!` — One CS-case thread message. internal_note rows NEVER serialize to the consumer face (ruling — the structural walk filter).

## Example request

```graphql
mutation ExampleAddCaseMessage($input: NewCaseMessageInput!) {
  addCaseMessage(input: $input) {
    id
    type
    caption
    status
    parentId
    rootId
    createdAt
    updatedAt
    revisionNum
    revision
    authorKind
    authorId
    visibility
    body
  }
}
```

Variables:

```json
{
  "input": {
    "caseId": "01900000-0000-7000-8000-4559fce40000",
    "body": "Restock before the weekend.",
    "visibility": "<visibility>"
  }
}
```

Send it with the envelope naming the version: `"extensions": {"at": {"version": {"name":"genesis","number":0}}}`.

## Example response

```json
{
  "data": {
    "addCaseMessage": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "type": "<type>",
      "caption": "Blue jeans",
      "status": "<status>",
      "parentId": "01900000-0000-7000-8000-065235280000",
      "rootId": "01900000-0000-7000-8000-a093dd800000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "updatedAt": "2027-01-31T00:00:00.000Z",
      "revisionNum": 1,
      "revision": "01900000-0000-7000-8000-b7960e180000",
      "authorKind": "<author kind>",
      "authorId": "01900000-0000-7000-8000-0046e40b0000",
      "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. ([VALIDATION](/errors/VALIDATION/))
- `AUTHN/REQUIRED` — Sign in to do this. ([AUTHN](/errors/AUTHN/))
- `AUTHZ/FORBIDDEN` — Your role does not allow this action. ([AUTHZ](/errors/AUTHZ/))
- `RATE_LIMIT/THROTTLED` — Too many requests in a short time. ([RATE_LIMIT](/errors/RATE_LIMIT/))
- `NOT_FOUND/*` — That record could not be found. ([NOT_FOUND](/errors/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](/errors/CONFLICT/))
- `VALIDATION/VERSION_REQUIRED` — The request did not say which app version it came from. ([VALIDATION](/errors/VALIDATION/))

## Used in

- [Handle a customer case from first message to close](/use-cases/handle-a-customer-case/)
