AlmondTill/G3N API

userActivityTrail

mutation · in the family Support trail

What it does

Ask what one of your users was doing — a user, a window of at most seven days and your reason; the sealed per-call trail opens for that window alone.

The merchant’S door: open ONE user’s sealed activity trail for ONE window (ISO instants, at most 7 days) with a reason (1–256 characters). the ledger-first rule: the opening is recorded — the ledger row + the permanent log event — before any row is unsealed; no record, no unseal. Answers the timeline in time order (time · app · build · screen · op · outcome · milliseconds · call id · session). Owner-only (the A19_TRAIL area). VALIDATION/INVALID on a bad window or a blank reason.

Before you call

A bearer session from an API key (see Authentication and key hygiene) or a signed-in user.

Capability area: Support trail — Opening a user’s sealed activity trail and the ledger of every opening.

Roles that may call it:

What happens

Records the opening in the trail ledger (visible to every owner) and on the permanent log, then reads that user’s sealed rows for the window; changes nothing else.

Arguments

NameTypeRequiredNotes
userIdID ID!yes
fromString String!yes
toString String!yes
reasonString String!yes

Returns

UserActivityTrail UserActivityTrail! — The merchant door’s answer: the opening as recorded + the timeline in time order + the rows that refused to open (counted, never hidden).

Example request

graphql
mutation ExampleUserActivityTrail($userId: ID!, $from: String!, $to: String!, $reason: String!) {
  userActivityTrail(userId: $userId, from: $from, to: $to, reason: $reason) {
    unreadable
  }
}

Variables:

json
{
  "userId": "01900000-0000-7000-8000-e0a63e120000",
  "from": "<from>",
  "to": "<to>",
  "reason": "Correcting a miscount."
}

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

Example response

json
{
  "data": {
    "userActivityTrail": {
      "unreadable": 1
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer