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:
- Owner
- An API key whose scope allows
api:userActivityTrail
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
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
mutation ExampleUserActivityTrail($userId: ID!, $from: String!, $to: String!, $reason: String!) {
userActivityTrail(userId: $userId, from: $from, to: $to, reason: $reason) {
unreadable
}
}Variables:
{
"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
{
"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
VALIDATION/INVALID— Something in the request is not valid. Retry: no. (VALIDATION)AUTHN/REQUIRED— Sign in to do this. Retry: no. (AUTHN)AUTHZ/FORBIDDEN— Your role does not allow this action. Retry: no. (AUTHZ)RATE_LIMIT/THROTTLED— Too many requests in a short time. Retry: yes. (RATE_LIMIT)NOT_FOUND/*— That record could not be found. Retry: no. (NOT_FOUND)CONFLICT/*— The record’s state, or a change made in the meantime, does not allow this; the codes are on the CONFLICT page. (CONFLICT)VALIDATION/VERSION_REQUIRED— The request did not say which app version it came from. Retry: no. (VALIDATION)