trainingRequirement
query · in the family Training requirement
What it does
Look up one training rule — which kind of role must pass which course, the days of grace and the pass mark.
One TrainingRequirement by id. The record must belong to your organization group; an id from another group reads as not found.
Before you call
A bearer session from an API key (see Authentication and key hygiene) or a signed-in user.
Capability area: Reading your records — Looking up and listing the records of your organization.
Roles that may call it:
- Owner
- System Administrator
- Manager
- Associate Manager
- Warehouse Associate
- Sales Associate
- An API key whose scope allows
api:trainingRequirement
What happens
Read-only.
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
id | ID ID! | yes | The id of the record. |
Returns
TrainingRequirement — A TrainingRequirement: the owner's rule that people holding a role copied from the canned template roleTemplateKey must hold a valid TrainingCertificate for the course courseKey — a live play key of the Playbook registry. graceDays (0..365, default 14) = the days after the role grant before the requirement falls due; passMark (1..100, default 80) = the mark a sitting must reach — the strictest rule binding the person for the course wins at an attempt's start. The pair (roleTemplateKey, courseKey) is immutable after birth and unique among the org's non-doomed rules (a duplicate refuses CONFLICT/IDENTITY_TAKEN); at most 100 rules per org (CONFLICT/TRAINING_CAP past it). NOT searchable (no filter roster until the face).
Example request
query ExampleTrainingRequirement($id: ID!) {
trainingRequirement(id: $id) {
id
sysId
type
caption
status
parentId
rootId
createdAt
updatedAt
revisionNum
revision
roleTemplateKey
courseKey
graceDays
passMark
note
}
}Variables:
{
"id": "01900000-0000-7000-8000-a9a88e920000"
}Example response
{
"data": {
"trainingRequirement": {
"id": "01900000-0000-7000-8000-a9a88e920000",
"sysId": "TE-EXMP-0000-000F",
"type": "TrainingRequirement",
"caption": "Blue jeans",
"status": "active",
"parentId": "01900000-0000-7000-8000-eacdfcfd0000",
"rootId": "01900000-0000-7000-8000-a1295a650000",
"createdAt": "2027-01-31T00:00:00.000Z",
"updatedAt": "2027-01-31T00:00:00.000Z",
"revisionNum": 1,
"revision": "01900000-0000-7000-8000-53c6eea90000",
"roleTemplateKey": "<role template key>",
"courseKey": "<course key>",
"graceDays": 1,
"passMark": 1,
"note": "Restock before the weekend."
}
},
"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)