AlmondTill/G3N API

On this page

sendMessage

mutation · in the family Work and notes

What it does

Send a message to one person or one of your teams — optionally about a specific record.

Send ONE message to EXACTLY one recipient: a USER recipient must exist in-tenant + non-doomed (suspended still receives — a mailbox outlives a login); a TEAM recipient requires YOU to be a member of that ACTIVE team; the optional targetRef pair ('about this record') gates in-tenant + non-doomed. body ≤ 4096. The row lands in the recipient's current month bucket and persists (no deletion v1). Requires authentication. Template class (universal staff work — the addNote kinship).

What happens

It lands in their inbox and stays there; messages can’t be deleted or edited once sent.

Who may call it

Capability area: Work and notes — Tasks, notes, messages, dashboards and the everyday tools every staff member keeps.

Arguments

NameTypeRequiredNotes
toUserIdIDnoNo further notes.
toTeamIdIDnoNo further notes.
bodyString String!yesNo further notes.
targetTypeStringnoNo further notes.
targetIdIDnoNo further notes.

Returns

MessageRef MessageRef! — One inbox message.

Example request

mutation ExampleSendMessage($toUserId: ID, $body: String!) {
  sendMessage(toUserId: $toUserId, body: $body) {
    id
    toKind
    toId
    fromKind
    fromUserId
    body
    targetType
    targetId
    createdAt
    readAt
  }
}

Variables:

{
  "toUserId": "01900000-0000-7000-8000-486d81ea0000",
  "body": "Restock before the weekend."
}

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

Example response

{
  "data": {
    "sendMessage": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "toKind": "USER",
      "toId": "01900000-0000-7000-8000-4dc937890000",
      "fromKind": "USER",
      "fromUserId": "01900000-0000-7000-8000-f626b68f0000",
      "body": "Restock before the weekend.",
      "targetType": "<target type>",
      "targetId": "01900000-0000-7000-8000-446adfd50000",
      "createdAt": "2027-01-31T00:00:00.000Z",
      "readAt": "2027-01-31T00:00:00.000Z"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer