AlmondTill/G3N API

On this page

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

Arguments

NameTypeRequiredNotes
inputNewCaseMessageInput NewCaseMessageInput!yesNo further notes.

Returns

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

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

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

Used in