AlmondTill/G3N API

myMessages

query · in the family Your own session

What it does

Your inbox — messages to you and to your teams, newest first. Unread ones have no read mark yet.

Your merged inbox. limit defaults 50, clamps at 100. Requires authentication.

Before you call

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

Capability area: Your own session — What every signed-in person may do for themselves — their session, their profile and their own work.

Roles that may call it:

Arguments

NameTypeRequiredNotes
limitIntnoHow many records to answer at most; a page may hold fewer.
nextTokenStringnoThe cursor from the previous page, passed back exactly as received.

Returns

MessageRefPage MessageRefPage! — One page of the merged inbox walk.

This is a page: items holds the records and nextToken the cursor for the next page — pass it back verbatim until it is null. See paging.

Example request

graphql
query ExampleMyMessages($limit: Int) {
  myMessages(limit: $limit) {
    items {
      id
      toKind
      toId
      fromKind
      fromUserId
      body
      targetType
      targetId
      createdAt
      readAt
    }
    nextToken
  }
}

Variables:

json
{
  "limit": 1
}

Example response

json
{
  "data": {
    "myMessages": {
      "items": [
        {
          "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"
        }
      ],
      "nextToken": "<the cursor from the previous page>"
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": null,
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer