suggestedActions
query · in the family Your own session
What it does
The likely next actions for one record, based on where it is in its lifecycle — ranked, and limited to what you may actually do.
The target's likely-next actions: with a construct id, the record's live status × the registry's realized ops, ranked by the curated per-type×state order; without one, the family's birth op (record-creating acts surface as suggestions, never as fixed links). Either way filtered to what YOU may actually perform (capability + descriptors — a suggestion you cannot take is never returned). A given target must exist in your tenant (a foreign/unknown target refuses NOT_FOUND — the revisions gate); a terminal record answers its honest remainder (usually empty). Requires authentication.
Before you call
A bearer session from an API key (see Authentication and key hygiene) or a signed-in user.
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:
- Owner
- System Administrator
- Manager
- Associate Manager
- Warehouse Associate
- Sales Associate
- Cashier
- An API key whose scope allows
api:suggestedActions
What happens
Read-only. The list already reflects your permissions; an action you cannot take is never shown.
Arguments
Returns
SuggestedAction [SuggestedAction!]! — One suggested next action: a live wire operation the caller may actually perform on the target, ranked by the curated per-type×state order. Render verbatim — the server already filtered and ranked (no client filtering by construction).
Example request
query ExampleSuggestedActions($targetType: String!, $targetConstructId: ID) {
suggestedActions(targetType: $targetType, targetConstructId: $targetConstructId) {
op
why
}
}Variables:
{
"targetType": "<target type>",
"targetConstructId": "01900000-0000-7000-8000-567d5fed0000"
}Example response
{
"data": {
"suggestedActions": [
{
"op": "<op>",
"why": "<why>"
}
]
},
"extensions": {
"at": {
"callId": "01EXAMPLE-CALL-ID",
"version": {
"requested": null,
"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)