AlmondTill/G3N API

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:

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

NameTypeRequiredNotes
inputNewCaseMessageInput NewCaseMessageInput!yesThe 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

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

json
{
  "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

Used in