On this page
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.
A TrainingRequirement by id, within the caller's OWN org-group family; requires authentication. A cross-tenant id reads as null (not-found) AND trips the rootId tripwire server-side.
What happens
Read-only.
Who may call it
Capability area: Reading your records — Looking up and listing the records of your organization.
- Owner
- System Administrator
- Manager
- Associate Manager
- Warehouse Associate
- Sales Associate
- An API key whose scope allows
api:trainingRequirement
Arguments
| Name | Type | Required | Notes |
|---|---|---|---|
id | ID ID! | yes | The id of the record. |
Returns
TrainingRequirement — A TrainingRequirement (🎓 — THE TRAINING PROGRAM, THE WIRE): 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-37386ae00000"
}
Example response
{
"data": {
"trainingRequirement": {
"id": "01900000-0000-7000-8000-37386ae00000",
"sysId": "TE-EXMP-0000-000F",
"type": "TrainingRequirement",
"caption": "Blue jeans",
"status": "active",
"parentId": "01900000-0000-7000-8000-065235280000",
"rootId": "01900000-0000-7000-8000-a093dd800000",
"createdAt": "2027-01-31T00:00:00.000Z",
"updatedAt": "2027-01-31T00:00:00.000Z",
"revisionNum": 1,
"revision": "01900000-0000-7000-8000-b7960e180000",
"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. (VALIDATION)AUTHN/REQUIRED— Sign in to do this. (AUTHN)AUTHZ/FORBIDDEN— Your role does not allow this action. (AUTHZ)RATE_LIMIT/THROTTLED— Too many requests in a short time. (RATE_LIMIT)NOT_FOUND/*— That record could not be found. (NOT_FOUND)