AlmondTill/G3N API

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

Before you call

A signed-in user’s session — the call refuses an API key (AUTHZ/FORBIDDEN).

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

Roles that may call it:

What happens

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

Arguments

NameTypeRequiredNotes
toUserIdIDno
toTeamIdIDno
bodyString String!yes
targetTypeStringno
targetIdIDno

Returns

MessageRef MessageRef! — One inbox message.

Example request

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

Variables:

json
{
  "toUserId": "01900000-0000-7000-8000-6e046b670000",
  "body": "Restock before the weekend."
}

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

Example response

json
{
  "data": {
    "sendMessage": {
      "id": "01900000-0000-7000-8000-37386ae00000",
      "toKind": "USER",
      "toId": "01900000-0000-7000-8000-41f596440000",
      "fromKind": "USER",
      "fromUserId": "01900000-0000-7000-8000-e7f2c3020000",
      "body": "Restock before the weekend.",
      "targetType": "<target type>",
      "targetId": "01900000-0000-7000-8000-8b67f1680000",
      "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