{"openapi":"3.1.0","info":{"title":"Tayl API","version":"1.0.0","description":"Tayl's Public API manages an organisation's people and groups, training assignments, courses, learning records and webhooks.\n\nThis file describes every operation for code generators and tools such as Postman, and is too large to read whole. Agents and people should start at https://tayl.pro/api/v1/docs.md (or https://tayl.pro/api/v1/docs in a browser), which explains authentication and points to the one smaller section each task needs.","license":{"name":"Proprietary"}},"servers":[{"url":"https://tayl.pro","description":"Production"},{"url":"https://demo.tayl.pro","description":"Staging"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Users","description":"Create, update, archive, and restore people in your organisation."},{"name":"Groups","description":"Mirror your organisation's structure into Tayl groups."},{"name":"Group Categories","description":"Organise groups by type, such as department or location."},{"name":"Group Memberships","description":"Manage which users belong to which groups."},{"name":"Content Library","description":"Published courses, pathways, and signable documents available to assign."},{"name":"Course Authoring","description":"Read a course your organisation authored as one document, save it as a draft, upload images for it and publish it."},{"name":"Assignments","description":"Assign training to people and groups. Tayl creates learner tasks automatically."},{"name":"Reports","description":"Training figures by organisation, group and content, as counts and rates."},{"name":"Tasks","description":"Learner task status and progress for incremental reporting syncs."},{"name":"Completions","description":"Completion records for reporting and compliance exports."},{"name":"Certificates","description":"Issued certificates and their PDF downloads for compliance archives."},{"name":"API Keys","description":"Inspect the API key used for the current request."},{"name":"Webhook Endpoints","description":"Create and manage signed webhook subscriptions."},{"name":"Webhook Deliveries","description":"Inspect and retry webhook deliveries."}],"paths":{"/api/v1/users":{"get":{"operationId":"listUsers","tags":["Users"],"summary":"List users","x-required-scope":"users:read","description":"Lists the organisation's users, including archived ones but not people removed from the organisation or whose accounts were deleted. `since` considers changes to each person's membership of the organisation.","parameters":[{"$ref":"#/components/parameters/Page"},{"$ref":"#/components/parameters/PerPage"},{"name":"email","in":"query","description":"Exact email match (case-insensitive).","schema":{"type":"string"}},{"name":"external_id","in":"query","description":"Exact external_id match.","schema":{"$ref":"#/components/schemas/ExternalId"}},{"name":"state","in":"query","schema":{"type":"string","enum":["pending","invited","onboarding","active","non_compliant","paused","suspended","archived"]},"description":"Return only records currently in this lifecycle state."},{"$ref":"#/components/parameters/Since"},{"name":"sort","in":"query","schema":{"type":"string","enum":["created_at","updated_at","email"],"default":"created_at"},"description":"Field used to order the result set."},{"$ref":"#/components/parameters/Order"}],"responses":{"200":{"description":"A page of users.","headers":{"Link":{"$ref":"#/components/headers/Link"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserList"},"example":{"users":[{"id":"019cf5b0-7c00-7000-8000-000000000002","external_id":"usr-1042","email":"alex.chen@example.com","name":"Alex Chen","first_name":"Alex","last_name":"Chen","state":"active","invited_at":"2026-03-10T09:00:00Z","accepted_at":"2026-03-10T09:15:00Z","created_at":"2026-03-10T09:00:00Z","updated_at":"2026-03-16T10:00:00Z"}],"meta":{"page":1,"per_page":25,"total_pages":1,"total_count":1}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"post":{"operationId":"createUser","tags":["Users"],"summary":"Create a user","x-required-scope":"users:write","description":"Creates an organisation user. An invitation email is sent unless `send_invite=false`; the invitation flow links the person's Tayl account when they accept. While the organisation is in Setup mode, invitations are held whatever `send_invite` says: the request still returns 201, and the user stays `pending` with no `invited_at`. When the organisation switches to Active, an admin can send the held invitations or invite people one at a time.","parameters":[{"name":"send_invite","in":"query","description":"Set to `false` to add the person without an invitation email.","schema":{"type":"boolean","default":true}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserInput"},"example":{"email":"alex.chen@example.com","first_name":"Alex","last_name":"Chen","external_id":"usr-1042"}}}},"responses":{"201":{"description":"The created user.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"},"example":{"id":"019cf5b0-7c00-7000-8000-000000000002","external_id":"usr-1042","email":"alex.chen@example.com","name":"Alex Chen","first_name":null,"last_name":null,"state":"invited","invited_at":"2026-03-16T10:00:00Z","accepted_at":null,"created_at":"2026-03-16T10:00:00Z","updated_at":"2026-03-16T10:00:00Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/UnprocessableContent"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/users/bulk":{"post":{"operationId":"bulkCreateUsers","tags":["Users"],"summary":"Bulk create users","x-required-scope":"users:write","description":"Creates up to 500 users in one call. Each entry succeeds or fails on its own, and the status sums them up: 201 if all succeeded, 207 if some did, 422 if none did. While the organisation is in Setup mode, invitations are held whatever `send_invite` says: created users stay `pending` with no `invited_at`. When the organisation switches to Active, an admin can send the held invitations or invite people one at a time.","parameters":[{"name":"send_invite","in":"query","description":"Set to `false` to add everyone without an invitation email.","schema":{"type":"boolean","default":true}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkUsersRequest"},"example":{"users":[{"email":"alex.chen@example.com","first_name":"Alex","last_name":"Chen","external_id":"usr-1042"},{"email":"sam.lee@example.com","first_name":"Sam","last_name":"Lee","external_id":"usr-1043"}]}}}},"responses":{"201":{"description":"Every user was created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkUsersResult"},"example":{"results":[{"index":0,"status":201,"user":{"id":"019cf5b0-7c00-7000-8000-000000000002","external_id":"usr-1042","email":"alex.chen@example.com","name":"Alex Chen","first_name":null,"last_name":null,"state":"invited","invited_at":"2026-03-16T10:00:00Z","accepted_at":null,"created_at":"2026-03-16T10:00:00Z","updated_at":"2026-03-16T10:00:00Z"},"errors":[]},{"index":1,"status":201,"user":{"id":"019cf5b0-7c00-7000-8000-000000000003","external_id":"usr-1043","email":"sam.lee@example.com","name":"Sam Lee","first_name":null,"last_name":null,"state":"invited","invited_at":"2026-03-16T10:00:00Z","accepted_at":null,"created_at":"2026-03-16T10:00:00Z","updated_at":"2026-03-16T10:00:00Z"},"errors":[]}],"meta":{"total":2,"succeeded":2,"failed":0}}}}},"207":{"description":"Some users were created; inspect per-entry statuses.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkUsersResult"},"example":{"results":[{"index":0,"status":201,"user":{"id":"019cf5b0-7c00-7000-8000-000000000002","external_id":"usr-1042","email":"alex.chen@example.com","name":"Alex Chen","first_name":null,"last_name":null,"state":"invited","invited_at":"2026-03-16T10:00:00Z","accepted_at":null,"created_at":"2026-03-16T10:00:00Z","updated_at":"2026-03-16T10:00:00Z"},"errors":[]},{"index":1,"status":409,"user":null,"errors":[{"code":"duplicate_external_id","message":"is already in use in this organisation","field":"external_id","pointer":"/data/external_id","existing_id":"019cf5b0-7c00-7000-8000-000000000004","documentation_url":"https://tayl.pro/api/v1/docs/errors#duplicate_external_id"}]}],"meta":{"total":2,"succeeded":1,"failed":1}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"description":"No user could be created; inspect per-entry errors.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkUsersResult"},"example":{"results":[{"index":0,"status":422,"user":null,"errors":[{"code":"validation_error","message":"has already been taken","field":"email","pointer":"/data/email","documentation_url":"https://tayl.pro/api/v1/docs/errors#validation_error"}]},{"index":1,"status":422,"user":null,"errors":[{"code":"validation_error","message":"has already been taken","field":"email","pointer":"/data/email","documentation_url":"https://tayl.pro/api/v1/docs/errors#validation_error"}]}],"meta":{"total":2,"succeeded":0,"failed":2}}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/users/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"The user's Tayl UUID.","schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getUser","tags":["Users"],"summary":"Get a user","x-required-scope":"users:read","responses":{"200":{"description":"The user.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"},"example":{"id":"019cf5b0-7c00-7000-8000-000000000002","external_id":"usr-1042","email":"alex.chen@example.com","name":"Alex Chen","first_name":"Alex","last_name":"Chen","state":"active","invited_at":"2026-03-10T09:00:00Z","accepted_at":"2026-03-10T09:15:00Z","created_at":"2026-03-10T09:00:00Z","updated_at":"2026-03-16T10:00:00Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Returns one current or archived organisation user by Tayl UUID."},"patch":{"operationId":"updateUser","tags":["Users"],"summary":"Update a user","x-required-scope":"users:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserUpdateInput"},"example":{"email":"alex.chen@example.net","external_id":"usr-1042"}}}},"responses":{"200":{"description":"The updated user.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"},"example":{"id":"019cf5b0-7c00-7000-8000-000000000002","external_id":"usr-1042","email":"alex.chen@example.net","name":"Alex Chen","first_name":"Alex","last_name":"Chen","state":"active","invited_at":"2026-03-10T09:00:00Z","accepted_at":"2026-03-10T09:15:00Z","created_at":"2026-03-10T09:00:00Z","updated_at":"2026-03-16T10:05:00Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/UnprocessableContent"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Applies only the supplied profile and external identifier fields; accepted users retain control of their account name and login email. Changing an invited user's email re-sends their invitation to the new address. In Setup mode the invitation is held instead, and the user returns to `pending`. If the invitation includes permissions, it is withdrawn (state `pending`) and an admin must invite them again."},"delete":{"operationId":"archiveUser","tags":["Users"],"summary":"Archive a user","x-required-scope":"users:write","description":"Archives the user (they've left the organisation). Learning history is retained; incomplete tasks are cancelled, sessions are ended, and group memberships are suspended. Restoring reverses it. An Organisation Group Admin, or someone who is a group admin elsewhere in the organisation's group, can only be archived by Tayl staff or another group admin, so this returns `403 not_permitted` for them.","responses":{"204":{"description":"User archived."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableContent"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/users/{id}/restore":{"parameters":[{"name":"id","in":"path","required":true,"description":"The user's Tayl UUID.","schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"restoreUser","tags":["Users"],"summary":"Restore an archived user","x-required-scope":"users:write","description":"Restores a paused or suspended user to active. Archived linked users return to active; unlinked users return to their pending or invited state. Tasks cancelled by the archive are reinstated. An Organisation Group Admin, or someone who is a group admin elsewhere in the organisation's group, can only be restored by Tayl staff or another group admin, so this returns `403 not_permitted` for them.","responses":{"200":{"description":"The restored user.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"},"example":{"id":"019cf5b0-7c00-7000-8000-000000000002","external_id":"usr-1042","email":"alex.chen@example.com","name":"Alex Chen","first_name":"Alex","last_name":"Chen","state":"active","invited_at":"2026-03-10T09:00:00Z","accepted_at":"2026-03-10T09:15:00Z","created_at":"2026-03-10T09:00:00Z","updated_at":"2026-03-16T10:00:00Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableContent"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/users/by-external-id/{external_id}":{"parameters":[{"name":"external_id","in":"path","required":true,"description":"The user's `external_id`.","schema":{"$ref":"#/components/schemas/ExternalId"}}],"get":{"operationId":"getUserByExternalId","tags":["Users"],"summary":"Get a user by external ID","x-required-scope":"users:read","responses":{"200":{"description":"The user.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"},"example":{"id":"019cf5b0-7c00-7000-8000-000000000002","external_id":"usr-1042","email":"alex.chen@example.com","name":"Alex Chen","first_name":"Alex","last_name":"Chen","state":"active","invited_at":"2026-03-10T09:00:00Z","accepted_at":"2026-03-10T09:15:00Z","created_at":"2026-03-10T09:00:00Z","updated_at":"2026-03-16T10:00:00Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Returns the user with this `external_id`, matched case-sensitively."},"patch":{"operationId":"updateUserByExternalId","tags":["Users"],"summary":"Update a user by external ID","x-required-scope":"users:write","description":"Updates the user with this `external_id`, returning 404 if there's none: it doesn't create one.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserUpdateInput"},"example":{"email":"alex.chen@example.net","external_id":"usr-1042"}}}},"responses":{"200":{"description":"The updated user.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"},"example":{"id":"019cf5b0-7c00-7000-8000-000000000002","external_id":"usr-1042","email":"alex.chen@example.net","name":"Alex Chen","first_name":"Alex","last_name":"Chen","state":"active","invited_at":"2026-03-10T09:00:00Z","accepted_at":"2026-03-10T09:15:00Z","created_at":"2026-03-10T09:00:00Z","updated_at":"2026-03-16T10:05:00Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/UnprocessableContent"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"delete":{"operationId":"archiveUserByExternalId","tags":["Users"],"summary":"Archive a user by external ID","x-required-scope":"users:write","responses":{"204":{"description":"User archived."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableContent"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Archives the externally identified user while retaining learning history and allowing a later restore by UUID. Returns `403 not_permitted` for an Organisation Group Admin, as archiving by UUID does."}},"/api/v1/groups":{"get":{"operationId":"listGroups","tags":["Groups"],"summary":"List groups","x-required-scope":"groups:read","description":"Lists current groups. `since` considers group updated_at.","parameters":[{"$ref":"#/components/parameters/Page"},{"$ref":"#/components/parameters/PerPage"},{"name":"external_id","in":"query","description":"Exact external_id match.","schema":{"$ref":"#/components/schemas/ExternalId"}},{"name":"category_id","in":"query","schema":{"type":"string","format":"uuid"},"description":"Return only groups assigned to this group category UUID."},{"name":"automatic","in":"query","description":"Filter to automatic (system-managed) or manual groups.","schema":{"type":"boolean"}},{"$ref":"#/components/parameters/Since"},{"name":"sort","in":"query","schema":{"type":"string","enum":["created_at","updated_at","name"],"default":"created_at"},"description":"Field used to order the result set."},{"$ref":"#/components/parameters/Order"}],"responses":{"200":{"description":"A page of groups.","headers":{"Link":{"$ref":"#/components/headers/Link"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupList"},"example":{"groups":[{"id":"019cf5b0-7c00-7000-8000-000000000003","external_id":"loc-london","name":"London","description":"People based at the London site","category_id":"019cf5b0-7c00-7000-8000-000000000004","automatic":false,"rule_user_group_ids":[],"category_made":false,"members_count":18,"created_at":"2026-02-01T09:00:00Z","updated_at":"2026-03-15T11:30:00Z"}],"meta":{"page":1,"per_page":25,"total_pages":1,"total_count":1}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"post":{"operationId":"createGroup","tags":["Groups"],"summary":"Create a group","x-required-scope":"groups:write","x-requires-role":"admin","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupInput"},"example":{"name":"London","description":"People based at the London site","category_id":"019cf5b0-7c00-7000-8000-000000000004","external_id":"loc-london"}}}},"responses":{"201":{"description":"The created group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Group"},"example":{"id":"019cf5b0-7c00-7000-8000-000000000003","external_id":"loc-london","name":"London","description":"People based at the London site","category_id":"019cf5b0-7c00-7000-8000-000000000004","automatic":false,"rule_user_group_ids":[],"category_made":false,"members_count":0,"created_at":"2026-03-16T10:00:00Z","updated_at":"2026-03-16T10:00:00Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/UnprocessableContent"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Creates a manual group; automatic and rule-based groups are made only by Tayl."}},"/api/v1/groups/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"The group's Tayl UUID.","schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getGroup","tags":["Groups"],"summary":"Get a group","x-required-scope":"groups:read","responses":{"200":{"description":"The group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Group"},"example":{"id":"019cf5b0-7c00-7000-8000-000000000003","external_id":"loc-london","name":"London","description":"People based at the London site","category_id":"019cf5b0-7c00-7000-8000-000000000004","automatic":false,"rule_user_group_ids":[],"category_made":false,"members_count":18,"created_at":"2026-02-01T09:00:00Z","updated_at":"2026-03-15T11:30:00Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Returns one visible group, including its category and current active-member count."},"patch":{"operationId":"updateGroup","tags":["Groups"],"summary":"Update a group","x-required-scope":"groups:write","x-requires-role":"admin","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupUpdateInput"},"example":{"name":"London team","description":"People based at the London site"}}}},"responses":{"200":{"description":"The updated group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Group"},"example":{"id":"019cf5b0-7c00-7000-8000-000000000003","external_id":"loc-london","name":"London team","description":"People based at the London site","category_id":"019cf5b0-7c00-7000-8000-000000000004","automatic":false,"rule_user_group_ids":[],"category_made":false,"members_count":18,"created_at":"2026-02-01T09:00:00Z","updated_at":"2026-03-16T10:05:00Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/UnprocessableContent"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Updates a manual group's supplied fields; automatic and category-made groups are read-only."},"delete":{"operationId":"deleteGroup","tags":["Groups"],"summary":"Delete a group","x-required-scope":"groups:write","x-requires-role":"admin","description":"Soft-deletes an empty manual group and removes its links to parent groups; the parents remain. Non-deleted memberships and active sub-groups block deletion (422). A category-made group can't be deleted here, and doesn't block deleting a group its rule names: it's hidden with that group. Deleting releases the group's external_id for reuse.","responses":{"204":{"description":"Group deleted."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableContent"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/groups/by-external-id/{external_id}":{"parameters":[{"name":"external_id","in":"path","required":true,"description":"The group's `external_id`.","schema":{"$ref":"#/components/schemas/ExternalId"}}],"get":{"operationId":"getGroupByExternalId","tags":["Groups"],"summary":"Get a group by external ID","x-required-scope":"groups:read","responses":{"200":{"description":"The group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Group"},"example":{"id":"019cf5b0-7c00-7000-8000-000000000003","external_id":"loc-london","name":"London","description":"People based at the London site","category_id":"019cf5b0-7c00-7000-8000-000000000004","automatic":false,"rule_user_group_ids":[],"category_made":false,"members_count":18,"created_at":"2026-02-01T09:00:00Z","updated_at":"2026-03-15T11:30:00Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Returns the group with this `external_id`, matched case-sensitively."},"patch":{"operationId":"updateGroupByExternalId","tags":["Groups"],"summary":"Update a group by external ID","x-required-scope":"groups:write","x-requires-role":"admin","description":"Updates the group with this `external_id`, returning 404 if there's none: it doesn't create one.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupUpdateInput"},"example":{"name":"London team","description":"People based at the London site"}}}},"responses":{"200":{"description":"The updated group.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Group"},"example":{"id":"019cf5b0-7c00-7000-8000-000000000003","external_id":"loc-london","name":"London team","description":"People based at the London site","category_id":"019cf5b0-7c00-7000-8000-000000000004","automatic":false,"rule_user_group_ids":[],"category_made":false,"members_count":18,"created_at":"2026-02-01T09:00:00Z","updated_at":"2026-03-16T10:05:00Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/UnprocessableContent"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"delete":{"operationId":"deleteGroupByExternalId","tags":["Groups"],"summary":"Delete a group by external ID","x-required-scope":"groups:write","x-requires-role":"admin","responses":{"204":{"description":"Group deleted."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableContent"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Soft-deletes the externally identified group under the same rules as deletion by ID. Non-deleted memberships and active sub-groups block deletion (422); a rule-based group whose rule names it does not. Deleting releases its external identifier for reuse."}},"/api/v1/groups/{group_id}/memberships":{"parameters":[{"name":"group_id","in":"path","required":true,"description":"The group's Tayl UUID.","schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"listGroupMemberships","tags":["Group Memberships"],"summary":"List group members","x-required-scope":"groups:read","parameters":[{"$ref":"#/components/parameters/Page"},{"$ref":"#/components/parameters/PerPage"}],"responses":{"200":{"description":"A page of the group's active memberships.","headers":{"Link":{"$ref":"#/components/headers/Link"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembershipList"},"example":{"memberships":[{"user_id":"019cf5b0-7c00-7000-8000-000000000002","user_external_id":"usr-1042","email":"alex.chen@example.com","name":"Alex Chen","source":"direct","created_at":"2026-03-12T14:30:00Z"}],"meta":{"page":1,"per_page":25,"total_pages":1,"total_count":1}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Lists current members from every source; only memberships whose source is `direct` can be removed through this API."},"post":{"operationId":"addGroupMembers","tags":["Group Memberships"],"summary":"Add members to a group","x-required-scope":"groups:write","description":"Adds current users to the group as direct members, entry by entry: existing members report 200, new or restored memberships 201, and archived users 422. A 200 entry keeps its membership's `source`; one from an included group or an integration is kept in step by Tayl and can't be removed through this API. Not available on automatic groups.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembershipsRequest"},"example":{"memberships":[{"user_external_id":"usr-1042"},{"user_external_id":"usr-1043"}]}}}},"responses":{"200":{"description":"Every entry succeeded and at least one user was already a member (inspect per-entry statuses).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkMembershipsResult"},"example":{"results":[{"index":0,"status":200,"membership":{"user_id":"019cf5b0-7c00-7000-8000-000000000002","user_external_id":"usr-1042","email":"alex.chen@example.com","name":"Alex Chen","source":"direct","created_at":"2026-03-12T14:30:00Z"},"errors":[]},{"index":1,"status":201,"membership":{"user_id":"019cf5b0-7c00-7000-8000-000000000003","user_external_id":"usr-1043","email":"sam.lee@example.com","name":"Sam Lee","source":"direct","created_at":"2026-03-12T14:30:00Z"},"errors":[]}],"meta":{"total":2,"succeeded":2,"failed":0}}}}},"201":{"description":"Every membership was created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkMembershipsResult"},"example":{"results":[{"index":0,"status":201,"membership":{"user_id":"019cf5b0-7c00-7000-8000-000000000002","user_external_id":"usr-1042","email":"alex.chen@example.com","name":"Alex Chen","source":"direct","created_at":"2026-03-12T14:30:00Z"},"errors":[]},{"index":1,"status":201,"membership":{"user_id":"019cf5b0-7c00-7000-8000-000000000003","user_external_id":"usr-1043","email":"sam.lee@example.com","name":"Sam Lee","source":"direct","created_at":"2026-03-12T14:30:00Z"},"errors":[]}],"meta":{"total":2,"succeeded":2,"failed":0}}}}},"207":{"description":"Some entries succeeded; inspect per-entry statuses.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkMembershipsResult"},"example":{"results":[{"index":0,"status":201,"membership":{"user_id":"019cf5b0-7c00-7000-8000-000000000002","user_external_id":"usr-1042","email":"alex.chen@example.com","name":"Alex Chen","source":"direct","created_at":"2026-03-12T14:30:00Z"},"errors":[]},{"index":1,"status":404,"membership":null,"errors":[{"code":"not_found","message":"could not be found in this organisation","field":"user_external_id","pointer":"/data/user_external_id","documentation_url":"https://tayl.pro/api/v1/docs/errors#not_found"}]}],"meta":{"total":2,"succeeded":1,"failed":1}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"description":"The group is automatic (error envelope), or no entry could be processed because its identifier or user state is invalid (per-entry results).","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/BulkMembershipsResult"},{"$ref":"#/components/schemas/Error"}]},"example":{"errors":[{"code":"automatic_group_read_only","message":"Automatic group memberships are managed by Tayl","documentation_url":"https://tayl.pro/api/v1/docs/errors#automatic_group_read_only"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/groups/{group_id}/memberships/bulk-remove":{"parameters":[{"name":"group_id","in":"path","required":true,"description":"The group's Tayl UUID.","schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"removeGroupMembers","tags":["Group Memberships"],"summary":"Remove members from a group","x-required-scope":"groups:write","description":"Removes current users' direct memberships. Someone also in a group that this group includes stays a member, with `source` `inclusion`. Archived users report a per-entry 422. Inclusion, automatic, and integration memberships are derived and cannot be removed (per-entry 404). Not available on automatic groups.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MembershipsRequest"},"example":{"memberships":[{"user_external_id":"usr-1042"},{"user_external_id":"usr-1043"}]}}}},"responses":{"200":{"description":"Every membership was removed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkMembershipsResult"},"example":{"results":[{"index":0,"status":200,"membership":null,"errors":[]},{"index":1,"status":200,"membership":null,"errors":[]}],"meta":{"total":2,"succeeded":2,"failed":0}}}}},"207":{"description":"Some entries succeeded; inspect per-entry statuses.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkMembershipsResult"},"example":{"results":[{"index":0,"status":200,"membership":null,"errors":[]},{"index":1,"status":404,"membership":null,"errors":[{"code":"not_found","message":"is not a direct member of this group","field":"user_external_id","pointer":"/data/user_external_id","documentation_url":"https://tayl.pro/api/v1/docs/errors#not_found"}]}],"meta":{"total":2,"succeeded":1,"failed":1}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"description":"The group is automatic (error envelope), or no entry could be processed because its identifier or user state is invalid (per-entry results).","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/BulkMembershipsResult"},{"$ref":"#/components/schemas/Error"}]},"example":{"results":[{"index":0,"status":422,"membership":null,"errors":[{"code":"invalid_user_state","message":"is archived","field":"user_external_id","pointer":"/data/user_external_id","documentation_url":"https://tayl.pro/api/v1/docs/errors#invalid_user_state"}]},{"index":1,"status":404,"membership":null,"errors":[{"code":"not_found","message":"is not a direct member of this group","field":"user_external_id","pointer":"/data/user_external_id","documentation_url":"https://tayl.pro/api/v1/docs/errors#not_found"}]}],"meta":{"total":2,"succeeded":0,"failed":2}}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/groups/{group_id}/memberships/{user_id}":{"parameters":[{"name":"group_id","in":"path","required":true,"description":"The group's Tayl UUID.","schema":{"type":"string","format":"uuid"}},{"name":"user_id","in":"path","required":true,"description":"The member's Tayl user UUID.","schema":{"type":"string","format":"uuid"}}],"delete":{"operationId":"removeGroupMember","tags":["Group Memberships"],"summary":"Remove a member from a group","x-required-scope":"groups:write","description":"Removes a current user's direct membership. Someone also in a group that this group includes stays a member, with `source` `inclusion`. Archived users receive 422; users without a direct membership receive 404. Not available on automatic groups.","responses":{"204":{"description":"Membership removed."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableContent"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/groups/{group_id}/memberships/by-external-id/{user_external_id}":{"parameters":[{"name":"group_id","in":"path","required":true,"description":"The group's Tayl UUID.","schema":{"type":"string","format":"uuid"}},{"name":"user_external_id","in":"path","required":true,"description":"The member's `external_id`.","schema":{"$ref":"#/components/schemas/ExternalId"}}],"delete":{"operationId":"removeGroupMemberByExternalId","tags":["Group Memberships"],"summary":"Remove a member from a group by external ID","x-required-scope":"groups:write","responses":{"204":{"description":"Membership removed."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableContent"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Removes a current user's direct membership, naming them by `external_id`; memberships from included groups or integrations stay as Tayl keeps them. Someone also in a group that this group includes stays a member, with `source` `inclusion`."}},"/api/v1/group-categories":{"get":{"operationId":"listGroupCategories","tags":["Group Categories"],"summary":"List group categories","x-required-scope":"groups:read","parameters":[{"$ref":"#/components/parameters/Page"},{"$ref":"#/components/parameters/PerPage"},{"name":"external_id","in":"query","description":"Exact external_id match.","schema":{"$ref":"#/components/schemas/ExternalId"}}],"responses":{"200":{"description":"A page of group categories, ordered by position.","headers":{"Link":{"$ref":"#/components/headers/Link"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupCategoryList"},"example":{"group_categories":[{"id":"019cf5b0-7c00-7000-8000-000000000004","external_id":"category-location","name":"Location","description":"The site where a person works","colour":"blue","icon":"map-pin","position":2,"automatic":false,"created_at":"2026-01-12T08:30:00Z","updated_at":"2026-03-01T12:00:00Z"}],"meta":{"page":1,"per_page":25,"total_pages":1,"total_count":1}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Lists the organisation's taxonomy in display order, including the read-only Automatic category."},"post":{"operationId":"createGroupCategory","tags":["Group Categories"],"summary":"Create a group category","x-required-scope":"groups:write","x-requires-role":"admin","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupCategoryInput"},"example":{"name":"Location","description":"The site where a person works","colour":"blue","icon":"map-pin","external_id":"category-location"}}}},"responses":{"201":{"description":"The created category.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupCategory"},"example":{"id":"019cf5b0-7c00-7000-8000-000000000004","external_id":"category-location","name":"Location","description":"The site where a person works","colour":"blue","icon":"map-pin","position":10,"automatic":false,"created_at":"2026-03-16T10:00:00Z","updated_at":"2026-03-16T10:00:00Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/UnprocessableContent"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Adds a category used to organise manual groups in manager views and integrations."}},"/api/v1/group-categories/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"The category's Tayl UUID.","schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getGroupCategory","tags":["Group Categories"],"summary":"Get a group category","x-required-scope":"groups:read","responses":{"200":{"description":"The category.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupCategory"},"example":{"id":"019cf5b0-7c00-7000-8000-000000000004","external_id":"category-location","name":"Location","description":"The site where a person works","colour":"blue","icon":"map-pin","position":2,"automatic":false,"created_at":"2026-01-12T08:30:00Z","updated_at":"2026-03-01T12:00:00Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Returns one organisation group category by Tayl UUID."},"patch":{"operationId":"updateGroupCategory","tags":["Group Categories"],"summary":"Update a group category","x-required-scope":"groups:write","x-requires-role":"admin","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupCategoryUpdateInput"},"example":{"description":"The primary site where a person works","colour":"indigo"}}}},"responses":{"200":{"description":"The updated category.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupCategory"},"example":{"id":"019cf5b0-7c00-7000-8000-000000000004","external_id":"category-location","name":"Location","description":"The primary site where a person works","colour":"indigo","icon":"map-pin","position":2,"automatic":false,"created_at":"2026-01-12T08:30:00Z","updated_at":"2026-03-16T10:05:00Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/UnprocessableContent"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Updates the supplied name, visual treatment, or external identifier; the Automatic category is read-only."},"delete":{"operationId":"deleteGroupCategory","tags":["Group Categories"],"summary":"Delete a group category","x-required-scope":"groups:write","x-requires-role":"admin","description":"Categories with groups attached cannot be deleted (422); recategorise the groups first.","responses":{"204":{"description":"Category deleted."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableContent"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/group-categories/by-external-id/{external_id}":{"parameters":[{"name":"external_id","in":"path","required":true,"description":"The category's `external_id`.","schema":{"$ref":"#/components/schemas/ExternalId"}}],"get":{"operationId":"getGroupCategoryByExternalId","tags":["Group Categories"],"summary":"Get a group category by external ID","x-required-scope":"groups:read","responses":{"200":{"description":"The category.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupCategory"},"example":{"id":"019cf5b0-7c00-7000-8000-000000000004","external_id":"category-location","name":"Location","description":"The site where a person works","colour":"blue","icon":"map-pin","position":2,"automatic":false,"created_at":"2026-01-12T08:30:00Z","updated_at":"2026-03-01T12:00:00Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Returns the category with this `external_id`, matched case-sensitively."},"patch":{"operationId":"updateGroupCategoryByExternalId","tags":["Group Categories"],"summary":"Update a group category by external ID","x-required-scope":"groups:write","x-requires-role":"admin","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupCategoryUpdateInput"},"example":{"description":"The primary site where a person works","colour":"indigo"}}}},"responses":{"200":{"description":"The updated category.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupCategory"},"example":{"id":"019cf5b0-7c00-7000-8000-000000000004","external_id":"category-location","name":"Location","description":"The primary site where a person works","colour":"indigo","icon":"map-pin","position":2,"automatic":false,"created_at":"2026-01-12T08:30:00Z","updated_at":"2026-03-16T10:05:00Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/UnprocessableContent"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Updates supplied fields on the externally identified category; it never creates a missing category."},"delete":{"operationId":"deleteGroupCategoryByExternalId","tags":["Group Categories"],"summary":"Delete a group category by external ID","x-required-scope":"groups:write","x-requires-role":"admin","responses":{"204":{"description":"Category deleted."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableContent"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Deletes the externally identified category only when no groups still use it."}},"/api/v1/courses":{"get":{"operationId":"listCourses","tags":["Content Library"],"summary":"List courses","x-required-scope":"content:read","description":"Lists the published courses the organisation can see: its own, Tayl's, and those shared through its organisation group, which stay visible only while the group shares them, even if assignments still use them. A course can be assigned once `in_library` is true; an admin or content manager adds Tayl's courses to the library in Tayl. With `status=draft` or `status=archived`, it lists the organisation's own drafts or archived courses instead, such as a course created through the API that hasn't been published yet. `since` considers changes to courses and to their places in the organisation's or group's library. Removing one of Tayl's courses from the library doesn't count, as the course stays listed with `in_library` false and no new timestamp, so reconcile against the full list regularly.","parameters":[{"name":"status","in":"query","schema":{"type":"string","enum":["published","draft","archived"],"default":"published"},"description":"Which courses to list. `published` lists those the organisation can see; `draft` (including `autosaved` drafts) and `archived` list only its own."},{"$ref":"#/components/parameters/Page"},{"$ref":"#/components/parameters/PerPage"},{"$ref":"#/components/parameters/Since"}],"responses":{"200":{"description":"A page of courses, sorted by title.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseList"},"example":{"courses":[{"id":"019cf5b0-7c00-7000-8000-000000000005","title":"Food safety essentials","description":"Safe food handling for new starters","status":"published","platform_course":true,"syncs_from_v2":false,"in_library":true,"compliance_training":true,"current_version_id":"019cf5b0-7c00-7000-8000-000000000006","current_version_number":3,"published_at":"2026-02-20T10:00:00Z","created_at":"2025-11-01T09:00:00Z","updated_at":"2026-02-20T10:00:00Z"}],"meta":{"page":1,"per_page":25,"total_pages":1,"total_count":1}}}},"headers":{"Link":{"$ref":"#/components/headers/Link"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"post":{"operationId":"createCourse","tags":["Course Authoring"],"summary":"Create a course","x-required-scope":"content:write","x-requires-feature":"course_builder","description":"Creates a course in your organisation from a course document. It starts as a draft only people in the course builder see; `course.editor_url` opens it there for review, and `GET /api/v1/courses?status=draft` lists it until it's published. Read `publishable` and `publish_error` to see whether it's ready to publish. A document over the limits in the course authoring guide returns 422 `document_too_large`: start a bigger course with its first chapters and add the rest with `POST /api/v1/courses/{id}/draft/chapters`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseDocument"},"example":{"title":"Allergen awareness","description":"What every server needs to know","hero_image":null,"duration_min_minutes":null,"duration_max_minutes":20,"appearance":{"display_theme":"adapt","theme_color":"#3f5da5","theme_color_dark":null,"theme_secondary_color":null,"theme_secondary_color_dark":null,"heading_font":null,"body_font":null},"chapters":[{"title":"The 14 allergens","header":false,"pages":[{"title":"Why it matters","blocks":[{"type":"text","html":"<p>One wrong ingredient can put a guest in hospital. Every dish lists its allergens, so you can answer their questions with confidence.</p>","wrapper":{"background_color":"#eef2fb","background_color_dark":"#1c2a4f"}},{"type":"highlight","html":"<p>Never guess an ingredient. If you're not sure, ask the kitchen.</p>","style":"warning"},{"type":"flashcard_container","cards":[{"front_html":"<p>Celery</p>","back_html":"<p>Includes celeriac and celery salt.</p>","appearance":{"front_bg_color":"#3f5da5","front_text_color":"#ffffff"}},{"front_html":"<p>Mustard</p>","back_html":"<p>Includes liquid mustard, mustard powder and seeds.</p>","appearance":{"front_bg_color":"#3f5da5","front_text_color":"#ffffff"}}]},{"type":"knowledge_check","question":{"kind":"single_choice","text":"A guest is allergic to celery. Which of these could contain it?","correct_message":"Right: celery salt is made from celery seeds.","incorrect_message":"Not quite: celery salt is made from celery seeds, so it contains celery.","answers":[{"text":"Celery salt","correct":true},{"text":"Black pepper","correct":false},{"text":"Sea salt","correct":false}]}}]}],"quiz":null,"signing":null,"scorm":null}]}}}},"responses":{"201":{"description":"The new course and its draft.","headers":{"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseContent"},"example":{"course":{"id":"019cf5b0-7c00-7000-8000-000000000005","status":"draft","published_at":null,"current_version_id":null,"editor_url":"https://tayl.pro/create/courses/019cf5b0-7c00-7000-8000-000000000005/edit"},"version":{"id":"019cf5b0-7c00-7000-8000-000000000006","number":1,"draft":true,"updated_at":"2026-10-21T09:00:00Z"},"etag":"\"5d41402abc4b2a76b9719d911017c592\"","publishable":true,"publish_error":null,"review":[{"pointer":"/hero_image","code":"no_hero_image","message":"Give the course a hero_image, which learners see on their task and at the top of the course."}],"media":{},"content":{"title":"Allergen awareness","description":"What every server needs to know","hero_image":null,"duration_min_minutes":null,"duration_max_minutes":20,"appearance":{"display_theme":"adapt","theme_color":"#3f5da5","theme_color_dark":null,"theme_secondary_color":null,"theme_secondary_color_dark":null,"heading_font":null,"body_font":null},"chapters":[{"id":"019cf5b0-7c00-7000-8000-00000000001b","title":"The 14 allergens","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-00000000002c","title":"Why it matters","blocks":[{"id":"019cf5b0-7c00-7000-8000-00000000012c","type":"text","html":"<p>One wrong ingredient can put a guest in hospital. Every dish lists its allergens, so you can answer their questions with confidence.</p>","wrapper":{"background_color":"#eef2fb","background_color_dark":"#1c2a4f"}},{"id":"019cf5b0-7c00-7000-8000-00000000012d","type":"highlight","html":"<p>Never guess an ingredient. If you're not sure, ask the kitchen.</p>","style":"warning"},{"id":"019cf5b0-7c00-7000-8000-00000000012e","type":"flashcard_container","cards":[{"front_html":"<p>Celery</p>","back_html":"<p>Includes celeriac and celery salt.</p>","appearance":{"front_bg_color":"#3f5da5","front_text_color":"#ffffff"}},{"front_html":"<p>Mustard</p>","back_html":"<p>Includes liquid mustard, mustard powder and seeds.</p>","appearance":{"front_bg_color":"#3f5da5","front_text_color":"#ffffff"}}]},{"id":"019cf5b0-7c00-7000-8000-00000000012f","type":"knowledge_check","question":{"kind":"single_choice","text":"A guest is allergic to celery. Which of these could contain it?","correct_message":"Right: celery salt is made from celery seeds.","incorrect_message":"Not quite: celery salt is made from celery seeds, so it contains celery.","answers":[{"text":"Celery salt","correct":true},{"text":"Black pepper","correct":false},{"text":"Sea salt","correct":false}]}}]}],"quiz":null,"signing":null,"scorm":null}]}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"413":{"$ref":"#/components/responses/ContentTooLarge"},"422":{"description":"The document isn't valid. Each error's `pointer` names the field, as a JSON Pointer under `/data`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"errors":[{"code":"validation_error","message":"value at `/chapters/0/pages/0/blocks/0/level` is not one of: [\"h1\", \"h2\", \"h3\", null]","pointer":"/data/chapters/0/pages/0/blocks/0/level","documentation_url":"https://tayl.pro/api/v1/docs/errors#validation_error"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/courses/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"The course's Tayl UUID.","schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getCourse","tags":["Content Library"],"summary":"Get a course","x-required-scope":"content:read","responses":{"200":{"description":"The course, including its current published version UUID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Course"},"example":{"id":"019cf5b0-7c00-7000-8000-000000000005","title":"Food safety essentials","description":"Safe food handling for new starters","status":"published","platform_course":true,"syncs_from_v2":false,"in_library":true,"compliance_training":true,"current_version_id":"019cf5b0-7c00-7000-8000-000000000006","current_version_number":3,"published_at":"2026-02-20T10:00:00Z","created_at":"2025-11-01T09:00:00Z","updated_at":"2026-02-20T10:00:00Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Returns a visible published course and the version UUID that a new assignment will deliver, or one of the organisation's own drafts or archived courses."},"delete":{"operationId":"deleteCourse","tags":["Course Authoring"],"summary":"Delete a course","x-required-scope":"content:write","x-requires-feature":"course_builder","description":"Deletes a course your organisation created that has never been published. A published course can't be deleted; archive it instead. Send the `etag` you last read as `If-Match` so a course someone has changed since isn't deleted.","parameters":[{"name":"If-Match","in":"header","required":false,"description":"Optional: the `etag` you last read. If the course has changed since, it isn't deleted and this returns 412.","schema":{"type":"string"}}],"responses":{"204":{"description":"Done. There's no response body."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"412":{"$ref":"#/components/responses/PreconditionFailed"},"422":{"description":"The course has been published.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"errors":[{"code":"not_deletable","message":"Only a course that has never been published can be deleted. Archive it instead.","documentation_url":"https://tayl.pro/api/v1/docs/errors#not_deletable"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/courses/{id}/content":{"parameters":[{"name":"id","in":"path","required":true,"description":"The course's Tayl UUID.","schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getCourseContent","tags":["Course Authoring"],"summary":"Get a course's published content","x-required-scope":"content:read","x-requires-role":"course_author","description":"Returns the published version of a course your organisation authored as one document, with the files it names. Courses from Tayl or shared by your organisation group aren't available. A course that has never been published has only a draft; read it with `GET /api/v1/courses/{id}/draft`. To change a published course, start its draft with `POST /api/v1/courses/{id}/draft` and work on that.","responses":{"200":{"description":"The published content.","headers":{"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseContent"},"example":{"course":{"id":"019cf5b0-7c00-7000-8000-000000000005","status":"published","published_at":"2026-10-01T09:00:00Z","current_version_id":"019cf5b0-7c00-7000-8000-000000000006","editor_url":"https://tayl.pro/create/courses/019cf5b0-7c00-7000-8000-000000000005/edit"},"version":{"id":"019cf5b0-7c00-7000-8000-000000000006","number":1,"draft":false,"updated_at":"2026-10-21T09:00:00Z"},"etag":"\"5d41402abc4b2a76b9719d911017c592\"","publishable":false,"publish_error":"There's no draft to publish.","review":[{"pointer":"/hero_image","code":"no_hero_image","message":"Give the course a hero_image, which learners see on their task and at the top of the course."},{"pointer":"/chapters/0/pages/0","code":"nothing_to_see_or_do","message":"This page is only text. Add a picture or diagram that shows its point, or something to do, such as a knowledge_check, flashcard_container or tab_list."},{"pointer":"/chapters/0","code":"no_practice","message":"Add a knowledge_check after a key idea, or a quiz, so learners recall what this chapter teaches."}],"media":{},"content":{"title":"Allergen awareness","description":"What every server needs to know","hero_image":null,"duration_min_minutes":null,"duration_max_minutes":20,"appearance":{"display_theme":"adapt","theme_color":"#3f5da5","theme_color_dark":null,"theme_secondary_color":null,"theme_secondary_color_dark":null,"heading_font":null,"body_font":null},"chapters":[{"id":"019cf5b0-7c00-7000-8000-000000000014","title":"The 14 allergens","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-000000000025","title":"Why it matters","blocks":[{"id":"019cf5b0-7c00-7000-8000-000000000125","type":"text","html":"<p>Every dish must list its allergens.</p>"}]}],"quiz":null,"signing":null,"scorm":null}]}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/courses/{id}/content/outline":{"parameters":[{"name":"id","in":"path","required":true,"description":"The course's Tayl UUID.","schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getCourseContentOutline","tags":["Course Authoring"],"summary":"Get a course's published outline","x-required-scope":"content:read","x-requires-role":"course_author","description":"Returns the chapters and pages of a course's published version by ID and title, without their content, so you can find your way around a large course before reading parts of it. A course that has never been published returns 404.","responses":{"200":{"description":"The published outline.","headers":{"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseOutlineContent"},"example":{"course":{"id":"019cf5b0-7c00-7000-8000-000000000005","status":"published","published_at":"2026-10-01T09:00:00Z","current_version_id":"019cf5b0-7c00-7000-8000-000000000006","editor_url":"https://tayl.pro/create/courses/019cf5b0-7c00-7000-8000-000000000005/edit"},"version":{"id":"019cf5b0-7c00-7000-8000-000000000006","number":1,"draft":false,"updated_at":"2026-10-21T09:00:00Z"},"etag":"\"5d41402abc4b2a76b9719d911017c592\"","content":{"chapters":[{"id":"019cf5b0-7c00-7000-8000-000000000301","title":"The 14 allergens","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-000000000401","title":"Why it matters"},{"id":"019cf5b0-7c00-7000-8000-000000000402","title":"Questions guests ask"}]},{"id":"019cf5b0-7c00-7000-8000-000000000302","title":"Serving guests safely","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-000000000403","title":"Taking an order"}]},{"id":"019cf5b0-7c00-7000-8000-000000000303","title":"Old notes","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-000000000404","title":"Draft notes"}]}]}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/courses/{id}/content/chapters/{chapter_id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"The course's Tayl UUID.","schema":{"type":"string","format":"uuid"}},{"name":"chapter_id","in":"path","required":true,"description":"The chapter's ID, from the course's outline or content.","schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getCourseContentChapter","tags":["Course Authoring"],"summary":"Get a chapter of a course's published content","x-required-scope":"content:read","x-requires-role":"course_author","description":"Returns one chapter of a course's published version as a document: its title, quiz, signing and SCORM package, and its pages with their blocks, with the files it names. Find chapter IDs in the published outline.","responses":{"200":{"description":"The chapter.","headers":{"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseChapterContent"},"example":{"course":{"id":"019cf5b0-7c00-7000-8000-000000000005","status":"published","published_at":"2026-10-01T09:00:00Z","current_version_id":"019cf5b0-7c00-7000-8000-000000000006","editor_url":"https://tayl.pro/create/courses/019cf5b0-7c00-7000-8000-000000000005/edit"},"version":{"id":"019cf5b0-7c00-7000-8000-000000000006","number":1,"draft":false,"updated_at":"2026-10-21T09:00:00Z"},"etag":"\"5d41402abc4b2a76b9719d911017c592\"","review":[{"pointer":"/pages/0","code":"nothing_to_see_or_do","message":"This page is only text. Add a picture or diagram that shows its point, or something to do, such as a knowledge_check, flashcard_container or tab_list."},{"pointer":"","code":"no_practice","message":"Add a knowledge_check after a key idea, or a quiz, so learners recall what this chapter teaches."}],"media":{},"content":{"id":"019cf5b0-7c00-7000-8000-000000000011","title":"The 14 allergens","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-000000000021","title":"Why it matters","blocks":[{"id":"019cf5b0-7c00-7000-8000-000000000121","type":"text","html":"<p>Every dish must list its allergens.</p>"}]}],"quiz":null,"signing":null,"scorm":null}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/courses/{id}/content/pages/{page_id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"The course's Tayl UUID.","schema":{"type":"string","format":"uuid"}},{"name":"page_id","in":"path","required":true,"description":"The page's ID, from the course's outline or content.","schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getCourseContentPage","tags":["Course Authoring"],"summary":"Get a page of a course's published content","x-required-scope":"content:read","x-requires-role":"course_author","description":"Returns one page of a course's published version as a document, its title and blocks, with the files it names. Find page IDs in the published outline.","responses":{"200":{"description":"The page.","headers":{"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CoursePageContent"},"example":{"course":{"id":"019cf5b0-7c00-7000-8000-000000000005","status":"published","published_at":"2026-10-01T09:00:00Z","current_version_id":"019cf5b0-7c00-7000-8000-000000000006","editor_url":"https://tayl.pro/create/courses/019cf5b0-7c00-7000-8000-000000000005/edit"},"version":{"id":"019cf5b0-7c00-7000-8000-000000000006","number":1,"draft":false,"updated_at":"2026-10-21T09:00:00Z"},"etag":"\"5d41402abc4b2a76b9719d911017c592\"","review":[{"pointer":"","code":"nothing_to_see_or_do","message":"This page is only text. Add a picture or diagram that shows its point, or something to do, such as a knowledge_check, flashcard_container or tab_list."}],"media":{},"content":{"id":"019cf5b0-7c00-7000-8000-000000000022","title":"Why it matters","blocks":[{"id":"019cf5b0-7c00-7000-8000-000000000122","type":"text","html":"<p>Every dish must list its allergens.</p>"}]}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/courses/{id}/draft":{"parameters":[{"name":"id","in":"path","required":true,"description":"The course's Tayl UUID.","schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getCourseDraft","tags":["Course Authoring"],"summary":"Get a course's draft","x-required-scope":"content:read","x-requires-role":"course_author","description":"Returns the draft of a course your organisation authored as one document, with the files it names, whether it can be published and the `etag` to send when saving it. A published course has no draft until one is started, with `POST` here or by editing the course in the course builder; until then this returns 404 `no_draft`.","responses":{"200":{"description":"The draft content.","headers":{"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseContent"},"example":{"course":{"id":"019cf5b0-7c00-7000-8000-000000000005","status":"draft","published_at":null,"current_version_id":null,"editor_url":"https://tayl.pro/create/courses/019cf5b0-7c00-7000-8000-000000000005/edit"},"version":{"id":"019cf5b0-7c00-7000-8000-000000000006","number":1,"draft":true,"updated_at":"2026-10-21T09:00:00Z"},"etag":"\"5d41402abc4b2a76b9719d911017c592\"","publishable":true,"publish_error":null,"review":[{"pointer":"/hero_image","code":"no_hero_image","message":"Give the course a hero_image, which learners see on their task and at the top of the course."},{"pointer":"/chapters/0/pages/0","code":"nothing_to_see_or_do","message":"This page is only text. Add a picture or diagram that shows its point, or something to do, such as a knowledge_check, flashcard_container or tab_list."},{"pointer":"/chapters/0","code":"no_practice","message":"Add a knowledge_check after a key idea, or a quiz, so learners recall what this chapter teaches."}],"media":{},"content":{"title":"Allergen awareness","description":"What every server needs to know","hero_image":null,"duration_min_minutes":null,"duration_max_minutes":20,"appearance":{"display_theme":"adapt","theme_color":"#3f5da5","theme_color_dark":null,"theme_secondary_color":null,"theme_secondary_color_dark":null,"heading_font":null,"body_font":null},"chapters":[{"id":"019cf5b0-7c00-7000-8000-000000000015","title":"The 14 allergens","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-000000000026","title":"Why it matters","blocks":[{"id":"019cf5b0-7c00-7000-8000-000000000126","type":"text","html":"<p>Every dish must list its allergens.</p>"}]}],"quiz":null,"signing":null,"scorm":null}]}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"post":{"operationId":"startCourseDraft","tags":["Course Authoring"],"summary":"Start a course's draft","x-required-scope":"content:write","x-requires-feature":"course_builder","description":"Starts the draft that changes to a published course go to, as opening the course in the course builder does, and returns it. The draft starts as a copy of the published content; learners keep the published version until the draft is published. If the course already has a draft, this returns it with 200, and a course that has never been published is a draft already. Archived courses return 422 `course_archived`.","responses":{"200":{"description":"The course's existing draft.","headers":{"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseContent"},"example":{"course":{"id":"019cf5b0-7c00-7000-8000-000000000005","status":"draft","published_at":null,"current_version_id":null,"editor_url":"https://tayl.pro/create/courses/019cf5b0-7c00-7000-8000-000000000005/edit"},"version":{"id":"019cf5b0-7c00-7000-8000-000000000006","number":1,"draft":true,"updated_at":"2026-10-21T09:00:00Z"},"etag":"\"5d41402abc4b2a76b9719d911017c592\"","publishable":true,"publish_error":null,"review":[{"pointer":"/hero_image","code":"no_hero_image","message":"Give the course a hero_image, which learners see on their task and at the top of the course."},{"pointer":"/chapters/0/pages/0","code":"nothing_to_see_or_do","message":"This page is only text. Add a picture or diagram that shows its point, or something to do, such as a knowledge_check, flashcard_container or tab_list."},{"pointer":"/chapters/0","code":"no_practice","message":"Add a knowledge_check after a key idea, or a quiz, so learners recall what this chapter teaches."}],"media":{},"content":{"title":"Allergen awareness","description":"What every server needs to know","hero_image":null,"duration_min_minutes":null,"duration_max_minutes":20,"appearance":{"display_theme":"adapt","theme_color":"#3f5da5","theme_color_dark":null,"theme_secondary_color":null,"theme_secondary_color_dark":null,"heading_font":null,"body_font":null},"chapters":[{"id":"019cf5b0-7c00-7000-8000-000000000016","title":"The 14 allergens","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-000000000027","title":"Why it matters","blocks":[{"id":"019cf5b0-7c00-7000-8000-000000000127","type":"text","html":"<p>Every dish must list its allergens.</p>"}]}],"quiz":null,"signing":null,"scorm":null}]}}}}},"201":{"description":"The new draft.","headers":{"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseContent"},"example":{"course":{"id":"019cf5b0-7c00-7000-8000-000000000005","status":"published","published_at":"2026-10-01T09:00:00Z","current_version_id":"019cf5b0-7c00-7000-8000-000000000007","editor_url":"https://tayl.pro/create/courses/019cf5b0-7c00-7000-8000-000000000005/edit"},"version":{"id":"019cf5b0-7c00-7000-8000-000000000006","number":2,"draft":true,"updated_at":"2026-10-21T09:00:00Z"},"etag":"\"5d41402abc4b2a76b9719d911017c592\"","publishable":false,"publish_error":"Nothing has changed since the last publish.","review":[{"pointer":"/hero_image","code":"no_hero_image","message":"Give the course a hero_image, which learners see on their task and at the top of the course."},{"pointer":"/chapters/0/pages/0","code":"nothing_to_see_or_do","message":"This page is only text. Add a picture or diagram that shows its point, or something to do, such as a knowledge_check, flashcard_container or tab_list."},{"pointer":"/chapters/0","code":"no_practice","message":"Add a knowledge_check after a key idea, or a quiz, so learners recall what this chapter teaches."}],"media":{},"content":{"title":"Allergen awareness","description":"What every server needs to know","hero_image":null,"duration_min_minutes":null,"duration_max_minutes":20,"appearance":{"display_theme":"adapt","theme_color":"#3f5da5","theme_color_dark":null,"theme_secondary_color":null,"theme_secondary_color_dark":null,"heading_font":null,"body_font":null},"chapters":[{"id":"019cf5b0-7c00-7000-8000-000000000017","title":"The 14 allergens","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-000000000028","title":"Why it matters","blocks":[{"id":"019cf5b0-7c00-7000-8000-000000000128","type":"text","html":"<p>Every dish must list its allergens.</p>"}]}],"quiz":null,"signing":null,"scorm":null}]}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"description":"The course is archived.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"errors":[{"code":"course_archived","message":"Archived courses can't change. Unarchive the course first.","documentation_url":"https://tayl.pro/api/v1/docs/errors#course_archived"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"put":{"operationId":"replaceCourseDraft","tags":["Course Authoring"],"summary":"Replace a course's draft","x-required-scope":"content:write","x-requires-feature":"course_builder","description":"Saves a course document as the course's draft and returns it. Send the `etag` from your last read as `If-Match`; if the course changed since, you get 412 and nothing is saved.\n\nChapters, pages and blocks you send with their `id` keep it, and a block's content or a chapter's quiz, signing or SCORM package you leave as they are aren't rewritten; a block moves to another page by appearing there. Those without an `id` are new; chapters, pages and blocks you leave out are removed, and fields you leave out inside them take the builder's defaults. Top-level fields you leave out keep their current values. `title`, `description`, `hero_image` and `appearance.display_theme` belong to the course, so they change for learners straight away; everything else waits until the draft is published. Saving a document identical to the current content changes nothing. Archived courses can't be saved, and saving needs Course Builder. A document over the size limits returns 422 `document_too_large`. Change a bigger course a chapter or page at a time.","parameters":[{"name":"If-Match","in":"header","required":true,"description":"The `etag` from your last read or save of this course's content. A stale value returns 412.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseDocument"},"example":{"title":"Allergen awareness","description":"What every server needs to know","hero_image":null,"duration_min_minutes":null,"duration_max_minutes":20,"appearance":{"display_theme":"adapt","theme_color":"#3f5da5","theme_color_dark":null,"theme_secondary_color":null,"theme_secondary_color_dark":null,"heading_font":null,"body_font":null},"chapters":[{"id":"019cf5b0-7c00-7000-8000-00000000001a","title":"The 14 allergens","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-00000000002b","title":"Why it matters","blocks":[{"id":"019cf5b0-7c00-7000-8000-00000000012b","type":"text","html":"<p>Every dish must list its allergens.</p>"}]}],"quiz":null,"signing":null,"scorm":null}]}}}},"responses":{"200":{"description":"The saved draft.","headers":{"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseContent"},"example":{"course":{"id":"019cf5b0-7c00-7000-8000-000000000005","status":"draft","published_at":null,"current_version_id":null,"editor_url":"https://tayl.pro/create/courses/019cf5b0-7c00-7000-8000-000000000005/edit"},"version":{"id":"019cf5b0-7c00-7000-8000-000000000006","number":1,"draft":true,"updated_at":"2026-10-21T09:00:00Z"},"etag":"\"5d41402abc4b2a76b9719d911017c592\"","publishable":true,"publish_error":null,"review":[{"pointer":"/hero_image","code":"no_hero_image","message":"Give the course a hero_image, which learners see on their task and at the top of the course."},{"pointer":"/chapters/0/pages/0","code":"nothing_to_see_or_do","message":"This page is only text. Add a picture or diagram that shows its point, or something to do, such as a knowledge_check, flashcard_container or tab_list."},{"pointer":"/chapters/0","code":"no_practice","message":"Add a knowledge_check after a key idea, or a quiz, so learners recall what this chapter teaches."}],"media":{},"content":{"title":"Allergen awareness","description":"What every server needs to know","hero_image":null,"duration_min_minutes":null,"duration_max_minutes":20,"appearance":{"display_theme":"adapt","theme_color":"#3f5da5","theme_color_dark":null,"theme_secondary_color":null,"theme_secondary_color_dark":null,"heading_font":null,"body_font":null},"chapters":[{"id":"019cf5b0-7c00-7000-8000-000000000018","title":"The 14 allergens","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-000000000029","title":"Why it matters","blocks":[{"id":"019cf5b0-7c00-7000-8000-000000000129","type":"text","html":"<p>Every dish must list its allergens.</p>"}]}],"quiz":null,"signing":null,"scorm":null}]}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"412":{"$ref":"#/components/responses/PreconditionFailed"},"413":{"$ref":"#/components/responses/ContentTooLarge"},"422":{"description":"The document isn't valid. Each error's `pointer` names the field, as a JSON Pointer under `/data`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"errors":[{"code":"validation_error","message":"value at `/chapters/0/pages/0/blocks/0/level` is not one of: [\"h1\", \"h2\", \"h3\", null]","pointer":"/data/chapters/0/pages/0/blocks/0/level","documentation_url":"https://tayl.pro/api/v1/docs/errors#validation_error"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}}}},"428":{"$ref":"#/components/responses/PreconditionRequired"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"patch":{"operationId":"updateCourseDraft","tags":["Course Authoring"],"summary":"Edit a course's draft with JSON Patch","x-required-scope":"content:write","x-requires-feature":"course_builder","description":"Applies RFC 6902 JSON Patch operations to the course's draft and saves the result like `PUT`. Paths are JSON Pointers into the document you read, so a typo fix is one `replace`. Send the `etag` from that read as `If-Match`. A malformed operation, or one that can't apply, returns 422 `invalid_patch` and nothing is saved.\n\nChapters, pages and blocks you send with their `id` keep it, and a block's content or a chapter's quiz, signing or SCORM package you leave as they are aren't rewritten; a block moves to another page by appearing there. Those without an `id` are new; chapters, pages and blocks you leave out are removed, and fields you leave out inside them take the builder's defaults. Top-level fields you leave out keep their current values. `title`, `description`, `hero_image` and `appearance.display_theme` belong to the course, so they change for learners straight away; everything else waits until the draft is published. Saving a document identical to the current content changes nothing. Archived courses can't be saved, and saving needs Course Builder. A document over the size limits returns 422 `document_too_large`. Change a bigger course a chapter or page at a time.","parameters":[{"name":"If-Match","in":"header","required":true,"description":"The `etag` from your last read or save of this course's content. A stale value returns 412.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json-patch+json":{"schema":{"$ref":"#/components/schemas/CourseDocumentPatch"},"example":[{"op":"test","path":"/chapters/0/title","value":"The 14 allergens"},{"op":"replace","path":"/chapters/0/pages/0/blocks/0/html","value":"<p>Every dish must list all 14 allergens.</p>"},{"op":"add","path":"/chapters/0/pages/-","value":{"title":"Questions guests ask","blocks":[]}}]}}},"responses":{"200":{"description":"The saved draft.","headers":{"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseContent"},"example":{"course":{"id":"019cf5b0-7c00-7000-8000-000000000005","status":"draft","published_at":null,"current_version_id":null,"editor_url":"https://tayl.pro/create/courses/019cf5b0-7c00-7000-8000-000000000005/edit"},"version":{"id":"019cf5b0-7c00-7000-8000-000000000006","number":1,"draft":true,"updated_at":"2026-10-21T09:00:00Z"},"etag":"\"5d41402abc4b2a76b9719d911017c592\"","publishable":true,"publish_error":null,"review":[{"pointer":"/hero_image","code":"no_hero_image","message":"Give the course a hero_image, which learners see on their task and at the top of the course."},{"pointer":"/chapters/0/pages/0","code":"nothing_to_see_or_do","message":"This page is only text. Add a picture or diagram that shows its point, or something to do, such as a knowledge_check, flashcard_container or tab_list."},{"pointer":"/chapters/0","code":"no_practice","message":"Add a knowledge_check after a key idea, or a quiz, so learners recall what this chapter teaches."}],"media":{},"content":{"title":"Allergen awareness","description":"What every server needs to know","hero_image":null,"duration_min_minutes":null,"duration_max_minutes":20,"appearance":{"display_theme":"adapt","theme_color":"#3f5da5","theme_color_dark":null,"theme_secondary_color":null,"theme_secondary_color_dark":null,"heading_font":null,"body_font":null},"chapters":[{"id":"019cf5b0-7c00-7000-8000-000000000019","title":"The 14 allergens","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-00000000002a","title":"Why it matters","blocks":[{"id":"019cf5b0-7c00-7000-8000-00000000012a","type":"text","html":"<p>Every dish must list its allergens.</p>"}]}],"quiz":null,"signing":null,"scorm":null}]}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"412":{"$ref":"#/components/responses/PreconditionFailed"},"413":{"$ref":"#/components/responses/ContentTooLarge"},"422":{"description":"The document isn't valid. Each error's `pointer` names the field, as a JSON Pointer under `/data`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"errors":[{"code":"validation_error","message":"value at `/chapters/0/pages/0/blocks/0/level` is not one of: [\"h1\", \"h2\", \"h3\", null]","pointer":"/data/chapters/0/pages/0/blocks/0/level","documentation_url":"https://tayl.pro/api/v1/docs/errors#validation_error"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}}}},"428":{"$ref":"#/components/responses/PreconditionRequired"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"delete":{"operationId":"discardCourseDraft","tags":["Course Authoring"],"summary":"Discard a course's draft","x-required-scope":"content:write","x-requires-feature":"course_builder","description":"Discards the draft of a published course, leaving the published version as it is. A course that has never been published is only a draft, so this returns 422 `not_discardable`; delete the course instead. Send the `etag` you last read as `If-Match` so a draft someone has changed since isn't discarded.","parameters":[{"name":"If-Match","in":"header","required":false,"description":"Optional: the `etag` you last read. If the course has changed since, nothing is discarded and this returns 412.","schema":{"type":"string"}}],"responses":{"204":{"description":"Done. There's no response body."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"412":{"$ref":"#/components/responses/PreconditionFailed"},"422":{"description":"The course has no draft to discard.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"errors":[{"code":"not_discardable","message":"No draft to discard.","documentation_url":"https://tayl.pro/api/v1/docs/errors#not_discardable"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/courses/{id}/draft/outline":{"parameters":[{"name":"id","in":"path","required":true,"description":"The course's Tayl UUID.","schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getCourseDraftOutline","tags":["Course Authoring"],"summary":"Get a course's draft outline","x-required-scope":"content:read","x-requires-role":"course_author","description":"Returns the chapters and pages of a course's draft by ID and title, without their content, with the `etag` to send when changing the draft. A large course reads quickly this way.","responses":{"200":{"description":"The draft's outline.","headers":{"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseOutlineContent"},"example":{"course":{"id":"019cf5b0-7c00-7000-8000-000000000005","status":"draft","published_at":null,"current_version_id":null,"editor_url":"https://tayl.pro/create/courses/019cf5b0-7c00-7000-8000-000000000005/edit"},"version":{"id":"019cf5b0-7c00-7000-8000-000000000006","number":1,"draft":true,"updated_at":"2026-10-21T09:00:00Z"},"etag":"\"5d41402abc4b2a76b9719d911017c592\"","content":{"chapters":[{"id":"019cf5b0-7c00-7000-8000-000000000301","title":"The 14 allergens","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-000000000401","title":"Why it matters"},{"id":"019cf5b0-7c00-7000-8000-000000000402","title":"Questions guests ask"}]},{"id":"019cf5b0-7c00-7000-8000-000000000302","title":"Serving guests safely","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-000000000403","title":"Taking an order"}]},{"id":"019cf5b0-7c00-7000-8000-000000000303","title":"Old notes","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-000000000404","title":"Draft notes"}]}]}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"put":{"operationId":"replaceCourseDraftOutline","tags":["Course Authoring"],"summary":"Reorganise a course's draft","x-required-scope":"content:write","x-requires-feature":"course_builder","description":"Reorders the draft's chapters, moves pages between chapters, renames them, and adds or removes them, leaving the content of every page, quiz and signing as it is. List every chapter and page once, by `id`: leaving one out returns 422, and setting `\"delete\": true` on one removes it, a chapter with the pages listed under it. Chapters and pages without an `id` are new and empty. Titles and headers you leave out stay as they are. Archived courses can't change.","parameters":[{"name":"If-Match","in":"header","required":true,"description":"The `etag` from your last read or save of this course's draft. A stale value returns 412.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseOutline"},"example":{"chapters":[{"id":"019cf5b0-7c00-7000-8000-000000000302","pages":[{"id":"019cf5b0-7c00-7000-8000-000000000403"},{"id":"019cf5b0-7c00-7000-8000-000000000402"}]},{"id":"019cf5b0-7c00-7000-8000-000000000301","title":"The 14 allergens in food","pages":[{"id":"019cf5b0-7c00-7000-8000-000000000401"},{"title":"Allergens in drinks"}]},{"id":"019cf5b0-7c00-7000-8000-000000000303","delete":true,"pages":[{"id":"019cf5b0-7c00-7000-8000-000000000404"}]},{"title":"Check your knowledge","pages":[]}]}}}},"responses":{"200":{"description":"The reorganised outline.","headers":{"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseOutlineContent"},"example":{"course":{"id":"019cf5b0-7c00-7000-8000-000000000005","status":"draft","published_at":null,"current_version_id":null,"editor_url":"https://tayl.pro/create/courses/019cf5b0-7c00-7000-8000-000000000005/edit"},"version":{"id":"019cf5b0-7c00-7000-8000-000000000006","number":1,"draft":true,"updated_at":"2026-10-21T09:00:00Z"},"etag":"\"5d41402abc4b2a76b9719d911017c592\"","content":{"chapters":[{"id":"019cf5b0-7c00-7000-8000-000000000302","title":"Serving guests safely","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-000000000403","title":"Taking an order"},{"id":"019cf5b0-7c00-7000-8000-000000000402","title":"Questions guests ask"}]},{"id":"019cf5b0-7c00-7000-8000-000000000301","title":"The 14 allergens in food","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-000000000401","title":"Why it matters"},{"id":"019cf5b0-7c00-7000-8000-000000000405","title":"Allergens in drinks"}]},{"id":"019cf5b0-7c00-7000-8000-000000000304","title":"Check your knowledge","header":false,"pages":[]}]}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"412":{"$ref":"#/components/responses/PreconditionFailed"},"413":{"$ref":"#/components/responses/ContentTooLarge"},"422":{"description":"The outline isn't valid. Each error's `pointer` names the field, as a JSON Pointer under `/data`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"errors":[{"code":"validation_error","message":"must list every chapter and page, but page 019cf5b0-7c00-7000-8000-000000000404 (Draft notes) is missing. To remove it, list it with \"delete\": true","pointer":"/data/chapters","documentation_url":"https://tayl.pro/api/v1/docs/errors#validation_error"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}}}},"428":{"$ref":"#/components/responses/PreconditionRequired"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"patch":{"operationId":"updateCourseDraftOutline","tags":["Course Authoring"],"summary":"Reorganise a course's draft with JSON Patch","x-required-scope":"content:write","x-requires-feature":"course_builder","description":"Applies RFC 6902 JSON Patch operations to the draft's outline and saves the result like `PUT`, so a `move` reorders a chapter or moves a page. A malformed operation, or one that can't apply, returns 422 `invalid_patch` and nothing is saved. Archived courses can't change.","parameters":[{"name":"If-Match","in":"header","required":true,"description":"The `etag` from your last read or save of this course's draft. A stale value returns 412.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json-patch+json":{"schema":{"$ref":"#/components/schemas/CourseDocumentPatch"},"example":[{"op":"move","from":"/chapters/0/pages/1","path":"/chapters/1/pages/-"}]}}},"responses":{"200":{"description":"The reorganised outline.","headers":{"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseOutlineContent"},"example":{"course":{"id":"019cf5b0-7c00-7000-8000-000000000005","status":"draft","published_at":null,"current_version_id":null,"editor_url":"https://tayl.pro/create/courses/019cf5b0-7c00-7000-8000-000000000005/edit"},"version":{"id":"019cf5b0-7c00-7000-8000-000000000006","number":1,"draft":true,"updated_at":"2026-10-21T09:00:00Z"},"etag":"\"5d41402abc4b2a76b9719d911017c592\"","content":{"chapters":[{"id":"019cf5b0-7c00-7000-8000-000000000301","title":"The 14 allergens","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-000000000401","title":"Why it matters"}]},{"id":"019cf5b0-7c00-7000-8000-000000000302","title":"Serving guests safely","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-000000000403","title":"Taking an order"},{"id":"019cf5b0-7c00-7000-8000-000000000402","title":"Questions guests ask"}]},{"id":"019cf5b0-7c00-7000-8000-000000000303","title":"Old notes","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-000000000404","title":"Draft notes"}]}]}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"412":{"$ref":"#/components/responses/PreconditionFailed"},"413":{"$ref":"#/components/responses/ContentTooLarge"},"422":{"description":"The outline isn't valid. Each error's `pointer` names the field, as a JSON Pointer under `/data`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"errors":[{"code":"validation_error","message":"must list every chapter and page, but page 019cf5b0-7c00-7000-8000-000000000404 (Draft notes) is missing. To remove it, list it with \"delete\": true","pointer":"/data/chapters","documentation_url":"https://tayl.pro/api/v1/docs/errors#validation_error"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}}}},"428":{"$ref":"#/components/responses/PreconditionRequired"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/courses/{id}/draft/chapters":{"parameters":[{"name":"id","in":"path","required":true,"description":"The course's Tayl UUID.","schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"createCourseDraftChapter","tags":["Course Authoring"],"summary":"Add a chapter to a course's draft","x-required-scope":"content:write","x-requires-feature":"course_builder","description":"Adds a chapter after the draft's last one, with the pages, quiz, signing and SCORM package its document holds, and returns it with the IDs its chapter, pages and blocks now have. A new chapter, its pages and their blocks have no `id` until then, so send them without one. Move it with the outline. A chapter over the size limits returns 422 `document_too_large`. Archived courses can't change.","parameters":[{"name":"If-Match","in":"header","required":true,"description":"The `etag` from your last read or save of this course's draft. A stale value returns 412.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseChapter"},"example":{"title":"The 14 allergens","header":false,"pages":[{"title":"Why it matters","blocks":[{"type":"text","html":"<p>Every dish must list its allergens.</p>"}]}],"quiz":null,"signing":null,"scorm":null}}}},"responses":{"201":{"description":"The new chapter.","headers":{"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseChapterContent"},"example":{"course":{"id":"019cf5b0-7c00-7000-8000-000000000005","status":"draft","published_at":null,"current_version_id":null,"editor_url":"https://tayl.pro/create/courses/019cf5b0-7c00-7000-8000-000000000005/edit"},"version":{"id":"019cf5b0-7c00-7000-8000-000000000006","number":1,"draft":true,"updated_at":"2026-10-21T09:00:00Z"},"etag":"\"5d41402abc4b2a76b9719d911017c592\"","review":[{"pointer":"/pages/0","code":"nothing_to_see_or_do","message":"This page is only text. Add a picture or diagram that shows its point, or something to do, such as a knowledge_check, flashcard_container or tab_list."},{"pointer":"","code":"no_practice","message":"Add a knowledge_check after a key idea, or a quiz, so learners recall what this chapter teaches."}],"media":{},"content":{"id":"019cf5b0-7c00-7000-8000-000000000011","title":"The 14 allergens","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-000000000021","title":"Why it matters","blocks":[{"id":"019cf5b0-7c00-7000-8000-000000000121","type":"text","html":"<p>Every dish must list its allergens.</p>"}]}],"quiz":null,"signing":null,"scorm":null}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"412":{"$ref":"#/components/responses/PreconditionFailed"},"413":{"$ref":"#/components/responses/ContentTooLarge"},"422":{"description":"The chapter isn't valid. Each error's `pointer` names the field, as a JSON Pointer under `/data`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"errors":[{"code":"validation_error","message":"value at `/pages/0/blocks/0/level` is not one of: [\"h1\", \"h2\", \"h3\", null]","pointer":"/data/pages/0/blocks/0/level","documentation_url":"https://tayl.pro/api/v1/docs/errors#validation_error"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}}}},"428":{"$ref":"#/components/responses/PreconditionRequired"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/courses/{id}/draft/chapters/{chapter_id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"The course's Tayl UUID.","schema":{"type":"string","format":"uuid"}},{"name":"chapter_id","in":"path","required":true,"description":"The chapter's ID, from the course's outline or content.","schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getCourseDraftChapter","tags":["Course Authoring"],"summary":"Get a chapter of a course's draft","x-required-scope":"content:read","x-requires-role":"course_author","description":"Returns one chapter of the draft as a document, with the files it names and the `etag` to send when changing it: its title, quiz, signing and SCORM package, and its pages with their blocks. Find chapter IDs in the draft's outline.","responses":{"200":{"description":"The chapter.","headers":{"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseChapterContent"},"example":{"course":{"id":"019cf5b0-7c00-7000-8000-000000000005","status":"draft","published_at":null,"current_version_id":null,"editor_url":"https://tayl.pro/create/courses/019cf5b0-7c00-7000-8000-000000000005/edit"},"version":{"id":"019cf5b0-7c00-7000-8000-000000000006","number":1,"draft":true,"updated_at":"2026-10-21T09:00:00Z"},"etag":"\"5d41402abc4b2a76b9719d911017c592\"","review":[{"pointer":"/pages/0","code":"nothing_to_see_or_do","message":"This page is only text. Add a picture or diagram that shows its point, or something to do, such as a knowledge_check, flashcard_container or tab_list."},{"pointer":"","code":"no_practice","message":"Add a knowledge_check after a key idea, or a quiz, so learners recall what this chapter teaches."}],"media":{},"content":{"id":"019cf5b0-7c00-7000-8000-000000000011","title":"The 14 allergens","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-000000000021","title":"Why it matters","blocks":[{"id":"019cf5b0-7c00-7000-8000-000000000121","type":"text","html":"<p>Every dish must list its allergens.</p>"}]}],"quiz":null,"signing":null,"scorm":null}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"put":{"operationId":"replaceCourseDraftChapter","tags":["Course Authoring"],"summary":"Replace a chapter of a course's draft","x-required-scope":"content:write","x-requires-feature":"course_builder","description":"Replaces one chapter of the draft with the document you send and returns it. Pages and blocks you send with their `id` keep it, and a block's content or the chapter's quiz, signing or SCORM package you leave as they are aren't rewritten. Those without an `id` are new; the chapter's pages and blocks you leave out are removed, and fields you leave out take the builder's defaults. A block can move between the chapter's pages by appearing there. Pages move between chapters through the outline, and blocks with a whole-course save. A document identical to the chapter changes nothing. A chapter over the size limits returns 422 `document_too_large`. Archived courses can't change.","parameters":[{"name":"If-Match","in":"header","required":true,"description":"The `etag` from your last read or save of this course's draft. A stale value returns 412.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseChapter"},"example":{"id":"019cf5b0-7c00-7000-8000-000000000011","title":"The 14 allergens in food","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-000000000021","title":"Why it matters","blocks":[{"id":"019cf5b0-7c00-7000-8000-000000000121","type":"text","html":"<p>Every dish must list its allergens.</p>"}]}],"quiz":null,"signing":null,"scorm":null}}}},"responses":{"200":{"description":"The chapter.","headers":{"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseChapterContent"},"example":{"course":{"id":"019cf5b0-7c00-7000-8000-000000000005","status":"draft","published_at":null,"current_version_id":null,"editor_url":"https://tayl.pro/create/courses/019cf5b0-7c00-7000-8000-000000000005/edit"},"version":{"id":"019cf5b0-7c00-7000-8000-000000000006","number":1,"draft":true,"updated_at":"2026-10-21T09:00:00Z"},"etag":"\"5d41402abc4b2a76b9719d911017c592\"","review":[{"pointer":"/pages/0","code":"nothing_to_see_or_do","message":"This page is only text. Add a picture or diagram that shows its point, or something to do, such as a knowledge_check, flashcard_container or tab_list."},{"pointer":"","code":"no_practice","message":"Add a knowledge_check after a key idea, or a quiz, so learners recall what this chapter teaches."}],"media":{},"content":{"id":"019cf5b0-7c00-7000-8000-000000000011","title":"The 14 allergens in food","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-000000000021","title":"Why it matters","blocks":[{"id":"019cf5b0-7c00-7000-8000-000000000121","type":"text","html":"<p>Every dish must list its allergens.</p>"}]}],"quiz":null,"signing":null,"scorm":null}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"412":{"$ref":"#/components/responses/PreconditionFailed"},"413":{"$ref":"#/components/responses/ContentTooLarge"},"422":{"description":"The chapter isn't valid. Each error's `pointer` names the field, as a JSON Pointer under `/data`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"errors":[{"code":"validation_error","message":"value at `/pages/0/blocks/0/level` is not one of: [\"h1\", \"h2\", \"h3\", null]","pointer":"/data/pages/0/blocks/0/level","documentation_url":"https://tayl.pro/api/v1/docs/errors#validation_error"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}}}},"428":{"$ref":"#/components/responses/PreconditionRequired"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"patch":{"operationId":"updateCourseDraftChapter","tags":["Course Authoring"],"summary":"Edit a chapter of a course's draft with JSON Patch","x-required-scope":"content:write","x-requires-feature":"course_builder","description":"Applies RFC 6902 JSON Patch operations to one chapter of the draft and saves the result like `PUT`. Paths are JSON Pointers into the chapter you read. A malformed operation, or one that can't apply, returns 422 `invalid_patch` and nothing is saved. Archived courses can't change.","parameters":[{"name":"If-Match","in":"header","required":true,"description":"The `etag` from your last read or save of this course's draft. A stale value returns 412.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json-patch+json":{"schema":{"$ref":"#/components/schemas/CourseDocumentPatch"},"example":[{"op":"replace","path":"/title","value":"The 14 allergens in food"}]}}},"responses":{"200":{"description":"The chapter.","headers":{"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseChapterContent"},"example":{"course":{"id":"019cf5b0-7c00-7000-8000-000000000005","status":"draft","published_at":null,"current_version_id":null,"editor_url":"https://tayl.pro/create/courses/019cf5b0-7c00-7000-8000-000000000005/edit"},"version":{"id":"019cf5b0-7c00-7000-8000-000000000006","number":1,"draft":true,"updated_at":"2026-10-21T09:00:00Z"},"etag":"\"5d41402abc4b2a76b9719d911017c592\"","review":[{"pointer":"/pages/0","code":"nothing_to_see_or_do","message":"This page is only text. Add a picture or diagram that shows its point, or something to do, such as a knowledge_check, flashcard_container or tab_list."},{"pointer":"","code":"no_practice","message":"Add a knowledge_check after a key idea, or a quiz, so learners recall what this chapter teaches."}],"media":{},"content":{"id":"019cf5b0-7c00-7000-8000-000000000011","title":"The 14 allergens in food","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-000000000021","title":"Why it matters","blocks":[{"id":"019cf5b0-7c00-7000-8000-000000000121","type":"text","html":"<p>Every dish must list its allergens.</p>"}]}],"quiz":null,"signing":null,"scorm":null}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"412":{"$ref":"#/components/responses/PreconditionFailed"},"413":{"$ref":"#/components/responses/ContentTooLarge"},"422":{"description":"The chapter isn't valid. Each error's `pointer` names the field, as a JSON Pointer under `/data`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"errors":[{"code":"validation_error","message":"value at `/pages/0/blocks/0/level` is not one of: [\"h1\", \"h2\", \"h3\", null]","pointer":"/data/pages/0/blocks/0/level","documentation_url":"https://tayl.pro/api/v1/docs/errors#validation_error"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}}}},"428":{"$ref":"#/components/responses/PreconditionRequired"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"delete":{"operationId":"deleteCourseDraftChapter","tags":["Course Authoring"],"summary":"Remove a chapter from a course's draft","x-required-scope":"content:write","x-requires-feature":"course_builder","description":"Removes one chapter of the draft with its pages, quiz, signing and SCORM package. Move a page you want to keep to another chapter first, with the outline. The response's `ETag` header has the draft's new etag. Archived courses can't change.","parameters":[{"name":"If-Match","in":"header","required":true,"description":"The `etag` from your last read or save of this course's draft. A stale value returns 412.","schema":{"type":"string"}}],"responses":{"204":{"description":"Done. There's no response body; the `ETag` header has the draft's new etag.","headers":{"ETag":{"$ref":"#/components/headers/ETag"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"412":{"$ref":"#/components/responses/PreconditionFailed"},"422":{"description":"The course is archived.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"errors":[{"code":"course_archived","message":"Archived courses can't change. Unarchive the course first.","documentation_url":"https://tayl.pro/api/v1/docs/errors#course_archived"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}}}},"428":{"$ref":"#/components/responses/PreconditionRequired"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/courses/{id}/draft/chapters/{chapter_id}/pages":{"parameters":[{"name":"id","in":"path","required":true,"description":"The course's Tayl UUID.","schema":{"type":"string","format":"uuid"}},{"name":"chapter_id","in":"path","required":true,"description":"The chapter's ID, from the course's outline or content.","schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"createCourseDraftPage","tags":["Course Authoring"],"summary":"Add a page to a chapter of a course's draft","x-required-scope":"content:write","x-requires-feature":"course_builder","description":"Adds a page after the chapter's last page, before its quiz, and returns it with its new `id` and its blocks' IDs. A new page and its blocks have no `id` until then, so send them without one. Move it with the outline. A page over the size limits returns 422 `document_too_large`. Archived courses can't change.","parameters":[{"name":"If-Match","in":"header","required":true,"description":"The `etag` from your last read or save of this course's draft. A stale value returns 412.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CoursePage"},"example":{"title":"Questions guests ask","blocks":[{"type":"text","html":"<p>Ask about allergies before taking an order.</p>"}]}}}},"responses":{"201":{"description":"The new page.","headers":{"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CoursePageContent"},"example":{"course":{"id":"019cf5b0-7c00-7000-8000-000000000005","status":"draft","published_at":null,"current_version_id":null,"editor_url":"https://tayl.pro/create/courses/019cf5b0-7c00-7000-8000-000000000005/edit"},"version":{"id":"019cf5b0-7c00-7000-8000-000000000006","number":1,"draft":true,"updated_at":"2026-10-21T09:00:00Z"},"etag":"\"5d41402abc4b2a76b9719d911017c592\"","review":[{"pointer":"","code":"nothing_to_see_or_do","message":"This page is only text. Add a picture or diagram that shows its point, or something to do, such as a knowledge_check, flashcard_container or tab_list."}],"media":{},"content":{"id":"019cf5b0-7c00-7000-8000-000000000051","title":"Questions guests ask","blocks":[{"id":"019cf5b0-7c00-7000-8000-000000000151","type":"text","html":"<p>Ask about allergies before taking an order.</p>"}]}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"412":{"$ref":"#/components/responses/PreconditionFailed"},"413":{"$ref":"#/components/responses/ContentTooLarge"},"422":{"description":"The page isn't valid. Each error's `pointer` names the field, as a JSON Pointer under `/data`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"errors":[{"code":"validation_error","message":"value at `/blocks/0/level` is not one of: [\"h1\", \"h2\", \"h3\", null]","pointer":"/data/blocks/0/level","documentation_url":"https://tayl.pro/api/v1/docs/errors#validation_error"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}}}},"428":{"$ref":"#/components/responses/PreconditionRequired"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/courses/{id}/draft/pages/{page_id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"The course's Tayl UUID.","schema":{"type":"string","format":"uuid"}},{"name":"page_id","in":"path","required":true,"description":"The page's ID, from the course's outline or content.","schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getCourseDraftPage","tags":["Course Authoring"],"summary":"Get a page of a course's draft","x-required-scope":"content:read","x-requires-role":"course_author","description":"Returns one page of the draft as a document, its title and blocks, with the files it names and the `etag` to send when changing it. Find page IDs in the draft's outline.","responses":{"200":{"description":"The page.","headers":{"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CoursePageContent"},"example":{"course":{"id":"019cf5b0-7c00-7000-8000-000000000005","status":"draft","published_at":null,"current_version_id":null,"editor_url":"https://tayl.pro/create/courses/019cf5b0-7c00-7000-8000-000000000005/edit"},"version":{"id":"019cf5b0-7c00-7000-8000-000000000006","number":1,"draft":true,"updated_at":"2026-10-21T09:00:00Z"},"etag":"\"5d41402abc4b2a76b9719d911017c592\"","review":[{"pointer":"","code":"nothing_to_see_or_do","message":"This page is only text. Add a picture or diagram that shows its point, or something to do, such as a knowledge_check, flashcard_container or tab_list."}],"media":{},"content":{"id":"019cf5b0-7c00-7000-8000-000000000022","title":"Why it matters","blocks":[{"id":"019cf5b0-7c00-7000-8000-000000000122","type":"text","html":"<p>Every dish must list its allergens.</p>"}]}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"put":{"operationId":"replaceCourseDraftPage","tags":["Course Authoring"],"summary":"Replace a page of a course's draft","x-required-scope":"content:write","x-requires-feature":"course_builder","description":"Replaces one page of the draft with the document you send and returns it. Blocks you send with their `id` keep it, and their content if you leave that as it is; blocks without an `id` are new, blocks you leave out are removed, and fields you leave out take the builder's defaults. The page's document can name only its own blocks. A document identical to the page changes nothing. A page over the size limits returns 422 `document_too_large`. Archived courses can't change.","parameters":[{"name":"If-Match","in":"header","required":true,"description":"The `etag` from your last read or save of this course's draft. A stale value returns 412.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CoursePage"},"example":{"id":"019cf5b0-7c00-7000-8000-000000000022","title":"Why allergens matter","blocks":[{"id":"019cf5b0-7c00-7000-8000-000000000122","type":"text","html":"<p>Every dish must list its allergens.</p>"}]}}}},"responses":{"200":{"description":"The saved page.","headers":{"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CoursePageContent"},"example":{"course":{"id":"019cf5b0-7c00-7000-8000-000000000005","status":"draft","published_at":null,"current_version_id":null,"editor_url":"https://tayl.pro/create/courses/019cf5b0-7c00-7000-8000-000000000005/edit"},"version":{"id":"019cf5b0-7c00-7000-8000-000000000006","number":1,"draft":true,"updated_at":"2026-10-21T09:00:00Z"},"etag":"\"5d41402abc4b2a76b9719d911017c592\"","review":[{"pointer":"","code":"nothing_to_see_or_do","message":"This page is only text. Add a picture or diagram that shows its point, or something to do, such as a knowledge_check, flashcard_container or tab_list."}],"media":{},"content":{"id":"019cf5b0-7c00-7000-8000-000000000022","title":"Why allergens matter","blocks":[{"id":"019cf5b0-7c00-7000-8000-000000000122","type":"text","html":"<p>Every dish must list its allergens.</p>"}]}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"412":{"$ref":"#/components/responses/PreconditionFailed"},"413":{"$ref":"#/components/responses/ContentTooLarge"},"422":{"description":"The page isn't valid. Each error's `pointer` names the field, as a JSON Pointer under `/data`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"errors":[{"code":"validation_error","message":"value at `/blocks/0/level` is not one of: [\"h1\", \"h2\", \"h3\", null]","pointer":"/data/blocks/0/level","documentation_url":"https://tayl.pro/api/v1/docs/errors#validation_error"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}}}},"428":{"$ref":"#/components/responses/PreconditionRequired"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"patch":{"operationId":"updateCourseDraftPage","tags":["Course Authoring"],"summary":"Edit a page of a course's draft with JSON Patch","x-required-scope":"content:write","x-requires-feature":"course_builder","description":"Applies RFC 6902 JSON Patch operations to one page of the draft and saves the result like `PUT`. Paths are JSON Pointers into the page you read, so a typo fix is one `replace`. A malformed operation, or one that can't apply, returns 422 `invalid_patch` and nothing is saved. Archived courses can't change.","parameters":[{"name":"If-Match","in":"header","required":true,"description":"The `etag` from your last read or save of this course's draft. A stale value returns 412.","schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json-patch+json":{"schema":{"$ref":"#/components/schemas/CourseDocumentPatch"},"example":[{"op":"replace","path":"/title","value":"Why allergens matter"}]}}},"responses":{"200":{"description":"The saved page.","headers":{"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CoursePageContent"},"example":{"course":{"id":"019cf5b0-7c00-7000-8000-000000000005","status":"draft","published_at":null,"current_version_id":null,"editor_url":"https://tayl.pro/create/courses/019cf5b0-7c00-7000-8000-000000000005/edit"},"version":{"id":"019cf5b0-7c00-7000-8000-000000000006","number":1,"draft":true,"updated_at":"2026-10-21T09:00:00Z"},"etag":"\"5d41402abc4b2a76b9719d911017c592\"","review":[{"pointer":"","code":"nothing_to_see_or_do","message":"This page is only text. Add a picture or diagram that shows its point, or something to do, such as a knowledge_check, flashcard_container or tab_list."}],"media":{},"content":{"id":"019cf5b0-7c00-7000-8000-000000000022","title":"Why allergens matter","blocks":[{"id":"019cf5b0-7c00-7000-8000-000000000122","type":"text","html":"<p>Every dish must list its allergens.</p>"}]}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"412":{"$ref":"#/components/responses/PreconditionFailed"},"413":{"$ref":"#/components/responses/ContentTooLarge"},"422":{"description":"The page isn't valid. Each error's `pointer` names the field, as a JSON Pointer under `/data`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"errors":[{"code":"validation_error","message":"value at `/blocks/0/level` is not one of: [\"h1\", \"h2\", \"h3\", null]","pointer":"/data/blocks/0/level","documentation_url":"https://tayl.pro/api/v1/docs/errors#validation_error"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}}}},"428":{"$ref":"#/components/responses/PreconditionRequired"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"delete":{"operationId":"deleteCourseDraftPage","tags":["Course Authoring"],"summary":"Remove a page from a course's draft","x-required-scope":"content:write","x-requires-feature":"course_builder","description":"Removes one page of the draft with its blocks. The response's `ETag` header has the draft's new etag. Archived courses can't change.","parameters":[{"name":"If-Match","in":"header","required":true,"description":"The `etag` from your last read or save of this course's draft. A stale value returns 412.","schema":{"type":"string"}}],"responses":{"204":{"description":"Done. There's no response body; the `ETag` header has the draft's new etag.","headers":{"ETag":{"$ref":"#/components/headers/ETag"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"412":{"$ref":"#/components/responses/PreconditionFailed"},"422":{"description":"The course is archived.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"errors":[{"code":"course_archived","message":"Archived courses can't change. Unarchive the course first.","documentation_url":"https://tayl.pro/api/v1/docs/errors#course_archived"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}}}},"428":{"$ref":"#/components/responses/PreconditionRequired"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/courses/{id}/draft/publish":{"parameters":[{"name":"id","in":"path","required":true,"description":"The course's Tayl UUID.","schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"publishCourseDraft","tags":["Course Authoring"],"summary":"Publish a course's draft","x-required-scope":"content:publish","x-requires-feature":"course_builder","description":"Publishes the course's draft as its new version, which learners get when they start the course from now on; anyone part-way through keeps the version they started. The first publish also adds the course to your organisation's content library, ready to assign, with `training_rules` or the rules the course recommends. Check `publishable` and `publish_error` on the draft first: a draft without content, unchanged since the last publish, or of an archived course returns 422 `not_publishable`. Send the `etag` you reviewed as `If-Match` to publish only that content.\n\nKeys without this scope can still prepare drafts for a person to review and publish in Tayl.","parameters":[{"name":"If-Match","in":"header","required":false,"description":"Optional: the `etag` you reviewed. If the draft has changed since, publishing returns 412.","schema":{"type":"string"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CoursePublish"},"example":{"training_rules":{"due_in_days":14,"compliance_training":true}}}}},"responses":{"200":{"description":"The published course.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Course"},"example":{"id":"019cf5b0-7c00-7000-8000-000000000005","title":"Food safety essentials","description":"Safe food handling for new starters","status":"published","platform_course":false,"syncs_from_v2":false,"in_library":true,"compliance_training":true,"current_version_id":"019cf5b0-7c00-7000-8000-000000000006","current_version_number":1,"published_at":"2026-10-21T10:00:00Z","created_at":"2025-11-01T09:00:00Z","updated_at":"2026-10-21T10:00:00Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"412":{"$ref":"#/components/responses/PreconditionFailed"},"422":{"description":"The draft can't be published, or `training_rules` were sent for a course that's already been published.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"errors":[{"code":"not_publishable","message":"Course must have at least one chapter with content","documentation_url":"https://tayl.pro/api/v1/docs/errors#not_publishable"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/courses/{id}/archive":{"parameters":[{"name":"id","in":"path","required":true,"description":"The course's Tayl UUID.","schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"archiveCourse","tags":["Course Authoring"],"summary":"Archive a course","x-required-scope":"content:publish","x-requires-feature":"course_builder","description":"Archives a published course. It can't be assigned or recertified any more, but its published assignments keep running until you archive them in Tayl's content library.","responses":{"200":{"description":"The archived course.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Course"},"example":{"id":"019cf5b0-7c00-7000-8000-000000000005","title":"Food safety essentials","description":"Safe food handling for new starters","status":"archived","platform_course":false,"syncs_from_v2":false,"in_library":true,"compliance_training":true,"current_version_id":"019cf5b0-7c00-7000-8000-000000000006","current_version_number":1,"published_at":"2026-10-21T10:00:00Z","created_at":"2025-11-01T09:00:00Z","updated_at":"2026-10-21T10:00:00Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"description":"The course can't be archived.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"errors":[{"code":"not_archivable","message":"Only published courses can be archived.","documentation_url":"https://tayl.pro/api/v1/docs/errors#not_archivable"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/courses/{id}/unarchive":{"parameters":[{"name":"id","in":"path","required":true,"description":"The course's Tayl UUID.","schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"unarchiveCourse","tags":["Course Authoring"],"summary":"Unarchive a course","x-required-scope":"content:publish","x-requires-feature":"course_builder","description":"Restores an archived course to published, so it can be assigned and edited again.","responses":{"200":{"description":"The unarchived course.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Course"},"example":{"id":"019cf5b0-7c00-7000-8000-000000000005","title":"Food safety essentials","description":"Safe food handling for new starters","status":"published","platform_course":false,"syncs_from_v2":false,"in_library":true,"compliance_training":true,"current_version_id":"019cf5b0-7c00-7000-8000-000000000006","current_version_number":1,"published_at":"2026-10-21T10:00:00Z","created_at":"2025-11-01T09:00:00Z","updated_at":"2026-10-21T10:00:00Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"description":"The course can't be unarchived.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"errors":[{"code":"not_unarchivable","message":"Only archived courses can be unarchived.","documentation_url":"https://tayl.pro/api/v1/docs/errors#not_unarchivable"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/courses/{id}/settings":{"parameters":[{"name":"id","in":"path","required":true,"description":"The Tayl course's UUID.","schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getCourseSettings","tags":["Course Authoring"],"summary":"Get a Tayl course's settings","x-required-scope":"content:settings","description":"For Tayl staff. Returns a Tayl course's recommendations, requirements, certification and availability, the categories, industries, regions and accreditors it lists, and the `choices` each list can take. A course has settings once a person has published it in Tayl; until then this returns 404.","responses":{"200":{"description":"The course's settings.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseSettings"},"example":{"course_id":"019cf5b0-7c00-7000-8000-000000000005","syncs_from_v2":false,"recommendations":{"due_in_days":14,"valid_for_months":12,"available_to_recertify_within_days":30,"issues_certificates":true,"minimum_minutes_required":20,"compliance_training":true},"requirements":{"valid_for_months":null,"minimum_minutes":null},"certification":{"certified":true,"licensing_scotland":false},"availability":{"on_request":false},"category_ids":["019cf5b0-7c00-7000-8000-000000000501"],"industry_ids":["019cf5b0-7c00-7000-8000-000000000511"],"region_ids":["019cf5b0-7c00-7000-8000-000000000521"],"accreditor_ids":["019cf5b0-7c00-7000-8000-000000000531"],"choices":{"categories":[{"id":"019cf5b0-7c00-7000-8000-000000000501","name":"Food safety"},{"id":"019cf5b0-7c00-7000-8000-000000000502","name":"Health and safety"}],"industries":[{"id":"019cf5b0-7c00-7000-8000-000000000511","name":"Hospitality"}],"regions":[{"id":"019cf5b0-7c00-7000-8000-000000000521","name":"England"},{"id":"019cf5b0-7c00-7000-8000-000000000522","name":"Scotland"}],"accreditors":[{"id":"019cf5b0-7c00-7000-8000-000000000531","name":"CPD"}]}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"patch":{"operationId":"updateCourseSettings","tags":["Course Authoring"],"summary":"Change a Tayl course's settings","x-required-scope":"content:settings","description":"For Tayl staff. A change reaches every organisation straight away, so make only the changes the person asks for. Fields you leave out keep their values, and each list you send replaces the course's, with ids from `choices`. While the course syncs from Taylv2 (`syncs_from_v2`), changing a setting V2 sets returns 422 `course_synced_from_v2`.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseSettingsInput"},"example":{"recommendations":{"due_in_days":14},"region_ids":["019cf5b0-7c00-7000-8000-000000000521","019cf5b0-7c00-7000-8000-000000000522"]}}}},"responses":{"200":{"description":"The course's settings, changed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseSettings"},"example":{"course_id":"019cf5b0-7c00-7000-8000-000000000005","syncs_from_v2":false,"recommendations":{"due_in_days":14,"valid_for_months":12,"available_to_recertify_within_days":30,"issues_certificates":true,"minimum_minutes_required":20,"compliance_training":true},"requirements":{"valid_for_months":null,"minimum_minutes":null},"certification":{"certified":true,"licensing_scotland":false},"availability":{"on_request":false},"category_ids":["019cf5b0-7c00-7000-8000-000000000501"],"industry_ids":["019cf5b0-7c00-7000-8000-000000000511"],"region_ids":["019cf5b0-7c00-7000-8000-000000000521","019cf5b0-7c00-7000-8000-000000000522"],"accreditor_ids":["019cf5b0-7c00-7000-8000-000000000531"],"choices":{"categories":[{"id":"019cf5b0-7c00-7000-8000-000000000501","name":"Food safety"},{"id":"019cf5b0-7c00-7000-8000-000000000502","name":"Health and safety"}],"industries":[{"id":"019cf5b0-7c00-7000-8000-000000000511","name":"Hospitality"}],"regions":[{"id":"019cf5b0-7c00-7000-8000-000000000521","name":"England"},{"id":"019cf5b0-7c00-7000-8000-000000000522","name":"Scotland"}],"accreditors":[{"id":"019cf5b0-7c00-7000-8000-000000000531","name":"CPD"}]}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"description":"A setting can't be changed. Each error's `pointer` names the field, as a JSON Pointer under `/data`: an id that isn't in `choices`, a value the course can't take, such as certifying it without an accreditor, or a setting Taylv2 sets while the course syncs from there.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"errors":[{"code":"course_synced_from_v2","message":"This course still syncs from Taylv2, which sets this, so change it there. Once the course is edited here, it stops syncing and this is Tayl's to change.","pointer":"/data/category_ids","documentation_url":"https://tayl.pro/api/v1/docs/errors#course_synced_from_v2"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/media":{"post":{"operationId":"uploadCourseImage","tags":["Course Authoring"],"summary":"Upload an image","x-required-scope":"content:write","x-requires-feature":"course_builder","description":"Adds an image to your organisation's media library for course documents and returns its `id`, which you put in a document's image field, such as `image`, `hero_image` or a card's `front_image`. Send the file as multipart form data or, if you can't send files, send JSON with a public `url` that returns the image and Tayl downloads it, following up to 3 redirects for up to 10 seconds. An organisation downloads 2 images at a time; more at once return `429 rate_limited`. If the library already holds the same file, you get that image with 200 instead of a copy. Retrying the same file after a transient upload failure is safe: any missing stored file is uploaded again before success is returned. Images must be JPEG, PNG, GIF, WebP or AVIF, up to 10 MB and 50 megapixels; anything wider or taller than 2400 pixels is scaled down. Videos can't be uploaded through the API.","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","description":"The image as a multipart form field.","required":["file"],"additionalProperties":false,"properties":{"file":{"type":"string","format":"binary","description":"The image file."}}}},"application/json":{"schema":{"type":"object","description":"The image's URL, for Tayl to download.","required":["url"],"additionalProperties":false,"properties":{"url":{"type":"string","format":"uri","pattern":"^https://","description":"A public HTTPS URL that returns the image itself, not a page showing it."},"filename":{"type":"string","maxLength":255,"description":"The image's name in the library. Defaults to the last part of the URL's path."}}},"example":{"url":"https://cdn.example.com/allergen-chart.png"}}}},"responses":{"200":{"description":"The library already holds this file; this is that image.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseImage"},"example":{"id":"eyJfcmFpbHMiOnsiZGF0YSI6IjAxOWNmNWIwLTdjMDAtNzAwMC04MDAwLTAwMDAwMDAwMDA0MCJ9fQ--3f9a","url":"https://tayl.pro/rails/active_storage/blobs/redirect/eyJfcmFpbHMi/allergen-chart.png","filename":"allergen-chart.png","content_type":"image/png","byte_size":48213}}}},"201":{"description":"The uploaded image.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CourseImage"},"example":{"id":"eyJfcmFpbHMiOnsiZGF0YSI6IjAxOWNmNWIwLTdjMDAtNzAwMC04MDAwLTAwMDAwMDAwMDA0MCJ9fQ--3f9a","url":"https://tayl.pro/rails/active_storage/blobs/redirect/eyJfcmFpbHMi/allergen-chart.png","filename":"allergen-chart.png","content_type":"image/png","byte_size":48213}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"413":{"$ref":"#/components/responses/ContentTooLarge"},"422":{"description":"The file isn't an image Tayl accepts, or the URL didn't give one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"errors":[{"code":"validation_error","field":"file","message":"must be a JPEG, PNG, GIF, WebP or AVIF image","pointer":"/data/file","documentation_url":"https://tayl.pro/api/v1/docs/errors#validation_error"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}}}},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/pathways":{"get":{"operationId":"listPathways","tags":["Content Library"],"summary":"List pathways","x-required-scope":"content:read","description":"Lists the published pathways the organisation can see: its own and those shared through its organisation group, which stay visible only while the group shares them, even if assignments still use them. `since` considers changes to pathways and to their places in the organisation's or group's library. A pathway leaving a library leaves no trace for `since`, so reconcile against the full list regularly.","parameters":[{"$ref":"#/components/parameters/Page"},{"$ref":"#/components/parameters/PerPage"},{"$ref":"#/components/parameters/Since"}],"responses":{"200":{"description":"A page of pathways, sorted by title.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PathwayList"},"example":{"pathways":[{"id":"019cf5b0-7c00-7000-8000-000000000007","title":"Front of house onboarding","current_version_id":"019cf5b0-7c00-7000-8000-000000000008","current_version_number":2,"published_at":"2026-02-25T10:00:00Z","created_at":"2025-12-01T09:00:00Z","updated_at":"2026-02-25T10:00:00Z"}],"meta":{"page":1,"per_page":25,"total_pages":1,"total_count":1}}}},"headers":{"Link":{"$ref":"#/components/headers/Link"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/pathways/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"The pathway's Tayl UUID.","schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getPathway","tags":["Content Library"],"summary":"Get a pathway","x-required-scope":"content:read","responses":{"200":{"description":"The pathway, including its current published version UUID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Pathway"},"example":{"id":"019cf5b0-7c00-7000-8000-000000000007","title":"Front of house onboarding","current_version_id":"019cf5b0-7c00-7000-8000-000000000008","current_version_number":2,"published_at":"2026-02-25T10:00:00Z","created_at":"2025-12-01T09:00:00Z","updated_at":"2026-02-25T10:00:00Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Returns a visible published pathway and the version UUID that a new assignment will deliver."}},"/api/v1/signable-documents":{"get":{"operationId":"listSignableDocuments","tags":["Content Library"],"summary":"List signable documents","x-required-scope":"content:read","description":"Lists the published signable documents the organisation can see: its own and those shared through its organisation group, which stay visible only while the group shares them, even if assignments still use them. `since` considers changes to documents and to their places in the organisation's or group's library. A document leaving a library leaves no trace for `since`, so reconcile against the full list regularly.","parameters":[{"$ref":"#/components/parameters/Page"},{"$ref":"#/components/parameters/PerPage"},{"$ref":"#/components/parameters/Since"}],"responses":{"200":{"description":"A page of signable documents, sorted by title.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignableDocumentList"},"example":{"signable_documents":[{"id":"019cf5b0-7c00-7000-8000-000000000009","title":"Employee handbook","compliance_training":true,"current_version_id":"019cf5b0-7c00-7000-8000-00000000000a","current_version_number":4,"published_at":"2026-03-01T10:00:00Z","created_at":"2025-10-01T09:00:00Z","updated_at":"2026-03-01T10:00:00Z"}],"meta":{"page":1,"per_page":25,"total_pages":1,"total_count":1}}}},"headers":{"Link":{"$ref":"#/components/headers/Link"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/signable-documents/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"The document's Tayl UUID.","schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getSignableDocument","tags":["Content Library"],"summary":"Get a signable document","x-required-scope":"content:read","responses":{"200":{"description":"The signable document, including its current published version UUID.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SignableDocument"},"example":{"id":"019cf5b0-7c00-7000-8000-000000000009","title":"Employee handbook","compliance_training":true,"current_version_id":"019cf5b0-7c00-7000-8000-00000000000a","current_version_number":4,"published_at":"2026-03-01T10:00:00Z","created_at":"2025-10-01T09:00:00Z","updated_at":"2026-03-01T10:00:00Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Returns a visible published document and the version UUID that a new assignment will deliver."}},"/api/v1/assignments":{"get":{"operationId":"listAssignments","tags":["Assignments"],"summary":"List assignments","x-required-scope":"assignments:read","description":"Lists the organisation's assignments in every state except draft, as drafts are still being set up in Tayl. `since` considers changes to assignments; replacing targets changes the assignment, but a change to a setting it inherits from the content library doesn't.","parameters":[{"$ref":"#/components/parameters/Page"},{"$ref":"#/components/parameters/PerPage"},{"name":"state","in":"query","schema":{"type":"string","enum":["scheduled","published","archived","frozen"]},"description":"Return only records currently in this lifecycle state."},{"name":"assignable_type","in":"query","schema":{"type":"string","enum":["course","pathway","signable_document"]},"description":"Content kind used with `assignable_id`; both filters must be supplied together."},{"name":"assignable_id","in":"query","description":"Content UUID: only assignments of that course, pathway or document.","schema":{"type":"string","format":"uuid"}},{"name":"target_type","in":"query","description":"Only assignments with at least one target of this kind.","schema":{"type":"string","enum":["user","group"]}},{"name":"external_id","in":"query","description":"Exact external_id match.","schema":{"type":"string"}},{"$ref":"#/components/parameters/Since"},{"name":"sort","in":"query","schema":{"type":"string","enum":["created_at","updated_at"],"default":"created_at"},"description":"Field used to order the result set."},{"$ref":"#/components/parameters/Order"}],"responses":{"200":{"description":"A page of assignments.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentList"},"example":{"assignments":[{"id":"019cf5b0-7c00-7000-8000-00000000000b","external_id":"asg-food-safety-london-2026","state":"published","assignable_type":"course","assignable_id":"019cf5b0-7c00-7000-8000-000000000005","assignable_version_id":"019cf5b0-7c00-7000-8000-000000000006","title":"Food safety essentials","targets":[{"type":"group","id":"019cf5b0-7c00-7000-8000-000000000003","external_id":"loc-london"}],"due_in_days":14,"due_on":null,"issues_certificates":true,"requires_recompletion":true,"require_sequential_progress":false,"include_future_members":true,"send_notification":true,"title_override":null,"effective_settings":{"due_in_days":14,"valid_for_months":12,"available_to_recertify_within_days":30,"issues_certificates":true,"minimum_minutes_required":10,"sources":{"due_in_days":{"source":"assignment","required":false,"locked":false},"valid_for_months":{"source":"content_library","required":false,"locked":false},"available_to_recertify_within_days":{"source":"content_library","required":false,"locked":false},"issues_certificates":{"source":"assignment","required":false,"locked":false},"minimum_minutes_required":{"source":"content_library","required":false,"locked":false}}},"published_at":"2026-03-12T09:00:00Z","scheduled_publish_at":null,"archived_at":null,"created_at":"2026-03-12T09:00:00Z","updated_at":"2026-03-12T09:00:00Z"}],"meta":{"page":1,"per_page":25,"total_pages":1,"total_count":1}}}},"headers":{"Link":{"$ref":"#/components/headers/Link"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"post":{"operationId":"createAssignment","tags":["Assignments"],"summary":"Create an assignment","x-required-scope":"assignments:write","description":"Creates and publishes an assignment in one call, then creates a task in the background for every person targeted, including each member of a targeted group. The content must be published, visible to the organisation and in its library. Targets mix people and groups, by UUID or `external_id`. Training rules come from the content library, though an assignment may set its own due date; validity, recertification, certificates and minimum time can't be changed here. Publishing fails with 422 if another published assignment already covers the same content and people.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentCreateInput"},"example":{"assignable_type":"course","assignable_id":"019cf5b0-7c00-7000-8000-000000000005","external_id":"asg-food-safety-london-2026","targets":[{"group_external_id":"loc-london"}],"due_in_days":14}}}},"responses":{"201":{"description":"The published assignment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assignment"},"example":{"id":"019cf5b0-7c00-7000-8000-00000000000b","external_id":"asg-food-safety-london-2026","state":"published","assignable_type":"course","assignable_id":"019cf5b0-7c00-7000-8000-000000000005","assignable_version_id":"019cf5b0-7c00-7000-8000-000000000006","title":"Food safety essentials","targets":[{"type":"group","id":"019cf5b0-7c00-7000-8000-000000000003","external_id":"loc-london"}],"due_in_days":14,"due_on":null,"issues_certificates":null,"requires_recompletion":true,"require_sequential_progress":false,"include_future_members":true,"send_notification":true,"title_override":null,"effective_settings":{"due_in_days":14,"valid_for_months":12,"available_to_recertify_within_days":30,"issues_certificates":true,"minimum_minutes_required":10,"sources":{"due_in_days":{"source":"assignment","required":false,"locked":false},"valid_for_months":{"source":"content_library","required":false,"locked":false},"available_to_recertify_within_days":{"source":"content_library","required":false,"locked":false},"issues_certificates":{"source":"content_library","required":false,"locked":false},"minimum_minutes_required":{"source":"content_library","required":false,"locked":false}}},"published_at":"2026-03-12T09:00:00Z","scheduled_publish_at":null,"archived_at":null,"created_at":"2026-03-12T09:00:00Z","updated_at":"2026-03-12T09:00:00Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/UnprocessableContent"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/assignments/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"The assignment's Tayl UUID.","schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getAssignment","tags":["Assignments"],"summary":"Get an assignment","x-required-scope":"assignments:read","responses":{"200":{"description":"The assignment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assignment"},"example":{"id":"019cf5b0-7c00-7000-8000-00000000000b","external_id":"asg-food-safety-london-2026","state":"published","assignable_type":"course","assignable_id":"019cf5b0-7c00-7000-8000-000000000005","assignable_version_id":"019cf5b0-7c00-7000-8000-000000000006","title":"Food safety essentials","targets":[{"type":"group","id":"019cf5b0-7c00-7000-8000-000000000003","external_id":"loc-london"}],"due_in_days":14,"due_on":null,"issues_certificates":true,"requires_recompletion":true,"require_sequential_progress":false,"include_future_members":true,"send_notification":true,"title_override":null,"effective_settings":{"due_in_days":14,"valid_for_months":12,"available_to_recertify_within_days":30,"issues_certificates":true,"minimum_minutes_required":10,"sources":{"due_in_days":{"source":"assignment","required":false,"locked":false},"valid_for_months":{"source":"content_library","required":false,"locked":false},"available_to_recertify_within_days":{"source":"content_library","required":false,"locked":false},"issues_certificates":{"source":"assignment","required":false,"locked":false},"minimum_minutes_required":{"source":"content_library","required":false,"locked":false}}},"published_at":"2026-03-12T09:00:00Z","scheduled_publish_at":null,"archived_at":null,"created_at":"2026-03-12T09:00:00Z","updated_at":"2026-03-12T09:00:00Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Returns one non-draft assignment, with the people and groups it's for and the settings learners get."},"patch":{"operationId":"updateAssignment","tags":["Assignments"],"summary":"Update an assignment","x-required-scope":"assignments:write","description":"Updates the assignment's own settings and, optionally, who it's for. Fields you leave out keep their values, and null returns a setting to the one it inherits. Validity, recertification, certificates and minimum time are set in the content library and can't be changed here. Setting one of `due_in_days` and `due_on` clears the other. A `targets` array replaces the people and groups: added ones get tasks in the background, and tasks kept only by removed ones are cancelled. Replacing them fails with 422, changing nothing, when another published assignment already covers the same content and one of the new targets. Archived assignments can't change, and frozen ones can't change their targets (422).","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentUpdateInput"},"example":{"due_in_days":21,"send_notification":false}}}},"responses":{"200":{"description":"The updated assignment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assignment"},"example":{"id":"019cf5b0-7c00-7000-8000-00000000000b","external_id":"asg-food-safety-london-2026","state":"published","assignable_type":"course","assignable_id":"019cf5b0-7c00-7000-8000-000000000005","assignable_version_id":"019cf5b0-7c00-7000-8000-000000000006","title":"Food safety essentials","targets":[{"type":"group","id":"019cf5b0-7c00-7000-8000-000000000003","external_id":"loc-london"}],"due_in_days":21,"due_on":null,"issues_certificates":true,"requires_recompletion":true,"require_sequential_progress":false,"include_future_members":true,"send_notification":false,"title_override":null,"effective_settings":{"due_in_days":21,"valid_for_months":12,"available_to_recertify_within_days":30,"issues_certificates":true,"minimum_minutes_required":10,"sources":{"due_in_days":{"source":"assignment","required":false,"locked":false},"valid_for_months":{"source":"content_library","required":false,"locked":false},"available_to_recertify_within_days":{"source":"content_library","required":false,"locked":false},"issues_certificates":{"source":"assignment","required":false,"locked":false},"minimum_minutes_required":{"source":"content_library","required":false,"locked":false}}},"published_at":"2026-03-12T09:00:00Z","scheduled_publish_at":null,"archived_at":null,"created_at":"2026-03-12T09:00:00Z","updated_at":"2026-03-16T10:05:00Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/UnprocessableContent"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"delete":{"operationId":"archiveAssignment","tags":["Assignments"],"summary":"Archive an assignment","x-required-scope":"assignments:write","description":"Archives the assignment and removes it from learners' tasks, cancelling any task only this assignment kept. Archiving an archived assignment changes nothing.","responses":{"204":{"description":"Assignment archived."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/assignments/by-external-id/{external_id}":{"parameters":[{"name":"external_id","in":"path","required":true,"description":"The assignment's `external_id`.","schema":{"type":"string"}}],"get":{"operationId":"getAssignmentByExternalId","tags":["Assignments"],"summary":"Get an assignment by external ID","x-required-scope":"assignments:read","responses":{"200":{"description":"The assignment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assignment"},"example":{"id":"019cf5b0-7c00-7000-8000-00000000000b","external_id":"asg-food-safety-london-2026","state":"published","assignable_type":"course","assignable_id":"019cf5b0-7c00-7000-8000-000000000005","assignable_version_id":"019cf5b0-7c00-7000-8000-000000000006","title":"Food safety essentials","targets":[{"type":"group","id":"019cf5b0-7c00-7000-8000-000000000003","external_id":"loc-london"}],"due_in_days":14,"due_on":null,"issues_certificates":true,"requires_recompletion":true,"require_sequential_progress":false,"include_future_members":true,"send_notification":true,"title_override":null,"effective_settings":{"due_in_days":14,"valid_for_months":12,"available_to_recertify_within_days":30,"issues_certificates":true,"minimum_minutes_required":10,"sources":{"due_in_days":{"source":"assignment","required":false,"locked":false},"valid_for_months":{"source":"content_library","required":false,"locked":false},"available_to_recertify_within_days":{"source":"content_library","required":false,"locked":false},"issues_certificates":{"source":"assignment","required":false,"locked":false},"minimum_minutes_required":{"source":"content_library","required":false,"locked":false}}},"published_at":"2026-03-12T09:00:00Z","scheduled_publish_at":null,"archived_at":null,"created_at":"2026-03-12T09:00:00Z","updated_at":"2026-03-12T09:00:00Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Returns the non-draft assignment with this `external_id`."},"patch":{"operationId":"updateAssignmentByExternalId","tags":["Assignments"],"summary":"Update an assignment by external ID","x-required-scope":"assignments:write","description":"Updates the assignment with this `external_id`, returning 404 if there's none: it doesn't create one.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignmentUpdateInput"},"example":{"due_in_days":21,"send_notification":false}}}},"responses":{"200":{"description":"The updated assignment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Assignment"},"example":{"id":"019cf5b0-7c00-7000-8000-00000000000b","external_id":"asg-food-safety-london-2026","state":"published","assignable_type":"course","assignable_id":"019cf5b0-7c00-7000-8000-000000000005","assignable_version_id":"019cf5b0-7c00-7000-8000-000000000006","title":"Food safety essentials","targets":[{"type":"group","id":"019cf5b0-7c00-7000-8000-000000000003","external_id":"loc-london"}],"due_in_days":21,"due_on":null,"issues_certificates":true,"requires_recompletion":true,"require_sequential_progress":false,"include_future_members":true,"send_notification":false,"title_override":null,"effective_settings":{"due_in_days":21,"valid_for_months":12,"available_to_recertify_within_days":30,"issues_certificates":true,"minimum_minutes_required":10,"sources":{"due_in_days":{"source":"assignment","required":false,"locked":false},"valid_for_months":{"source":"content_library","required":false,"locked":false},"available_to_recertify_within_days":{"source":"content_library","required":false,"locked":false},"issues_certificates":{"source":"assignment","required":false,"locked":false},"minimum_minutes_required":{"source":"content_library","required":false,"locked":false}}},"published_at":"2026-03-12T09:00:00Z","scheduled_publish_at":null,"archived_at":null,"created_at":"2026-03-12T09:00:00Z","updated_at":"2026-03-16T10:05:00Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/UnprocessableContent"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"delete":{"operationId":"archiveAssignmentByExternalId","tags":["Assignments"],"summary":"Archive an assignment by external ID","x-required-scope":"assignments:write","responses":{"204":{"description":"Assignment archived."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Archives the externally identified assignment and cancels tasks sustained only by that assignment."}},"/api/v1/reports/summary":{"get":{"operationId":"getTrainingSummary","tags":["Reports"],"summary":"Summarise training","x-required-scope":"reports:read","x-requires-feature":"reporting","description":"Returns the training figures for the organisation's current people that the key reaches, or for one group's, as on Tayl's Home: how many people have and haven't completed their training, tasks by status, compliance, completion and recent completions.","parameters":[{"$ref":"#/components/parameters/ReportGroupId"},{"$ref":"#/components/parameters/ReportGroupExternalId"},{"$ref":"#/components/parameters/ReportCompletedAfter"},{"$ref":"#/components/parameters/ReportCompletedBefore"}],"responses":{"200":{"description":"The figures.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainingSummary"},"example":{"group":null,"people":{"counted":24,"completed":18,"not_completed":6,"overdue":3},"tasks":{"not_started":21,"in_progress":9,"overdue":4,"completed":186},"compliance":{"rate":88,"compliant":21,"counted":24},"completion":{"rate":85,"completed":186,"counted":220},"completions":37,"basis":{"compliance":"people","completion":"tasks","locked_tasks_counted":false},"period":{"completed_after":"2026-10-05T00:00:00Z","completed_before":"2026-11-03T23:59:59Z"}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/reports/groups":{"get":{"operationId":"listGroupTrainingSummaries","tags":["Reports"],"summary":"Summarise training by group","x-required-scope":"reports:read","x-requires-feature":"reporting","description":"Returns each group's training figures, as on Tayl's Home group cards: one row for each group people make (not automatic ones) that the key oversees and that has current members, by name.","parameters":[{"$ref":"#/components/parameters/Page"},{"$ref":"#/components/parameters/PerPage"},{"name":"category_id","in":"query","description":"Only groups in this group category, such as Location.","schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/ReportCompletedAfter"},{"$ref":"#/components/parameters/ReportCompletedBefore"}],"responses":{"200":{"description":"A page of groups' figures.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GroupReportList"},"example":{"groups":[{"group":{"id":"019cf5b0-7c00-7000-8000-000000000003","external_id":"site-leeds","name":"Leeds","category_id":"019cf5b0-7c00-7000-8000-000000000010"},"people":{"counted":24,"completed":18,"not_completed":6,"overdue":3},"tasks":{"not_started":21,"in_progress":9,"overdue":4,"completed":186},"compliance":{"rate":88,"compliant":21,"counted":24},"completion":{"rate":85,"completed":186,"counted":220},"completions":37}],"basis":{"compliance":"people","completion":"tasks","locked_tasks_counted":false},"period":{"completed_after":"2026-10-05T00:00:00Z","completed_before":"2026-11-03T23:59:59Z"},"meta":{"page":1,"per_page":25,"total_pages":1,"total_count":1}}}},"headers":{"Link":{"$ref":"#/components/headers/Link"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/reports/content":{"get":{"operationId":"listContentTrainingSummaries","tags":["Reports"],"summary":"Summarise training by content","x-required-scope":"reports:read","x-requires-feature":"reporting","description":"Returns each content's training figures across the current people the key reaches, counting each person once: one row for each course, signable document and (while Pathways is on) pathway in the content library that any of them has a task for, archived content included. With `by_group=true`, one row for each group and content instead, for the groups `listGroupTrainingSummaries` lists.","parameters":[{"$ref":"#/components/parameters/Page"},{"$ref":"#/components/parameters/PerPage"},{"name":"assignable_type","in":"query","description":"Only this kind of content; `assignable_id` needs it.","schema":{"type":"string","enum":["course","pathway","signable_document"]}},{"name":"assignable_id","in":"query","description":"Only this content, by its UUID. Needs `assignable_type`.","schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/ReportGroupId"},{"$ref":"#/components/parameters/ReportGroupExternalId"},{"name":"by_group","in":"query","description":"`true` for a row for each group and content. Not with `group_id` or `group_external_id`, which give one group's rows.","schema":{"type":"boolean","default":false}},{"name":"category_id","in":"query","description":"Only groups in this group category, such as Location. Needs `by_group=true`; without it, a `400`.","schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/ReportCompletedAfter"},{"$ref":"#/components/parameters/ReportCompletedBefore"}],"responses":{"200":{"description":"A page of content's figures.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContentReportList"},"example":{"content":[{"content":{"type":"course","id":"019cf5b0-7c00-7000-8000-000000000005","title":"Food safety essentials","archived":false},"group":null,"people":{"counted":24,"completed":20,"not_completed":4,"overdue":2,"with_open_tasks":6,"ever_completed":22,"expired":1,"due_for_renewal":2},"tasks":{"not_started":2,"in_progress":0,"overdue":2,"completed":20},"compliance":{"rate":91,"compliant":21,"counted":23},"completion":{"rate":83,"completed":20,"counted":24},"completions":5}],"basis":{"compliance":"people","completion":"tasks","locked_tasks_counted":false},"period":{"completed_after":"2026-10-05T00:00:00Z","completed_before":"2026-11-03T23:59:59Z"},"meta":{"page":1,"per_page":25,"total_pages":1,"total_count":1}}}},"headers":{"Link":{"$ref":"#/components/headers/Link"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/tasks":{"get":{"operationId":"listTasks","tags":["Tasks"],"summary":"List tasks","x-required-scope":"tasks:read","description":"Lists learner tasks across the organisation. `since` considers changes to the task, its progress, its latest completion and the learner's `user_external_id`.","parameters":[{"$ref":"#/components/parameters/Page"},{"$ref":"#/components/parameters/PerPage"},{"name":"user_id","in":"query","description":"The learner's Tayl user UUID.","schema":{"type":"string","format":"uuid"}},{"name":"user_external_id","in":"query","description":"The learner's `external_id`.","schema":{"type":"string"}},{"$ref":"#/components/parameters/GroupId"},{"$ref":"#/components/parameters/GroupExternalId"},{"name":"state","in":"query","schema":{"type":"string","enum":["pending","in_progress","completed","cancelled","locked"]},"description":"Return only records currently in this lifecycle state."},{"name":"status","in":"query","schema":{"type":"string","enum":["not_started","in_progress","overdue","completed"]},"description":"Return only tasks with this status, which lists the tasks a report summary counts under it."},{"name":"assignable_type","in":"query","schema":{"type":"string","enum":["course","pathway","signable_document","resource"]},"description":"Content kind used with `assignable_id`; both filters must be supplied together."},{"name":"assignable_id","in":"query","description":"Content UUID, matching tasks for any version of it. Needs `assignable_type`.","schema":{"type":"string","format":"uuid"}},{"$ref":"#/components/parameters/Since"},{"name":"sort","in":"query","schema":{"type":"string","enum":["created_at","updated_at","due_on"],"default":"created_at"},"description":"Field used to order the result set."},{"$ref":"#/components/parameters/Order"}],"responses":{"200":{"description":"A page of tasks.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskList"},"example":{"tasks":[{"id":"019cf5b0-7c00-7000-8000-00000000000c","state":"completed","status":"completed","user_id":"019cf5b0-7c00-7000-8000-000000000002","user_external_id":"usr-1042","assignable_type":"course","assignable_id":"019cf5b0-7c00-7000-8000-000000000005","assignable_version_id":"019cf5b0-7c00-7000-8000-000000000006","title":"Food safety essentials","due_on":"2026-03-26","due_on_paused_at":null,"started_at":"2026-03-15T09:10:00Z","completed_at":"2026-03-16T10:00:00Z","progress":{"percent_complete":100,"time_spent_seconds":1840,"last_interacted_at":"2026-03-16T10:00:00Z"},"latest_completion":{"id":"019cf5b0-7c00-7000-8000-00000000000d","completed_at":"2026-03-16T10:00:00Z","valid_until":"2027-03-16","certificate_reference":"CERT-20260316-A7K2"},"current_completion":{"id":"019cf5b0-7c00-7000-8000-00000000000d","completed_at":"2026-03-16T10:00:00Z","valid_until":"2027-03-16","certificate_reference":"CERT-20260316-A7K2"},"created_at":"2026-03-12T09:01:00Z","updated_at":"2026-03-16T10:00:00Z"}],"meta":{"page":1,"per_page":25,"total_pages":1,"total_count":1}}}},"headers":{"Link":{"$ref":"#/components/headers/Link"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/tasks/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"The task's Tayl UUID.","schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getTask","tags":["Tasks"],"summary":"Get a task","x-required-scope":"tasks:read","responses":{"200":{"description":"The task with progress and completion summary.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Task"},"example":{"id":"019cf5b0-7c00-7000-8000-00000000000c","state":"completed","status":"completed","user_id":"019cf5b0-7c00-7000-8000-000000000002","user_external_id":"usr-1042","assignable_type":"course","assignable_id":"019cf5b0-7c00-7000-8000-000000000005","assignable_version_id":"019cf5b0-7c00-7000-8000-000000000006","title":"Food safety essentials","due_on":"2026-03-26","due_on_paused_at":null,"started_at":"2026-03-15T09:10:00Z","completed_at":"2026-03-16T10:00:00Z","progress":{"percent_complete":100,"time_spent_seconds":1840,"last_interacted_at":"2026-03-16T10:00:00Z"},"latest_completion":{"id":"019cf5b0-7c00-7000-8000-00000000000d","completed_at":"2026-03-16T10:00:00Z","valid_until":"2027-03-16","certificate_reference":"CERT-20260316-A7K2"},"current_completion":{"id":"019cf5b0-7c00-7000-8000-00000000000d","completed_at":"2026-03-16T10:00:00Z","valid_until":"2027-03-16","certificate_reference":"CERT-20260316-A7K2"},"created_at":"2026-03-12T09:01:00Z","updated_at":"2026-03-16T10:00:00Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Returns one learner task with its latest progress and completion summary."}},"/api/v1/completions":{"get":{"operationId":"listCompletions","tags":["Completions"],"summary":"List completions","x-required-scope":"completions:read","description":"Lists completions across the organisation, newest first. Poll with `since=<last_poll_timestamp>` to land newly created or updated completion data in a data warehouse. `completed_after` and `completed_before` filter the learner's business completion date and are not ingestion cursors.","parameters":[{"$ref":"#/components/parameters/Page"},{"$ref":"#/components/parameters/PerPage"},{"name":"user_id","in":"query","description":"The learner's Tayl user UUID.","schema":{"type":"string","format":"uuid"}},{"name":"user_external_id","in":"query","description":"The learner's `external_id`.","schema":{"type":"string"}},{"$ref":"#/components/parameters/GroupId"},{"$ref":"#/components/parameters/GroupExternalId"},{"name":"assignable_type","in":"query","schema":{"type":"string","enum":["course","pathway","signable_document","resource"]},"description":"Content kind used with `assignable_id`; both filters must be supplied together."},{"name":"assignable_id","in":"query","description":"Content UUID, matching completions of any version of it. Needs `assignable_type`.","schema":{"type":"string","format":"uuid"}},{"name":"completed_after","in":"query","description":"Only completions at or after this ISO 8601 datetime.","schema":{"type":"string","format":"date-time"}},{"name":"completed_before","in":"query","description":"Only completions at or before this ISO 8601 datetime.","schema":{"type":"string","format":"date-time"}},{"$ref":"#/components/parameters/Since"},{"name":"sort","in":"query","schema":{"type":"string","enum":["completed_at","created_at"],"default":"completed_at"},"description":"Field used to order the result set."},{"name":"order","in":"query","description":"Sort direction. Completions list newest first by default.","schema":{"type":"string","enum":["asc","desc"],"default":"desc"}}],"responses":{"200":{"description":"A page of completions.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompletionList"},"example":{"completions":[{"id":"019cf5b0-7c00-7000-8000-00000000000d","task_id":"019cf5b0-7c00-7000-8000-00000000000c","user_id":"019cf5b0-7c00-7000-8000-000000000002","user_external_id":"usr-1042","assignable_type":"course","assignable_id":"019cf5b0-7c00-7000-8000-000000000005","assignable_version_id":"019cf5b0-7c00-7000-8000-000000000006","title":"Food safety essentials","learner_name":"Alex Chen","completed_at":"2026-03-16T10:00:00Z","valid_until":"2027-03-16","time_spent_seconds":1840,"certificate_reference":"CERT-20260316-A7K2","created_at":"2026-03-16T10:00:00Z","updated_at":"2026-03-16T10:00:00Z"}],"meta":{"page":1,"per_page":25,"total_pages":1,"total_count":1}}}},"headers":{"Link":{"$ref":"#/components/headers/Link"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/completions/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"The completion's Tayl UUID.","schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getCompletion","tags":["Completions"],"summary":"Get a completion","x-required-scope":"completions:read","responses":{"200":{"description":"The completion. A `certificate_reference` means it issued a certificate, which `/certificates/{id}` reads.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Completion"},"example":{"id":"019cf5b0-7c00-7000-8000-00000000000d","task_id":"019cf5b0-7c00-7000-8000-00000000000c","user_id":"019cf5b0-7c00-7000-8000-000000000002","user_external_id":"usr-1042","assignable_type":"course","assignable_id":"019cf5b0-7c00-7000-8000-000000000005","assignable_version_id":"019cf5b0-7c00-7000-8000-000000000006","title":"Food safety essentials","learner_name":"Alex Chen","completed_at":"2026-03-16T10:00:00Z","valid_until":"2027-03-16","time_spent_seconds":1840,"certificate_reference":"CERT-20260316-A7K2","created_at":"2026-03-16T10:00:00Z","updated_at":"2026-03-16T10:00:00Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Returns one immutable learning completion and any issued certificate reference."}},"/api/v1/certificates":{"get":{"operationId":"listCertificates","tags":["Certificates"],"summary":"List certificates","x-required-scope":"certificates:read","description":"Lists completions that issued a certificate, newest first, for systems that archive them. Poll with `since` and download each PDF with `/certificates/{id}/download`. `issued_after` and `issued_before` filter by the date a certificate was issued, so they aren't safe sync cursors. A certificate's reference is set when its completion is recorded.","parameters":[{"$ref":"#/components/parameters/Page"},{"$ref":"#/components/parameters/PerPage"},{"name":"user_id","in":"query","description":"The learner's Tayl user UUID.","schema":{"type":"string","format":"uuid"}},{"name":"user_external_id","in":"query","description":"The learner's `external_id`.","schema":{"type":"string"}},{"$ref":"#/components/parameters/GroupId"},{"$ref":"#/components/parameters/GroupExternalId"},{"name":"issued_after","in":"query","description":"Only certificates issued at or after this ISO 8601 datetime.","schema":{"type":"string","format":"date-time"}},{"name":"issued_before","in":"query","description":"Only certificates issued at or before this ISO 8601 datetime.","schema":{"type":"string","format":"date-time"}},{"$ref":"#/components/parameters/Since"},{"name":"sort","in":"query","schema":{"type":"string","enum":["completed_at","created_at"],"default":"completed_at"},"description":"Field used to order the result set."},{"name":"order","in":"query","description":"Sort direction. Certificates list newest first by default.","schema":{"type":"string","enum":["asc","desc"],"default":"desc"}}],"responses":{"200":{"description":"A page of certificates.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CertificateList"},"example":{"certificates":[{"id":"019cf5b0-7c00-7000-8000-00000000000d","certificate_reference":"CERT-20260316-A7K2","issued_at":"2026-03-16T10:00:00Z","valid_until":"2027-03-16","learner_name":"Alex Chen","user_id":"019cf5b0-7c00-7000-8000-000000000002","user_external_id":"usr-1042","task_id":"019cf5b0-7c00-7000-8000-00000000000c","course_id":"019cf5b0-7c00-7000-8000-000000000005","course_title":"Food safety essentials"}],"meta":{"page":1,"per_page":25,"total_pages":1,"total_count":1}}}},"headers":{"Link":{"$ref":"#/components/headers/Link"}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/certificates/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"The completion UUID or the certificate's CERT-... reference.","schema":{"type":"string"}}],"get":{"operationId":"getCertificate","tags":["Certificates"],"summary":"Get certificate metadata","x-required-scope":"certificates:read","description":"A certificate is a course completion that issued one, so its ID is the completion's UUID. Completions without a certificate return 404 here.","responses":{"200":{"description":"The certificate metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Certificate"},"example":{"id":"019cf5b0-7c00-7000-8000-00000000000d","certificate_reference":"CERT-20260316-A7K2","issued_at":"2026-03-16T10:00:00Z","valid_until":"2027-03-16","learner_name":"Alex Chen","user_id":"019cf5b0-7c00-7000-8000-000000000002","user_external_id":"usr-1042","task_id":"019cf5b0-7c00-7000-8000-00000000000c","course_id":"019cf5b0-7c00-7000-8000-000000000005","course_title":"Food safety essentials"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/certificates/{id}/download":{"parameters":[{"name":"id","in":"path","required":true,"description":"The completion UUID or the certificate's CERT-... reference.","schema":{"type":"string"}}],"get":{"operationId":"downloadCertificate","tags":["Certificates"],"summary":"Download the certificate PDF","x-required-scope":"certificates:read","description":"Streams the certificate as `application/pdf`. A certificate's PDF is made on its first download, which can take a few seconds.","responses":{"200":{"description":"The certificate PDF.","headers":{"Content-Length":{"description":"The certificate PDF size in bytes.","schema":{"type":"integer","minimum":0}}},"content":{"application/pdf":{"schema":{"type":"string","format":"binary"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"description":"The PDF couldn't be made. Retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"errors":[{"code":"certificate_generation_failed","message":"The certificate PDF could not be generated — retry later","documentation_url":"https://tayl.pro/api/v1/docs/errors#certificate_generation_failed"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}}}}}}},"/api/v1/api-keys/current":{"get":{"operationId":"getCurrentApiKey","tags":["API Keys"],"summary":"Check what this key can do","description":"Returns the key making the request, its organisation and the scopes it can use, and for each section of the docs how many operations it can call, the scopes it could hold, and anything else blocking it. Any active key can call it, without a scope and even while its organisation is restricted, and it never changes anything.","responses":{"200":{"description":"The key and what it can do.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"},"example":{"id":"019cf5b0-7c00-7000-8000-00000000000f","name":"Course drafting agent","kind":"organisation","person":null,"organisation":{"id":"019cf5b0-7c00-7000-8000-00000000000e","name":"The Anchor Pub Co"},"scopes":["content:read","content:write"],"granted_scopes":["content:read","content:write"],"rate_limit_rps":10,"expires_at":null,"created_at":"2026-03-01T09:00:00Z","restriction":null,"features":{"course_builder":true,"reporting":true},"sections":[{"key":"course-authoring","title":"Course authoring","operations":{"callable":27,"total":30},"missing_scopes":["content:publish"],"blocked_by":[],"docs":{"markdown":"https://tayl.pro/api/v1/docs/course-authoring.md"}}]}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/webhook-endpoints":{"get":{"operationId":"listWebhookEndpoints","tags":["Webhook Endpoints"],"summary":"List webhook endpoints","x-required-scope":"webhooks:manage","parameters":[{"$ref":"#/components/parameters/Page"},{"$ref":"#/components/parameters/PerPage"},{"name":"status","in":"query","schema":{"type":"string","enum":["active","deactivated"]},"description":"Return only records currently in this processing or lifecycle status."},{"name":"event","in":"query","schema":{"$ref":"#/components/schemas/WebhookEventType"},"description":"Return endpoints subscribed to this exact event type."},{"name":"sort","in":"query","schema":{"type":"string","enum":["created_at","updated_at"],"default":"created_at"},"description":"Field used to order the result set."},{"name":"order","in":"query","schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"description":"Direction used to order the result set."}],"responses":{"200":{"description":"A page of webhook endpoints, newest first by default.","headers":{"Link":{"$ref":"#/components/headers/Link"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointList"},"example":{"webhook_endpoints":[{"id":"019cf5b0-7c00-7000-8000-000000000010","url":"https://integrations.example.com/tayl/webhooks","events":["user.created","task.completed"],"status":"active","created_by_user_id":"019cf5b0-7c00-7000-8000-000000000002","deactivated_at":null,"consecutive_failures":0,"last_success_at":"2026-03-16T10:00:02Z","last_failure_at":null,"last_failure_reason":null,"created_at":"2026-03-01T09:00:00Z","updated_at":"2026-03-16T10:00:02Z"}],"meta":{"page":1,"per_page":25,"total_pages":1,"total_count":1}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Lists active and deactivated webhook destinations without exposing current or previous signing secrets."},"post":{"operationId":"createWebhookEndpoint","tags":["Webhook Endpoints"],"summary":"Create a webhook endpoint","x-required-scope":"webhooks:manage","description":"Creates an endpoint. The signing_secret is returned exactly once and cannot be retrieved later. Each event also needs its resource's read scope (for example `users:read` for `user.*` events).","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointCreateInput"},"example":{"url":"https://integrations.example.com/tayl/webhooks","events":["user.created","task.completed"]}}}},"responses":{"201":{"description":"The endpoint and its one-time signing secret.","headers":{"Cache-Control":{"description":"Prevents storage of the one-time secret response.","required":true,"schema":{"type":"string","const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointWithSecret"},"example":{"id":"019cf5b0-7c00-7000-8000-000000000010","url":"https://integrations.example.com/tayl/webhooks","events":["user.created","task.completed"],"status":"active","created_by_user_id":null,"deactivated_at":null,"consecutive_failures":0,"last_success_at":null,"last_failure_at":null,"last_failure_reason":null,"created_at":"2026-03-16T10:00:00Z","updated_at":"2026-03-16T10:00:00Z","signing_secret":"whsec_lQ8fY2mN7cR4vP9xT6kD3sA1bE5gH0jU"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"422":{"$ref":"#/components/responses/UnprocessableContent"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/webhook-endpoints/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"The webhook endpoint UUID.","schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getWebhookEndpoint","tags":["Webhook Endpoints"],"summary":"Get a webhook endpoint","x-required-scope":"webhooks:manage","responses":{"200":{"description":"The webhook endpoint. Signing secrets are never included.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"},"example":{"id":"019cf5b0-7c00-7000-8000-000000000010","url":"https://integrations.example.com/tayl/webhooks","events":["user.created","task.completed"],"status":"active","created_by_user_id":"019cf5b0-7c00-7000-8000-000000000002","deactivated_at":null,"consecutive_failures":0,"last_success_at":"2026-03-16T10:00:02Z","last_failure_at":null,"last_failure_reason":null,"created_at":"2026-03-01T09:00:00Z","updated_at":"2026-03-16T10:00:02Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Returns endpoint configuration and delivery health without exposing signing secrets."},"patch":{"operationId":"updateWebhookEndpoint","tags":["Webhook Endpoints"],"summary":"Update a webhook endpoint","x-required-scope":"webhooks:manage","description":"Fields you leave out keep their values. Each event also needs its resource's read scope (for example `users:read` for `user.*` events). An update that keeps the existing events, such as a URL change, is checked against those events. Pending and retrying deliveries of a removed event are abandoned rather than sent.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointUpdateInput"},"example":{"events":["user.created","user.updated","task.completed"]}}}},"responses":{"200":{"description":"The updated endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"},"example":{"id":"019cf5b0-7c00-7000-8000-000000000010","url":"https://integrations.example.com/tayl/webhooks","events":["user.created","user.updated","task.completed"],"status":"active","created_by_user_id":"019cf5b0-7c00-7000-8000-000000000002","deactivated_at":null,"consecutive_failures":0,"last_success_at":"2026-03-16T10:00:02Z","last_failure_at":null,"last_failure_reason":null,"created_at":"2026-03-01T09:00:00Z","updated_at":"2026-03-16T10:05:00Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableContent"},"429":{"$ref":"#/components/responses/TooManyRequests"}}},"delete":{"operationId":"deactivateWebhookEndpoint","tags":["Webhook Endpoints"],"summary":"Deactivate a webhook endpoint","x-required-scope":"webhooks:manage","responses":{"204":{"description":"Endpoint deactivated."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Stops new deliveries to the endpoint; calling this more than once is safe."}},"/api/v1/webhook-endpoints/{id}/reactivate":{"parameters":[{"name":"id","in":"path","required":true,"description":"The webhook endpoint UUID.","schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"reactivateWebhookEndpoint","tags":["Webhook Endpoints"],"summary":"Reactivate a webhook endpoint","x-required-scope":"webhooks:manage","responses":{"200":{"description":"The reactivated endpoint with failure health reset.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"},"example":{"id":"019cf5b0-7c00-7000-8000-000000000010","url":"https://integrations.example.com/tayl/webhooks","events":["user.created","task.completed"],"status":"active","created_by_user_id":"019cf5b0-7c00-7000-8000-000000000002","deactivated_at":null,"consecutive_failures":0,"last_success_at":"2026-03-16T10:00:02Z","last_failure_at":null,"last_failure_reason":null,"created_at":"2026-03-01T09:00:00Z","updated_at":"2026-03-16T10:00:02Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableContent"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Resumes delivery and resets consecutive-failure health for a deactivated endpoint."}},"/api/v1/webhook-endpoints/{id}/rotate-secret":{"parameters":[{"name":"id","in":"path","required":true,"description":"The webhook endpoint UUID.","schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"rotateWebhookEndpointSecret","tags":["Webhook Endpoints"],"summary":"Rotate a webhook endpoint signing secret","x-required-scope":"webhooks:manage","description":"Returns the new signing_secret exactly once. The previous secret remains valid during the 24-hour dual-signature grace period.","responses":{"200":{"description":"The endpoint and its new one-time signing secret.","headers":{"Cache-Control":{"description":"Prevents storage of the one-time secret response.","required":true,"schema":{"type":"string","const":"no-store"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointWithSecret"},"example":{"id":"019cf5b0-7c00-7000-8000-000000000010","url":"https://integrations.example.com/tayl/webhooks","events":["user.created","task.completed"],"status":"active","created_by_user_id":"019cf5b0-7c00-7000-8000-000000000002","deactivated_at":null,"consecutive_failures":0,"last_success_at":"2026-03-16T10:00:02Z","last_failure_at":null,"last_failure_reason":null,"created_at":"2026-03-01T09:00:00Z","updated_at":"2026-03-16T10:00:02Z","signing_secret":"whsec_lQ8fY2mN7cR4vP9xT6kD3sA1bE5gH0jU"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/api/v1/webhook-deliveries":{"get":{"operationId":"listWebhookDeliveries","tags":["Webhook Deliveries"],"summary":"List webhook deliveries","x-required-scope":"webhooks:manage","parameters":[{"$ref":"#/components/parameters/Page"},{"$ref":"#/components/parameters/PerPage"},{"name":"endpoint_id","in":"query","schema":{"type":"string","format":"uuid"},"description":"Return deliveries sent to this webhook endpoint UUID."},{"name":"event_type","in":"query","schema":{"$ref":"#/components/schemas/WebhookEventType"},"description":"Return deliveries carrying this exact event type."},{"name":"status","in":"query","schema":{"type":"string","enum":["pending","delivering","sent","failed","abandoned"]},"description":"Return only records currently in this processing or lifecycle status."},{"name":"sort","in":"query","schema":{"type":"string","enum":["created_at","updated_at","last_attempted_at"],"default":"created_at"},"description":"Field used to order the result set."},{"name":"order","in":"query","schema":{"type":"string","enum":["asc","desc"],"default":"desc"},"description":"Direction used to order the result set."}],"responses":{"200":{"description":"A page of deliveries, newest first by default.","headers":{"Link":{"$ref":"#/components/headers/Link"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryList"},"example":{"webhook_deliveries":[{"id":"019cf5b0-7c00-7000-8000-000000000012","webhook_endpoint_id":"019cf5b0-7c00-7000-8000-000000000010","event_type":"user.created","event_id":"019cf5b0-7c00-7000-8000-000000000011","payload":{"id":"019cf5b0-7c00-7000-8000-000000000011","type":"user.created","created_at":"2026-03-16T10:00:00Z","data":{"id":"019cf5b0-7c00-7000-8000-000000000002","external_id":"usr-1042","email":"alex.chen@example.com","name":"Alex Chen","first_name":"Alex","last_name":"Chen","state":"active","invited_at":"2026-03-10T09:00:00Z","accepted_at":"2026-03-10T09:15:00Z","created_at":"2026-03-10T09:00:00Z","updated_at":"2026-03-16T10:00:00Z"}},"status":"sent","status_reason":null,"attempts":1,"next_attempt_at":null,"delivery_started_at":null,"last_attempted_at":"2026-03-16T10:00:02Z","response_status":204,"response_body_excerpt":"","history":[{"at":"2026-03-16T10:00:02Z","manual":false,"status":204,"error":null,"duration_ms":182}],"created_at":"2026-03-16T10:00:00Z","updated_at":"2026-03-16T10:00:02Z"}],"meta":{"page":1,"per_page":25,"total_pages":1,"total_count":1}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Lists retained delivery records for diagnosing endpoint behavior and locating failed events. Only deliveries of events whose resource the key can read (for example `users:read` for `user.*`) are listed."}},"/api/v1/webhook-deliveries/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"The webhook delivery UUID.","schema":{"type":"string","format":"uuid"}}],"get":{"operationId":"getWebhookDelivery","tags":["Webhook Deliveries"],"summary":"Get a webhook delivery","x-required-scope":"webhooks:manage","responses":{"200":{"description":"The delivery, including its immutable event envelope and bounded attempt history.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"},"example":{"id":"019cf5b0-7c00-7000-8000-000000000012","webhook_endpoint_id":"019cf5b0-7c00-7000-8000-000000000010","event_type":"user.created","event_id":"019cf5b0-7c00-7000-8000-000000000011","payload":{"id":"019cf5b0-7c00-7000-8000-000000000011","type":"user.created","created_at":"2026-03-16T10:00:00Z","data":{"id":"019cf5b0-7c00-7000-8000-000000000002","external_id":"usr-1042","email":"alex.chen@example.com","name":"Alex Chen","first_name":"Alex","last_name":"Chen","state":"active","invited_at":"2026-03-10T09:00:00Z","accepted_at":"2026-03-10T09:15:00Z","created_at":"2026-03-10T09:00:00Z","updated_at":"2026-03-16T10:00:00Z"}},"status":"sent","status_reason":null,"attempts":1,"next_attempt_at":null,"delivery_started_at":null,"last_attempted_at":"2026-03-16T10:00:02Z","response_status":204,"response_body_excerpt":"","history":[{"at":"2026-03-16T10:00:02Z","manual":false,"status":204,"error":null,"duration_ms":182}],"created_at":"2026-03-16T10:00:00Z","updated_at":"2026-03-16T10:00:02Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}},"description":"Returns one retained delivery with the immutable payload and up to 20 recent attempt diagnostics. A delivery of an event whose resource the key can't read (for example `users:read` for `user.*`) returns `404`."}},"/api/v1/webhook-deliveries/{id}/retry":{"parameters":[{"name":"id","in":"path","required":true,"description":"The webhook delivery UUID.","schema":{"type":"string","format":"uuid"}}],"post":{"operationId":"retryWebhookDelivery","tags":["Webhook Deliveries"],"summary":"Retry a webhook delivery","x-required-scope":"webhooks:manage","description":"Atomically claims and enqueues a retained failed or abandoned delivery. The endpoint must still be active and subscribed to the delivery's event (`event_unsubscribed` otherwise). A delivery of an event whose resource the key can't read (for example `users:read` for `user.*`) returns `404`.","responses":{"202":{"description":"The delivery was claimed and queued for a manual attempt.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"},"example":{"id":"019cf5b0-7c00-7000-8000-000000000012","webhook_endpoint_id":"019cf5b0-7c00-7000-8000-000000000010","event_type":"user.created","event_id":"019cf5b0-7c00-7000-8000-000000000011","payload":{"id":"019cf5b0-7c00-7000-8000-000000000011","type":"user.created","created_at":"2026-03-16T10:00:00Z","data":{"id":"019cf5b0-7c00-7000-8000-000000000002","external_id":"usr-1042","email":"alex.chen@example.com","name":"Alex Chen","first_name":"Alex","last_name":"Chen","state":"active","invited_at":"2026-03-10T09:00:00Z","accepted_at":"2026-03-10T09:15:00Z","created_at":"2026-03-10T09:00:00Z","updated_at":"2026-03-16T10:00:00Z"}},"status":"delivering","status_reason":"http_500","attempts":1,"next_attempt_at":null,"delivery_started_at":"2026-03-16T10:05:00Z","last_attempted_at":"2026-03-16T10:00:02Z","response_status":500,"response_body_excerpt":"Internal Server Error","history":[{"at":"2026-03-16T10:00:02Z","manual":false,"status":500,"error":null,"duration_ms":182}],"created_at":"2026-03-16T10:00:00Z","updated_at":"2026-03-16T10:05:00Z"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/PaymentRequired"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableContent"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}}},"webhooks":{"user.created":{"post":{"operationId":"webhookUserCreated","summary":"user.created","description":"Sent when a user is created.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayloadUserCreated"}}}},"responses":{"2XX":{"description":"Return any 2xx status once the event has been durably accepted. Connection failures and HTTP 408, 429, and 5xx responses are retried; other responses stop automatic delivery."}}}},"user.updated":{"post":{"operationId":"webhookUserUpdated","summary":"user.updated","description":"Sent when a user is updated.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayloadUserUpdated"}}}},"responses":{"2XX":{"description":"Return any 2xx status once the event has been durably accepted. Connection failures and HTTP 408, 429, and 5xx responses are retried; other responses stop automatic delivery."}}}},"user.archived":{"post":{"operationId":"webhookUserArchived","summary":"user.archived","description":"Sent when a user is archived.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayloadUserArchived"}}}},"responses":{"2XX":{"description":"Return any 2xx status once the event has been durably accepted. Connection failures and HTTP 408, 429, and 5xx responses are retried; other responses stop automatic delivery."}}}},"user.restored":{"post":{"operationId":"webhookUserRestored","summary":"user.restored","description":"Sent when an archived user is restored.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayloadUserRestored"}}}},"responses":{"2XX":{"description":"Return any 2xx status once the event has been durably accepted. Connection failures and HTTP 408, 429, and 5xx responses are retried; other responses stop automatic delivery."}}}},"group.created":{"post":{"operationId":"webhookGroupCreated","summary":"group.created","description":"Sent when a group is created.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayloadGroupCreated"}}}},"responses":{"2XX":{"description":"Return any 2xx status once the event has been durably accepted. Connection failures and HTTP 408, 429, and 5xx responses are retried; other responses stop automatic delivery."}}}},"group.updated":{"post":{"operationId":"webhookGroupUpdated","summary":"group.updated","description":"Sent when a group is updated, or restored after being archived.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayloadGroupUpdated"}}}},"responses":{"2XX":{"description":"Return any 2xx status once the event has been durably accepted. Connection failures and HTTP 408, 429, and 5xx responses are retried; other responses stop automatic delivery."}}}},"group.archived":{"post":{"operationId":"webhookGroupArchived","summary":"group.archived","description":"Sent when a group is archived.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayloadGroupArchived"}}}},"responses":{"2XX":{"description":"Return any 2xx status once the event has been durably accepted. Connection failures and HTTP 408, 429, and 5xx responses are retried; other responses stop automatic delivery."}}}},"group.member_added":{"post":{"operationId":"webhookGroupMemberAdded","summary":"group.member_added","description":"Sent when a user is added to a group.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayloadGroupMemberAdded"}}}},"responses":{"2XX":{"description":"Return any 2xx status once the event has been durably accepted. Connection failures and HTTP 408, 429, and 5xx responses are retried; other responses stop automatic delivery."}}}},"group.member_removed":{"post":{"operationId":"webhookGroupMemberRemoved","summary":"group.member_removed","description":"Sent when a user is removed from a group.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayloadGroupMemberRemoved"}}}},"responses":{"2XX":{"description":"Return any 2xx status once the event has been durably accepted. Connection failures and HTTP 408, 429, and 5xx responses are retried; other responses stop automatic delivery."}}}},"assignment.created":{"post":{"operationId":"webhookAssignmentCreated","summary":"assignment.created","description":"Sent when an assignment is created.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayloadAssignmentCreated"}}}},"responses":{"2XX":{"description":"Return any 2xx status once the event has been durably accepted. Connection failures and HTTP 408, 429, and 5xx responses are retried; other responses stop automatic delivery."}}}},"assignment.updated":{"post":{"operationId":"webhookAssignmentUpdated","summary":"assignment.updated","description":"Sent when an assignment is updated.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayloadAssignmentUpdated"}}}},"responses":{"2XX":{"description":"Return any 2xx status once the event has been durably accepted. Connection failures and HTTP 408, 429, and 5xx responses are retried; other responses stop automatic delivery."}}}},"assignment.archived":{"post":{"operationId":"webhookAssignmentArchived","summary":"assignment.archived","description":"Sent when an assignment is archived.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayloadAssignmentArchived"}}}},"responses":{"2XX":{"description":"Return any 2xx status once the event has been durably accepted. Connection failures and HTTP 408, 429, and 5xx responses are retried; other responses stop automatic delivery."}}}},"task.started":{"post":{"operationId":"webhookTaskStarted","summary":"task.started","description":"Sent when a learner starts a task.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayloadTaskStarted"}}}},"responses":{"2XX":{"description":"Return any 2xx status once the event has been durably accepted. Connection failures and HTTP 408, 429, and 5xx responses are retried; other responses stop automatic delivery."}}}},"task.completed":{"post":{"operationId":"webhookTaskCompleted","summary":"task.completed","description":"Sent when a learner completes a task.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayloadTaskCompleted"}}}},"responses":{"2XX":{"description":"Return any 2xx status once the event has been durably accepted. Connection failures and HTTP 408, 429, and 5xx responses are retried; other responses stop automatic delivery."}}}},"task.overdue":{"post":{"operationId":"webhookTaskOverdue","summary":"task.overdue","description":"Sent when a task becomes overdue.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayloadTaskOverdue"}}}},"responses":{"2XX":{"description":"Return any 2xx status once the event has been durably accepted. Connection failures and HTTP 408, 429, and 5xx responses are retried; other responses stop automatic delivery."}}}},"completion.created":{"post":{"operationId":"webhookCompletionCreated","summary":"completion.created","description":"Sent when a completion is recorded.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayloadCompletionCreated"}}}},"responses":{"2XX":{"description":"Return any 2xx status once the event has been durably accepted. Connection failures and HTTP 408, 429, and 5xx responses are retried; other responses stop automatic delivery."}}}},"certificate.issued":{"post":{"operationId":"webhookCertificateIssued","summary":"certificate.issued","description":"Sent when a certificate is issued.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayloadCertificateIssued"}}}},"responses":{"2XX":{"description":"Return any 2xx status once the event has been durably accepted. Connection failures and HTTP 408, 429, and 5xx responses are retried; other responses stop automatic delivery."}}}},"signable.signed":{"post":{"operationId":"webhookSignableSigned","summary":"signable.signed","description":"Sent when a signable document is signed.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayloadSignableSigned"}}}},"responses":{"2XX":{"description":"Return any 2xx status once the event has been durably accepted. Connection failures and HTTP 408, 429, and 5xx responses are retried; other responses stop automatic delivery."}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"tayl_live_xxxx","description":"Per-organisation API key. Send as `Authorization: Bearer tayl_live_...`."}},"schemas":{"Error":{"type":"object","description":"Standard error envelope returned by every error response the API renders. An unhandled 500 is built outside the API and carries Rails' default JSON error instead.","required":["errors","request_id"],"properties":{"errors":{"type":"array","items":{"$ref":"#/components/schemas/ErrorItem"},"description":"Structured errors; empty for a successful bulk entry."},"request_id":{"type":"string","description":"Identifies the request. Include it when contacting support."}},"example":{"errors":[{"code":"validation_error","message":"is invalid","field":"email","pointer":"/data/email","documentation_url":"https://tayl.pro/api/v1/docs/errors#validation_error"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}},"Meta":{"type":"object","description":"Pagination details on every list. Page links also come in the RFC 8288 `Link` header, as `first`, `prev`, `next` and `last`.","required":["page","per_page","total_pages","total_count"],"properties":{"page":{"type":"integer","description":"Current page (1-based)."},"per_page":{"type":"integer","description":"Records per page (default 25, max 100)."},"total_pages":{"type":"integer","description":"Number of pages available for the current filters."},"total_count":{"type":"integer","description":"Total records matching the current filters."}},"example":{"page":1,"per_page":25,"total_pages":1,"total_count":1}},"WebhookEndpoint":{"type":"object","required":["id","url","events","status","created_by_user_id","deactivated_at","consecutive_failures","last_success_at","last_failure_at","last_failure_reason","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid","description":"Stable UUID for this resource."},"url":{"type":"string","format":"uri","pattern":"^https://","description":"Public HTTPS URL that receives webhook POST requests."},"events":{"type":"array","minItems":1,"uniqueItems":true,"items":{"$ref":"#/components/schemas/WebhookEventType"},"description":"Event types delivered to this endpoint."},"status":{"type":"string","enum":["active","deactivated"],"description":"Current processing or lifecycle status."},"created_by_user_id":{"type":["string","null"],"format":"uuid","description":"UUID of the administrator who created the endpoint; null if no longer available."},"deactivated_at":{"type":["string","null"],"format":"date-time","description":"When delivery was disabled; null while active."},"consecutive_failures":{"type":"integer","minimum":0,"description":"Consecutive countable failures since the last successful delivery."},"last_success_at":{"type":["string","null"],"format":"date-time","description":"Time of the latest successful delivery; null before the first success."},"last_failure_at":{"type":["string","null"],"format":"date-time","description":"Time of the latest countable failure; null before the first failure."},"last_failure_reason":{"type":["string","null"],"description":"Machine-readable reason for the latest failure; null when none is recorded."},"created_at":{"type":"string","format":"date-time","description":"When the record was created, as an ISO 8601 UTC timestamp."},"updated_at":{"type":"string","format":"date-time","description":"When the represented record last changed, as an ISO 8601 UTC timestamp."}},"example":{"id":"019cf5b0-7c00-7000-8000-000000000010","url":"https://integrations.example.com/tayl/webhooks","events":["user.created","task.completed"],"status":"active","created_by_user_id":"019cf5b0-7c00-7000-8000-000000000002","deactivated_at":null,"consecutive_failures":0,"last_success_at":"2026-03-16T10:00:02Z","last_failure_at":null,"last_failure_reason":null,"created_at":"2026-03-01T09:00:00Z","updated_at":"2026-03-16T10:00:02Z"},"description":"An HTTPS destination and the event types Tayl sends to it."},"WebhookDelivery":{"type":"object","required":["id","webhook_endpoint_id","event_type","event_id","payload","status","status_reason","attempts","next_attempt_at","delivery_started_at","last_attempted_at","response_status","response_body_excerpt","history","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid","description":"Stable UUID for this resource."},"webhook_endpoint_id":{"type":"string","format":"uuid","description":"UUID of the endpoint this delivery targeted."},"event_type":{"$ref":"#/components/schemas/WebhookEventType","description":"Event type carried by the immutable payload."},"event_id":{"type":"string","format":"uuid","description":"UUID shared by this delivery and all deliveries of the same event."},"payload":{"$ref":"#/components/schemas/WebhookEnvelope","description":"Immutable JSON body sent to the endpoint."},"status":{"type":"string","enum":["pending","delivering","sent","failed","abandoned"],"description":"Current processing or lifecycle status."},"status_reason":{"type":["string","null"],"description":"Machine-readable explanation for a failed or abandoned delivery."},"attempts":{"type":"integer","minimum":0,"description":"Number of HTTP attempts made for this delivery."},"next_attempt_at":{"type":["string","null"],"format":"date-time","description":"Scheduled automatic retry time; null when no retry is pending."},"delivery_started_at":{"type":["string","null"],"format":"date-time","description":"When the current worker claimed the delivery; null when not in flight."},"last_attempted_at":{"type":["string","null"],"format":"date-time","description":"Time of the most recent HTTP attempt; null before delivery begins."},"response_status":{"type":["integer","null"],"minimum":100,"maximum":599,"description":"Last endpoint HTTP status; null when no valid response was received."},"response_body_excerpt":{"type":["string","null"],"description":"At most 4 KiB. The exact response body is not retained or exposed."},"history":{"type":"array","maxItems":20,"items":{"$ref":"#/components/schemas/WebhookDeliveryHistoryEntry"},"description":"Up to 20 most recent delivery attempts, oldest first."},"created_at":{"type":"string","format":"date-time","description":"When the record was created, as an ISO 8601 UTC timestamp."},"updated_at":{"type":"string","format":"date-time","description":"When the represented record last changed, as an ISO 8601 UTC timestamp."}},"example":{"id":"019cf5b0-7c00-7000-8000-000000000012","webhook_endpoint_id":"019cf5b0-7c00-7000-8000-000000000010","event_type":"user.created","event_id":"019cf5b0-7c00-7000-8000-000000000011","payload":{"id":"019cf5b0-7c00-7000-8000-000000000011","type":"user.created","created_at":"2026-03-16T10:00:00Z","data":{"id":"019cf5b0-7c00-7000-8000-000000000002","external_id":"usr-1042","email":"alex.chen@example.com","name":"Alex Chen","first_name":"Alex","last_name":"Chen","state":"active","invited_at":"2026-03-10T09:00:00Z","accepted_at":"2026-03-10T09:15:00Z","created_at":"2026-03-10T09:00:00Z","updated_at":"2026-03-16T10:00:00Z"}},"status":"sent","status_reason":null,"attempts":1,"next_attempt_at":null,"delivery_started_at":null,"last_attempted_at":"2026-03-16T10:00:02Z","response_status":204,"response_body_excerpt":"","history":[{"at":"2026-03-16T10:00:02Z","manual":false,"status":204,"error":null,"duration_ms":182}],"created_at":"2026-03-16T10:00:00Z","updated_at":"2026-03-16T10:00:02Z"},"description":"Retained delivery state, immutable event payload, and bounded attempt diagnostics."},"WebhookEnvelope":{"type":"object","additionalProperties":false,"required":["id","type","created_at","data"],"properties":{"id":{"type":"string","format":"uuid","description":"Stable UUID for this resource."},"type":{"$ref":"#/components/schemas/WebhookEventType","description":"Resource or event type discriminator."},"created_at":{"type":"string","format":"date-time","description":"When the record was created, as an ISO 8601 UTC timestamp."},"data":{"type":"object","description":"Resource snapshot captured when the event was emitted."}},"example":{"id":"019cf5b0-7c00-7000-8000-000000000011","type":"user.created","created_at":"2026-03-16T10:00:00Z","data":{"id":"019cf5b0-7c00-7000-8000-000000000002","external_id":"usr-1042","email":"alex.chen@example.com","name":"Alex Chen","first_name":"Alex","last_name":"Chen","state":"active","invited_at":"2026-03-10T09:00:00Z","accepted_at":"2026-03-10T09:15:00Z","created_at":"2026-03-10T09:00:00Z","updated_at":"2026-03-16T10:00:00Z"}},"description":"Immutable event envelope delivered as the raw webhook request body."},"WebhookPayloadUserCreated":{"allOf":[{"$ref":"#/components/schemas/WebhookEnvelope"},{"properties":{"type":{"const":"user.created","description":"Resource or event type discriminator."},"data":{"$ref":"#/components/schemas/User","description":"Resource snapshot captured when the event was emitted."}}}],"description":"Signed webhook envelope emitted when user created.","example":{"id":"019cf5b0-7c00-7000-8000-000000000011","type":"user.created","created_at":"2026-03-16T10:00:00Z","data":{"id":"019cf5b0-7c00-7000-8000-000000000002","external_id":"usr-1042","email":"alex.chen@example.com","name":"Alex Chen","first_name":"Alex","last_name":"Chen","state":"active","invited_at":"2026-03-10T09:00:00Z","accepted_at":"2026-03-10T09:15:00Z","created_at":"2026-03-10T09:00:00Z","updated_at":"2026-03-16T10:00:00Z"}}},"WebhookPayloadUserUpdated":{"allOf":[{"$ref":"#/components/schemas/WebhookEnvelope"},{"properties":{"type":{"const":"user.updated","description":"Resource or event type discriminator."},"data":{"$ref":"#/components/schemas/User","description":"Resource snapshot captured when the event was emitted."}}}],"description":"Signed webhook envelope emitted when user updated.","example":{"id":"019cf5b0-7c00-7000-8000-000000000011","type":"user.updated","created_at":"2026-03-16T10:00:00Z","data":{"id":"019cf5b0-7c00-7000-8000-000000000002","external_id":"usr-1042","email":"alex.chen@example.com","name":"Alex Chen","first_name":"Alex","last_name":"Chen","state":"active","invited_at":"2026-03-10T09:00:00Z","accepted_at":"2026-03-10T09:15:00Z","created_at":"2026-03-10T09:00:00Z","updated_at":"2026-03-16T10:00:00Z"}}},"WebhookPayloadUserArchived":{"allOf":[{"$ref":"#/components/schemas/WebhookEnvelope"},{"properties":{"type":{"const":"user.archived","description":"Resource or event type discriminator."},"data":{"$ref":"#/components/schemas/User","description":"Resource snapshot captured when the event was emitted."}}}],"description":"Signed webhook envelope emitted when user archived.","example":{"id":"019cf5b0-7c00-7000-8000-000000000011","type":"user.archived","created_at":"2026-03-16T10:00:00Z","data":{"id":"019cf5b0-7c00-7000-8000-000000000002","external_id":"usr-1042","email":"alex.chen@example.com","name":"Alex Chen","first_name":"Alex","last_name":"Chen","state":"archived","invited_at":"2026-03-10T09:00:00Z","accepted_at":"2026-03-10T09:15:00Z","created_at":"2026-03-10T09:00:00Z","updated_at":"2026-03-16T10:00:00Z"}}},"WebhookPayloadUserRestored":{"allOf":[{"$ref":"#/components/schemas/WebhookEnvelope"},{"properties":{"type":{"const":"user.restored","description":"Resource or event type discriminator."},"data":{"$ref":"#/components/schemas/User","description":"Resource snapshot captured when the event was emitted."}}}],"description":"Signed webhook envelope emitted when user restored.","example":{"id":"019cf5b0-7c00-7000-8000-000000000011","type":"user.restored","created_at":"2026-03-16T10:00:00Z","data":{"id":"019cf5b0-7c00-7000-8000-000000000002","external_id":"usr-1042","email":"alex.chen@example.com","name":"Alex Chen","first_name":"Alex","last_name":"Chen","state":"active","invited_at":"2026-03-10T09:00:00Z","accepted_at":"2026-03-10T09:15:00Z","created_at":"2026-03-10T09:00:00Z","updated_at":"2026-03-16T10:00:00Z"}}},"WebhookPayloadGroupCreated":{"allOf":[{"$ref":"#/components/schemas/WebhookEnvelope"},{"properties":{"type":{"const":"group.created","description":"Resource or event type discriminator."},"data":{"$ref":"#/components/schemas/Group","description":"Resource snapshot captured when the event was emitted."}}}],"description":"Signed webhook envelope emitted when group created.","example":{"id":"019cf5b0-7c00-7000-8000-000000000011","type":"group.created","created_at":"2026-03-16T10:00:00Z","data":{"id":"019cf5b0-7c00-7000-8000-000000000003","external_id":"loc-london","name":"London","description":"People based at the London site","category_id":"019cf5b0-7c00-7000-8000-000000000004","automatic":false,"rule_user_group_ids":[],"category_made":false,"members_count":18,"created_at":"2026-02-01T09:00:00Z","updated_at":"2026-03-15T11:30:00Z"}}},"WebhookPayloadGroupUpdated":{"allOf":[{"$ref":"#/components/schemas/WebhookEnvelope"},{"properties":{"type":{"const":"group.updated","description":"Resource or event type discriminator."},"data":{"$ref":"#/components/schemas/Group","description":"Resource snapshot captured when the event was emitted."}}}],"description":"Signed webhook envelope emitted when group updated.","example":{"id":"019cf5b0-7c00-7000-8000-000000000011","type":"group.updated","created_at":"2026-03-16T10:00:00Z","data":{"id":"019cf5b0-7c00-7000-8000-000000000003","external_id":"loc-london","name":"London","description":"People based at the London site","category_id":"019cf5b0-7c00-7000-8000-000000000004","automatic":false,"rule_user_group_ids":[],"category_made":false,"members_count":18,"created_at":"2026-02-01T09:00:00Z","updated_at":"2026-03-15T11:30:00Z"}}},"WebhookPayloadGroupArchived":{"allOf":[{"$ref":"#/components/schemas/WebhookEnvelope"},{"properties":{"type":{"const":"group.archived","description":"Resource or event type discriminator."},"data":{"$ref":"#/components/schemas/Group","description":"Resource snapshot captured when the event was emitted."}}}],"description":"Signed webhook envelope emitted when group archived.","example":{"id":"019cf5b0-7c00-7000-8000-000000000011","type":"group.archived","created_at":"2026-03-16T10:00:00Z","data":{"id":"019cf5b0-7c00-7000-8000-000000000003","external_id":"loc-london","name":"London","description":"People based at the London site","category_id":"019cf5b0-7c00-7000-8000-000000000004","automatic":false,"rule_user_group_ids":[],"category_made":false,"members_count":18,"created_at":"2026-02-01T09:00:00Z","updated_at":"2026-03-15T11:30:00Z"}}},"WebhookPayloadGroupMemberAdded":{"allOf":[{"$ref":"#/components/schemas/WebhookEnvelope"},{"properties":{"type":{"const":"group.member_added","description":"Resource or event type discriminator."},"data":{"$ref":"#/components/schemas/WebhookMembershipData","description":"Resource snapshot captured when the event was emitted."}}}],"description":"Signed webhook envelope emitted when group member added.","example":{"id":"019cf5b0-7c00-7000-8000-000000000011","type":"group.member_added","created_at":"2026-03-16T10:00:00Z","data":{"user_id":"019cf5b0-7c00-7000-8000-000000000002","user_external_id":"usr-1042","email":"alex.chen@example.com","name":"Alex Chen","source":"direct","created_at":"2026-03-12T14:30:00Z","group_id":"019cf5b0-7c00-7000-8000-000000000003","group_external_id":"loc-london"}}},"WebhookPayloadGroupMemberRemoved":{"allOf":[{"$ref":"#/components/schemas/WebhookEnvelope"},{"properties":{"type":{"const":"group.member_removed","description":"Resource or event type discriminator."},"data":{"$ref":"#/components/schemas/WebhookMembershipData","description":"Resource snapshot captured when the event was emitted."}}}],"description":"Signed webhook envelope emitted when group member removed.","example":{"id":"019cf5b0-7c00-7000-8000-000000000011","type":"group.member_removed","created_at":"2026-03-16T10:00:00Z","data":{"user_id":"019cf5b0-7c00-7000-8000-000000000002","user_external_id":"usr-1042","email":"alex.chen@example.com","name":"Alex Chen","source":"direct","created_at":"2026-03-12T14:30:00Z","group_id":"019cf5b0-7c00-7000-8000-000000000003","group_external_id":"loc-london"}}},"WebhookPayloadAssignmentCreated":{"allOf":[{"$ref":"#/components/schemas/WebhookEnvelope"},{"properties":{"type":{"const":"assignment.created","description":"Resource or event type discriminator."},"data":{"$ref":"#/components/schemas/Assignment","description":"Resource snapshot captured when the event was emitted."}}}],"description":"Signed webhook envelope emitted when assignment created.","example":{"id":"019cf5b0-7c00-7000-8000-000000000011","type":"assignment.created","created_at":"2026-03-16T10:00:00Z","data":{"id":"019cf5b0-7c00-7000-8000-00000000000b","external_id":"asg-food-safety-london-2026","state":"published","assignable_type":"course","assignable_id":"019cf5b0-7c00-7000-8000-000000000005","assignable_version_id":"019cf5b0-7c00-7000-8000-000000000006","title":"Food safety essentials","targets":[{"type":"group","id":"019cf5b0-7c00-7000-8000-000000000003","external_id":"loc-london"}],"due_in_days":14,"due_on":null,"issues_certificates":true,"requires_recompletion":true,"require_sequential_progress":false,"include_future_members":true,"send_notification":true,"title_override":null,"effective_settings":{"due_in_days":14,"valid_for_months":12,"available_to_recertify_within_days":30,"issues_certificates":true,"minimum_minutes_required":10,"sources":{"due_in_days":{"source":"assignment","required":false,"locked":false},"valid_for_months":{"source":"content_library","required":false,"locked":false},"available_to_recertify_within_days":{"source":"content_library","required":false,"locked":false},"issues_certificates":{"source":"assignment","required":false,"locked":false},"minimum_minutes_required":{"source":"content_library","required":false,"locked":false}}},"published_at":"2026-03-12T09:00:00Z","scheduled_publish_at":null,"archived_at":null,"created_at":"2026-03-12T09:00:00Z","updated_at":"2026-03-12T09:00:00Z"}}},"WebhookPayloadAssignmentUpdated":{"allOf":[{"$ref":"#/components/schemas/WebhookEnvelope"},{"properties":{"type":{"const":"assignment.updated","description":"Resource or event type discriminator."},"data":{"$ref":"#/components/schemas/Assignment","description":"Resource snapshot captured when the event was emitted."}}}],"description":"Signed webhook envelope emitted when assignment updated.","example":{"id":"019cf5b0-7c00-7000-8000-000000000011","type":"assignment.updated","created_at":"2026-03-16T10:00:00Z","data":{"id":"019cf5b0-7c00-7000-8000-00000000000b","external_id":"asg-food-safety-london-2026","state":"published","assignable_type":"course","assignable_id":"019cf5b0-7c00-7000-8000-000000000005","assignable_version_id":"019cf5b0-7c00-7000-8000-000000000006","title":"Food safety essentials","targets":[{"type":"group","id":"019cf5b0-7c00-7000-8000-000000000003","external_id":"loc-london"}],"due_in_days":14,"due_on":null,"issues_certificates":true,"requires_recompletion":true,"require_sequential_progress":false,"include_future_members":true,"send_notification":true,"title_override":null,"effective_settings":{"due_in_days":14,"valid_for_months":12,"available_to_recertify_within_days":30,"issues_certificates":true,"minimum_minutes_required":10,"sources":{"due_in_days":{"source":"assignment","required":false,"locked":false},"valid_for_months":{"source":"content_library","required":false,"locked":false},"available_to_recertify_within_days":{"source":"content_library","required":false,"locked":false},"issues_certificates":{"source":"assignment","required":false,"locked":false},"minimum_minutes_required":{"source":"content_library","required":false,"locked":false}}},"published_at":"2026-03-12T09:00:00Z","scheduled_publish_at":null,"archived_at":null,"created_at":"2026-03-12T09:00:00Z","updated_at":"2026-03-12T09:00:00Z"}}},"WebhookPayloadAssignmentArchived":{"allOf":[{"$ref":"#/components/schemas/WebhookEnvelope"},{"properties":{"type":{"const":"assignment.archived","description":"Resource or event type discriminator."},"data":{"$ref":"#/components/schemas/Assignment","description":"Resource snapshot captured when the event was emitted."}}}],"description":"Signed webhook envelope emitted when assignment archived.","example":{"id":"019cf5b0-7c00-7000-8000-000000000011","type":"assignment.archived","created_at":"2026-03-16T10:00:00Z","data":{"id":"019cf5b0-7c00-7000-8000-00000000000b","external_id":"asg-food-safety-london-2026","state":"archived","assignable_type":"course","assignable_id":"019cf5b0-7c00-7000-8000-000000000005","assignable_version_id":"019cf5b0-7c00-7000-8000-000000000006","title":"Food safety essentials","targets":[{"type":"group","id":"019cf5b0-7c00-7000-8000-000000000003","external_id":"loc-london"}],"due_in_days":14,"due_on":null,"issues_certificates":true,"requires_recompletion":true,"require_sequential_progress":false,"include_future_members":true,"send_notification":true,"title_override":null,"effective_settings":{"due_in_days":14,"valid_for_months":12,"available_to_recertify_within_days":30,"issues_certificates":true,"minimum_minutes_required":10,"sources":{"due_in_days":{"source":"assignment","required":false,"locked":false},"valid_for_months":{"source":"content_library","required":false,"locked":false},"available_to_recertify_within_days":{"source":"content_library","required":false,"locked":false},"issues_certificates":{"source":"assignment","required":false,"locked":false},"minimum_minutes_required":{"source":"content_library","required":false,"locked":false}}},"published_at":"2026-03-12T09:00:00Z","scheduled_publish_at":null,"archived_at":"2026-03-16T10:00:00Z","created_at":"2026-03-12T09:00:00Z","updated_at":"2026-03-16T10:00:00Z"}}},"WebhookPayloadTaskStarted":{"allOf":[{"$ref":"#/components/schemas/WebhookEnvelope"},{"properties":{"type":{"const":"task.started","description":"Resource or event type discriminator."},"data":{"$ref":"#/components/schemas/Task","description":"Resource snapshot captured when the event was emitted."}}}],"description":"Signed webhook envelope emitted when task started.","example":{"id":"019cf5b0-7c00-7000-8000-000000000011","type":"task.started","created_at":"2026-03-16T10:00:00Z","data":{"id":"019cf5b0-7c00-7000-8000-00000000000c","state":"in_progress","status":"in_progress","user_id":"019cf5b0-7c00-7000-8000-000000000002","user_external_id":"usr-1042","assignable_type":"course","assignable_id":"019cf5b0-7c00-7000-8000-000000000005","assignable_version_id":"019cf5b0-7c00-7000-8000-000000000006","title":"Food safety essentials","due_on":"2026-03-26","due_on_paused_at":null,"started_at":"2026-03-16T10:00:00Z","completed_at":null,"progress":null,"latest_completion":null,"current_completion":null,"created_at":"2026-03-12T09:01:00Z","updated_at":"2026-03-16T10:00:00Z"}}},"WebhookPayloadTaskCompleted":{"allOf":[{"$ref":"#/components/schemas/WebhookEnvelope"},{"properties":{"type":{"const":"task.completed","description":"Resource or event type discriminator."},"data":{"$ref":"#/components/schemas/Task","description":"Resource snapshot captured when the event was emitted."}}}],"description":"Signed webhook envelope emitted when task completed.","example":{"id":"019cf5b0-7c00-7000-8000-000000000011","type":"task.completed","created_at":"2026-03-16T10:00:00Z","data":{"id":"019cf5b0-7c00-7000-8000-00000000000c","state":"completed","status":"completed","user_id":"019cf5b0-7c00-7000-8000-000000000002","user_external_id":"usr-1042","assignable_type":"course","assignable_id":"019cf5b0-7c00-7000-8000-000000000005","assignable_version_id":"019cf5b0-7c00-7000-8000-000000000006","title":"Food safety essentials","due_on":"2026-03-26","due_on_paused_at":null,"started_at":"2026-03-15T09:10:00Z","completed_at":"2026-03-16T10:00:00Z","progress":{"percent_complete":100,"time_spent_seconds":1840,"last_interacted_at":"2026-03-16T10:00:00Z"},"latest_completion":{"id":"019cf5b0-7c00-7000-8000-00000000000d","completed_at":"2026-03-16T10:00:00Z","valid_until":"2027-03-16","certificate_reference":"CERT-20260316-A7K2"},"current_completion":{"id":"019cf5b0-7c00-7000-8000-00000000000d","completed_at":"2026-03-16T10:00:00Z","valid_until":"2027-03-16","certificate_reference":"CERT-20260316-A7K2"},"created_at":"2026-03-12T09:01:00Z","updated_at":"2026-03-16T10:00:00Z"}}},"WebhookPayloadTaskOverdue":{"allOf":[{"$ref":"#/components/schemas/WebhookEnvelope"},{"properties":{"type":{"const":"task.overdue","description":"Resource or event type discriminator."},"data":{"$ref":"#/components/schemas/Task","description":"Resource snapshot captured when the event was emitted."}}}],"description":"Signed webhook envelope emitted when task overdue.","example":{"id":"019cf5b0-7c00-7000-8000-000000000011","type":"task.overdue","created_at":"2026-03-16T10:00:00Z","data":{"id":"019cf5b0-7c00-7000-8000-00000000000c","state":"in_progress","status":"overdue","user_id":"019cf5b0-7c00-7000-8000-000000000002","user_external_id":"usr-1042","assignable_type":"course","assignable_id":"019cf5b0-7c00-7000-8000-000000000005","assignable_version_id":"019cf5b0-7c00-7000-8000-000000000006","title":"Food safety essentials","due_on":"2026-03-15","due_on_paused_at":null,"started_at":"2026-03-12T09:10:00Z","completed_at":null,"progress":{"percent_complete":40,"time_spent_seconds":840,"last_interacted_at":"2026-03-15T16:00:00Z"},"latest_completion":null,"current_completion":null,"created_at":"2026-03-12T09:01:00Z","updated_at":"2026-03-16T10:00:00Z"}}},"WebhookPayloadCompletionCreated":{"allOf":[{"$ref":"#/components/schemas/WebhookEnvelope"},{"properties":{"type":{"const":"completion.created","description":"Resource or event type discriminator."},"data":{"$ref":"#/components/schemas/Completion","description":"Resource snapshot captured when the event was emitted."}}}],"description":"Signed webhook envelope emitted when completion created.","example":{"id":"019cf5b0-7c00-7000-8000-000000000011","type":"completion.created","created_at":"2026-03-16T10:00:00Z","data":{"id":"019cf5b0-7c00-7000-8000-00000000000d","task_id":"019cf5b0-7c00-7000-8000-00000000000c","user_id":"019cf5b0-7c00-7000-8000-000000000002","user_external_id":"usr-1042","assignable_type":"course","assignable_id":"019cf5b0-7c00-7000-8000-000000000005","assignable_version_id":"019cf5b0-7c00-7000-8000-000000000006","title":"Food safety essentials","learner_name":"Alex Chen","completed_at":"2026-03-16T10:00:00Z","valid_until":"2027-03-16","time_spent_seconds":1840,"certificate_reference":"CERT-20260316-A7K2","created_at":"2026-03-16T10:00:00Z","updated_at":"2026-03-16T10:00:00Z"}}},"WebhookPayloadCertificateIssued":{"allOf":[{"$ref":"#/components/schemas/WebhookEnvelope"},{"properties":{"type":{"const":"certificate.issued","description":"Resource or event type discriminator."},"data":{"$ref":"#/components/schemas/Certificate","description":"Resource snapshot captured when the event was emitted."}}}],"description":"Signed webhook envelope emitted when certificate issued.","example":{"id":"019cf5b0-7c00-7000-8000-000000000011","type":"certificate.issued","created_at":"2026-03-16T10:00:00Z","data":{"id":"019cf5b0-7c00-7000-8000-00000000000d","certificate_reference":"CERT-20260316-A7K2","issued_at":"2026-03-16T10:00:00Z","valid_until":"2027-03-16","learner_name":"Alex Chen","user_id":"019cf5b0-7c00-7000-8000-000000000002","user_external_id":"usr-1042","task_id":"019cf5b0-7c00-7000-8000-00000000000c","course_id":"019cf5b0-7c00-7000-8000-000000000005","course_title":"Food safety essentials"}}},"WebhookPayloadSignableSigned":{"allOf":[{"$ref":"#/components/schemas/WebhookEnvelope"},{"properties":{"type":{"const":"signable.signed","description":"Resource or event type discriminator."},"data":{"$ref":"#/components/schemas/WebhookSignableSignedData","description":"Resource snapshot captured when the event was emitted."}}}],"description":"Signed webhook envelope emitted when signable signed.","example":{"id":"019cf5b0-7c00-7000-8000-000000000011","type":"signable.signed","created_at":"2026-03-16T10:00:00Z","data":{"id":"019cf5b0-7c00-7000-8000-000000000013","task_id":"019cf5b0-7c00-7000-8000-00000000000c","user_id":"019cf5b0-7c00-7000-8000-000000000002","user_external_id":"usr-1042","assignable_type":"signable_document","assignable_id":"019cf5b0-7c00-7000-8000-000000000009","assignable_version_id":"019cf5b0-7c00-7000-8000-00000000000a","signable_chapter_id":null,"title":"Employee handbook","signed_at":"2026-03-16T10:00:00Z","time_spent_reading_seconds":420,"created_at":"2026-03-16T10:00:00Z","updated_at":"2026-03-16T10:00:00Z"}}},"ExternalId":{"type":"string","maxLength":255,"description":"Caller-owned identifier, unique within the organisation. Matched case-sensitively; surrounding whitespace is stripped.","example":"usr-1042"},"NullableExternalId":{"type":["string","null"],"maxLength":255,"description":"Caller-owned identifier, unique within the organisation. Matched case-sensitively; surrounding whitespace is stripped.","example":"usr-1042"},"User":{"type":"object","description":"A member of the organisation (an OrganisationUser). `state` tracks the membership lifecycle; archived users are retained with their learning history.","required":["id","external_id","email","name","first_name","last_name","state","invited_at","accepted_at","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid","description":"Tayl UUID."},"external_id":{"$ref":"#/components/schemas/NullableExternalId","description":"Caller-owned identifier used to reconcile this record with the source system."},"email":{"type":"string","format":"email","description":"The organisation contact email, normalised to lowercase."},"name":{"type":"string","description":"Display name: the linked account's name, the invited name, or the email."},"first_name":{"type":["string","null"],"description":"From the linked user account; null until the invitation is accepted."},"last_name":{"type":["string","null"],"description":"From the linked user account; null until the invitation is accepted."},"state":{"type":"string","enum":["pending","invited","onboarding","active","non_compliant","paused","suspended","archived"],"description":"Current lifecycle state of the resource."},"invited_at":{"type":["string","null"],"format":"date-time","description":"When Tayl most recently sent the invitation; null when no invitation was sent."},"accepted_at":{"type":["string","null"],"format":"date-time","description":"When the person accepted their invitation; null until acceptance."},"created_at":{"type":"string","format":"date-time","description":"When the record was created, as an ISO 8601 UTC timestamp."},"updated_at":{"type":"string","format":"date-time","description":"When the represented record last changed, as an ISO 8601 UTC timestamp."}},"example":{"id":"019cf5b0-7c00-7000-8000-000000000002","external_id":"usr-1042","email":"alex.chen@example.com","name":"Alex Chen","first_name":"Alex","last_name":"Chen","state":"active","invited_at":"2026-03-10T09:00:00Z","accepted_at":"2026-03-10T09:15:00Z","created_at":"2026-03-10T09:00:00Z","updated_at":"2026-03-16T10:00:00Z"}},"UserList":{"type":"object","required":["users","meta"],"properties":{"users":{"type":"array","items":{"$ref":"#/components/schemas/User"},"description":"Users on this page."},"meta":{"$ref":"#/components/schemas/Meta","description":"Metadata describing this page or bulk operation."}},"example":{"users":[{"id":"019cf5b0-7c00-7000-8000-000000000002","external_id":"usr-1042","email":"alex.chen@example.com","name":"Alex Chen","first_name":"Alex","last_name":"Chen","state":"active","invited_at":"2026-03-10T09:00:00Z","accepted_at":"2026-03-10T09:15:00Z","created_at":"2026-03-10T09:00:00Z","updated_at":"2026-03-16T10:00:00Z"}],"meta":{"page":1,"per_page":25,"total_pages":1,"total_count":1}},"description":"One page of organisation users and its pagination metadata."},"ErrorItem":{"type":"object","required":["code","message","documentation_url"],"properties":{"code":{"type":"string","description":"Machine-readable error code, such as `validation_error`."},"message":{"type":"string","description":"Human-readable description."},"field":{"type":"string","description":"Offending field, for validation errors."},"pointer":{"type":"string","description":"JSON pointer to the offending field."},"existing_id":{"type":"string","format":"uuid","description":"For duplicate_external_id errors: the Tayl UUID of the record already holding the external_id, when the key can see it."},"documentation_url":{"type":"string","format":"uri","description":"The error reference's entry for this code: what it means and how to fix it."}},"example":{"code":"validation_error","message":"is invalid","field":"email","pointer":"/data/email","documentation_url":"https://tayl.pro/api/v1/docs/errors#validation_error"},"description":"One machine-readable problem in the standard API error envelope."},"UserGroupReference":{"type":"object","description":"Names a group by exactly one of `group_id` (Tayl UUID) or `group_external_id` (yours).","properties":{"group_id":{"type":"string","format":"uuid","description":"The group's Tayl UUID."},"group_external_id":{"$ref":"#/components/schemas/ExternalId","minLength":1,"description":"The group's `external_id`."}},"example":{"group_external_id":"site-12"}},"UserInput":{"type":"object","required":["email"],"properties":{"email":{"type":"string","format":"email","description":"The organisation contact email, normalised to lowercase."},"first_name":{"type":"string","description":"Stored with last_name as the invited display name, returned in `name`. `first_name`/`last_name` read null until the person accepts and links their account."},"last_name":{"type":"string","description":"See first_name."},"external_id":{"$ref":"#/components/schemas/NullableExternalId","description":"Caller-owned identifier used to reconcile this record with the source system."},"groups":{"type":"array","maxItems":100,"items":{"$ref":"#/components/schemas/UserGroupReference"},"description":"Manual or rule-based groups to add the person to. A manager's personal key must name at least one group they manage, so the person lands in their reach; an entry naming a group the key can't add people to fails with `422 validation_error`."}},"example":{"email":"alex.chen@example.com","first_name":"Alex","last_name":"Chen","external_id":"usr-1042","groups":[{"group_external_id":"site-12"}]},"description":"Fields for adding one person."},"BulkUserInput":{"type":"object","description":"Same fields as UserInput, but deliberately without schema-level required fields: entries are validated server-side per entry, so a missing or invalid field (email included) fails that entry with a per-entry 422, never the whole request.","properties":{"email":{"type":"string","format":"email","description":"The organisation contact email, normalised to lowercase."},"first_name":{"type":"string","description":"Stored with last_name as the invited display name, returned in `name`. `first_name`/`last_name` read null until the person accepts and links their account."},"last_name":{"type":"string","description":"See first_name."},"external_id":{"$ref":"#/components/schemas/NullableExternalId","description":"Caller-owned identifier used to reconcile this record with the source system."},"groups":{"type":"array","maxItems":100,"items":{"$ref":"#/components/schemas/UserGroupReference"},"description":"Manual or rule-based groups to add the person to. A manager's personal key must name at least one group they manage, so the person lands in their reach; an entry naming a group the key can't add people to fails with `422 validation_error`."}},"example":{"email":"alex.chen@example.com","first_name":"Alex","last_name":"Chen","external_id":"usr-1042","groups":[{"group_external_id":"site-12"}]}},"BulkUsersRequest":{"type":"object","required":["users"],"properties":{"users":{"type":"array","minItems":1,"maxItems":500,"items":{"$ref":"#/components/schemas/BulkUserInput"},"description":"Users on this page."}},"example":{"users":[{"email":"alex.chen@example.com","first_name":"Alex","last_name":"Chen","external_id":"usr-1042"}]},"description":"Up to 500 users, each checked and added on its own."},"BulkUsersResult":{"type":"object","description":"One entry per submitted user, in submission order. The HTTP status is 201 when every entry succeeded, 207 on partial success, 422 when every entry failed.","required":["results","meta"],"properties":{"results":{"type":"array","items":{"type":"object","required":["index","status","errors"],"properties":{"index":{"type":"integer","description":"Position in the submitted array."},"status":{"type":"integer","description":"Per-entry outcome: 201 created, 409 duplicate external_id, 422 invalid."},"user":{"oneOf":[{"$ref":"#/components/schemas/User"},{"type":"null"}],"description":"Created user, or null when this entry failed."},"errors":{"type":"array","items":{"$ref":"#/components/schemas/ErrorItem"},"description":"Structured errors; empty for a successful bulk entry."}}},"description":"Per-entry outcomes in the same order as the submitted entries."},"meta":{"type":"object","required":["total","succeeded","failed"],"properties":{"total":{"type":"integer","description":"Number of submitted entries."},"succeeded":{"type":"integer","description":"Number of entries that succeeded."},"failed":{"type":"integer","description":"Number of entries that failed."}},"description":"Metadata describing this page or bulk operation."}},"example":{"results":[{"index":0,"status":201,"user":{"id":"019cf5b0-7c00-7000-8000-000000000002","external_id":"usr-1042","email":"alex.chen@example.com","name":"Alex Chen","first_name":"Alex","last_name":"Chen","state":"active","invited_at":"2026-03-10T09:00:00Z","accepted_at":"2026-03-10T09:15:00Z","created_at":"2026-03-10T09:00:00Z","updated_at":"2026-03-16T10:00:00Z"},"errors":[]}],"meta":{"total":1,"succeeded":1,"failed":0}}},"UserUpdateInput":{"type":"object","description":"Fields you leave out keep their values. Name fields are refused once the user has accepted their invitation, as the name then belongs to their account, and `first_name` and `last_name` must be sent together, as the invited name is stored as one string. For accepted users, changing `email` changes only the address the organisation contacts and matches them by, as HR sync does; their Tayl sign-in email is theirs and stays as it is. The changed address stays unconfirmed until the person confirms it, and emails only go there if they choose it. For invited users, changing `email` re-sends their invitation to the new address, and the previous invitation link stops working.","properties":{"email":{"type":"string","format":"email","description":"The organisation contact email, normalised to lowercase."},"first_name":{"type":"string","description":"The person's given name."},"last_name":{"type":"string","description":"The person's family name."},"external_id":{"$ref":"#/components/schemas/NullableExternalId","description":"Caller-owned identifier used to reconcile this record with the source system."}},"example":{"email":"alex.chen@example.net","external_id":"usr-1042"}},"Group":{"type":"object","description":"A group of people. Automatic groups (`automatic: true`) are maintained by Tayl and read-only through the API. Rule-based groups (a non-empty `rule_user_group_ids`, `category_made: true`) are made only by Tayl, as a group category's subgroups: each holds everyone in both of the groups its rule names, and is read-only here apart from its memberships. People added to one directly (`source` `direct`) are in those groups through it.","required":["id","external_id","name","description","category_id","automatic","rule_user_group_ids","category_made","members_count","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid","description":"Tayl UUID."},"external_id":{"$ref":"#/components/schemas/NullableExternalId","description":"Caller-owned identifier used to reconcile this record with the source system."},"name":{"type":"string","description":"Human-readable name shown in Tayl."},"description":{"type":["string","null"],"description":"Optional explanatory text. Automatic groups describe the organisation's current criteria; changing those criteria advances updated_at and emits group.updated for the current group."},"category_id":{"type":["string","null"],"format":"uuid","description":"Group category UUID (see /group-categories)."},"automatic":{"type":"boolean","description":"Whether Tayl maintains it automatically, so it can't be changed by hand or through the API."},"rule_user_group_ids":{"type":"array","items":{"type":"string","format":"uuid"},"description":"For a rule-based group, the two groups its members are all in: the group it is a subgroup of, then the other. Empty for a manual or automatic group. Only Tayl makes rule-based groups, so a create or update ignores this field."},"category_made":{"type":"boolean","description":"Whether Tayl made this rule-based group as a group category's subgroup, such as Bristol · Bar Staff when Location makes subgroups by Job Role. Tayl names it and keeps it up to date, so it can't be changed or deleted through the API, though people can be added to it directly."},"members_count":{"type":"integer","description":"Active member count."},"created_at":{"type":"string","format":"date-time","description":"When the record was created, as an ISO 8601 UTC timestamp."},"updated_at":{"type":"string","format":"date-time","description":"When the represented record last changed, as an ISO 8601 UTC timestamp."}},"example":{"id":"019cf5b0-7c00-7000-8000-000000000003","external_id":"loc-london","name":"London","description":"People based at the London site","category_id":"019cf5b0-7c00-7000-8000-000000000004","automatic":false,"rule_user_group_ids":[],"category_made":false,"members_count":18,"created_at":"2026-02-01T09:00:00Z","updated_at":"2026-03-15T11:30:00Z"}},"GroupList":{"type":"object","required":["groups","meta"],"properties":{"groups":{"type":"array","items":{"$ref":"#/components/schemas/Group"},"description":"Groups on this page."},"meta":{"$ref":"#/components/schemas/Meta","description":"Metadata describing this page or bulk operation."}},"example":{"groups":[{"id":"019cf5b0-7c00-7000-8000-000000000003","external_id":"loc-london","name":"London","description":"People based at the London site","category_id":"019cf5b0-7c00-7000-8000-000000000004","automatic":false,"rule_user_group_ids":[],"category_made":false,"members_count":18,"created_at":"2026-02-01T09:00:00Z","updated_at":"2026-03-15T11:30:00Z"}],"meta":{"page":1,"per_page":25,"total_pages":1,"total_count":1}},"description":"One page of groups and its pagination metadata."},"GroupInput":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"Human-readable name shown in Tayl."},"description":{"type":["string","null"],"description":"Optional explanatory text shown with the resource."},"category_id":{"type":["string","null"],"format":"uuid","description":"Must be a category in your organisation (see /group-categories)."},"external_id":{"$ref":"#/components/schemas/NullableExternalId","description":"Caller-owned identifier used to reconcile this record with the source system."}},"example":{"name":"London","description":"People based at the London site","category_id":"019cf5b0-7c00-7000-8000-000000000004","external_id":"loc-london"},"description":"Fields accepted when creating a group."},"GroupUpdateInput":{"type":"object","description":"Fields you leave out keep their values.","properties":{"name":{"type":"string","description":"Human-readable name shown in Tayl."},"description":{"type":["string","null"],"description":"Optional explanatory text shown with the resource."},"category_id":{"type":["string","null"],"format":"uuid","description":"Must be a category in your organisation (see /group-categories)."},"external_id":{"$ref":"#/components/schemas/NullableExternalId","description":"Caller-owned identifier used to reconcile this record with the source system."}},"example":{"name":"London team","description":"People based at the London site"}},"Membership":{"type":"object","description":"A person's membership of a group. `source` records how it arose; only `direct` memberships can be managed through the API.","required":["user_id","user_external_id","email","name","source","created_at"],"properties":{"user_id":{"type":"string","format":"uuid","description":"The member's Tayl user UUID."},"user_external_id":{"$ref":"#/components/schemas/NullableExternalId","description":"Caller-owned identifier of the learner, when set."},"email":{"type":"string","format":"email","description":"The organisation contact email, normalised to lowercase."},"name":{"type":"string","description":"Human-readable name shown in Tayl."},"source":{"type":"string","enum":["direct","inclusion","automatic","integration","rule"],"description":"How the membership was created and whether callers can remove it."},"created_at":{"type":"string","format":"date-time","description":"When the record was created, as an ISO 8601 UTC timestamp."}},"example":{"user_id":"019cf5b0-7c00-7000-8000-000000000002","user_external_id":"usr-1042","email":"alex.chen@example.com","name":"Alex Chen","source":"direct","created_at":"2026-03-12T14:30:00Z"}},"MembershipList":{"type":"object","required":["memberships","meta"],"properties":{"memberships":{"type":"array","items":{"$ref":"#/components/schemas/Membership"},"description":"Memberships in the request, result, or current page."},"meta":{"$ref":"#/components/schemas/Meta","description":"Metadata describing this page or bulk operation."}},"example":{"memberships":[{"user_id":"019cf5b0-7c00-7000-8000-000000000002","user_external_id":"usr-1042","email":"alex.chen@example.com","name":"Alex Chen","source":"direct","created_at":"2026-03-12T14:30:00Z"}],"meta":{"page":1,"per_page":25,"total_pages":1,"total_count":1}},"description":"One page of active memberships for a group."},"MembershipEntry":{"type":"object","description":"Names a current user by exactly one of `user_id` (Tayl UUID) or `user_external_id` (yours). Entries in one request can mix them. Each entry is checked on its own, so a malformed identifier, an archived user, or an entry naming both identifiers or neither fails with its own 422, never the whole request.","properties":{"user_id":{"type":"string","format":"uuid","description":"UUID of the learner or organisation user."},"user_external_id":{"$ref":"#/components/schemas/ExternalId","minLength":1,"description":"Caller-owned identifier of the learner, when set."}},"example":{"user_external_id":"usr-1042"}},"MembershipsRequest":{"type":"object","required":["memberships"],"properties":{"memberships":{"type":"array","minItems":1,"maxItems":500,"items":{"$ref":"#/components/schemas/MembershipEntry"},"description":"Memberships in the request, result, or current page."}},"example":{"memberships":[{"user_external_id":"usr-1042"}]},"description":"Users to add to or remove from a group, identified independently."},"BulkMembershipsResult":{"type":"object","description":"One entry per submitted membership, in submission order. Add: 201 added (or restored), 200 already a member (idempotent). Remove: 200 direct membership removed (the user stays a member through any group this group includes), 404 not a direct member.","required":["results","meta"],"properties":{"results":{"type":"array","items":{"type":"object","required":["index","status","errors"],"properties":{"index":{"type":"integer","description":"Zero-based position of the submitted entry."},"status":{"type":"integer","description":"This entry's outcome: 200 or 201 succeeded, 404 user or membership not found, 422 invalid identifier or archived user."},"membership":{"oneOf":[{"$ref":"#/components/schemas/Membership"},{"type":"null"}],"description":"Affected membership, or null when this entry failed."},"errors":{"type":"array","items":{"$ref":"#/components/schemas/ErrorItem"},"description":"Structured errors; empty for a successful bulk entry."}}},"description":"Per-entry outcomes in the same order as the submitted entries."},"meta":{"type":"object","required":["total","succeeded","failed"],"properties":{"total":{"type":"integer","description":"Number of submitted entries."},"succeeded":{"type":"integer","description":"Number of entries that succeeded."},"failed":{"type":"integer","description":"Number of entries that failed."}},"description":"Metadata describing this page or bulk operation."}},"example":{"results":[{"index":0,"status":201,"membership":{"user_id":"019cf5b0-7c00-7000-8000-000000000002","user_external_id":"usr-1042","email":"alex.chen@example.com","name":"Alex Chen","source":"direct","created_at":"2026-03-12T14:30:00Z"},"errors":[]}],"meta":{"total":1,"succeeded":1,"failed":0}}},"CategoryColour":{"type":"string","description":"One of Tayl's category colours.","enum":["gray","slate","red","orange","amber","yellow","lime","green","teal","blue","indigo","purple","pink"],"example":"blue"},"CategoryIcon":{"type":"string","description":"One of Tayl's category icons.","enum":["tag","badge","badge-check","book","briefcase","briefcase-business","briefcase-medical","brush","building","camera","chart-line","clipboard-check","clipboard-list","clock","droplet","film","flame","flask-conical","globe","graduation-cap","hand-heart","headset","heart","hotel","id-card","laptop","leaf","lightbulb","map-pin","map-pinned","palette","pencil","puzzle","scale","settings","shield","sparkles","star","store","truck","users","utensils","wrench"],"example":"map-pin"},"GroupCategory":{"type":"object","description":"A group category, one of the ways the organisation sorts its groups, such as Department or Location. The system \"Automatic\" category is read-only.","required":["id","external_id","name","description","colour","icon","position","automatic","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid","description":"Tayl UUID."},"external_id":{"$ref":"#/components/schemas/NullableExternalId","description":"Caller-owned identifier used to reconcile this record with the source system."},"name":{"type":"string","description":"Human-readable name shown in Tayl."},"description":{"type":["string","null"],"description":"Optional explanatory text shown with the resource."},"colour":{"$ref":"#/components/schemas/CategoryColour","description":"Named colour used to distinguish the category in Tayl."},"icon":{"$ref":"#/components/schemas/CategoryIcon","description":"Named icon used to represent the category in Tayl."},"position":{"type":"integer","description":"Zero-based display order within the organisation's categories."},"automatic":{"type":"boolean","description":"Whether Tayl maintains it automatically, so it can't be changed by hand or through the API."},"created_at":{"type":"string","format":"date-time","description":"When the record was created, as an ISO 8601 UTC timestamp."},"updated_at":{"type":"string","format":"date-time","description":"When the represented record last changed, as an ISO 8601 UTC timestamp."}},"example":{"id":"019cf5b0-7c00-7000-8000-000000000004","external_id":"category-location","name":"Location","description":"The site where a person works","colour":"blue","icon":"map-pin","position":2,"automatic":false,"created_at":"2026-01-12T08:30:00Z","updated_at":"2026-03-01T12:00:00Z"}},"GroupCategoryList":{"type":"object","required":["group_categories","meta"],"properties":{"group_categories":{"type":"array","items":{"$ref":"#/components/schemas/GroupCategory"},"description":"Group categories on this page."},"meta":{"$ref":"#/components/schemas/Meta","description":"Metadata describing this page or bulk operation."}},"example":{"group_categories":[{"id":"019cf5b0-7c00-7000-8000-000000000004","external_id":"category-location","name":"Location","description":"The site where a person works","colour":"blue","icon":"map-pin","position":2,"automatic":false,"created_at":"2026-01-12T08:30:00Z","updated_at":"2026-03-01T12:00:00Z"}],"meta":{"page":1,"per_page":25,"total_pages":1,"total_count":1}},"description":"One ordered page of group categories and its pagination metadata."},"GroupCategoryInput":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"Human-readable name shown in Tayl."},"description":{"type":["string","null"],"description":"Optional explanatory text shown with the resource."},"colour":{"$ref":"#/components/schemas/CategoryColour","description":"Named colour used to distinguish the category in Tayl."},"icon":{"$ref":"#/components/schemas/CategoryIcon","description":"Named icon used to represent the category in Tayl."},"external_id":{"$ref":"#/components/schemas/NullableExternalId","description":"Caller-owned identifier used to reconcile this record with the source system."}},"example":{"name":"Location","description":"The site where a person works","colour":"blue","icon":"map-pin","external_id":"category-location"},"description":"Fields accepted when adding an organisation taxonomy category."},"GroupCategoryUpdateInput":{"type":"object","description":"Fields you leave out keep their values.","properties":{"name":{"type":"string","description":"Human-readable name shown in Tayl."},"description":{"type":["string","null"],"description":"Optional explanatory text shown with the resource."},"colour":{"$ref":"#/components/schemas/CategoryColour","description":"Named colour used to distinguish the category in Tayl."},"icon":{"$ref":"#/components/schemas/CategoryIcon","description":"Named icon used to represent the category in Tayl."},"external_id":{"$ref":"#/components/schemas/NullableExternalId","description":"Caller-owned identifier used to reconcile this record with the source system."}},"example":{"description":"The primary site where a person works","colour":"indigo"}},"Course":{"type":"object","description":"A published course the organisation can see, or one of its own drafts or archived courses. Pass a published course's `id` as `assignable_id` (with `assignable_type: course`) when creating an assignment; learners get the current published version.","required":["id","title","status","platform_course","syncs_from_v2","in_library","compliance_training","current_version_id","published_at","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid","description":"Tayl UUID."},"title":{"type":["string","null"],"description":"Title shown to managers and learners. Null only for an unfinished `autosaved` draft."},"description":{"type":["string","null"],"description":"Optional explanatory text shown with the resource."},"status":{"type":"string","description":"`draft` until first published; `autosaved` is a draft never saved explicitly. Only a published course can be assigned.","enum":["draft","autosaved","published","archived"]},"platform_course":{"type":"boolean","description":"True for courses from the Tayl platform catalogue."},"syncs_from_v2":{"type":"boolean","description":"True while a Tayl course still syncs from Taylv2. The first change saved to its draft stops that for good, so check with the person first."},"in_library":{"type":"boolean","description":"Whether the course is in the organisation's content library. Must be true before the course can be assigned; an admin or content manager adds Tayl's courses to the library in Tayl."},"compliance_training":{"type":["boolean","null"],"description":"The organisation's current compliance policy for this course. Null when the course is visible but not in its library."},"current_version_id":{"type":["string","null"],"format":"uuid","description":"UUID of the current published version, which new assignments deliver."},"current_version_number":{"type":["integer","null"],"description":"Human-facing number of the current published version."},"published_at":{"type":["string","null"],"format":"date-time","description":"When the course was first published. Null for a draft."},"created_at":{"type":"string","format":"date-time","description":"When the record was created, as an ISO 8601 UTC timestamp."},"updated_at":{"type":"string","format":"date-time","description":"When the represented record last changed, as an ISO 8601 UTC timestamp."}},"example":{"id":"019cf5b0-7c00-7000-8000-000000000005","title":"Food safety essentials","description":"Safe food handling for new starters","status":"published","platform_course":true,"syncs_from_v2":false,"in_library":true,"compliance_training":true,"current_version_id":"019cf5b0-7c00-7000-8000-000000000006","current_version_number":3,"published_at":"2026-02-20T10:00:00Z","created_at":"2025-11-01T09:00:00Z","updated_at":"2026-02-20T10:00:00Z"}},"CourseList":{"type":"object","required":["courses","meta"],"properties":{"courses":{"type":"array","items":{"$ref":"#/components/schemas/Course"},"description":"Courses on this page."},"meta":{"$ref":"#/components/schemas/Meta","description":"Metadata describing this page or bulk operation."}},"example":{"courses":[{"id":"019cf5b0-7c00-7000-8000-000000000005","title":"Food safety essentials","description":"Safe food handling for new starters","status":"published","platform_course":true,"syncs_from_v2":false,"in_library":true,"compliance_training":true,"current_version_id":"019cf5b0-7c00-7000-8000-000000000006","current_version_number":3,"published_at":"2026-02-20T10:00:00Z","created_at":"2025-11-01T09:00:00Z","updated_at":"2026-02-20T10:00:00Z"}],"meta":{"page":1,"per_page":25,"total_pages":1,"total_count":1}},"description":"One page of courses."},"CourseBlockWrapper":{"type":"object","description":"The band a block sits in on the page. Tayl ignores its background on blocks that draw their own card: highlight, quote, text_over_image, carousel, accordion, tab_list, table, knowledge_check, embed and the charts.","properties":{"background_color":{"type":["string","null"],"description":"Background colour of the band. Null leaves it transparent."},"background_color_dark":{"type":["string","null"],"description":"Colour used when learners view in dark mode. Null keeps the light colour, or a dark tint of it when it is pale. Ignored when the light colour is null."},"padding_top":{"type":["integer","null"],"description":"Extra space above the block, in pixels. Older courses only; leave null.","minimum":0,"maximum":2147483647},"padding_bottom":{"type":["integer","null"],"description":"Extra space below the block, in pixels. Older courses only; leave null.","minimum":0,"maximum":2147483647},"min_height":{"type":["integer","null"],"description":"Minimum height in viewport-height units, used by imported banner images. Leave null.","minimum":0,"maximum":2147483647},"heading_font":{"type":["string","null"],"enum":["sans","serif","rounded","monospace",null],"description":"Heading typeface for this block. Null uses the course font."},"body_font":{"type":["string","null"],"enum":["sans","serif","rounded","monospace",null],"description":"Body typeface for this block. Null uses the course font."}},"additionalProperties":false,"example":{"background_color":"#eef2fb","background_color_dark":"#1c2a4f","padding_top":null,"padding_bottom":null,"min_height":null,"heading_font":null,"body_font":null}},"CourseBlockText":{"type":"object","description":"Paragraphs of rich text.","required":["type"],"properties":{"id":{"type":["string","null"],"format":"uuid","description":"The block's ID, as read. Send it to keep this block, or leave it out for a new one. A block moves to another page by appearing there."},"type":{"type":"string","const":"text","description":"Always `text`."},"html":{"type":["string","null"],"description":"Rich text as HTML. Tags and styles outside Tayl's allowed set are removed when learners see it."},"appearance":{"type":"object","description":"Presentation settings. Null values use the builder's defaults.","properties":{"text_color":{"type":["string","null"],"description":"Text colour. Null is the normal text colour."},"text_color_dark":{"type":["string","null"],"description":"Colour used when learners view in dark mode. Null keeps the light colour where it's easy to read in dark mode, and otherwise adjusts its lightness until it is. Ignored when the light colour is null."},"text_align":{"type":["string","null"],"enum":["left","center","right",null],"description":"Horizontal alignment."}},"additionalProperties":false},"wrapper":{"$ref":"#/components/schemas/CourseBlockWrapper","description":"The band the block sits in."}},"additionalProperties":false,"example":{"type":"text","html":"<p>Every dish must list its allergens.</p>"}},"CourseBlockLargeText":{"type":"object","description":"Large plain text. Kept for older courses; use `text` or `header` instead.","required":["type"],"properties":{"id":{"type":["string","null"],"format":"uuid","description":"The block's ID, as read. Send it to keep this block, or leave it out for a new one. A block moves to another page by appearing there."},"type":{"type":"string","const":"large_text","description":"Always `large_text`."},"text":{"type":["string","null"],"description":"Plain text; line breaks are kept."},"appearance":{"type":"object","description":"Presentation settings. Null values use the builder's defaults.","properties":{"text_color":{"type":["string","null"],"description":"Text colour. Null uses the course's theme colour, or the normal text colour."},"text_color_dark":{"type":["string","null"],"description":"Colour used when learners view in dark mode. Null keeps the light colour where it's easy to read in dark mode, and otherwise adjusts its lightness until it is. Ignored when the light colour is null."},"text_align":{"type":["string","null"],"enum":["left","center","right",null],"description":"Horizontal alignment."}},"additionalProperties":false},"wrapper":{"$ref":"#/components/schemas/CourseBlockWrapper","description":"The band the block sits in."}},"additionalProperties":false,"example":{"type":"large_text","text":"Ask every guest about allergies."}},"CourseBlockHeader":{"type":"object","description":"A heading with an optional subtitle.","required":["type"],"properties":{"id":{"type":["string","null"],"format":"uuid","description":"The block's ID, as read. Send it to keep this block, or leave it out for a new one. A block moves to another page by appearing there."},"type":{"type":"string","const":"header","description":"Always `header`."},"title":{"type":["string","null"],"description":"Heading text."},"subtitle":{"type":["string","null"],"description":"Smaller text under the heading."},"level":{"type":["string","null"],"enum":["h1","h2","h3",null],"description":"Heading level. Null is `h2`."},"appearance":{"type":"object","description":"Presentation settings. Null values use the builder's defaults.","properties":{"text_color":{"type":["string","null"],"description":"Text colour. Null uses the course's theme colour, or the normal text colour."},"text_color_dark":{"type":["string","null"],"description":"Colour used when learners view in dark mode. Null keeps the light colour where it's easy to read in dark mode, and otherwise adjusts its lightness until it is. Ignored when the light colour is null."},"title_align":{"type":["string","null"],"enum":["left","center","right",null],"description":"Horizontal alignment."}},"additionalProperties":false},"wrapper":{"$ref":"#/components/schemas/CourseBlockWrapper","description":"The band the block sits in."}},"additionalProperties":false,"example":{"type":"header","title":"The 14 allergens","subtitle":"What the law requires","level":"h2"}},"CourseBlockHighlight":{"type":"object","description":"A callout box for a tip, warning or alert.","required":["type"],"properties":{"id":{"type":["string","null"],"format":"uuid","description":"The block's ID, as read. Send it to keep this block, or leave it out for a new one. A block moves to another page by appearing there."},"type":{"type":"string","const":"highlight","description":"Always `highlight`."},"html":{"type":["string","null"],"description":"Rich text as HTML. Tags and styles outside Tayl's allowed set are removed when learners see it."},"style":{"type":["string","null"],"enum":["info","warning","alert",null],"description":"Callout style. Null is `info`."},"appearance":{"type":"object","description":"Presentation settings. Null values use the builder's defaults.","properties":{"text_color":{"type":["string","null"],"description":"Text colour. Null is the normal text colour."},"text_color_dark":{"type":["string","null"],"description":"Colour used when learners view in dark mode. Null keeps the light colour where it's easy to read in dark mode, and otherwise adjusts its lightness until it is. Ignored when the light colour is null."}},"additionalProperties":false},"wrapper":{"$ref":"#/components/schemas/CourseBlockWrapper","description":"The band the block sits in."}},"additionalProperties":false,"example":{"type":"highlight","html":"<p>Never guess an ingredient.</p>","style":"warning"}},"CourseBlockQuote":{"type":"object","description":"A quotation.","required":["type"],"properties":{"id":{"type":["string","null"],"format":"uuid","description":"The block's ID, as read. Send it to keep this block, or leave it out for a new one. A block moves to another page by appearing there."},"type":{"type":"string","const":"quote","description":"Always `quote`."},"html":{"type":["string","null"],"description":"Rich text as HTML. Tags and styles outside Tayl's allowed set are removed when learners see it."},"author":{"type":["string","null"],"description":"Who said it, as HTML."},"style":{"type":["string","null"],"enum":["default","pullquote",null],"description":"`default` is a bordered card; `pullquote` is large centred text. Null is `default`."},"appearance":{"type":"object","description":"Presentation settings. Null values use the builder's defaults.","properties":{"text_color":{"type":["string","null"],"description":"Text colour. Null is the normal text colour."},"text_color_dark":{"type":["string","null"],"description":"Colour used when learners view in dark mode. Null keeps the light colour where it's easy to read in dark mode, and otherwise adjusts its lightness until it is. Ignored when the light colour is null."},"background_color":{"type":["string","null"],"description":"Hue the card's background, border and icon are mixed from, darkened in dark mode. Null uses the course's secondary theme colour, or cyan."},"background_color_dark":{"type":["string","null"],"description":"Hue used in dark mode, where it is mixed toward black. Null uses `background_color`."}},"additionalProperties":false},"wrapper":{"$ref":"#/components/schemas/CourseBlockWrapper","description":"The band the block sits in."}},"additionalProperties":false,"example":{"type":"quote","html":"<p>If in doubt, leave it out.</p>","author":"<p>Head chef</p>","style":"default"}},"CourseBlockImage":{"type":"object","description":"An image from the organisation's media library.","required":["type"],"properties":{"id":{"type":["string","null"],"format":"uuid","description":"The block's ID, as read. Send it to keep this block, or leave it out for a new one. A block moves to another page by appearing there."},"type":{"type":"string","const":"image","description":"Always `image`."},"image":{"type":["string","null"],"description":"A file named by a value from this API: an `id` from `POST /api/v1/media`, or a value read from this organisation's course content. Null for none."},"image_url":{"type":["string","null"],"description":"External image shown when no file is attached. Prefer uploading."},"thumbnail_url":{"type":["string","null"],"description":"Fallback external image from imports. Leave null."},"alt":{"type":["string","null"],"description":"Text describing the image for screen readers. Changing it in a document leaves other placements and published versions unchanged."},"caption":{"type":["string","null"],"description":"Caption shown under the image."},"appearance":{"type":"object","description":"Presentation settings. Null values use the builder's defaults.","properties":{"size":{"type":["string","null"],"enum":["small","medium","large","full",null],"description":"Display size. Null is `medium`."},"corner_radius":{"type":["string","null"],"enum":["square","rounded","circle",null],"description":"Corner style. Null is `rounded`."},"click_action":{"type":["string","null"],"enum":["none","expand","link",null],"description":"What clicking does: nothing, open it larger, or follow `link_url`."},"link_url":{"type":["string","null"],"description":"Where the image links when `click_action` is `link`."},"link_new_tab":{"type":["boolean","null"],"description":"Whether the link opens in a new tab. Null is true."},"focus_position":{"type":["string","null"],"pattern":"^(100|[1-9]?[0-9])% (100|[1-9]?[0-9])%$","description":"The part of the picture that stays in view when `corner_radius` is `circle` crops it, as `x% y%` across and down from the top left, such as `20% 75%`. Null keeps the middle. A point suits one picture, so send null with a new image unless you choose one for it."}},"additionalProperties":false},"wrapper":{"$ref":"#/components/schemas/CourseBlockWrapper","description":"The band the block sits in."}},"additionalProperties":false,"example":{"type":"image","image":"eyJfcmFpbHMiOnsiZGF0YSI6IjAxOWNmNWIwLTdjMDAtNzAwMC04MDAwLTAwMDAwMDAwMDA0MCJ9fQ--3f9a","image_url":null,"alt":"Allergen chart on the kitchen wall","caption":"Keep the chart up to date"}},"CourseBlockVideo":{"type":"object","description":"A YouTube or Vimeo video, or an uploaded file kept from earlier courses.","required":["type"],"properties":{"id":{"type":["string","null"],"format":"uuid","description":"The block's ID, as read. Send it to keep this block, or leave it out for a new one. A block moves to another page by appearing there."},"type":{"type":"string","const":"video","description":"Always `video`."},"url":{"type":["string","null"],"description":"YouTube or Vimeo link, such as `https://www.youtube.com/watch?v=...`."},"video":{"type":["string","null"],"description":"An uploaded video file read from this organisation's courses. Videos can't be uploaded through the API."},"video_url":{"type":["string","null"],"description":"External video file address kept from imports; learners don't see it. Leave null."},"caption":{"type":["string","null"],"description":"Caption shown under the video."},"appearance":{"type":"object","description":"Presentation settings. Null values use the builder's defaults.","properties":{"size":{"type":["string","null"],"enum":["small","medium","large","full",null],"description":"Display size. Null is `medium`."},"corner_radius":{"type":["string","null"],"enum":["square","rounded",null],"description":"Corner style. Null is `rounded`."},"muted":{"type":["boolean","null"],"description":"Whether the video starts muted."},"show_controls":{"type":["boolean","null"],"description":"Whether learners see the player controls. Null is true."},"preload":{"type":["string","null"],"enum":["auto","metadata","none",null],"description":"How much of an uploaded file to load before play. Null is `auto`."},"start_time":{"type":["string","null"],"description":"Where playback starts, as seconds (`90`) or minutes and seconds (`1:30`)."},"hide_branding":{"type":["boolean","null"],"description":"Whether to minimise the provider's branding."}},"additionalProperties":false},"wrapper":{"$ref":"#/components/schemas/CourseBlockWrapper","description":"The band the block sits in."}},"additionalProperties":false,"example":{"type":"video","url":"https://www.youtube.com/watch?v=JZdHQmBy7Tc","video":null,"video_url":null,"caption":"Watch before your first shift"}},"CourseBlockEmbed":{"type":"object","description":"Embedded content from another site.","required":["type"],"properties":{"id":{"type":["string","null"],"format":"uuid","description":"The block's ID, as read. Send it to keep this block, or leave it out for a new one. A block moves to another page by appearing there."},"type":{"type":"string","const":"embed","description":"Always `embed`."},"source":{"type":["string","null"],"description":"An `https://` address to show in a frame, or `<iframe>`/`<embed>` HTML."},"file":{"type":["string","null"],"description":"A file attached by an import, read from this organisation's courses. Leave null."},"wrapper":{"$ref":"#/components/schemas/CourseBlockWrapper","description":"The band the block sits in."}},"additionalProperties":false,"example":{"type":"embed","source":"https://www.example.com/allergen-quiz","file":null}},"CourseBlockTextBesideImage":{"type":"object","description":"Text with an image beside it.","required":["type"],"properties":{"id":{"type":["string","null"],"format":"uuid","description":"The block's ID, as read. Send it to keep this block, or leave it out for a new one. A block moves to another page by appearing there."},"type":{"type":"string","const":"text_beside_image","description":"Always `text_beside_image`."},"html":{"type":["string","null"],"description":"Rich text as HTML. Tags and styles outside Tayl's allowed set are removed when learners see it."},"caption":{"type":["string","null"],"description":"Caption shown under the image."},"image":{"type":["string","null"],"description":"A file named by a value from this API: an `id` from `POST /api/v1/media`, or a value read from this organisation's course content. Null for none."},"image_url":{"type":["string","null"],"description":"External image shown when no file is attached, from imports. Prefer uploading."},"thumbnail_url":{"type":["string","null"],"description":"Fallback external image from imports. Leave null."},"appearance":{"type":"object","description":"Presentation settings. Null values use the builder's defaults.","properties":{"image_alignment":{"type":["string","null"],"enum":["left","right",null],"description":"Which side the image sits on. Null is `left`."},"text_color":{"type":["string","null"],"description":"Text colour. Null is the normal text colour."},"text_color_dark":{"type":["string","null"],"description":"Colour used when learners view in dark mode. Null keeps the light colour where it's easy to read in dark mode, and otherwise adjusts its lightness until it is. Ignored when the light colour is null."},"text_align":{"type":["string","null"],"enum":["left","center","right",null],"description":"Horizontal text alignment."},"vertical_align":{"type":["string","null"],"enum":["top","center","bottom",null],"description":"Vertical text alignment. Null is `top`."},"image_width":{"type":["string","null"],"enum":["narrow","equal","wide",null],"description":"Image width relative to the text. Null is `narrow`."},"gap":{"type":["string","null"],"enum":["none","s","m","l",null],"description":"Space between image and text. Null is `m`."},"corner_radius":{"type":["string","null"],"enum":["square","rounded","circle",null],"description":"Image corner style. Null is `rounded`."},"focus_position":{"type":["string","null"],"pattern":"^(100|[1-9]?[0-9])% (100|[1-9]?[0-9])%$","description":"The part of the picture that stays in view when `corner_radius` is `circle` crops it, as `x% y%` across and down from the top left, such as `20% 75%`. Null keeps the middle. A point suits one picture, so send null with a new image unless you choose one for it."}},"additionalProperties":false},"wrapper":{"$ref":"#/components/schemas/CourseBlockWrapper","description":"The band the block sits in."}},"additionalProperties":false,"example":{"type":"text_beside_image","html":"<p>Store allergens on the bottom shelf.</p>","caption":null,"image":null,"image_url":null,"thumbnail_url":null}},"CourseBlockTextOverImage":{"type":"object","description":"Text over a background image.","required":["type"],"properties":{"id":{"type":["string","null"],"format":"uuid","description":"The block's ID, as read. Send it to keep this block, or leave it out for a new one. A block moves to another page by appearing there."},"type":{"type":"string","const":"text_over_image","description":"Always `text_over_image`."},"html":{"type":["string","null"],"description":"Rich text as HTML. Tags and styles outside Tayl's allowed set are removed when learners see it."},"image":{"type":["string","null"],"description":"A file named by a value from this API: an `id` from `POST /api/v1/media`, or a value read from this organisation's course content. Null for none."},"image_url":{"type":["string","null"],"description":"External image shown when no file is attached, from imports. Prefer uploading."},"thumbnail_url":{"type":["string","null"],"description":"Fallback external image from imports. Leave null."},"appearance":{"type":"object","description":"Presentation settings. Null values use the builder's defaults.","properties":{"text_align":{"type":["string","null"],"enum":["left","center","right",null],"description":"Horizontal text alignment. Null is `center`."},"background_color":{"type":["string","null"],"description":"Colour of the overlay between image and text. Null is black. Same in dark mode."},"text_color":{"type":["string","null"],"description":"Text colour. Null is white, or dark over a light overlay. Same in dark mode."},"overlay_opacity":{"type":["integer","null"],"description":"Overlay opacity from 0 to 100.","minimum":0,"maximum":100},"vertical_align":{"type":["string","null"],"enum":["top","center","bottom",null],"description":"Vertical text alignment."},"size":{"type":["string","null"],"enum":["small","medium","large","full",null],"description":"Block width; a shape keeps its proportions as it grows. Null is `medium`."},"aspect_ratio":{"type":["string","null"],"enum":["fit","square","4-3","16-9","auto",null],"description":"Block shape. `auto` follows the image's own shape; `fit` keeps the box as tall as the text. Hero blocks ignore it. Null is `fit`."},"focus_position":{"type":["string","null"],"pattern":"^(100|[1-9]?[0-9])% (100|[1-9]?[0-9])%$","description":"The part of the image that stays in view when the block crops it, as `x% y%` across and down from the top left, such as `20% 75%`. Null keeps the middle. A point suits one picture, so send null with a new image unless you choose one for it."},"variant":{"type":["string","null"],"enum":["hero",null],"description":"`hero` gives imported course banners their heading style. Leave null."}},"additionalProperties":false},"wrapper":{"$ref":"#/components/schemas/CourseBlockWrapper","description":"The band the block sits in."}},"additionalProperties":false,"example":{"type":"text_over_image","html":"<h2>Welcome to the kitchen</h2>","image":null,"image_url":null,"thumbnail_url":null}},"CourseImageGridItem":{"type":"object","description":"One image in an image grid.","properties":{"image":{"type":["string","null"],"description":"A file named by a value from this API: an `id` from `POST /api/v1/media`, or a value read from this organisation's course content. Null for none."},"image_url":{"type":["string","null"],"description":"External image shown when no file is attached, from imports. Prefer uploading."},"thumbnail_url":{"type":["string","null"],"description":"Fallback external image from imports. Leave null."},"caption":{"type":["string","null"],"description":"Caption shown under the image."},"appearance":{"type":"object","description":"Presentation settings. Null values use the builder's defaults.","properties":{"focus_position":{"type":["string","null"],"pattern":"^(100|[1-9]?[0-9])% (100|[1-9]?[0-9])%$","description":"The part of the tile's picture that stays in view when the grid crops it to its `aspect_ratio` (`auto` shows it whole), as `x% y%` across and down from the top left, such as `20% 75%`. Null keeps the middle. A point suits one picture, so send null with a new image unless you choose one for it."}},"additionalProperties":false}},"additionalProperties":false,"example":{"image":null,"image_url":null,"thumbnail_url":null,"caption":"Gluten"}},"CourseBlockImageGrid":{"type":"object","description":"A grid of images.","required":["type"],"properties":{"id":{"type":["string","null"],"format":"uuid","description":"The block's ID, as read. Send it to keep this block, or leave it out for a new one. A block moves to another page by appearing there."},"type":{"type":"string","const":"image_grid","description":"Always `image_grid`."},"items":{"type":"array","description":"Images in order.","items":{"$ref":"#/components/schemas/CourseImageGridItem"},"maxItems":500},"appearance":{"type":"object","description":"Presentation settings. Null values use the builder's defaults.","properties":{"text_color":{"type":["string","null"],"description":"Caption colour. Null is grey. Older courses only; leave null."},"text_color_dark":{"type":["string","null"],"description":"Colour used when learners view in dark mode. Null keeps the light colour where it's easy to read in dark mode, and otherwise adjusts its lightness until it is. Ignored when the light colour is null."},"columns":{"type":["string","null"],"enum":["2","3","4","5",null],"description":"Columns on wide screens. Null is `3`."},"aspect_ratio":{"type":["string","null"],"enum":["square","4-3","16-9","auto",null],"description":"Image shape. Null is `square`."},"gap":{"type":["string","null"],"enum":["none","s","m","l",null],"description":"Space between images. Null is `m`."},"corner_radius":{"type":["string","null"],"enum":["square","rounded","circle",null],"description":"Corner style. Null is `rounded`."}},"additionalProperties":false},"wrapper":{"$ref":"#/components/schemas/CourseBlockWrapper","description":"The band the block sits in."}},"additionalProperties":false,"example":{"type":"image_grid","items":[{"image":null,"image_url":null,"thumbnail_url":null,"caption":"Gluten"}]}},"CourseCarouselItem":{"type":"object","description":"One slide in a carousel.","properties":{"image":{"type":["string","null"],"description":"A file named by a value from this API: an `id` from `POST /api/v1/media`, or a value read from this organisation's course content. Null for none."},"image_url":{"type":["string","null"],"description":"External image shown when no file is attached, from imports. Prefer uploading."},"thumbnail_url":{"type":["string","null"],"description":"Fallback external image from imports. Leave null."},"caption":{"type":["string","null"],"description":"Caption shown under the slide."},"html":{"type":["string","null"],"description":"Text over the slide, as HTML."},"appearance":{"type":"object","description":"This slide's overlay, used unless the carousel applies one overlay to every slide.","properties":{"overlay_color":{"type":["string","null"],"description":"Overlay colour. Null shows no overlay. Same in dark mode."},"overlay_text_color":{"type":["string","null"],"description":"Colour of text on the overlay. Null is white. Same in dark mode."},"overlay_opacity":{"type":["integer","null"],"description":"Overlay opacity from 0 to 100.","minimum":0,"maximum":100},"overlay_text_align":{"type":["string","null"],"enum":["left","center","right",null],"description":"Horizontal alignment of overlay text."},"overlay_vertical_align":{"type":["string","null"],"enum":["top","center","bottom",null],"description":"Vertical position of overlay text. Null is `bottom`."},"focus_position":{"type":["string","null"],"pattern":"^(100|[1-9]?[0-9])% (100|[1-9]?[0-9])%$","description":"The part of the slide's picture that stays in view when the carousel crops it to its `aspect_ratio` (`auto` shows it whole), as `x% y%` across and down from the top left, such as `20% 75%`. Null keeps the middle. A point suits one picture, so send null with a new image unless you choose one for it."}},"additionalProperties":false}},"additionalProperties":false,"example":{"image":null,"image_url":null,"thumbnail_url":null,"caption":"Step 1","html":null}},"CourseBlockCarousel":{"type":"object","description":"A slideshow of images.","required":["type"],"properties":{"id":{"type":["string","null"],"format":"uuid","description":"The block's ID, as read. Send it to keep this block, or leave it out for a new one. A block moves to another page by appearing there."},"type":{"type":"string","const":"carousel","description":"Always `carousel`."},"items":{"type":"array","description":"Slides in order.","items":{"$ref":"#/components/schemas/CourseCarouselItem"},"maxItems":500},"appearance":{"type":"object","description":"Presentation settings. Null values use the builder's defaults.","properties":{"text_color":{"type":["string","null"],"description":"Caption colour. Null is grey. Older courses only; leave null."},"text_color_dark":{"type":["string","null"],"description":"Colour used when learners view in dark mode. Null keeps the light colour where it's easy to read in dark mode, and otherwise adjusts its lightness until it is. Ignored when the light colour is null."},"aspect_ratio":{"type":["string","null"],"enum":["square","4-3","16-9","auto",null],"description":"Slide shape. Null is `16-9`."},"corner_radius":{"type":["string","null"],"enum":["square","rounded","circle",null],"description":"Corner style. Null is `rounded`."},"autoplay":{"type":["string","null"],"enum":["off","slow","medium","fast",null],"description":"Automatic advance speed. Null is `off`."},"loop":{"type":["string","null"],"enum":["on","off",null],"description":"Whether the last slide leads back to the first. Null is `on`."},"show_dots":{"type":["string","null"],"enum":["on","off",null],"description":"Whether position dots show. Null is `on`."},"overlay_apply_to_all":{"type":["boolean","null"],"description":"Whether the overlay below applies to every slide instead of each slide's own."},"overlay_color":{"type":["string","null"],"description":"Overlay colour. Null shows no overlay. Same in dark mode."},"overlay_text_color":{"type":["string","null"],"description":"Colour of text on the overlay. Null is white. Same in dark mode."},"overlay_opacity":{"type":["integer","null"],"description":"Overlay opacity from 0 to 100.","minimum":0,"maximum":100},"overlay_text_align":{"type":["string","null"],"enum":["left","center","right",null],"description":"Horizontal alignment of overlay text."},"overlay_vertical_align":{"type":["string","null"],"enum":["top","center","bottom",null],"description":"Vertical position of overlay text. Null is `bottom`."}},"additionalProperties":false},"wrapper":{"$ref":"#/components/schemas/CourseBlockWrapper","description":"The band the block sits in."}},"additionalProperties":false,"example":{"type":"carousel","items":[{"image":null,"image_url":null,"thumbnail_url":null,"caption":"Step 1","html":null}]}},"CourseTab":{"type":"object","description":"One section of an accordion or one tab of a tab list.","properties":{"title":{"type":["string","null"],"description":"Section or tab title."},"html":{"type":["string","null"],"description":"Rich text as HTML. Tags and styles outside Tayl's allowed set are removed when learners see it."},"image":{"type":["string","null"],"description":"A file named by a value from this API: an `id` from `POST /api/v1/media`, or a value read from this organisation's course content. Null for none."}},"additionalProperties":false,"example":{"title":"Gluten","html":"<p>Found in wheat, barley and rye.</p>","image":null}},"CourseBlockAccordion":{"type":"object","description":"Sections learners expand one at a time.","required":["type"],"properties":{"id":{"type":["string","null"],"format":"uuid","description":"The block's ID, as read. Send it to keep this block, or leave it out for a new one. A block moves to another page by appearing there."},"type":{"type":"string","const":"accordion","description":"Always `accordion`."},"items":{"type":"array","description":"Sections in order.","items":{"$ref":"#/components/schemas/CourseTab"},"maxItems":500},"appearance":{"type":"object","description":"Presentation settings. Null values use the builder's defaults.","properties":{"text_color":{"type":["string","null"],"description":"Content text colour. Null is the normal text colour."},"text_color_dark":{"type":["string","null"],"description":"Colour used when learners view in dark mode. Null keeps the light colour where it's easy to read in dark mode, and otherwise adjusts its lightness until it is. Ignored when the light colour is null."},"header_text_color":{"type":["string","null"],"description":"Header text colour. Null is the normal text colour."},"header_text_color_dark":{"type":["string","null"],"description":"Colour used when learners view in dark mode. Null keeps the light colour where it's easy to read in dark mode, and otherwise adjusts its lightness until it is. Ignored when the light colour is null."},"header_style":{"type":["string","null"],"enum":["default","custom","none",null],"description":"Header look: `custom` uses `header_bg_color`. Null is `default`."},"header_bg_color":{"type":["string","null"],"description":"Header background when `header_style` is `custom`. Null is light grey, or dark blue in dark mode."},"header_bg_color_dark":{"type":["string","null"],"description":"Colour used when learners view in dark mode. Null keeps the light colour, or a dark tint of it when it is pale. Ignored when the light colour is null."}},"additionalProperties":false},"wrapper":{"$ref":"#/components/schemas/CourseBlockWrapper","description":"The band the block sits in."}},"additionalProperties":false,"example":{"type":"accordion","items":[{"title":"Gluten","html":"<p>Found in wheat, barley and rye.</p>","image":null}]}},"CourseBlockTabList":{"type":"object","description":"Content split across tabs.","required":["type"],"properties":{"id":{"type":["string","null"],"format":"uuid","description":"The block's ID, as read. Send it to keep this block, or leave it out for a new one. A block moves to another page by appearing there."},"type":{"type":"string","const":"tab_list","description":"Always `tab_list`."},"items":{"type":"array","description":"Tabs in order.","items":{"$ref":"#/components/schemas/CourseTab"},"maxItems":500},"appearance":{"type":"object","description":"Presentation settings. Null values use the builder's defaults.","properties":{"text_color":{"type":["string","null"],"description":"Content text colour. Null is the normal text colour."},"text_color_dark":{"type":["string","null"],"description":"Colour used when learners view in dark mode. Null keeps the light colour where it's easy to read in dark mode, and otherwise adjusts its lightness until it is. Ignored when the light colour is null."},"header_text_color":{"type":["string","null"],"description":"Header text colour. Null is the normal text colour."},"header_text_color_dark":{"type":["string","null"],"description":"Colour used when learners view in dark mode. Null keeps the light colour where it's easy to read in dark mode, and otherwise adjusts its lightness until it is. Ignored when the light colour is null."},"header_style":{"type":["string","null"],"enum":["default","custom","none",null],"description":"Header look: `custom` uses `header_bg_color`. Null is `default`."},"header_bg_color":{"type":["string","null"],"description":"Header background when `header_style` is `custom`. Null is light grey, or dark blue in dark mode."},"header_bg_color_dark":{"type":["string","null"],"description":"Colour used when learners view in dark mode. Null keeps the light colour, or a dark tint of it when it is pale. Ignored when the light colour is null."},"header_text_align":{"type":["string","null"],"enum":["left","center","right",null],"description":"Tab title alignment."}},"additionalProperties":false},"wrapper":{"$ref":"#/components/schemas/CourseBlockWrapper","description":"The band the block sits in."}},"additionalProperties":false,"example":{"type":"tab_list","items":[{"title":"Gluten","html":"<p>Found in wheat, barley and rye.</p>","image":null}]}},"CourseBlockTable":{"type":"object","description":"A table of plain text cells.","required":["type"],"properties":{"id":{"type":["string","null"],"format":"uuid","description":"The block's ID, as read. Send it to keep this block, or leave it out for a new one. A block moves to another page by appearing there."},"type":{"type":"string","const":"table","description":"Always `table`."},"rows":{"type":"array","description":"Rows of cell text. The first row is the header row; every row should have the same number of cells.","items":{"type":"array","items":{"type":"string","maxLength":10000},"maxItems":50},"maxItems":500},"appearance":{"type":"object","description":"Presentation settings. Null values use the builder's defaults.","properties":{"text_color":{"type":["string","null"],"description":"Text colour. Null is the normal text colour."},"text_color_dark":{"type":["string","null"],"description":"Colour used when learners view in dark mode. Null keeps the light colour where it's easy to read in dark mode, and otherwise adjusts its lightness until it is. Ignored when the light colour is null."},"text_align":{"type":["string","null"],"enum":["left","center","right",null],"description":"Cell text alignment."},"header_style":{"type":["string","null"],"enum":["default","custom","none",null],"description":"Header row look: `custom` uses `header_bg_color`. Null is `default`."},"header_bg_color":{"type":["string","null"],"description":"Header background when `header_style` is `custom`. Null is light grey, or dark blue in dark mode."},"header_bg_color_dark":{"type":["string","null"],"description":"Colour used when learners view in dark mode. Null keeps the light colour, or a dark tint of it when it is pale. Ignored when the light colour is null."},"header_text_color":{"type":["string","null"],"description":"Header row text colour. Null uses `text_color`."},"header_text_color_dark":{"type":["string","null"],"description":"Colour used when learners view in dark mode. Null keeps the light colour where it's easy to read in dark mode, and otherwise adjusts its lightness until it is. Ignored when the light colour is null."},"row_stripes":{"type":["string","null"],"enum":["on","off",null],"description":"Whether alternate rows are shaded. Null is `on`."},"borders":{"type":["string","null"],"enum":["all","horizontal","none",null],"description":"Cell borders. Null is `all`."}},"additionalProperties":false},"wrapper":{"$ref":"#/components/schemas/CourseBlockWrapper","description":"The band the block sits in."}},"additionalProperties":false,"example":{"type":"table","rows":[["Allergen","Found in"],["Gluten","Bread, pasta"]]}},"CourseFlashcard":{"type":"object","description":"One flash card.","properties":{"front_html":{"type":["string","null"],"description":"Front text, as HTML. Paragraphs, headings, lists, links and inline styles only."},"back_html":{"type":["string","null"],"description":"Back text, as HTML. Paragraphs, headings, lists, links and inline styles only."},"front_image":{"type":["string","null"],"description":"A file named by a value from this API: an `id` from `POST /api/v1/media`, or a value read from this organisation's course content. Null for none."},"back_image":{"type":["string","null"],"description":"A file named by a value from this API: an `id` from `POST /api/v1/media`, or a value read from this organisation's course content. Null for none."},"appearance":{"type":"object","description":"This card's colours and alignment.","properties":{"front_overlay_color":{"type":["string","null"],"description":"Overlay colour over the front image. Null is black. Same in dark mode."},"front_overlay_text_color":{"type":["string","null"],"description":"Colour of text over the front image. Null uses `front_text_color`, then the deck's `card_text_color`, or white. Same in dark mode."},"front_overlay_opacity":{"type":["integer","null"],"description":"Front overlay opacity from 0 to 100.","minimum":0,"maximum":100},"back_overlay_color":{"type":["string","null"],"description":"Overlay colour over the back image. Null is black. Same in dark mode."},"back_overlay_text_color":{"type":["string","null"],"description":"Colour of text over the back image. Null uses `back_text_color`, then the deck's `card_text_color`, or white. Same in dark mode."},"back_overlay_opacity":{"type":["integer","null"],"description":"Back overlay opacity from 0 to 100.","minimum":0,"maximum":100},"front_bg_color":{"type":["string","null"],"description":"Front background. Null uses the deck colour."},"front_bg_color_dark":{"type":["string","null"],"description":"Colour used when learners view in dark mode. Null keeps the light colour, or a dark tint of it when it is pale, or the deck's if both are null."},"front_text_color":{"type":["string","null"],"description":"Front text colour. Null uses the deck colour."},"front_text_color_dark":{"type":["string","null"],"description":"Colour used when learners view in dark mode. Null keeps the light colour where it's easy to read in dark mode, and otherwise adjusts its lightness until it is, or the deck's if both are null."},"back_bg_color":{"type":["string","null"],"description":"Back background. Null uses the deck colour."},"back_bg_color_dark":{"type":["string","null"],"description":"Colour used when learners view in dark mode. Null keeps the light colour, or a dark tint of it when it is pale, or the deck's if both are null."},"back_text_color":{"type":["string","null"],"description":"Back text colour. Null uses the deck colour."},"back_text_color_dark":{"type":["string","null"],"description":"Colour used when learners view in dark mode. Null keeps the light colour where it's easy to read in dark mode, and otherwise adjusts its lightness until it is, or the deck's if both are null."},"text_align":{"type":["string","null"],"enum":["left","center",null],"description":"This card's text alignment. Null uses the deck's."},"front_focus_position":{"type":["string","null"],"pattern":"^(100|[1-9]?[0-9])% (100|[1-9]?[0-9])%$","description":"The part of the front picture that stays in view when the card crops it, as `x% y%` across and down from the top left, such as `20% 75%`. Null keeps the middle. A point suits one picture, so send null with a new image unless you choose one for it."},"back_focus_position":{"type":["string","null"],"pattern":"^(100|[1-9]?[0-9])% (100|[1-9]?[0-9])%$","description":"The part of the back picture that stays in view when the card crops it, as `x% y%` across and down from the top left, such as `20% 75%`. Null keeps the middle. A point suits one picture, so send null with a new image unless you choose one for it."}},"additionalProperties":false}},"additionalProperties":false,"example":{"front_html":"<p>Celery</p>","back_html":"<p>Includes celeriac and celery salt.</p>","front_image":null,"back_image":null,"appearance":{"front_bg_color":"#3f5da5","front_text_color":"#ffffff"}}},"CourseBlockFlashcardContainer":{"type":"object","description":"A deck of flash cards learners turn over.","required":["type"],"properties":{"id":{"type":["string","null"],"format":"uuid","description":"The block's ID, as read. Send it to keep this block, or leave it out for a new one. A block moves to another page by appearing there."},"type":{"type":"string","const":"flashcard_container","description":"Always `flashcard_container`."},"cards":{"type":"array","description":"Cards in order.","items":{"$ref":"#/components/schemas/CourseFlashcard"},"maxItems":500},"appearance":{"type":"object","description":"Presentation settings. Null values use the builder's defaults.","properties":{"card_bg_color":{"type":["string","null"],"description":"Card background. Null is white, or dark blue in dark mode."},"card_bg_color_dark":{"type":["string","null"],"description":"Colour used when learners view in dark mode. Null keeps the light colour, or a dark tint of it when it is pale. Ignored when the light colour is null."},"card_text_color":{"type":["string","null"],"description":"Card text colour, also used over pictures. Null is the normal text colour, or white over pictures."},"card_text_color_dark":{"type":["string","null"],"description":"Colour used when learners view in dark mode. Null keeps the light colour where it's easy to read in dark mode, and otherwise adjusts its lightness until it is. Ignored when the light colour is null."},"layout":{"type":["string","null"],"enum":["grid","stack","deck",null],"description":"`grid` shows the cards in rows; `stack` shows them one under another; `deck` shows one card at a time, with previous and next buttons and a count such as \"3 of 10\". Null is `grid`."},"aspect_ratio":{"type":["string","null"],"enum":["square","4-3","16-9","auto",null],"description":"Card shape. Null is `square`."},"size":{"type":["string","null"],"enum":["compact","standard","large",null],"description":"Card size. Null is `standard`."},"text_align":{"type":["string","null"],"enum":["left","center",null],"description":"Default card text alignment."}},"additionalProperties":false},"wrapper":{"$ref":"#/components/schemas/CourseBlockWrapper","description":"The band the block sits in."}},"additionalProperties":false,"example":{"type":"flashcard_container","cards":[{"front_html":"<p>Celery</p>","back_html":"<p>Includes celeriac and celery salt.</p>","front_image":null,"back_image":null,"appearance":{"front_bg_color":"#3f5da5","front_text_color":"#ffffff"}}]}},"CourseAnswer":{"type":"object","description":"One answer to a choice question.","properties":{"text":{"type":["string","null"],"description":"Answer text."},"correct":{"type":["boolean","null"],"description":"Whether this answer is correct."},"feedback":{"type":["string","null"],"description":"Feedback shown for this answer when `feedback_by_choice` is on."}},"additionalProperties":false,"example":{"text":"Sesame","correct":true,"feedback":null}},"CourseQuestionSingleChoice":{"type":"object","description":"Learners pick the one correct answer.","required":["kind"],"properties":{"kind":{"type":"string","const":"single_choice","description":"Always `single_choice`."},"text":{"type":["string","null"],"description":"The question as plain text. For `fill_in_the_gap`, each `[]` marks a gap."},"image":{"type":["string","null"],"description":"A file named by a value from this API: an `id` from `POST /api/v1/media`, or a value read from this organisation's course content. Null for none. The hotspot image for `hotspot_image`."},"image_url":{"type":["string","null"],"description":"External image from imports. Leave null."},"randomize_order":{"type":["boolean","null"],"description":"Whether options appear in a random order."},"feedback_by_choice":{"type":["boolean","null"],"description":"Whether each answer's own `feedback` shows when chosen."},"correct_message":{"type":["string","null"],"description":"Message shown for a correct answer."},"incorrect_message":{"type":["string","null"],"description":"Message shown for an incorrect answer."},"incorrect_hint":{"type":["string","null"],"description":"Hint shown when `incorrect_action` is `show_hint`."},"incorrect_action":{"type":["string","null"],"enum":["nothing","show_hint","highlight_correct_answers","highlight_right_or_wrong",null],"description":"What happens after an incorrect answer. Null is `highlight_right_or_wrong`."},"answers":{"type":"array","description":"Answers in order. At most one may be correct.","items":{"$ref":"#/components/schemas/CourseAnswer"},"maxItems":50,"contains":{"type":"object","properties":{"correct":{"const":true,"description":"Marked correct."}},"required":["correct"]},"minContains":0,"maxContains":1}},"additionalProperties":false,"example":{"kind":"single_choice","text":"Which of these is one of the 14 allergens?","answers":[{"text":"Sesame","correct":true,"feedback":null},{"text":"Rice","correct":false,"feedback":null}]}},"CourseQuestionMultipleChoice":{"type":"object","description":"Learners pick every correct answer.","required":["kind"],"properties":{"kind":{"type":"string","const":"multiple_choice","description":"Always `multiple_choice`."},"text":{"type":["string","null"],"description":"The question as plain text. For `fill_in_the_gap`, each `[]` marks a gap."},"image":{"type":["string","null"],"description":"A file named by a value from this API: an `id` from `POST /api/v1/media`, or a value read from this organisation's course content. Null for none. The hotspot image for `hotspot_image`."},"image_url":{"type":["string","null"],"description":"External image from imports. Leave null."},"randomize_order":{"type":["boolean","null"],"description":"Whether options appear in a random order."},"feedback_by_choice":{"type":["boolean","null"],"description":"Whether each answer's own `feedback` shows when chosen."},"correct_message":{"type":["string","null"],"description":"Message shown for a correct answer."},"incorrect_message":{"type":["string","null"],"description":"Message shown for an incorrect answer."},"incorrect_hint":{"type":["string","null"],"description":"Hint shown when `incorrect_action` is `show_hint`."},"incorrect_action":{"type":["string","null"],"enum":["nothing","show_hint","highlight_correct_answers","highlight_right_or_wrong",null],"description":"What happens after an incorrect answer. Null is `highlight_right_or_wrong`."},"answers":{"type":"array","description":"Answers in order. Mark each correct one.","items":{"$ref":"#/components/schemas/CourseAnswer"},"maxItems":50}},"additionalProperties":false,"example":{"kind":"multiple_choice","text":"Which of these contain gluten?","answers":[{"text":"Barley","correct":true,"feedback":null},{"text":"Rye","correct":true,"feedback":null},{"text":"Rice","correct":false,"feedback":null}]}},"CourseQuestionTrueFalse":{"type":"object","description":"Learners say whether a statement is true.","required":["kind"],"properties":{"kind":{"type":"string","const":"true_false","description":"Always `true_false`."},"text":{"type":["string","null"],"description":"The question as plain text. For `fill_in_the_gap`, each `[]` marks a gap."},"image":{"type":["string","null"],"description":"A file named by a value from this API: an `id` from `POST /api/v1/media`, or a value read from this organisation's course content. Null for none. The hotspot image for `hotspot_image`."},"image_url":{"type":["string","null"],"description":"External image from imports. Leave null."},"randomize_order":{"type":["boolean","null"],"description":"Whether options appear in a random order."},"feedback_by_choice":{"type":["boolean","null"],"description":"Whether each answer's own `feedback` shows when chosen."},"correct_message":{"type":["string","null"],"description":"Message shown for a correct answer."},"incorrect_message":{"type":["string","null"],"description":"Message shown for an incorrect answer."},"incorrect_hint":{"type":["string","null"],"description":"Hint shown when `incorrect_action` is `show_hint`."},"incorrect_action":{"type":["string","null"],"enum":["nothing","show_hint","highlight_correct_answers","highlight_right_or_wrong",null],"description":"What happens after an incorrect answer. Null is `highlight_right_or_wrong`."},"answers":{"type":"array","description":"The `True` and `False` answers. Mark the correct one.","items":{"$ref":"#/components/schemas/CourseAnswer"},"maxItems":50,"contains":{"type":"object","properties":{"correct":{"const":true,"description":"Marked correct."}},"required":["correct"]},"minContains":0,"maxContains":1}},"additionalProperties":false,"example":{"kind":"true_false","text":"Sesame is one of the 14 allergens.","answers":[{"text":"True","correct":true,"feedback":null},{"text":"False","correct":false,"feedback":null}]}},"CourseGap":{"type":"object","description":"The answer for one `[]` gap, in order.","properties":{"correct_answer":{"type":["string","null"],"description":"The word or phrase that fills the gap. Matching ignores case."},"hint":{"type":["string","null"],"description":"Hint for this gap."}},"additionalProperties":false,"example":{"correct_answer":"fourteen","hint":null}},"CourseQuestionFillInTheGap":{"type":"object","description":"Learners drag words into the gaps marked `[]` in the text.","required":["kind"],"properties":{"kind":{"type":"string","const":"fill_in_the_gap","description":"Always `fill_in_the_gap`."},"text":{"type":["string","null"],"description":"The question as plain text. For `fill_in_the_gap`, each `[]` marks a gap."},"image":{"type":["string","null"],"description":"A file named by a value from this API: an `id` from `POST /api/v1/media`, or a value read from this organisation's course content. Null for none. The hotspot image for `hotspot_image`."},"image_url":{"type":["string","null"],"description":"External image from imports. Leave null."},"randomize_order":{"type":["boolean","null"],"description":"Whether options appear in a random order."},"feedback_by_choice":{"type":["boolean","null"],"description":"Whether each answer's own `feedback` shows when chosen."},"correct_message":{"type":["string","null"],"description":"Message shown for a correct answer."},"incorrect_message":{"type":["string","null"],"description":"Message shown for an incorrect answer."},"incorrect_hint":{"type":["string","null"],"description":"Hint shown when `incorrect_action` is `show_hint`."},"incorrect_action":{"type":["string","null"],"enum":["nothing","show_hint","highlight_correct_answers","highlight_right_or_wrong",null],"description":"What happens after an incorrect answer. Null is `highlight_right_or_wrong`."},"gaps":{"type":"array","description":"One answer per `[]`, in order. As in the course builder, answers beyond the markers are dropped and missing ones are added blank.","items":{"$ref":"#/components/schemas/CourseGap"},"maxItems":50},"distractors":{"type":"array","description":"Wrong words offered alongside the answers.","items":{"type":"string","maxLength":255},"maxItems":50}},"additionalProperties":false,"example":{"kind":"fill_in_the_gap","text":"UK law names [] allergens.","gaps":[{"correct_answer":"fourteen","hint":null}],"distractors":["ten","twelve"]}},"CourseBox":{"type":"object","description":"A category learners sort items into.","required":["name"],"properties":{"name":{"type":"string","description":"Category name.","maxLength":255},"items":{"type":"array","description":"Items that belong in this category.","items":{"type":"string","maxLength":10000},"maxItems":500}},"additionalProperties":false,"example":{"name":"Allergen","items":["Peanuts"]}},"CourseQuestionBoxing":{"type":"object","description":"Learners sort items into categories.","required":["kind"],"properties":{"kind":{"type":"string","const":"boxing","description":"Always `boxing`."},"text":{"type":["string","null"],"description":"The question as plain text. For `fill_in_the_gap`, each `[]` marks a gap."},"image":{"type":["string","null"],"description":"A file named by a value from this API: an `id` from `POST /api/v1/media`, or a value read from this organisation's course content. Null for none. The hotspot image for `hotspot_image`."},"image_url":{"type":["string","null"],"description":"External image from imports. Leave null."},"randomize_order":{"type":["boolean","null"],"description":"Whether options appear in a random order."},"feedback_by_choice":{"type":["boolean","null"],"description":"Whether each answer's own `feedback` shows when chosen."},"correct_message":{"type":["string","null"],"description":"Message shown for a correct answer."},"incorrect_message":{"type":["string","null"],"description":"Message shown for an incorrect answer."},"incorrect_hint":{"type":["string","null"],"description":"Hint shown when `incorrect_action` is `show_hint`."},"incorrect_action":{"type":["string","null"],"enum":["nothing","show_hint","highlight_correct_answers","highlight_right_or_wrong",null],"description":"What happens after an incorrect answer. Null is `highlight_right_or_wrong`."},"boxes":{"type":"array","description":"Categories with the items that belong in each.","items":{"$ref":"#/components/schemas/CourseBox"},"maxItems":50},"unboxed_items":{"type":"array","description":"Items not yet given a category; they stop the question being complete.","items":{"type":"string","maxLength":10000},"maxItems":500}},"additionalProperties":false,"example":{"kind":"boxing","text":"Sort these ingredients.","boxes":[{"name":"Allergen","items":["Peanuts"]},{"name":"Not an allergen","items":["Rice"]}],"unboxed_items":[]}},"CoursePair":{"type":"object","description":"A matching pair.","properties":{"left":{"type":["string","null"],"description":"Left-hand prompt.","maxLength":255},"right":{"type":["string","null"],"description":"Matching right-hand answer.","maxLength":255}},"additionalProperties":false,"example":{"left":"Mustard","right":"Seeds, powder and leaves"}},"CourseQuestionMatchThePairs":{"type":"object","description":"Learners match each left-hand prompt to its answer.","required":["kind"],"properties":{"kind":{"type":"string","const":"match_the_pairs","description":"Always `match_the_pairs`."},"text":{"type":["string","null"],"description":"The question as plain text. For `fill_in_the_gap`, each `[]` marks a gap."},"image":{"type":["string","null"],"description":"A file named by a value from this API: an `id` from `POST /api/v1/media`, or a value read from this organisation's course content. Null for none. The hotspot image for `hotspot_image`."},"image_url":{"type":["string","null"],"description":"External image from imports. Leave null."},"randomize_order":{"type":["boolean","null"],"description":"Whether options appear in a random order."},"feedback_by_choice":{"type":["boolean","null"],"description":"Whether each answer's own `feedback` shows when chosen."},"correct_message":{"type":["string","null"],"description":"Message shown for a correct answer."},"incorrect_message":{"type":["string","null"],"description":"Message shown for an incorrect answer."},"incorrect_hint":{"type":["string","null"],"description":"Hint shown when `incorrect_action` is `show_hint`."},"incorrect_action":{"type":["string","null"],"enum":["nothing","show_hint","highlight_correct_answers","highlight_right_or_wrong",null],"description":"What happens after an incorrect answer. Null is `highlight_right_or_wrong`."},"pairs":{"type":"array","description":"Pairs in order.","items":{"$ref":"#/components/schemas/CoursePair"},"maxItems":50}},"additionalProperties":false,"example":{"kind":"match_the_pairs","text":"Match each allergen to where it's found.","pairs":[{"left":"Mustard","right":"Seeds, powder and leaves"},{"left":"Lupin","right":"Some breads and pastries"}]}},"CourseQuestionSequencing":{"type":"object","description":"Learners put steps in order.","required":["kind"],"properties":{"kind":{"type":"string","const":"sequencing","description":"Always `sequencing`."},"text":{"type":["string","null"],"description":"The question as plain text. For `fill_in_the_gap`, each `[]` marks a gap."},"image":{"type":["string","null"],"description":"A file named by a value from this API: an `id` from `POST /api/v1/media`, or a value read from this organisation's course content. Null for none. The hotspot image for `hotspot_image`."},"image_url":{"type":["string","null"],"description":"External image from imports. Leave null."},"randomize_order":{"type":["boolean","null"],"description":"Whether options appear in a random order."},"feedback_by_choice":{"type":["boolean","null"],"description":"Whether each answer's own `feedback` shows when chosen."},"correct_message":{"type":["string","null"],"description":"Message shown for a correct answer."},"incorrect_message":{"type":["string","null"],"description":"Message shown for an incorrect answer."},"incorrect_hint":{"type":["string","null"],"description":"Hint shown when `incorrect_action` is `show_hint`."},"incorrect_action":{"type":["string","null"],"enum":["nothing","show_hint","highlight_correct_answers","highlight_right_or_wrong",null],"description":"What happens after an incorrect answer. Null is `highlight_right_or_wrong`."},"sequence":{"type":"array","description":"Steps in their correct order.","items":{"type":"string","maxLength":10000},"maxItems":50}},"additionalProperties":false,"example":{"kind":"sequencing","text":"Put the allergy check in order.","sequence":["Ask about allergies","Check the matrix","Tell the kitchen"]}},"CourseHotspot":{"type":"object","description":"An area of the hotspot image.","properties":{"x":{"type":["number","null"],"description":"Centre from the left edge, as a percentage of the image width.","minimum":0,"maximum":100},"y":{"type":["number","null"],"description":"Centre from the top edge, as a percentage of the image height.","minimum":0,"maximum":100},"radius":{"type":["number","null"],"description":"Radius as a percentage of the image width.","minimum":0,"maximum":100},"correct":{"type":["boolean","null"],"description":"Whether learners must click this area. Null is true."},"description":{"type":["string","null"],"description":"What the area shows.","maxLength":255}},"additionalProperties":false,"example":{"x":42.5,"y":30,"radius":6,"correct":true,"description":"Allergen label"}},"CourseQuestionHotspotImage":{"type":"object","description":"Learners click the right areas of an image.","required":["kind"],"properties":{"kind":{"type":"string","const":"hotspot_image","description":"Always `hotspot_image`."},"text":{"type":["string","null"],"description":"The question as plain text. For `fill_in_the_gap`, each `[]` marks a gap."},"image":{"type":["string","null"],"description":"A file named by a value from this API: an `id` from `POST /api/v1/media`, or a value read from this organisation's course content. Null for none. The hotspot image for `hotspot_image`."},"image_url":{"type":["string","null"],"description":"External image from imports. Leave null."},"randomize_order":{"type":["boolean","null"],"description":"Whether options appear in a random order."},"feedback_by_choice":{"type":["boolean","null"],"description":"Whether each answer's own `feedback` shows when chosen."},"correct_message":{"type":["string","null"],"description":"Message shown for a correct answer."},"incorrect_message":{"type":["string","null"],"description":"Message shown for an incorrect answer."},"incorrect_hint":{"type":["string","null"],"description":"Hint shown when `incorrect_action` is `show_hint`."},"incorrect_action":{"type":["string","null"],"enum":["nothing","show_hint","highlight_correct_answers","highlight_right_or_wrong",null],"description":"What happens after an incorrect answer. Null is `highlight_right_or_wrong`."},"hotspots":{"type":"array","description":"Areas of the image.","items":{"$ref":"#/components/schemas/CourseHotspot"},"maxItems":50}},"additionalProperties":false,"example":{"kind":"hotspot_image","text":"Click the allergen label.","image":null,"hotspots":[{"x":42.5,"y":30,"radius":6,"correct":true,"description":"Allergen label"}]}},"CourseQuestion":{"description":"A quiz or knowledge check question. `kind` decides which fields apply.","oneOf":[{"$ref":"#/components/schemas/CourseQuestionSingleChoice"},{"$ref":"#/components/schemas/CourseQuestionMultipleChoice"},{"$ref":"#/components/schemas/CourseQuestionTrueFalse"},{"$ref":"#/components/schemas/CourseQuestionFillInTheGap"},{"$ref":"#/components/schemas/CourseQuestionBoxing"},{"$ref":"#/components/schemas/CourseQuestionMatchThePairs"},{"$ref":"#/components/schemas/CourseQuestionSequencing"},{"$ref":"#/components/schemas/CourseQuestionHotspotImage"}],"discriminator":{"propertyName":"kind","mapping":{"single_choice":"#/components/schemas/CourseQuestionSingleChoice","multiple_choice":"#/components/schemas/CourseQuestionMultipleChoice","true_false":"#/components/schemas/CourseQuestionTrueFalse","fill_in_the_gap":"#/components/schemas/CourseQuestionFillInTheGap","boxing":"#/components/schemas/CourseQuestionBoxing","match_the_pairs":"#/components/schemas/CourseQuestionMatchThePairs","sequencing":"#/components/schemas/CourseQuestionSequencing","hotspot_image":"#/components/schemas/CourseQuestionHotspotImage"}},"example":{"kind":"true_false","text":"Sesame is one of the 14 allergens.","answers":[{"text":"True","correct":true,"feedback":null},{"text":"False","correct":false,"feedback":null}]}},"CourseBlockKnowledgeCheck":{"type":"object","description":"One practice question on the page. Learners see feedback; nothing is scored.","required":["type"],"properties":{"id":{"type":["string","null"],"format":"uuid","description":"The block's ID, as read. Send it to keep this block, or leave it out for a new one. A block moves to another page by appearing there."},"type":{"type":"string","const":"knowledge_check","description":"Always `knowledge_check`."},"question":{"oneOf":[{"$ref":"#/components/schemas/CourseQuestion"},{"type":"null"}],"description":"The question. Null leaves the block empty."},"wrapper":{"$ref":"#/components/schemas/CourseBlockWrapper","description":"The band the block sits in."}},"additionalProperties":false,"example":{"type":"knowledge_check","question":{"kind":"true_false","text":"Sesame is one of the 14 allergens.","answers":[{"text":"True","correct":true,"feedback":null},{"text":"False","correct":false,"feedback":null}]}}},"CourseChartDataPoint":{"type":"object","description":"One value in a chart.","properties":{"label":{"type":["string","null"],"description":"Label for the value."},"value":{"type":["integer","null"],"description":"Whole-number value.","minimum":-2147483648,"maximum":2147483647},"color":{"type":["string","null"],"description":"Colour for this bar or slice. Null uses the course's secondary theme colour, or a default."}},"additionalProperties":false,"example":{"label":"Week 1","value":12,"color":null}},"CourseBlockBarChart":{"type":"object","description":"A bar chart.","required":["type"],"properties":{"id":{"type":["string","null"],"format":"uuid","description":"The block's ID, as read. Send it to keep this block, or leave it out for a new one. A block moves to another page by appearing there."},"type":{"type":"string","const":"bar_chart","description":"Always `bar_chart`."},"title":{"type":["string","null"],"description":"Title shown above the chart."},"data":{"type":"array","description":"Values in order.","items":{"$ref":"#/components/schemas/CourseChartDataPoint"},"maxItems":500},"appearance":{"type":"object","description":"Presentation settings. Null values use the builder's defaults.","properties":{"text_color":{"type":["string","null"],"description":"Label colour. Null is the normal text colour."},"text_color_dark":{"type":["string","null"],"description":"Colour used when learners view in dark mode. Null keeps the light colour where it's easy to read in dark mode, and otherwise adjusts its lightness until it is. Ignored when the light colour is null."}},"additionalProperties":false},"wrapper":{"$ref":"#/components/schemas/CourseBlockWrapper","description":"The band the block sits in."}},"additionalProperties":false,"example":{"type":"bar_chart","title":"Allergen incidents","data":[{"label":"Week 1","value":12,"color":null}]}},"CourseBlockPieChart":{"type":"object","description":"A pie chart.","required":["type"],"properties":{"id":{"type":["string","null"],"format":"uuid","description":"The block's ID, as read. Send it to keep this block, or leave it out for a new one. A block moves to another page by appearing there."},"type":{"type":"string","const":"pie_chart","description":"Always `pie_chart`."},"title":{"type":["string","null"],"description":"Title shown above the chart."},"data":{"type":"array","description":"Values in order.","items":{"$ref":"#/components/schemas/CourseChartDataPoint"},"maxItems":500},"appearance":{"type":"object","description":"Presentation settings. Null values use the builder's defaults.","properties":{"text_color":{"type":["string","null"],"description":"Label colour. Null is the normal text colour."},"text_color_dark":{"type":["string","null"],"description":"Colour used when learners view in dark mode. Null keeps the light colour where it's easy to read in dark mode, and otherwise adjusts its lightness until it is. Ignored when the light colour is null."}},"additionalProperties":false},"wrapper":{"$ref":"#/components/schemas/CourseBlockWrapper","description":"The band the block sits in."}},"additionalProperties":false,"example":{"type":"pie_chart","title":"Allergen incidents","data":[{"label":"Week 1","value":12,"color":null}]}},"CourseBlockLineChart":{"type":"object","description":"A line chart.","required":["type"],"properties":{"id":{"type":["string","null"],"format":"uuid","description":"The block's ID, as read. Send it to keep this block, or leave it out for a new one. A block moves to another page by appearing there."},"type":{"type":"string","const":"line_chart","description":"Always `line_chart`."},"title":{"type":["string","null"],"description":"Title shown above the chart."},"data":{"type":"array","description":"Values in order.","items":{"$ref":"#/components/schemas/CourseChartDataPoint"},"maxItems":500},"appearance":{"type":"object","description":"Presentation settings. Null values use the builder's defaults.","properties":{"color":{"type":["string","null"],"description":"Line colour. Null uses the course's secondary theme colour, or blue."},"text_color":{"type":["string","null"],"description":"Label colour. Null is the normal text colour, with grey axis labels."},"text_color_dark":{"type":["string","null"],"description":"Colour used when learners view in dark mode. Null keeps the light colour where it's easy to read in dark mode, and otherwise adjusts its lightness until it is. Ignored when the light colour is null."}},"additionalProperties":false},"wrapper":{"$ref":"#/components/schemas/CourseBlockWrapper","description":"The band the block sits in."}},"additionalProperties":false,"example":{"type":"line_chart","title":"Allergen incidents","data":[{"label":"Week 1","value":12,"color":null}]}},"CourseBlock":{"description":"One block on a page. `type` decides which fields apply.","oneOf":[{"$ref":"#/components/schemas/CourseBlockText"},{"$ref":"#/components/schemas/CourseBlockLargeText"},{"$ref":"#/components/schemas/CourseBlockHeader"},{"$ref":"#/components/schemas/CourseBlockHighlight"},{"$ref":"#/components/schemas/CourseBlockQuote"},{"$ref":"#/components/schemas/CourseBlockImage"},{"$ref":"#/components/schemas/CourseBlockVideo"},{"$ref":"#/components/schemas/CourseBlockEmbed"},{"$ref":"#/components/schemas/CourseBlockTextBesideImage"},{"$ref":"#/components/schemas/CourseBlockTextOverImage"},{"$ref":"#/components/schemas/CourseBlockImageGrid"},{"$ref":"#/components/schemas/CourseBlockCarousel"},{"$ref":"#/components/schemas/CourseBlockAccordion"},{"$ref":"#/components/schemas/CourseBlockTabList"},{"$ref":"#/components/schemas/CourseBlockTable"},{"$ref":"#/components/schemas/CourseBlockFlashcardContainer"},{"$ref":"#/components/schemas/CourseBlockKnowledgeCheck"},{"$ref":"#/components/schemas/CourseBlockBarChart"},{"$ref":"#/components/schemas/CourseBlockPieChart"},{"$ref":"#/components/schemas/CourseBlockLineChart"}],"discriminator":{"propertyName":"type","mapping":{"text":"#/components/schemas/CourseBlockText","large_text":"#/components/schemas/CourseBlockLargeText","header":"#/components/schemas/CourseBlockHeader","highlight":"#/components/schemas/CourseBlockHighlight","quote":"#/components/schemas/CourseBlockQuote","image":"#/components/schemas/CourseBlockImage","video":"#/components/schemas/CourseBlockVideo","embed":"#/components/schemas/CourseBlockEmbed","text_beside_image":"#/components/schemas/CourseBlockTextBesideImage","text_over_image":"#/components/schemas/CourseBlockTextOverImage","image_grid":"#/components/schemas/CourseBlockImageGrid","carousel":"#/components/schemas/CourseBlockCarousel","accordion":"#/components/schemas/CourseBlockAccordion","tab_list":"#/components/schemas/CourseBlockTabList","table":"#/components/schemas/CourseBlockTable","flashcard_container":"#/components/schemas/CourseBlockFlashcardContainer","knowledge_check":"#/components/schemas/CourseBlockKnowledgeCheck","bar_chart":"#/components/schemas/CourseBlockBarChart","pie_chart":"#/components/schemas/CourseBlockPieChart","line_chart":"#/components/schemas/CourseBlockLineChart"}},"example":{"type":"text","html":"<p>Every dish must list its allergens.</p>"}},"CoursePage":{"type":"object","description":"One page of a chapter.","required":["title"],"properties":{"id":{"type":["string","null"],"format":"uuid","description":"The page's ID, as read. Send it to change this page, which keeps its ID, and its blocks if you leave them as they are; leave it out for a new page. A page can move to another chapter by appearing there."},"title":{"type":"string","description":"Page title.","minLength":1,"maxLength":255},"blocks":{"type":"array","description":"Blocks in order, top to bottom.","items":{"$ref":"#/components/schemas/CourseBlock"},"maxItems":500}},"additionalProperties":false,"example":{"id":"019cf5b0-7c00-7000-8000-000000000022","title":"Why it matters","blocks":[{"id":"019cf5b0-7c00-7000-8000-000000000122","type":"text","html":"<p>Every dish must list its allergens.</p>"}]}},"CourseQuiz":{"type":"object","description":"A scored quiz.","required":["title"],"properties":{"title":{"type":"string","description":"Quiz title, usually the chapter title.","minLength":1,"maxLength":255},"requires_pass":{"type":["boolean","null"],"description":"Whether learners must reach `passing_percentage` to complete the course."},"passing_percentage":{"type":["integer","null"],"description":"Score needed to pass, from 0 to 100; at least 1 when `requires_pass` is true.","minimum":0,"maximum":100},"shuffle_questions":{"type":["boolean","null"],"description":"Whether each attempt shuffles the questions."},"reveal_strategy":{"type":["string","null"],"enum":["reveal_all","hide_all","show_incorrect_with_feedback",null],"description":"What the results show: every answer, none, or only incorrect answers with feedback. Null is `show_incorrect_with_feedback`."},"questions":{"type":"array","description":"Questions in order.","items":{"$ref":"#/components/schemas/CourseQuestion"},"maxItems":500}},"additionalProperties":false,"example":{"title":"Allergen check","requires_pass":true,"passing_percentage":80,"shuffle_questions":false,"reveal_strategy":"show_incorrect_with_feedback","questions":[{"kind":"true_false","text":"Sesame is one of the 14 allergens.","answers":[{"text":"True","correct":true,"feedback":null},{"text":"False","correct":false,"feedback":null}]}]}},"CourseSigning":{"type":"object","description":"A document learners read and sign.","properties":{"body":{"type":["string","null"],"description":"The document, as HTML."},"statement":{"type":"string","description":"What learners agree to by signing.","maxLength":10000}},"additionalProperties":false,"example":{"body":"<p>I will check the allergen matrix before serving.</p>","statement":"I have read and agree to the above."}},"CourseChapter":{"type":"object","description":"One chapter. Most chapters hold pages; give a quiz or a signing its own chapter. Learners see a chapter's pages, then its quiz, signing or SCORM package.","required":["title"],"properties":{"id":{"type":["string","null"],"format":"uuid","description":"The chapter's ID, as read. Send it to change this chapter, which keeps its ID and every part you leave as it is; leave it out for a new chapter."},"title":{"type":"string","description":"Chapter title.","minLength":1,"maxLength":255},"header":{"type":["boolean","null"],"description":"Older section headings only: true makes the chapter a heading over the chapters after it. Leave false."},"picture":{"type":["string","null"],"description":"The picture in this chapter's circle on the learner's course page, named by a value from this API: an `id` from `POST /api/v1/media`, or a value read from this organisation's course content. Null shows the first photo in the chapter instead. In an imported course split into sections, give the section heading the picture."},"pages":{"type":"array","description":"Pages in order.","items":{"$ref":"#/components/schemas/CoursePage"},"maxItems":500},"quiz":{"oneOf":[{"$ref":"#/components/schemas/CourseQuiz"},{"type":"null"}],"description":"The chapter's quiz, if it has one."},"signing":{"oneOf":[{"$ref":"#/components/schemas/CourseSigning"},{"type":"null"}],"description":"The document learners sign, if the chapter has one."},"scorm":{"type":["string","null"],"description":"A SCORM package already in this course, as read. Packages can't be uploaded through the API; keep the value to keep the package."}},"additionalProperties":false,"example":{"id":"019cf5b0-7c00-7000-8000-000000000011","title":"The 14 allergens","header":false,"picture":null,"pages":[{"id":"019cf5b0-7c00-7000-8000-000000000021","title":"Why it matters","blocks":[{"id":"019cf5b0-7c00-7000-8000-000000000121","type":"text","html":"<p>Every dish must list its allergens.</p>"}]}],"quiz":null,"signing":null,"scorm":null}},"CourseDocument":{"type":"object","description":"A course's content as one document. Read it, change it and send it back whole. Chapters, pages and blocks you send with their `id` keep their IDs and anything you leave as it is; those without one are new, and those you leave out are removed. Top-level fields you leave out keep their current values, and fields you leave out inside `chapters` take the builder's defaults. `title`, `description`, `hero_image` and `appearance.display_theme` belong to the course and change straight away; everything else is versioned.","required":["title","chapters"],"properties":{"title":{"type":["string","null"],"description":"Course title. An unfinished builder draft can have an empty or null title; saving through this API requires a nonblank title.","maxLength":255},"description":{"type":["string","null"],"description":"Short description shown with the course.","maxLength":10000},"hero_image":{"type":["string","null"],"description":"A file named by a value from this API: an `id` from `POST /api/v1/media`, or a value read from this organisation's course content. Null for none. Shown on the course card."},"duration_min_minutes":{"type":["integer","null"],"description":"Shortest expected duration, in minutes.","minimum":0,"maximum":2147483647},"duration_max_minutes":{"type":["integer","null"],"description":"Expected duration, in minutes.","minimum":0,"maximum":2147483647},"appearance":{"type":"object","description":"The course's theme.","properties":{"display_theme":{"type":["string","null"],"enum":["adapt","light","dark",null],"description":"`adapt` follows each learner's light or dark preference; `light` and `dark` force one. Null is `adapt`."},"theme_color":{"type":["string","null"],"description":"Main theme colour as hex. Null uses Tayl's own colours."},"theme_color_dark":{"type":["string","null"],"description":"Colour used when learners view in dark mode. Null uses `theme_color`. Either way, Tayl lightens it for text on the dark page."},"theme_secondary_color":{"type":["string","null"],"description":"Secondary theme colour as hex, used by quotes and charts. Null uses Tayl's own colours."},"theme_secondary_color_dark":{"type":["string","null"],"description":"Colour used when learners view in dark mode. Null uses `theme_secondary_color`."},"heading_font":{"type":["string","null"],"enum":["sans","serif","rounded","monospace",null],"description":"Heading typeface. Null uses Tayl's."},"body_font":{"type":["string","null"],"enum":["sans","serif","rounded","monospace",null],"description":"Body typeface. Null uses Tayl's."}},"additionalProperties":false},"chapters":{"type":"array","description":"Chapters in order.","items":{"$ref":"#/components/schemas/CourseChapter"},"maxItems":500}},"additionalProperties":false,"example":{"title":"Allergen awareness","description":"What every server needs to know","hero_image":null,"duration_min_minutes":null,"duration_max_minutes":20,"appearance":{"display_theme":"adapt","theme_color":"#3f5da5","theme_color_dark":null,"theme_secondary_color":null,"theme_secondary_color_dark":null,"heading_font":null,"body_font":null},"chapters":[{"id":"019cf5b0-7c00-7000-8000-000000000012","title":"The 14 allergens","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-000000000023","title":"Why it matters","blocks":[{"id":"019cf5b0-7c00-7000-8000-000000000123","type":"text","html":"<p>Every dish must list its allergens.</p>"}]}],"quiz":null,"signing":null,"scorm":null}]}},"CourseReviewSuggestion":{"type":"object","description":"One way to make a course, chapter or page easier to learn from.","required":["pointer","code","message"],"properties":{"pointer":{"type":"string","description":"Where it applies, as a JSON Pointer into `content`, such as `/chapters/0/pages/1/blocks/2`."},"code":{"type":"string","enum":["long_text","missing_alt","no_feedback","no_hero_image","no_practice","nothing_to_see_or_do","plain_flashcards","repeats_page_title","text_run"],"description":"What the suggestion is about."},"message":{"type":"string","description":"What to change and why, in a sentence."}},"additionalProperties":false,"example":{"pointer":"/chapters/0/pages/0/blocks/1/alt","code":"missing_alt","message":"Add alt text saying what the image shows, for learners who use a screen reader."}},"CourseMediaFile":{"type":"object","description":"A file named in the document.","required":["url","filename","content_type","byte_size"],"properties":{"url":{"type":"string","description":"Download address. It redirects to the file; treat it as private.","format":"uri"},"filename":{"type":"string","description":"Original file name."},"content_type":{"type":"string","description":"MIME type."},"byte_size":{"type":"integer","description":"Size in bytes."}},"additionalProperties":false,"example":{"url":"https://tayl.pro/rails/active_storage/blobs/redirect/eyJfcmFpbHMi/chart.png","filename":"chart.png","content_type":"image/png","byte_size":48213}},"CourseContent":{"type":"object","description":"A course's content with what you need to save it back or publish it.","required":["course","version","etag","publishable","publish_error","review","media","content"],"properties":{"course":{"type":"object","description":"The course.","required":["id","status","published_at","current_version_id","editor_url"],"properties":{"id":{"type":"string","description":"Tayl UUID.","format":"uuid"},"status":{"type":"string","description":"`draft` until first published; `autosaved` is a draft never saved explicitly.","enum":["draft","autosaved","published","archived"]},"published_at":{"type":["string","null"],"description":"When the course was first published.","format":"date-time"},"current_version_id":{"type":["string","null"],"description":"UUID of the published version learners get.","format":"uuid"},"editor_url":{"type":"string","description":"Where a person opens the course builder to review the course.","format":"uri"}},"additionalProperties":false},"version":{"type":"object","description":"The version this content belongs to.","required":["id","number","draft","updated_at"],"properties":{"id":{"type":"string","description":"Tayl UUID.","format":"uuid"},"number":{"type":"integer","description":"Version number."},"draft":{"type":"boolean","description":"Whether this is the course's draft."},"updated_at":{"type":"string","description":"When the version last changed.","format":"date-time"}},"additionalProperties":false},"etag":{"type":"string","description":"Send as `If-Match` when saving the draft, so a change made since you read it isn't overwritten. Also sent in the `ETag` header. The published content's etag identifies that version; changes go to the draft."},"publishable":{"type":"boolean","description":"Whether the course's draft can be published now."},"publish_error":{"type":["string","null"],"description":"Why the draft can't be published yet, or null."},"review":{"type":"array","description":"Suggestions that would make this content easier to learn from, such as a picture without `alt` text, at most 20; read a chapter or page for its own. They never stop a save or publish: work through them, or tell the person why one doesn't apply.","items":{"$ref":"#/components/schemas/CourseReviewSuggestion"}},"media":{"type":"object","description":"Each file the content names, by the value used in the content.","additionalProperties":{"$ref":"#/components/schemas/CourseMediaFile"}},"content":{"$ref":"#/components/schemas/CourseDocument","description":"The content. Change it and send it back to save the draft."}},"additionalProperties":false,"example":{"course":{"id":"019cf5b0-7c00-7000-8000-000000000005","status":"draft","published_at":null,"current_version_id":null,"editor_url":"https://tayl.pro/create/courses/019cf5b0-7c00-7000-8000-000000000005/edit"},"version":{"id":"019cf5b0-7c00-7000-8000-000000000006","number":1,"draft":true,"updated_at":"2026-10-21T09:00:00Z"},"etag":"\"5d41402abc4b2a76b9719d911017c592\"","publishable":true,"publish_error":null,"review":[{"pointer":"/hero_image","code":"no_hero_image","message":"Give the course a hero_image, which learners see on their task and at the top of the course."},{"pointer":"/chapters/0/pages/0","code":"nothing_to_see_or_do","message":"This page is only text. Add a picture or diagram that shows its point, or something to do, such as a knowledge_check, flashcard_container or tab_list."},{"pointer":"/chapters/0","code":"no_practice","message":"Add a knowledge_check after a key idea, or a quiz, so learners recall what this chapter teaches."}],"media":{},"content":{"title":"Allergen awareness","description":"What every server needs to know","hero_image":null,"duration_min_minutes":null,"duration_max_minutes":20,"appearance":{"display_theme":"adapt","theme_color":"#3f5da5","theme_color_dark":null,"theme_secondary_color":null,"theme_secondary_color_dark":null,"heading_font":null,"body_font":null},"chapters":[{"id":"019cf5b0-7c00-7000-8000-000000000013","title":"The 14 allergens","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-000000000024","title":"Why it matters","blocks":[{"id":"019cf5b0-7c00-7000-8000-000000000124","type":"text","html":"<p>Every dish must list its allergens.</p>"}]}],"quiz":null,"signing":null,"scorm":null}]}}},"CourseOutlinePage":{"type":"object","description":"One page of an outline. A page moves to another chapter by being listed under it.","properties":{"id":{"type":["string","null"],"format":"uuid","description":"The page's ID, as read. Leave it out for a new, empty page."},"title":{"type":"string","minLength":1,"maxLength":255,"description":"Page title. Leave it out to keep the current one; a new page needs one."},"delete":{"type":"boolean","description":"True removes the page and its blocks."}},"additionalProperties":false,"example":{"id":"019cf5b0-7c00-7000-8000-000000000401","title":"Why it matters"}},"CourseOutlineChapter":{"type":"object","description":"One chapter of an outline.","properties":{"id":{"type":["string","null"],"format":"uuid","description":"The chapter's ID, as read. Leave it out for a new chapter."},"title":{"type":"string","minLength":1,"maxLength":255,"description":"Chapter title. Leave it out to keep the current one; a new chapter needs one."},"header":{"type":["boolean","null"],"description":"Older section headings only: true makes the chapter a heading over the chapters after it. Leave it out to keep the current value."},"delete":{"type":"boolean","description":"True removes the chapter, its quiz, signing and SCORM package, and the pages listed under it. Move a page out first by listing it under another chapter."},"pages":{"type":"array","description":"The chapter's pages in order, including any moving here.","items":{"$ref":"#/components/schemas/CourseOutlinePage"}}},"additionalProperties":false,"example":{"id":"019cf5b0-7c00-7000-8000-000000000301","title":"The 14 allergens","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-000000000401","title":"Why it matters"},{"id":"019cf5b0-7c00-7000-8000-000000000402","title":"Questions guests ask"}]}},"CourseOutline":{"type":"object","description":"A course's chapters and pages by ID and title, without their content. Send it back to reorder chapters, move pages between chapters, rename them, or add empty ones; content stays as it is. List every chapter and page once: leaving one out returns 422, and one marked `\"delete\": true` is removed, a chapter with the pages listed under it. Chapters and pages without an `id` are new and empty.","required":["chapters"],"properties":{"chapters":{"type":"array","description":"Chapters in order.","items":{"$ref":"#/components/schemas/CourseOutlineChapter"}}},"additionalProperties":false,"example":{"chapters":[{"id":"019cf5b0-7c00-7000-8000-000000000301","title":"The 14 allergens","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-000000000401","title":"Why it matters"},{"id":"019cf5b0-7c00-7000-8000-000000000402","title":"Questions guests ask"}]},{"id":"019cf5b0-7c00-7000-8000-000000000302","title":"Serving guests safely","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-000000000403","title":"Taking an order"}]},{"id":"019cf5b0-7c00-7000-8000-000000000303","title":"Old notes","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-000000000404","title":"Draft notes"}]}]}},"CourseOutlineContent":{"type":"object","description":"A course's outline with what you need to reorganise it.","required":["course","version","etag","content"],"properties":{"course":{"type":"object","description":"The course.","required":["id","status","published_at","current_version_id","editor_url"],"properties":{"id":{"type":"string","description":"Tayl UUID.","format":"uuid"},"status":{"type":"string","description":"`draft` until first published; `autosaved` is a draft never saved explicitly.","enum":["draft","autosaved","published","archived"]},"published_at":{"type":["string","null"],"description":"When the course was first published.","format":"date-time"},"current_version_id":{"type":["string","null"],"description":"UUID of the published version learners get.","format":"uuid"},"editor_url":{"type":"string","description":"Where a person opens the course builder to review the course.","format":"uri"}},"additionalProperties":false},"version":{"type":"object","description":"The version this content belongs to.","required":["id","number","draft","updated_at"],"properties":{"id":{"type":"string","description":"Tayl UUID.","format":"uuid"},"number":{"type":"integer","description":"Version number."},"draft":{"type":"boolean","description":"Whether this is the course's draft."},"updated_at":{"type":"string","description":"When the version last changed.","format":"date-time"}},"additionalProperties":false},"etag":{"type":"string","description":"Send as `If-Match` when saving the draft, so a change made since you read it isn't overwritten. Also sent in the `ETag` header. The published content's etag identifies that version; changes go to the draft."},"content":{"$ref":"#/components/schemas/CourseOutline","description":"The chapters and pages, without their content."}},"additionalProperties":false,"example":{"course":{"id":"019cf5b0-7c00-7000-8000-000000000005","status":"draft","published_at":null,"current_version_id":null,"editor_url":"https://tayl.pro/create/courses/019cf5b0-7c00-7000-8000-000000000005/edit"},"version":{"id":"019cf5b0-7c00-7000-8000-000000000006","number":1,"draft":true,"updated_at":"2026-10-21T09:00:00Z"},"etag":"\"5d41402abc4b2a76b9719d911017c592\"","content":{"chapters":[{"id":"019cf5b0-7c00-7000-8000-000000000301","title":"The 14 allergens","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-000000000401","title":"Why it matters"},{"id":"019cf5b0-7c00-7000-8000-000000000402","title":"Questions guests ask"}]},{"id":"019cf5b0-7c00-7000-8000-000000000302","title":"Serving guests safely","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-000000000403","title":"Taking an order"}]},{"id":"019cf5b0-7c00-7000-8000-000000000303","title":"Old notes","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-000000000404","title":"Draft notes"}]}]}}},"CourseChapterContent":{"type":"object","description":"One chapter of a course's content with what you need to save it back.","required":["course","version","etag","review","media","content"],"properties":{"course":{"type":"object","description":"The course.","required":["id","status","published_at","current_version_id","editor_url"],"properties":{"id":{"type":"string","description":"Tayl UUID.","format":"uuid"},"status":{"type":"string","description":"`draft` until first published; `autosaved` is a draft never saved explicitly.","enum":["draft","autosaved","published","archived"]},"published_at":{"type":["string","null"],"description":"When the course was first published.","format":"date-time"},"current_version_id":{"type":["string","null"],"description":"UUID of the published version learners get.","format":"uuid"},"editor_url":{"type":"string","description":"Where a person opens the course builder to review the course.","format":"uri"}},"additionalProperties":false},"version":{"type":"object","description":"The version this content belongs to.","required":["id","number","draft","updated_at"],"properties":{"id":{"type":"string","description":"Tayl UUID.","format":"uuid"},"number":{"type":"integer","description":"Version number."},"draft":{"type":"boolean","description":"Whether this is the course's draft."},"updated_at":{"type":"string","description":"When the version last changed.","format":"date-time"}},"additionalProperties":false},"etag":{"type":"string","description":"Send as `If-Match` when saving the draft, so a change made since you read it isn't overwritten. Also sent in the `ETag` header. The published content's etag identifies that version; changes go to the draft."},"review":{"type":"array","description":"Suggestions that would make this content easier to learn from, such as a picture without `alt` text, at most 20; read a chapter or page for its own. They never stop a save or publish: work through them, or tell the person why one doesn't apply.","items":{"$ref":"#/components/schemas/CourseReviewSuggestion"}},"media":{"type":"object","description":"Each file the content names, by the value used in the content.","additionalProperties":{"$ref":"#/components/schemas/CourseMediaFile"}},"content":{"$ref":"#/components/schemas/CourseChapter","description":"The chapter. Change it and send it back to save it."}},"additionalProperties":false,"example":{"course":{"id":"019cf5b0-7c00-7000-8000-000000000005","status":"draft","published_at":null,"current_version_id":null,"editor_url":"https://tayl.pro/create/courses/019cf5b0-7c00-7000-8000-000000000005/edit"},"version":{"id":"019cf5b0-7c00-7000-8000-000000000006","number":1,"draft":true,"updated_at":"2026-10-21T09:00:00Z"},"etag":"\"5d41402abc4b2a76b9719d911017c592\"","review":[{"pointer":"/pages/0","code":"nothing_to_see_or_do","message":"This page is only text. Add a picture or diagram that shows its point, or something to do, such as a knowledge_check, flashcard_container or tab_list."},{"pointer":"","code":"no_practice","message":"Add a knowledge_check after a key idea, or a quiz, so learners recall what this chapter teaches."}],"media":{},"content":{"id":"019cf5b0-7c00-7000-8000-000000000011","title":"The 14 allergens","header":false,"pages":[{"id":"019cf5b0-7c00-7000-8000-000000000021","title":"Why it matters","blocks":[{"id":"019cf5b0-7c00-7000-8000-000000000121","type":"text","html":"<p>Every dish must list its allergens.</p>"}]}],"quiz":null,"signing":null,"scorm":null}}},"CoursePageContent":{"type":"object","description":"One page of a course's content with what you need to save it back.","required":["course","version","etag","review","media","content"],"properties":{"course":{"type":"object","description":"The course.","required":["id","status","published_at","current_version_id","editor_url"],"properties":{"id":{"type":"string","description":"Tayl UUID.","format":"uuid"},"status":{"type":"string","description":"`draft` until first published; `autosaved` is a draft never saved explicitly.","enum":["draft","autosaved","published","archived"]},"published_at":{"type":["string","null"],"description":"When the course was first published.","format":"date-time"},"current_version_id":{"type":["string","null"],"description":"UUID of the published version learners get.","format":"uuid"},"editor_url":{"type":"string","description":"Where a person opens the course builder to review the course.","format":"uri"}},"additionalProperties":false},"version":{"type":"object","description":"The version this content belongs to.","required":["id","number","draft","updated_at"],"properties":{"id":{"type":"string","description":"Tayl UUID.","format":"uuid"},"number":{"type":"integer","description":"Version number."},"draft":{"type":"boolean","description":"Whether this is the course's draft."},"updated_at":{"type":"string","description":"When the version last changed.","format":"date-time"}},"additionalProperties":false},"etag":{"type":"string","description":"Send as `If-Match` when saving the draft, so a change made since you read it isn't overwritten. Also sent in the `ETag` header. The published content's etag identifies that version; changes go to the draft."},"review":{"type":"array","description":"Suggestions that would make this content easier to learn from, such as a picture without `alt` text, at most 20; read a chapter or page for its own. They never stop a save or publish: work through them, or tell the person why one doesn't apply.","items":{"$ref":"#/components/schemas/CourseReviewSuggestion"}},"media":{"type":"object","description":"Each file the content names, by the value used in the content.","additionalProperties":{"$ref":"#/components/schemas/CourseMediaFile"}},"content":{"$ref":"#/components/schemas/CoursePage","description":"The page. Change it and send it back to save it."}},"additionalProperties":false,"example":{"course":{"id":"019cf5b0-7c00-7000-8000-000000000005","status":"draft","published_at":null,"current_version_id":null,"editor_url":"https://tayl.pro/create/courses/019cf5b0-7c00-7000-8000-000000000005/edit"},"version":{"id":"019cf5b0-7c00-7000-8000-000000000006","number":1,"draft":true,"updated_at":"2026-10-21T09:00:00Z"},"etag":"\"5d41402abc4b2a76b9719d911017c592\"","review":[{"pointer":"","code":"nothing_to_see_or_do","message":"This page is only text. Add a picture or diagram that shows its point, or something to do, such as a knowledge_check, flashcard_container or tab_list."}],"media":{},"content":{"id":"019cf5b0-7c00-7000-8000-000000000022","title":"Why it matters","blocks":[{"id":"019cf5b0-7c00-7000-8000-000000000122","type":"text","html":"<p>Every dish must list its allergens.</p>"}]}}},"CourseDocumentPatchValueOperation":{"type":"object","description":"Adds, replaces or tests a value. A failed `test` stops the whole patch.","required":["op","path","value"],"properties":{"op":{"type":"string","description":"The operation.","enum":["add","replace","test"]},"path":{"type":"string","description":"JSON Pointer into the document, such as `/chapters/0/pages/1/blocks/2/html`. `-` appends to an array."},"value":{"description":"The value to add, replace with or test for."}},"additionalProperties":false,"example":{"op":"replace","path":"/chapters/0/pages/0/blocks/0/html","value":"<p>Every dish must list all 14 allergens.</p>"}},"CourseDocumentPatchRemoveOperation":{"type":"object","description":"Removes a value.","required":["op","path"],"properties":{"op":{"type":"string","description":"The operation.","enum":["remove"]},"path":{"type":"string","description":"JSON Pointer into the document, such as `/chapters/0/pages/1/blocks/2/html`. `-` appends to an array."}},"additionalProperties":false,"example":{"op":"remove","path":"/chapters/0/pages/1"}},"CourseDocumentPatchMoveOperation":{"type":"object","description":"Moves or copies a value from `from` to `path`.","required":["op","from","path"],"properties":{"op":{"type":"string","description":"The operation.","enum":["move","copy"]},"from":{"type":"string","description":"JSON Pointer to the value to move or copy."},"path":{"type":"string","description":"JSON Pointer into the document, such as `/chapters/0/pages/1/blocks/2/html`. `-` appends to an array."}},"additionalProperties":false,"example":{"op":"move","from":"/chapters/0/pages/1","path":"/chapters/0/pages/0"}},"CourseDocumentPatchOperation":{"description":"One RFC 6902 JSON Patch operation on the course document. `op` decides which fields apply.","oneOf":[{"$ref":"#/components/schemas/CourseDocumentPatchValueOperation"},{"$ref":"#/components/schemas/CourseDocumentPatchRemoveOperation"},{"$ref":"#/components/schemas/CourseDocumentPatchMoveOperation"}],"discriminator":{"propertyName":"op","mapping":{"add":"#/components/schemas/CourseDocumentPatchValueOperation","replace":"#/components/schemas/CourseDocumentPatchValueOperation","test":"#/components/schemas/CourseDocumentPatchValueOperation","remove":"#/components/schemas/CourseDocumentPatchRemoveOperation","move":"#/components/schemas/CourseDocumentPatchMoveOperation","copy":"#/components/schemas/CourseDocumentPatchMoveOperation"}},"example":{"op":"replace","path":"/chapters/0/pages/0/blocks/0/html","value":"<p>Every dish must list all 14 allergens.</p>"}},"CourseDocumentPatch":{"type":"array","description":"RFC 6902 JSON Patch operations, applied in order to the document you last read. The result is saved like a full replacement.","items":{"$ref":"#/components/schemas/CourseDocumentPatchOperation"},"minItems":1,"maxItems":1000,"example":[{"op":"test","path":"/chapters/0/title","value":"The 14 allergens"},{"op":"replace","path":"/chapters/0/pages/0/blocks/0/html","value":"<p>Every dish must list all 14 allergens.</p>"},{"op":"add","path":"/chapters/0/pages/-","value":{"title":"Questions guests ask","blocks":[]}}]},"CourseTrainingRules":{"type":"object","description":"Training rules for the course in your organisation's content library. Fields you leave out take the rules the course recommends.","properties":{"due_in_days":{"type":["integer","null"],"description":"Days learners have to complete the course after it's assigned. 0 or null means no due date.","minimum":0,"maximum":365},"valid_for_months":{"type":["integer","null"],"description":"How long a completion stays valid before it expires, in months. Null means it never expires.","minimum":1,"maximum":120},"available_to_recertify_within_days":{"type":["integer","null"],"description":"How many days before expiry learners can recertify. Needs `valid_for_months`.","minimum":1,"maximum":365},"issues_certificates":{"type":["boolean","null"],"description":"Whether learners can download a PDF certificate when they complete the course."},"minimum_minutes_required":{"type":["integer","null"],"description":"Minutes learners must spend in the course before they can complete it.","minimum":0,"maximum":2147483647},"compliance_training":{"type":["boolean","null"],"description":"Whether current assignments of the course count towards your organisation's compliance. Null means false."}},"additionalProperties":false,"example":{"due_in_days":14,"valid_for_months":12,"available_to_recertify_within_days":30,"issues_certificates":true,"minimum_minutes_required":null,"compliance_training":true}},"CoursePublish":{"type":"object","description":"Options for publishing a course's draft.","properties":{"training_rules":{"$ref":"#/components/schemas/CourseTrainingRules","description":"Rules for the content library, only when the course is first published. After that, change them in Tayl's content library."}},"additionalProperties":false,"example":{"training_rules":{"due_in_days":14,"compliance_training":true}}},"CourseRecommendations":{"type":"object","description":"What a Tayl course recommends, which each organisation's content library starts with when it adds the course and can change there. The names are the training rules a first publish takes.","properties":{"due_in_days":{"type":["integer","null"],"description":"Days learners have to complete the course after it's assigned. 0 or null means no due date.","minimum":0,"maximum":365},"valid_for_months":{"type":["integer","null"],"description":"How long a completion stays valid before it expires, in months. Null means it never expires. Set by Taylv2 while the course syncs from there.","minimum":1,"maximum":120},"available_to_recertify_within_days":{"type":["integer","null"],"description":"How many days before expiry learners can recertify. It needs a validity, recommended or required; null means 30.","minimum":1,"maximum":365},"issues_certificates":{"type":"boolean","description":"Whether learners can download a PDF certificate when they complete the course. Set by Taylv2 while the course syncs from there."},"minimum_minutes_required":{"type":["integer","null"],"description":"Minutes learners must spend in the course before they can complete it.","minimum":0,"maximum":2147483647},"compliance_training":{"type":"boolean","description":"Whether organisations that add the course start with it as compliance training."}},"additionalProperties":false,"example":{"due_in_days":14,"valid_for_months":12,"available_to_recertify_within_days":30,"issues_certificates":true,"minimum_minutes_required":20,"compliance_training":true}},"CourseRequirements":{"type":"object","description":"Rules a Tayl course fixes for every organisation, which no organisation or group can change. A change applies to every organisation straight away, including to learners part-way through.","properties":{"valid_for_months":{"type":["integer","null"],"description":"How long a completion stays valid before it expires, in months. Null leaves each organisation to choose.","minimum":1,"maximum":120},"minimum_minutes":{"type":["integer","null"],"description":"Minutes learners must spend in the course before they can complete it. Null leaves each organisation to choose.","minimum":0,"maximum":2147483647}},"additionalProperties":false,"example":{"valid_for_months":null,"minimum_minutes":null}},"CourseCertification":{"type":"object","description":"How a Tayl course is certified.","properties":{"certified":{"type":"boolean","description":"Whether an awarding body officially certifies the course. A certified course needs an accreditor."},"licensing_scotland":{"type":"boolean","description":"Whether the course's certificate carries the learner and trainer declarations the Licensing (Training of Staff) (Scotland) Regulations 2007 require."}},"additionalProperties":false,"example":{"certified":true,"licensing_scotland":false}},"CourseAvailability":{"type":"object","description":"How organisations get a Tayl course.","properties":{"on_request":{"type":"boolean","description":"Whether organisations ask Tayl for the course, such as one Tayl pays a licence for. Only Tayl staff add it to a library or share it with a group; everyone else is asked to get in touch. Turning it on leaves libraries that already have it alone."}},"additionalProperties":false,"example":{"on_request":false}},"CourseSettingsChoice":{"type":"object","description":"A category, industry, region or accreditor a Tayl course's settings can list. Tayl staff add them in Tayl.","required":["id","name"],"properties":{"id":{"type":"string","format":"uuid","description":"Tayl UUID, to send in the matching list."},"name":{"type":"string","description":"Its name, as people see it in Tayl."}},"additionalProperties":false,"example":{"id":"019cf5b0-7c00-7000-8000-000000000521","name":"England"}},"CourseSettings":{"type":"object","description":"A Tayl course's settings, which reach every organisation, and the choices its lists can take.","required":["course_id","syncs_from_v2","recommendations","requirements","certification","availability","category_ids","industry_ids","region_ids","accreditor_ids","choices"],"properties":{"course_id":{"type":"string","format":"uuid","description":"The course's Tayl UUID."},"syncs_from_v2":{"type":"boolean","description":"Whether the course still syncs from Taylv2, which then sets its validity, PDF certificates, categories and industries. Its first change of content or appearance in Tayl stops the sync for good."},"recommendations":{"$ref":"#/components/schemas/CourseRecommendations","description":"What the course recommends to each organisation."},"requirements":{"$ref":"#/components/schemas/CourseRequirements","description":"Rules the course fixes for every organisation."},"certification":{"$ref":"#/components/schemas/CourseCertification","description":"How the course is certified."},"availability":{"$ref":"#/components/schemas/CourseAvailability","description":"How organisations get the course."},"category_ids":{"type":"array","description":"The categories the course is in, from `choices.categories`. Set by Taylv2 while the course syncs from there.","uniqueItems":true,"items":{"type":"string","format":"uuid"}},"industry_ids":{"type":"array","description":"The industries the course is for, from `choices.industries`. Set by Taylv2 while the course syncs from there.","uniqueItems":true,"items":{"type":"string","format":"uuid"}},"region_ids":{"type":"array","description":"The regions the course is for, from `choices.regions`.","uniqueItems":true,"items":{"type":"string","format":"uuid"}},"accreditor_ids":{"type":"array","description":"The bodies that accredit the course, from `choices.accreditors`. Their logos appear on its certificates. While the course syncs from Taylv2, each sync adds V2's back.","uniqueItems":true,"items":{"type":"string","format":"uuid"}},"choices":{"type":"object","description":"What each list can hold.","required":["categories","industries","regions","accreditors"],"properties":{"categories":{"type":"array","description":"Tayl's course categories, for `category_ids`.","items":{"$ref":"#/components/schemas/CourseSettingsChoice"}},"industries":{"type":"array","description":"Tayl's industries, for `industry_ids`.","items":{"$ref":"#/components/schemas/CourseSettingsChoice"}},"regions":{"type":"array","description":"Tayl's regions, for `region_ids`.","items":{"$ref":"#/components/schemas/CourseSettingsChoice"}},"accreditors":{"type":"array","description":"The accrediting bodies, for `accreditor_ids`.","items":{"$ref":"#/components/schemas/CourseSettingsChoice"}}},"additionalProperties":false}},"additionalProperties":false,"example":{"course_id":"019cf5b0-7c00-7000-8000-000000000005","syncs_from_v2":false,"recommendations":{"due_in_days":14,"valid_for_months":12,"available_to_recertify_within_days":30,"issues_certificates":true,"minimum_minutes_required":20,"compliance_training":true},"requirements":{"valid_for_months":null,"minimum_minutes":null},"certification":{"certified":true,"licensing_scotland":false},"availability":{"on_request":false},"category_ids":["019cf5b0-7c00-7000-8000-000000000501"],"industry_ids":["019cf5b0-7c00-7000-8000-000000000511"],"region_ids":["019cf5b0-7c00-7000-8000-000000000521"],"accreditor_ids":["019cf5b0-7c00-7000-8000-000000000531"],"choices":{"categories":[{"id":"019cf5b0-7c00-7000-8000-000000000501","name":"Food safety"},{"id":"019cf5b0-7c00-7000-8000-000000000502","name":"Health and safety"}],"industries":[{"id":"019cf5b0-7c00-7000-8000-000000000511","name":"Hospitality"}],"regions":[{"id":"019cf5b0-7c00-7000-8000-000000000521","name":"England"},{"id":"019cf5b0-7c00-7000-8000-000000000522","name":"Scotland"}],"accreditors":[{"id":"019cf5b0-7c00-7000-8000-000000000531","name":"CPD"}]}}},"CourseSettingsInput":{"type":"object","description":"Changes to a Tayl course's settings. Fields you leave out keep their values; each list you send replaces the course's.","properties":{"recommendations":{"$ref":"#/components/schemas/CourseRecommendations","description":"What the course recommends to each organisation."},"requirements":{"$ref":"#/components/schemas/CourseRequirements","description":"Rules the course fixes for every organisation."},"certification":{"$ref":"#/components/schemas/CourseCertification","description":"How the course is certified."},"availability":{"$ref":"#/components/schemas/CourseAvailability","description":"How organisations get the course."},"category_ids":{"type":"array","description":"The categories the course is in, from `choices.categories`. Set by Taylv2 while the course syncs from there.","uniqueItems":true,"items":{"type":"string","format":"uuid"}},"industry_ids":{"type":"array","description":"The industries the course is for, from `choices.industries`. Set by Taylv2 while the course syncs from there.","uniqueItems":true,"items":{"type":"string","format":"uuid"}},"region_ids":{"type":"array","description":"The regions the course is for, from `choices.regions`.","uniqueItems":true,"items":{"type":"string","format":"uuid"}},"accreditor_ids":{"type":"array","description":"The bodies that accredit the course, from `choices.accreditors`. Their logos appear on its certificates. While the course syncs from Taylv2, each sync adds V2's back.","uniqueItems":true,"items":{"type":"string","format":"uuid"}}},"additionalProperties":false,"example":{"recommendations":{"due_in_days":14},"region_ids":["019cf5b0-7c00-7000-8000-000000000521","019cf5b0-7c00-7000-8000-000000000522"]}},"CourseImage":{"type":"object","description":"An image in the organisation's media library, ready to use in course documents.","required":["id","url","filename","content_type","byte_size"],"properties":{"id":{"type":"string","description":"Put this in a course document's image field, such as `image`, `hero_image` or `front_image`, to use the image."},"url":{"type":"string","description":"Download address. It redirects to the file; treat it as private.","format":"uri"},"filename":{"type":"string","description":"Original file name."},"content_type":{"type":"string","description":"MIME type."},"byte_size":{"type":"integer","description":"Size in bytes, after images wider or taller than 2400 pixels are scaled down."}},"additionalProperties":false,"example":{"id":"eyJfcmFpbHMiOnsiZGF0YSI6IjAxOWNmNWIwLTdjMDAtNzAwMC04MDAwLTAwMDAwMDAwMDA0MCJ9fQ--3f9a","url":"https://tayl.pro/rails/active_storage/blobs/redirect/eyJfcmFpbHMi/allergen-chart.png","filename":"allergen-chart.png","content_type":"image/png","byte_size":48213}},"Pathway":{"type":"object","description":"A published learning pathway in the organisation's library. Pass `id` as `assignable_id` (with `assignable_type: pathway`) when creating an assignment.","required":["id","title","current_version_id","published_at","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid","description":"Tayl UUID."},"title":{"type":"string","description":"Title shown to managers and learners."},"current_version_id":{"type":["string","null"],"format":"uuid","description":"UUID of the current published version, which new assignments deliver."},"current_version_number":{"type":["integer","null"],"description":"Human-facing number of the current published version."},"published_at":{"type":"string","format":"date-time","description":"When this version or assignment was published."},"created_at":{"type":"string","format":"date-time","description":"When the record was created, as an ISO 8601 UTC timestamp."},"updated_at":{"type":"string","format":"date-time","description":"When the represented record last changed, as an ISO 8601 UTC timestamp."}},"example":{"id":"019cf5b0-7c00-7000-8000-000000000007","title":"Front of house onboarding","current_version_id":"019cf5b0-7c00-7000-8000-000000000008","current_version_number":2,"published_at":"2026-02-25T10:00:00Z","created_at":"2025-12-01T09:00:00Z","updated_at":"2026-02-25T10:00:00Z"}},"PathwayList":{"type":"object","required":["pathways","meta"],"properties":{"pathways":{"type":"array","items":{"$ref":"#/components/schemas/Pathway"},"description":"Pathways on this page."},"meta":{"$ref":"#/components/schemas/Meta","description":"Metadata describing this page or bulk operation."}},"example":{"pathways":[{"id":"019cf5b0-7c00-7000-8000-000000000007","title":"Front of house onboarding","current_version_id":"019cf5b0-7c00-7000-8000-000000000008","current_version_number":2,"published_at":"2026-02-25T10:00:00Z","created_at":"2025-12-01T09:00:00Z","updated_at":"2026-02-25T10:00:00Z"}],"meta":{"page":1,"per_page":25,"total_pages":1,"total_count":1}},"description":"One page of published pathways in the organisation library."},"SignableDocument":{"type":"object","description":"A published document requiring signatures, in the organisation's library. Pass `id` as `assignable_id` (with `assignable_type: signable_document`) when creating an assignment.","required":["id","title","compliance_training","current_version_id","published_at","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid","description":"Tayl UUID."},"title":{"type":["string","null"],"description":"The current published version's title, as a document's title belongs to its version."},"compliance_training":{"type":"boolean","description":"The organisation's current compliance policy for this document."},"current_version_id":{"type":["string","null"],"format":"uuid","description":"UUID of the current published version, which new assignments deliver."},"current_version_number":{"type":["integer","null"],"description":"Human-facing number of the current published version."},"published_at":{"type":"string","format":"date-time","description":"When this version or assignment was published."},"created_at":{"type":"string","format":"date-time","description":"When the record was created, as an ISO 8601 UTC timestamp."},"updated_at":{"type":"string","format":"date-time","description":"When the represented record last changed, as an ISO 8601 UTC timestamp."}},"example":{"id":"019cf5b0-7c00-7000-8000-000000000009","title":"Employee handbook","compliance_training":true,"current_version_id":"019cf5b0-7c00-7000-8000-00000000000a","current_version_number":4,"published_at":"2026-03-01T10:00:00Z","created_at":"2025-10-01T09:00:00Z","updated_at":"2026-03-01T10:00:00Z"}},"SignableDocumentList":{"type":"object","required":["signable_documents","meta"],"properties":{"signable_documents":{"type":"array","items":{"$ref":"#/components/schemas/SignableDocument"},"description":"Signable documents on this page."},"meta":{"$ref":"#/components/schemas/Meta","description":"Metadata describing this page or bulk operation."}},"example":{"signable_documents":[{"id":"019cf5b0-7c00-7000-8000-000000000009","title":"Employee handbook","compliance_training":true,"current_version_id":"019cf5b0-7c00-7000-8000-00000000000a","current_version_number":4,"published_at":"2026-03-01T10:00:00Z","created_at":"2025-10-01T09:00:00Z","updated_at":"2026-03-01T10:00:00Z"}],"meta":{"page":1,"per_page":25,"total_pages":1,"total_count":1}},"description":"One page of published signable documents in the organisation library."},"AssignmentTarget":{"type":"object","required":["type","id"],"properties":{"type":{"type":"string","enum":["user","group"],"description":"Resource or event type discriminator."},"id":{"type":"string","format":"uuid","description":"The user's or group's Tayl UUID."},"external_id":{"type":["string","null"],"description":"The person's or group's `external_id`, when set."}},"example":{"type":"group","id":"019cf5b0-7c00-7000-8000-000000000003","external_id":"loc-london"},"description":"A person or group the assignment is for."},"AssignmentSettingSource":{"type":"object","required":["source","required","locked"],"additionalProperties":false,"properties":{"source":{"type":"string","enum":["assignment","content_library","organisation_group","course_requirement"],"description":"The authoritative owner of the effective value."},"required":{"type":"boolean","description":"Whether an explicit Course requirement fixes the value."},"locked":{"type":"boolean","description":"Whether the organisation is prevented from changing the value."}},"description":"Ownership and write-protection metadata for one effective training setting.","example":{"source":"content_library","required":false,"locked":false}},"Assignment":{"type":"object","description":"Content assigned to people and groups. The assignment's own settings are top-level fields; the settings learners get, wherever they come from, are under `effective_settings`.","required":["id","state","assignable_type","assignable_id","assignable_version_id","title","targets","requires_recompletion","require_sequential_progress","effective_settings","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid","description":"Tayl UUID."},"external_id":{"type":["string","null"],"description":"Caller-owned identifier, unique within the organisation."},"state":{"type":"string","enum":["scheduled","published","archived","frozen"],"description":"Current lifecycle state of the resource."},"assignable_type":{"type":"string","enum":["course","pathway","signable_document"],"description":"Kind of content represented by `assignable_id`."},"assignable_id":{"type":"string","format":"uuid","description":"The assigned content's UUID."},"assignable_version_id":{"type":["string","null"],"format":"uuid","description":"The minimum content version learners receive."},"title":{"type":["string","null"],"description":"The assignment's display title: `title_override` when set, otherwise the content's title."},"targets":{"type":"array","items":{"$ref":"#/components/schemas/AssignmentTarget"},"description":"The people and groups the assignment is for."},"due_in_days":{"type":["integer","null"],"description":"Days from task creation until due. 0 means explicitly no due date; null inherits."},"due_on":{"type":["string","null"],"format":"date","description":"Fixed due date. Can't be set with `due_in_days`."},"issues_certificates":{"type":["boolean","null"],"description":"A certificate setting kept from older course assignments. Read-only; null follows the content library."},"requires_recompletion":{"type":"boolean","description":"Whether learners who already completed a course or document must complete it again. Completed pathways are not reopened. When true on a pathway assignment, carried-over or imported course evidence must be dated after the assignment date."},"require_sequential_progress":{"type":"boolean","description":"Whether learners must view a course's pages in order. When true, later pages, quizzes, signing chapters and SCORM chapters stay locked until every page before them is viewed, and completion needs every page viewed. On a pathway assignment it applies to the pathway's courses; documents ignore it."},"include_future_members":{"type":["boolean","null"],"description":"Whether users who later join a targeted group are assigned too."},"send_notification":{"type":["boolean","null"],"description":"Whether Tayl notifies learners about newly created tasks."},"title_override":{"type":["string","null"],"description":"Assignment-specific title; null uses the content title."},"effective_settings":{"type":"object","description":"The settings learners get. They come from the content library, the organisation group's locks or the course's own requirements; due dates may be the assignment's own.","required":["due_in_days","valid_for_months","available_to_recertify_within_days","issues_certificates","minimum_minutes_required","sources"],"properties":{"due_in_days":{"type":["integer","null"],"description":"Relative number of days until a new task is due; null means inherited."},"valid_for_months":{"type":["integer","null"],"description":"Months a completion stays valid, as the content library sets; null means it doesn't expire, as for pathways."},"available_to_recertify_within_days":{"type":["integer","null"],"description":"Days before expiry when recertification opens, as the content library sets; null means no window is set, as for pathways."},"issues_certificates":{"type":"boolean","description":"Whether qualifying course completions issue certificates."},"minimum_minutes_required":{"type":["integer","null"],"minimum":0,"description":"Minimum learner engagement time required before completing the course."},"sources":{"type":"object","description":"Ownership metadata for each effective training setting, or null where a setting doesn't apply: certificates and minimum engagement apply only to courses, and validity and the recertification window only to courses and documents.","required":["due_in_days","valid_for_months","available_to_recertify_within_days","issues_certificates","minimum_minutes_required"],"additionalProperties":false,"properties":{"due_in_days":{"$ref":"#/components/schemas/AssignmentSettingSource","description":"Ownership metadata for the effective relative deadline."},"valid_for_months":{"oneOf":[{"$ref":"#/components/schemas/AssignmentSettingSource"},{"type":"null"}],"description":"Ownership metadata for how long completions remain valid, or null when validity does not apply."},"available_to_recertify_within_days":{"oneOf":[{"$ref":"#/components/schemas/AssignmentSettingSource"},{"type":"null"}],"description":"Ownership metadata for the recertification window, or null when validity does not apply."},"issues_certificates":{"oneOf":[{"$ref":"#/components/schemas/AssignmentSettingSource"},{"type":"null"}],"description":"Ownership metadata for certificate issuance, or null when certificates do not apply."},"minimum_minutes_required":{"oneOf":[{"$ref":"#/components/schemas/AssignmentSettingSource"},{"type":"null"}],"description":"Ownership metadata for minimum engagement, or null when minimum engagement does not apply."}}}}},"published_at":{"type":["string","null"],"format":"date-time","description":"When this version or assignment was published."},"scheduled_publish_at":{"type":["string","null"],"format":"date-time","description":"Scheduled publication time; null when publication is not scheduled."},"archived_at":{"type":["string","null"],"format":"date-time","description":"When the record was archived; null while current."},"created_at":{"type":"string","format":"date-time","description":"When the record was created, as an ISO 8601 UTC timestamp."},"updated_at":{"type":"string","format":"date-time","description":"When the represented record last changed, as an ISO 8601 UTC timestamp."}},"example":{"id":"019cf5b0-7c00-7000-8000-00000000000b","external_id":"asg-food-safety-london-2026","state":"published","assignable_type":"course","assignable_id":"019cf5b0-7c00-7000-8000-000000000005","assignable_version_id":"019cf5b0-7c00-7000-8000-000000000006","title":"Food safety essentials","targets":[{"type":"group","id":"019cf5b0-7c00-7000-8000-000000000003","external_id":"loc-london"}],"due_in_days":14,"due_on":null,"issues_certificates":true,"requires_recompletion":true,"require_sequential_progress":false,"include_future_members":true,"send_notification":true,"title_override":null,"effective_settings":{"due_in_days":14,"valid_for_months":12,"available_to_recertify_within_days":30,"issues_certificates":true,"minimum_minutes_required":10,"sources":{"due_in_days":{"source":"assignment","required":false,"locked":false},"valid_for_months":{"source":"content_library","required":false,"locked":false},"available_to_recertify_within_days":{"source":"content_library","required":false,"locked":false},"issues_certificates":{"source":"assignment","required":false,"locked":false},"minimum_minutes_required":{"source":"content_library","required":false,"locked":false}}},"published_at":"2026-03-12T09:00:00Z","scheduled_publish_at":null,"archived_at":null,"created_at":"2026-03-12T09:00:00Z","updated_at":"2026-03-12T09:00:00Z"}},"AssignmentList":{"type":"object","required":["assignments","meta"],"properties":{"assignments":{"type":"array","items":{"$ref":"#/components/schemas/Assignment"},"description":"Assignments on this page."},"meta":{"$ref":"#/components/schemas/Meta","description":"Metadata describing this page or bulk operation."}},"example":{"assignments":[{"id":"019cf5b0-7c00-7000-8000-00000000000b","external_id":"asg-food-safety-london-2026","state":"published","assignable_type":"course","assignable_id":"019cf5b0-7c00-7000-8000-000000000005","assignable_version_id":"019cf5b0-7c00-7000-8000-000000000006","title":"Food safety essentials","targets":[{"type":"group","id":"019cf5b0-7c00-7000-8000-000000000003","external_id":"loc-london"}],"due_in_days":14,"due_on":null,"issues_certificates":true,"requires_recompletion":true,"require_sequential_progress":false,"include_future_members":true,"send_notification":true,"title_override":null,"effective_settings":{"due_in_days":14,"valid_for_months":12,"available_to_recertify_within_days":30,"issues_certificates":true,"minimum_minutes_required":10,"sources":{"due_in_days":{"source":"assignment","required":false,"locked":false},"valid_for_months":{"source":"content_library","required":false,"locked":false},"available_to_recertify_within_days":{"source":"content_library","required":false,"locked":false},"issues_certificates":{"source":"assignment","required":false,"locked":false},"minimum_minutes_required":{"source":"content_library","required":false,"locked":false}}},"published_at":"2026-03-12T09:00:00Z","scheduled_publish_at":null,"archived_at":null,"created_at":"2026-03-12T09:00:00Z","updated_at":"2026-03-12T09:00:00Z"}],"meta":{"page":1,"per_page":25,"total_pages":1,"total_count":1}},"description":"One page of non-draft assignments."},"AssignmentTargetInput":{"type":"object","description":"Exactly one identifying key per entry. Unresolvable entries fail the whole request with a 422 pointing at the offending index.","additionalProperties":false,"properties":{"user_id":{"type":"string","format":"uuid","description":"UUID of the learner or organisation user."},"user_external_id":{"type":"string","minLength":1,"pattern":"\\S","description":"Caller-owned identifier of the learner, when set."},"group_id":{"type":"string","format":"uuid","description":"UUID of the group."},"group_external_id":{"type":"string","minLength":1,"pattern":"\\S","description":"Caller-owned identifier of the group, when set."}},"oneOf":[{"required":["user_id"]},{"required":["user_external_id"]},{"required":["group_id"]},{"required":["group_external_id"]}],"example":{"group_external_id":"loc-london"}},"AssignmentCreateInput":{"type":"object","required":["assignable_type","assignable_id","targets"],"properties":{"assignable_type":{"type":"string","enum":["course","pathway","signable_document"],"description":"Kind of content represented by `assignable_id`."},"assignable_id":{"type":"string","format":"uuid","description":"UUID of published content visible to the organisation and in its library (see the content endpoints)."},"external_id":{"type":["string","null"],"description":"Caller-owned identifier, unique within the organisation."},"targets":{"type":"array","minItems":1,"maxItems":500,"items":{"$ref":"#/components/schemas/AssignmentTargetInput"},"description":"The people and groups the assignment is for."},"due_in_days":{"type":["integer","null"],"minimum":0,"description":"Relative number of days until a new task is due; null means inherited."},"due_on":{"type":["string","null"],"format":"date","description":"Fixed task due date; null means no fixed date."},"requires_recompletion":{"type":"boolean","description":"Whether learners who already completed a course or document must complete it again. Completed pathways are not reopened. When true on a pathway assignment, carried-over or imported course evidence must be dated after the assignment date."},"require_sequential_progress":{"type":"boolean","description":"Whether learners must view a course's pages in order. When true, later pages, quizzes, signing chapters and SCORM chapters stay locked until every page before them is viewed, and completion needs every page viewed. On a pathway assignment it applies to the pathway's courses; documents ignore it."},"title_override":{"type":["string","null"],"description":"Assignment-specific title; null uses the content title."},"include_future_members":{"type":"boolean","default":true,"description":"Whether people joining a targeted group later also receive a task."},"send_notification":{"type":"boolean","default":true,"description":"Whether Tayl notifies learners about newly created tasks."}},"example":{"assignable_type":"course","assignable_id":"019cf5b0-7c00-7000-8000-000000000005","external_id":"asg-food-safety-london-2026","targets":[{"group_external_id":"loc-london"}],"due_in_days":14},"description":"Published content, the people and groups to assign it to, and optional assignment settings. Validity, recertification, certificates and minimum time are set in the content library; sending them returns 422."},"AssignmentUpdateInput":{"type":"object","description":"Fields you leave out keep their values, and null returns a setting to the one it inherits. Validity, recertification, certificates and minimum time are set in the content library; sending them returns 422. Setting one of `due_in_days` and `due_on` clears the other. A `targets` array replaces the people and groups: added ones get tasks, and tasks kept only by removed ones are cancelled.","properties":{"external_id":{"type":["string","null"],"description":"Caller-owned identifier used to reconcile this record with the source system."},"targets":{"type":"array","minItems":1,"maxItems":500,"items":{"$ref":"#/components/schemas/AssignmentTargetInput"},"description":"The people and groups the assignment is for."},"due_in_days":{"type":["integer","null"],"minimum":0,"description":"Relative number of days until a new task is due; null means inherited."},"due_on":{"type":["string","null"],"format":"date","description":"Fixed task due date; null means no fixed date."},"requires_recompletion":{"type":"boolean","description":"Whether learners who already completed a course or document must complete it again. Completed pathways are not reopened. When true on a pathway assignment, carried-over or imported course evidence must be dated after the assignment date."},"require_sequential_progress":{"type":"boolean","description":"Whether learners must view a course's pages in order. When true, later pages, quizzes, signing chapters and SCORM chapters stay locked until every page before them is viewed, and completion needs every page viewed. On a pathway assignment it applies to the pathway's courses; documents ignore it."},"title_override":{"type":["string","null"],"description":"Assignment-specific title; null uses the content title."},"include_future_members":{"type":"boolean","description":"Whether people joining a targeted group later also receive a task."},"send_notification":{"type":"boolean","description":"Whether Tayl notifies learners about newly created tasks."}},"example":{"due_in_days":21,"send_notification":false}},"ReportGroup":{"type":"object","description":"A group a row counts.","required":["id","external_id","name","category_id"],"properties":{"id":{"type":"string","format":"uuid","description":"Tayl UUID."},"external_id":{"$ref":"#/components/schemas/NullableExternalId","description":"Your ID for the group, when set."},"name":{"type":"string","description":"The group's name, such as a site."},"category_id":{"type":["string","null"],"format":"uuid","description":"The group's category, such as Location."}},"example":{"id":"019cf5b0-7c00-7000-8000-000000000003","external_id":"site-leeds","name":"Leeds","category_id":"019cf5b0-7c00-7000-8000-000000000010"}},"ReportPeople":{"type":"object","description":"People, each counted once. `counted` and `completed` answer how many people have and haven't completed their training.","required":["counted","completed","not_completed","overdue"],"properties":{"counted":{"type":"integer","minimum":0,"description":"People with a task that counts towards completion: not cancelled, and locked pathway tasks only when `basis.locked_tasks_counted`."},"completed":{"type":"integer","minimum":0,"description":"Of those, people who've completed all their counted tasks. On a content row, people who've completed it now: someone renewing it isn't, though `ever_completed` counts them."},"not_completed":{"type":"integer","minimum":0,"description":"`counted` less `completed`."},"overdue":{"type":"integer","minimum":0,"description":"People with an overdue task."},"with_open_tasks":{"type":"integer","minimum":0,"description":"Content rows only, as its Content Library page counts them: people with an open task for it, locked pathway tasks included."},"ever_completed":{"type":"integer","minimum":0,"description":"Content rows only: people who've completed it at least once, including in an earlier cycle."},"expired":{"type":"integer","minimum":0,"description":"Content rows only: people whose current certificate or signing for it has expired."},"due_for_renewal":{"type":"integer","minimum":0,"description":"Content rows only: people whose current certificate or signing is in its renewal window."}},"example":{"counted":24,"completed":20,"not_completed":4,"overdue":2,"with_open_tasks":6,"ever_completed":22,"expired":1,"due_for_renewal":2}},"ReportTasks":{"type":"object","description":"Tasks by status, as Tayl's Tasks overview counts them; each has at most one. A `pending` or `in_progress` task past its due date is overdue, unless the deadline is paused. Otherwise `pending` tasks are not started, and `active`, `in_progress` and `paused` ones in progress. Cancelled and expired tasks have no status, nor do locked pathway tasks unless `basis.locked_tasks_counted`, when they're not started, or overdue once past their due date.","required":["not_started","in_progress","overdue","completed"],"properties":{"not_started":{"type":"integer","minimum":0,"description":"Not started and not overdue."},"in_progress":{"type":"integer","minimum":0,"description":"Started and not overdue."},"overdue":{"type":"integer","minimum":0,"description":"Past their due date, unless the deadline is paused."},"completed":{"type":"integer","minimum":0,"description":"Completed in their current cycle."}},"example":{"not_started":21,"in_progress":9,"overdue":4,"completed":186}},"ReportCompliance":{"type":"object","description":"Compliance on `basis.compliance`: people fully compliant out of people with compliance training due, or compliance training items met out of those due. Training that isn't due yet doesn't count. A content row counts the people due to have done it.","required":["rate","compliant","counted"],"properties":{"rate":{"type":["integer","null"],"minimum":0,"maximum":100,"description":"Percentage, rounded; null when nothing is counted."},"compliant":{"type":"integer","minimum":0,"description":"People, or items, compliant."},"counted":{"type":"integer","minimum":0,"description":"People, or items, counted."}},"example":{"rate":88,"compliant":21,"counted":24}},"ReportCompletion":{"type":"object","description":"Completion on `basis.completion`: counted tasks completed, or people who've completed all their counted tasks out of people with any.","required":["rate","completed","counted"],"properties":{"rate":{"type":["integer","null"],"minimum":0,"maximum":100,"description":"Percentage, rounded; null when nothing is counted."},"completed":{"type":"integer","minimum":0,"description":"Tasks, or people, completed."},"counted":{"type":"integer","minimum":0,"description":"Tasks, or people, counted."}},"example":{"rate":85,"completed":186,"counted":220}},"ReportBasis":{"type":"object","description":"How the organisation counts, as chosen in Tayl under Settings > Compliance & completion.","required":["compliance","completion","locked_tasks_counted"],"properties":{"compliance":{"type":"string","enum":["people","tasks"],"description":"Compliance's basis."},"completion":{"type":"string","enum":["people","tasks"],"description":"Completion's basis."},"locked_tasks_counted":{"type":"boolean","description":"Whether tasks in locked pathway stages count."}},"example":{"compliance":"people","completion":"tasks","locked_tasks_counted":false}},"ReportPeriod":{"type":"object","description":"The window `completions` counts.","required":["completed_after","completed_before"],"properties":{"completed_after":{"type":"string","format":"date-time","description":"Start, as an ISO 8601 UTC timestamp."},"completed_before":{"type":"string","format":"date-time","description":"End, as an ISO 8601 UTC timestamp."}},"example":{"completed_after":"2026-10-05T00:00:00Z","completed_before":"2026-11-03T23:59:59Z"}},"TrainingSummary":{"type":"object","description":"The organisation's training figures, or one group's, for the current people the key reaches.","required":["group","people","tasks","compliance","completion","completions","basis","period"],"properties":{"group":{"oneOf":[{"$ref":"#/components/schemas/ReportGroup"},{"type":"null"}],"description":"The group filtered to, or null for the organisation."},"people":{"$ref":"#/components/schemas/ReportPeople","description":"People, each counted once."},"tasks":{"$ref":"#/components/schemas/ReportTasks","description":"Tasks by status."},"compliance":{"$ref":"#/components/schemas/ReportCompliance","description":"Compliance, with the counts behind it."},"completion":{"$ref":"#/components/schemas/ReportCompletion","description":"Completion, with the counts behind it."},"completions":{"type":"integer","minimum":0,"description":"Completions in `period`, renewals included. Derived credit isn't counted, nor, in organisation and group figures, pathway completions."},"basis":{"$ref":"#/components/schemas/ReportBasis","description":"How the organisation counts these figures."},"period":{"$ref":"#/components/schemas/ReportPeriod","description":"The window `completions` counts."}},"example":{"group":null,"people":{"counted":24,"completed":18,"not_completed":6,"overdue":3},"tasks":{"not_started":21,"in_progress":9,"overdue":4,"completed":186},"compliance":{"rate":88,"compliant":21,"counted":24},"completion":{"rate":85,"completed":186,"counted":220},"completions":37,"basis":{"compliance":"people","completion":"tasks","locked_tasks_counted":false},"period":{"completed_after":"2026-10-05T00:00:00Z","completed_before":"2026-11-03T23:59:59Z"}}},"GroupReport":{"type":"object","description":"One group's training figures. Someone in two groups counts in both.","required":["group","people","tasks","compliance","completion","completions"],"properties":{"group":{"$ref":"#/components/schemas/ReportGroup","description":"The group."},"people":{"$ref":"#/components/schemas/ReportPeople","description":"People, each counted once."},"tasks":{"$ref":"#/components/schemas/ReportTasks","description":"Tasks by status."},"compliance":{"$ref":"#/components/schemas/ReportCompliance","description":"Compliance, with the counts behind it."},"completion":{"$ref":"#/components/schemas/ReportCompletion","description":"Completion, with the counts behind it."},"completions":{"type":"integer","minimum":0,"description":"Completions in `period`, renewals included. Derived credit isn't counted, nor, in organisation and group figures, pathway completions."}},"example":{"group":{"id":"019cf5b0-7c00-7000-8000-000000000003","external_id":"site-leeds","name":"Leeds","category_id":"019cf5b0-7c00-7000-8000-000000000010"},"people":{"counted":24,"completed":18,"not_completed":6,"overdue":3},"tasks":{"not_started":21,"in_progress":9,"overdue":4,"completed":186},"compliance":{"rate":88,"compliant":21,"counted":24},"completion":{"rate":85,"completed":186,"counted":220},"completions":37}},"GroupReportList":{"type":"object","description":"A page of groups' training figures.","required":["groups","basis","period","meta"],"properties":{"groups":{"type":"array","items":{"$ref":"#/components/schemas/GroupReport"},"description":"Groups on this page, by name."},"basis":{"$ref":"#/components/schemas/ReportBasis","description":"How the organisation counts these figures."},"period":{"$ref":"#/components/schemas/ReportPeriod","description":"The window `completions` counts."},"meta":{"$ref":"#/components/schemas/Meta","description":"Metadata describing this page."}},"example":{"groups":[{"group":{"id":"019cf5b0-7c00-7000-8000-000000000003","external_id":"site-leeds","name":"Leeds","category_id":"019cf5b0-7c00-7000-8000-000000000010"},"people":{"counted":24,"completed":18,"not_completed":6,"overdue":3},"tasks":{"not_started":21,"in_progress":9,"overdue":4,"completed":186},"compliance":{"rate":88,"compliant":21,"counted":24},"completion":{"rate":85,"completed":186,"counted":220},"completions":37}],"basis":{"compliance":"people","completion":"tasks","locked_tasks_counted":false},"period":{"completed_after":"2026-10-05T00:00:00Z","completed_before":"2026-11-03T23:59:59Z"},"meta":{"page":1,"per_page":25,"total_pages":1,"total_count":1}}},"ReportContent":{"type":"object","description":"The content a row counts, across its versions.","required":["type","id","title","archived"],"properties":{"type":{"type":"string","enum":["course","pathway","signable_document"],"description":"Kind of content, as `assignable_type` elsewhere."},"id":{"type":"string","format":"uuid","description":"The content's UUID, as `assignable_id` on tasks and completions."},"title":{"type":"string","description":"Its current title."},"archived":{"type":"boolean","description":"Whether it's archived: no longer assigned, though its tasks still count."}},"example":{"type":"course","id":"019cf5b0-7c00-7000-8000-000000000005","title":"Food safety essentials","archived":false}},"ContentReport":{"type":"object","description":"One content's training figures, or with `by_group`, one group's for it. A pathway's row counts the pathway's own tasks; the courses and documents in it have rows of their own.","required":["content","group","people","tasks","compliance","completion","completions"],"properties":{"content":{"$ref":"#/components/schemas/ReportContent","description":"The content this row counts."},"group":{"oneOf":[{"$ref":"#/components/schemas/ReportGroup"},{"type":"null"}],"description":"With `by_group`, the group; otherwise null."},"people":{"$ref":"#/components/schemas/ReportPeople","description":"People, each counted once."},"tasks":{"$ref":"#/components/schemas/ReportTasks","description":"Tasks by status."},"compliance":{"$ref":"#/components/schemas/ReportCompliance","description":"Compliance, with the counts behind it."},"completion":{"$ref":"#/components/schemas/ReportCompletion","description":"Completion, with the counts behind it."},"completions":{"type":"integer","minimum":0,"description":"Completions in `period`, renewals included. Derived credit isn't counted, nor, in organisation and group figures, pathway completions."}},"example":{"content":{"type":"course","id":"019cf5b0-7c00-7000-8000-000000000005","title":"Food safety essentials","archived":false},"group":null,"people":{"counted":24,"completed":20,"not_completed":4,"overdue":2,"with_open_tasks":6,"ever_completed":22,"expired":1,"due_for_renewal":2},"tasks":{"not_started":2,"in_progress":0,"overdue":2,"completed":20},"compliance":{"rate":91,"compliant":21,"counted":23},"completion":{"rate":83,"completed":20,"counted":24},"completions":5}},"ContentReportList":{"type":"object","description":"A page of content's training figures.","required":["content","basis","period","meta"],"properties":{"content":{"type":"array","items":{"$ref":"#/components/schemas/ContentReport"},"description":"Rows on this page."},"basis":{"$ref":"#/components/schemas/ReportBasis","description":"How the organisation counts these figures."},"period":{"$ref":"#/components/schemas/ReportPeriod","description":"The window `completions` counts."},"meta":{"$ref":"#/components/schemas/Meta","description":"Metadata describing this page."}},"example":{"content":[{"content":{"type":"course","id":"019cf5b0-7c00-7000-8000-000000000005","title":"Food safety essentials","archived":false},"group":null,"people":{"counted":24,"completed":20,"not_completed":4,"overdue":2,"with_open_tasks":6,"ever_completed":22,"expired":1,"due_for_renewal":2},"tasks":{"not_started":2,"in_progress":0,"overdue":2,"completed":20},"compliance":{"rate":91,"compliant":21,"counted":23},"completion":{"rate":83,"completed":20,"counted":24},"completions":5}],"basis":{"compliance":"people","completion":"tasks","locked_tasks_counted":false},"period":{"completed_after":"2026-10-05T00:00:00Z","completed_before":"2026-11-03T23:59:59Z"},"meta":{"page":1,"per_page":25,"total_pages":1,"total_count":1}}},"Task":{"type":"object","description":"Training assigned to a learner. A task points at a version of its content: `assignable_id` is the course, pathway or document, and `assignable_version_id` its version. A course task's version can still change until the learner starts it; other tasks keep the version they were assigned.","required":["id","state","status","user_id","assignable_type","assignable_id","assignable_version_id","title","progress","latest_completion","current_completion","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid","description":"Tayl UUID."},"state":{"type":"string","enum":["pending","in_progress","completed","cancelled","locked"],"description":"Current lifecycle state of the resource."},"status":{"type":["string","null"],"enum":["not_started","in_progress","overdue","completed",null],"description":"Where the task stands for reporting, as the report summaries count it: `overdue` is unfinished work past `due_on` unless the deadline is paused. Null for a cancelled task, and for a locked one unless the organisation counts locked tasks (`basis.locked_tasks_counted` on a summary). It changes with the date, without `updated_at` moving."},"user_id":{"type":"string","format":"uuid","description":"The learner's Tayl user UUID."},"user_external_id":{"type":["string","null"],"description":"The learner's `external_id`, when set."},"assignable_type":{"type":"string","enum":["course","pathway","signable_document","resource"],"description":"Kind of content represented by `assignable_id`."},"assignable_id":{"type":"string","format":"uuid","description":"The parent content record's UUID."},"assignable_version_id":{"type":"string","format":"uuid","description":"UUID of the content version. For a course task the learner hasn't started, it becomes the latest published version when they start, then stays fixed."},"title":{"type":"string","description":"Title shown to managers and learners."},"due_on":{"type":["string","null"],"format":"date","description":"Fixed task due date; null means no fixed date."},"due_on_paused_at":{"type":["string","null"],"format":"date-time","description":"When a manager paused the deadline; null while it runs. A task with a paused deadline isn't overdue."},"started_at":{"type":["string","null"],"format":"date-time","description":"When the learner first started this task; null until started."},"completed_at":{"type":["string","null"],"format":"date-time","description":"When the learner completed the work; null until completion."},"progress":{"oneOf":[{"type":"object","required":["percent_complete","time_spent_seconds"],"properties":{"percent_complete":{"type":["integer","null"],"description":"Whole-number completion percentage, or null when the content cannot calculate one."},"time_spent_seconds":{"type":"integer","description":"Cumulative active learning time in seconds."},"last_interacted_at":{"type":["string","null"],"format":"date-time","description":"Most recent learner interaction time; null before interaction."}}},{"type":"null"}],"description":"Latest progress summary, or null before progress is recorded."},"latest_completion":{"oneOf":[{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"uuid","description":"Completion UUID, for `/completions/{id}` and `/certificates/{id}`."},"completed_at":{"type":["string","null"],"format":"date-time","description":"When the learner completed the work; null until completion."},"valid_until":{"type":["string","null"],"format":"date","description":"Date through which the completion or certificate is valid; null when it never expires."},"certificate_reference":{"type":["string","null"],"description":"Printable certificate reference, or null when no certificate was issued."}}},{"type":"null"}],"description":"Most recent completion for this task, or null before completion."},"current_completion":{"oneOf":[{"type":"object","required":["id"],"properties":{"id":{"type":"string","format":"uuid","description":"Completion UUID, for `/completions/{id}` and `/certificates/{id}`."},"completed_at":{"type":["string","null"],"format":"date-time","description":"When the learner completed the work; null until completion."},"valid_until":{"type":["string","null"],"format":"date","description":"Date through which the completion or certificate is valid; null when it never expires."},"certificate_reference":{"type":["string","null"],"description":"Printable certificate reference, or null when no certificate was issued."}}},{"type":"null"}],"description":"Completion that currently satisfies this task, or null when the task is incomplete."},"created_at":{"type":"string","format":"date-time","description":"When the record was created, as an ISO 8601 UTC timestamp."},"updated_at":{"type":"string","format":"date-time","description":"When the represented record last changed, as an ISO 8601 UTC timestamp."}},"example":{"id":"019cf5b0-7c00-7000-8000-00000000000c","state":"completed","status":"completed","user_id":"019cf5b0-7c00-7000-8000-000000000002","user_external_id":"usr-1042","assignable_type":"course","assignable_id":"019cf5b0-7c00-7000-8000-000000000005","assignable_version_id":"019cf5b0-7c00-7000-8000-000000000006","title":"Food safety essentials","due_on":"2026-03-26","due_on_paused_at":null,"started_at":"2026-03-15T09:10:00Z","completed_at":"2026-03-16T10:00:00Z","progress":{"percent_complete":100,"time_spent_seconds":1840,"last_interacted_at":"2026-03-16T10:00:00Z"},"latest_completion":{"id":"019cf5b0-7c00-7000-8000-00000000000d","completed_at":"2026-03-16T10:00:00Z","valid_until":"2027-03-16","certificate_reference":"CERT-20260316-A7K2"},"current_completion":{"id":"019cf5b0-7c00-7000-8000-00000000000d","completed_at":"2026-03-16T10:00:00Z","valid_until":"2027-03-16","certificate_reference":"CERT-20260316-A7K2"},"created_at":"2026-03-12T09:01:00Z","updated_at":"2026-03-16T10:00:00Z"}},"TaskList":{"type":"object","required":["tasks","meta"],"properties":{"tasks":{"type":"array","items":{"$ref":"#/components/schemas/Task"},"description":"Learner tasks on this page."},"meta":{"$ref":"#/components/schemas/Meta","description":"Metadata describing this page or bulk operation."}},"example":{"tasks":[{"id":"019cf5b0-7c00-7000-8000-00000000000c","state":"completed","status":"completed","user_id":"019cf5b0-7c00-7000-8000-000000000002","user_external_id":"usr-1042","assignable_type":"course","assignable_id":"019cf5b0-7c00-7000-8000-000000000005","assignable_version_id":"019cf5b0-7c00-7000-8000-000000000006","title":"Food safety essentials","due_on":"2026-03-26","due_on_paused_at":null,"started_at":"2026-03-15T09:10:00Z","completed_at":"2026-03-16T10:00:00Z","progress":{"percent_complete":100,"time_spent_seconds":1840,"last_interacted_at":"2026-03-16T10:00:00Z"},"latest_completion":{"id":"019cf5b0-7c00-7000-8000-00000000000d","completed_at":"2026-03-16T10:00:00Z","valid_until":"2027-03-16","certificate_reference":"CERT-20260316-A7K2"},"current_completion":{"id":"019cf5b0-7c00-7000-8000-00000000000d","completed_at":"2026-03-16T10:00:00Z","valid_until":"2027-03-16","certificate_reference":"CERT-20260316-A7K2"},"created_at":"2026-03-12T09:01:00Z","updated_at":"2026-03-16T10:00:00Z"}],"meta":{"page":1,"per_page":25,"total_pages":1,"total_count":1}},"description":"One page of learner tasks with current progress and completion summaries."},"Completion":{"type":"object","description":"A learner's completion of a piece of content. valid_until is null for completions that never expire; certificate_reference is non-null when a certificate was issued.","required":["id","task_id","user_id","assignable_type","assignable_id","assignable_version_id","title","completed_at","time_spent_seconds","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid","description":"Tayl UUID, which is also the certificate's ID when one was issued."},"task_id":{"type":"string","format":"uuid","description":"UUID of the learner task that produced this record."},"user_id":{"type":"string","format":"uuid","description":"The learner's Tayl user UUID."},"user_external_id":{"type":["string","null"],"description":"The learner's `external_id`, when set."},"assignable_type":{"type":"string","enum":["course","pathway","signable_document","resource"],"description":"Kind of content represented by `assignable_id`."},"assignable_id":{"type":"string","format":"uuid","description":"The parent content record's UUID."},"assignable_version_id":{"type":"string","format":"uuid","description":"The exact content version that was completed."},"title":{"type":"string","description":"Title shown to managers and learners."},"learner_name":{"type":["string","null"],"description":"The learner's name as captured at completion time."},"completed_at":{"type":["string","null"],"format":"date-time","description":"When the learner completed the work; null until completion."},"valid_until":{"type":["string","null"],"format":"date","description":"Null when the completion never expires."},"time_spent_seconds":{"type":"integer","description":"Cumulative active learning time in seconds."},"certificate_reference":{"type":["string","null"],"description":"Set when a certificate was issued; download it with `/certificates/{id}/download`."},"created_at":{"type":"string","format":"date-time","description":"When the record was created, as an ISO 8601 UTC timestamp."},"updated_at":{"type":"string","format":"date-time","description":"When the represented record last changed, as an ISO 8601 UTC timestamp."}},"example":{"id":"019cf5b0-7c00-7000-8000-00000000000d","task_id":"019cf5b0-7c00-7000-8000-00000000000c","user_id":"019cf5b0-7c00-7000-8000-000000000002","user_external_id":"usr-1042","assignable_type":"course","assignable_id":"019cf5b0-7c00-7000-8000-000000000005","assignable_version_id":"019cf5b0-7c00-7000-8000-000000000006","title":"Food safety essentials","learner_name":"Alex Chen","completed_at":"2026-03-16T10:00:00Z","valid_until":"2027-03-16","time_spent_seconds":1840,"certificate_reference":"CERT-20260316-A7K2","created_at":"2026-03-16T10:00:00Z","updated_at":"2026-03-16T10:00:00Z"}},"CompletionList":{"type":"object","required":["completions","meta"],"properties":{"completions":{"type":"array","items":{"$ref":"#/components/schemas/Completion"},"description":"Completions on this page."},"meta":{"$ref":"#/components/schemas/Meta","description":"Metadata describing this page or bulk operation."}},"example":{"completions":[{"id":"019cf5b0-7c00-7000-8000-00000000000d","task_id":"019cf5b0-7c00-7000-8000-00000000000c","user_id":"019cf5b0-7c00-7000-8000-000000000002","user_external_id":"usr-1042","assignable_type":"course","assignable_id":"019cf5b0-7c00-7000-8000-000000000005","assignable_version_id":"019cf5b0-7c00-7000-8000-000000000006","title":"Food safety essentials","learner_name":"Alex Chen","completed_at":"2026-03-16T10:00:00Z","valid_until":"2027-03-16","time_spent_seconds":1840,"certificate_reference":"CERT-20260316-A7K2","created_at":"2026-03-16T10:00:00Z","updated_at":"2026-03-16T10:00:00Z"}],"meta":{"page":1,"per_page":25,"total_pages":1,"total_count":1}},"description":"One page of learner completions for reporting or incremental export."},"Certificate":{"type":"object","description":"Metadata for an issued certificate. A certificate is a course completion with a PDF, not a record of its own, so its `id` is the completion's UUID.","required":["id","certificate_reference","issued_at","learner_name","user_id","task_id","course_id","course_title"],"properties":{"id":{"type":"string","format":"uuid","description":"The completion UUID."},"certificate_reference":{"type":"string","description":"Human-checkable reference printed on the certificate (CERT-YYYYMMDD-XXXX)."},"issued_at":{"type":["string","null"],"format":"date-time","description":"When the completion was recorded."},"valid_until":{"type":["string","null"],"format":"date","description":"Null when the certification never expires."},"learner_name":{"type":"string","description":"The learner's name as printed on the certificate."},"user_id":{"type":"string","format":"uuid","description":"UUID of the learner or organisation user."},"user_external_id":{"type":["string","null"],"description":"Caller-owned identifier of the learner, when set."},"task_id":{"type":"string","format":"uuid","description":"UUID of the learner task that produced this record."},"course_id":{"type":"string","format":"uuid","description":"UUID of the completed course."},"course_title":{"type":"string","description":"Course title printed on the certificate."}},"example":{"id":"019cf5b0-7c00-7000-8000-00000000000d","certificate_reference":"CERT-20260316-A7K2","issued_at":"2026-03-16T10:00:00Z","valid_until":"2027-03-16","learner_name":"Alex Chen","user_id":"019cf5b0-7c00-7000-8000-000000000002","user_external_id":"usr-1042","task_id":"019cf5b0-7c00-7000-8000-00000000000c","course_id":"019cf5b0-7c00-7000-8000-000000000005","course_title":"Food safety essentials"}},"CertificateList":{"type":"object","required":["certificates","meta"],"properties":{"certificates":{"type":"array","items":{"$ref":"#/components/schemas/Certificate"},"description":"Issued certificates on this page."},"meta":{"$ref":"#/components/schemas/Meta","description":"Metadata describing this page or bulk operation."}},"example":{"certificates":[{"id":"019cf5b0-7c00-7000-8000-00000000000d","certificate_reference":"CERT-20260316-A7K2","issued_at":"2026-03-16T10:00:00Z","valid_until":"2027-03-16","learner_name":"Alex Chen","user_id":"019cf5b0-7c00-7000-8000-000000000002","user_external_id":"usr-1042","task_id":"019cf5b0-7c00-7000-8000-00000000000c","course_id":"019cf5b0-7c00-7000-8000-000000000005","course_title":"Food safety essentials"}],"meta":{"page":1,"per_page":25,"total_pages":1,"total_count":1}},"description":"One page of issued certificate metadata for archival workflows."},"ApiKeySection":{"type":"object","description":"How much of one section of the docs a key can use.","required":["key","title","operations","missing_scopes","blocked_by","docs"],"properties":{"key":{"type":"string","description":"The section's key, as in its docs URL."},"title":{"type":"string","description":"The section's title."},"operations":{"type":"object","description":"How many of the section's operations the key can call now, out of all of them.","required":["callable","total"],"properties":{"callable":{"type":"integer","description":"Operations the key can call now."},"total":{"type":"integer","description":"All the section's operations."}}},"missing_scopes":{"type":"array","items":{"type":"string"},"description":"Scopes the section uses that the key lacks and could hold: an organisation admin can add them to an organisation key, and a person can include those their role allows in a new personal key."},"blocked_by":{"type":"array","items":{"type":"string","enum":["personal_keys_disabled","organisation_restricted","organisation_unavailable","course_builder_unavailable","reporting_unavailable","scope_not_grantable","role"]},"description":"What stops some of the section's operations, besides missing scopes: the organisation has turned off personal keys, its account needs attention, a personal key's person can't use it in Tayl for now, Course Builder or Advanced reporting isn't available, an operation needs a scope keys of this organisation can never hold, or a personal key's person has no role that allows it."},"docs":{"type":"object","description":"Where the section's docs are.","required":["markdown"],"properties":{"markdown":{"type":"string","format":"uri","description":"The section as markdown, for agents."}}}},"example":{"key":"people","title":"People and groups","operations":{"callable":0,"total":31},"missing_scopes":["users:read","users:write","groups:read","groups:write"],"blocked_by":[],"docs":{"markdown":"https://tayl.pro/api/v1/docs/people.md"}}},"ApiKey":{"type":"object","description":"The API key making the request and what it can do. The raw token is never returned.","required":["id","name","kind","person","organisation","scopes","granted_scopes","rate_limit_rps","expires_at","created_at","restriction","features","sections"],"properties":{"id":{"type":"string","format":"uuid","description":"Stable UUID for this resource."},"name":{"type":"string","description":"Human-readable name shown in Tayl."},"kind":{"type":"string","enum":["organisation","personal"],"description":"`organisation` for a key that acts for its organisation, as an integration does. `personal` for a key that acts as its person and can never do more than they can in Tayl, including keys an AI assistant holds after someone connects it."},"person":{"type":["object","null"],"description":"Who a personal key acts as; null for an organisation key.","required":["user_id","name"],"properties":{"user_id":{"type":["string","null"],"format":"uuid","description":"The person's user ID in this organisation, as `GET /api/v1/users/{id}` reads it; null for a group admin or Tayl staff member without a membership here."},"name":{"type":"string","description":"The person's name."}}},"organisation":{"type":"object","description":"The organisation whose data this key can reach.","required":["id","name"],"properties":{"id":{"type":"string","format":"uuid","description":"The organisation's Tayl UUID."},"name":{"type":"string","description":"The organisation's name."}}},"scopes":{"type":"array","items":{"type":"string"},"description":"The scopes this key can use: its grants, with `*` expanded and limited to what keys of its organisation can hold and, for a personal key, to what its person's role allows."},"granted_scopes":{"type":"array","items":{"type":"string"},"description":"The scopes granted to the key when it was created or last changed. `*` grants every scope keys of its organisation can hold, and for a personal key everything its person can do, including scopes added later."},"rate_limit_rps":{"type":"integer","description":"Requests per second this key may make."},"expires_at":{"type":["string","null"],"format":"date-time","description":"When the key expires; null for a key without scheduled expiry."},"created_at":{"type":"string","format":"date-time","description":"When the record was created, as an ISO 8601 UTC timestamp."},"restriction":{"type":["string","null"],"enum":["on_hold","unpaid","over_free_limit",null],"description":"Why the organisation's account needs attention: `on_hold` while Tayl has put it on hold, `unpaid`, or `over_free_limit` after a paid plan ended. Until it's resolved in Tayl, every other request with its keys returns `402 organisation_restricted`. Null when nothing needs attention."},"features":{"type":"object","description":"Features of the organisation that some operations need.","required":["course_builder","reporting"],"properties":{"course_builder":{"type":"boolean","description":"Whether Course Builder is available. Every course authoring write needs it."},"reporting":{"type":"boolean","description":"Whether Advanced reporting is available. The Reports summaries need it."}}},"sections":{"type":"array","items":{"$ref":"#/components/schemas/ApiKeySection"},"description":"Each section of the docs, with how much of it this key can use."}},"example":{"id":"019cf5b0-7c00-7000-8000-00000000000f","name":"Course drafting agent","kind":"organisation","person":null,"organisation":{"id":"019cf5b0-7c00-7000-8000-00000000000e","name":"The Anchor Pub Co"},"scopes":["content:read","content:write"],"granted_scopes":["content:read","content:write"],"rate_limit_rps":10,"expires_at":null,"created_at":"2026-03-01T09:00:00Z","restriction":null,"features":{"course_builder":true,"reporting":true},"sections":[{"key":"course-authoring","title":"Course authoring","operations":{"callable":27,"total":30},"missing_scopes":["content:publish"],"blocked_by":[],"docs":{"markdown":"https://tayl.pro/api/v1/docs/course-authoring.md"}}]}},"WebhookEventType":{"type":"string","enum":["user.created","user.updated","user.archived","user.restored","group.created","group.updated","group.archived","group.member_added","group.member_removed","assignment.created","assignment.updated","assignment.archived","task.started","task.completed","task.overdue","completion.created","certificate.issued","signable.signed"],"example":"user.created","description":"Event type available for webhook subscription and delivery filtering."},"WebhookEndpointList":{"type":"object","required":["webhook_endpoints","meta"],"properties":{"webhook_endpoints":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"},"description":"Webhook endpoints on this page."},"meta":{"$ref":"#/components/schemas/Meta","description":"Metadata describing this page or bulk operation."}},"example":{"webhook_endpoints":[{"id":"019cf5b0-7c00-7000-8000-000000000010","url":"https://integrations.example.com/tayl/webhooks","events":["user.created","task.completed"],"status":"active","created_by_user_id":"019cf5b0-7c00-7000-8000-000000000002","deactivated_at":null,"consecutive_failures":0,"last_success_at":"2026-03-16T10:00:02Z","last_failure_at":null,"last_failure_reason":null,"created_at":"2026-03-01T09:00:00Z","updated_at":"2026-03-16T10:00:02Z"}],"meta":{"page":1,"per_page":25,"total_pages":1,"total_count":1}},"description":"One page of configured webhook destinations."},"WebhookEndpointCreateInput":{"type":"object","additionalProperties":false,"required":["url","events"],"properties":{"url":{"type":"string","format":"uri","pattern":"^https://","maxLength":2048,"description":"Public HTTPS URL that receives webhook POST requests."},"events":{"type":"array","minItems":1,"uniqueItems":true,"items":{"$ref":"#/components/schemas/WebhookEventType"},"description":"Event types delivered to this endpoint."}},"example":{"url":"https://integrations.example.com/tayl/webhooks","events":["user.created","task.completed"]},"description":"HTTPS destination and subscriptions for a new webhook endpoint."},"WebhookEndpointWithSecret":{"allOf":[{"$ref":"#/components/schemas/WebhookEndpoint"},{"type":"object","required":["signing_secret"],"properties":{"signing_secret":{"type":"string","pattern":"^whsec_","description":"Shown once. Store it securely."}}}],"example":{"id":"019cf5b0-7c00-7000-8000-000000000010","url":"https://integrations.example.com/tayl/webhooks","events":["user.created","task.completed"],"status":"active","created_by_user_id":"019cf5b0-7c00-7000-8000-000000000002","deactivated_at":null,"consecutive_failures":0,"last_success_at":"2026-03-16T10:00:02Z","last_failure_at":null,"last_failure_reason":null,"created_at":"2026-03-01T09:00:00Z","updated_at":"2026-03-16T10:00:02Z","signing_secret":"whsec_lQ8fY2mN7cR4vP9xT6kD3sA1bE5gH0jU"},"description":"Webhook endpoint plus the one-time signing secret returned after creation or rotation."},"WebhookEndpointUpdateInput":{"type":"object","additionalProperties":false,"minProperties":1,"properties":{"url":{"type":"string","format":"uri","pattern":"^https://","maxLength":2048,"description":"Public HTTPS URL that receives webhook POST requests."},"events":{"type":"array","minItems":1,"uniqueItems":true,"items":{"$ref":"#/components/schemas/WebhookEventType"},"description":"Event types delivered to this endpoint."}},"example":{"events":["user.created","user.updated","task.completed"]},"description":"A new URL, new events or both for an existing endpoint."},"WebhookDeliveryHistoryEntry":{"type":"object","required":["at","manual","status","error","duration_ms"],"properties":{"at":{"type":"string","format":"date-time","description":"When this delivery attempt finished."},"manual":{"type":"boolean","description":"Whether an administrator requested this attempt."},"status":{"type":["integer","null"],"minimum":100,"maximum":599,"description":"Current processing or lifecycle status."},"error":{"type":["string","null"],"description":"Transport failure reason; null when an HTTP response was received."},"duration_ms":{"type":"integer","minimum":0,"description":"Elapsed delivery time in milliseconds."}},"example":{"at":"2026-03-16T10:00:02Z","manual":false,"status":204,"error":null,"duration_ms":182},"description":"Bounded diagnostic record for one HTTP delivery attempt."},"WebhookDeliveryList":{"type":"object","required":["webhook_deliveries","meta"],"properties":{"webhook_deliveries":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"},"description":"Webhook deliveries on this page."},"meta":{"$ref":"#/components/schemas/Meta","description":"Metadata describing this page or bulk operation."}},"example":{"webhook_deliveries":[{"id":"019cf5b0-7c00-7000-8000-000000000012","webhook_endpoint_id":"019cf5b0-7c00-7000-8000-000000000010","event_type":"user.created","event_id":"019cf5b0-7c00-7000-8000-000000000011","payload":{"id":"019cf5b0-7c00-7000-8000-000000000011","type":"user.created","created_at":"2026-03-16T10:00:00Z","data":{"id":"019cf5b0-7c00-7000-8000-000000000002","external_id":"usr-1042","email":"alex.chen@example.com","name":"Alex Chen","first_name":"Alex","last_name":"Chen","state":"active","invited_at":"2026-03-10T09:00:00Z","accepted_at":"2026-03-10T09:15:00Z","created_at":"2026-03-10T09:00:00Z","updated_at":"2026-03-16T10:00:00Z"}},"status":"sent","status_reason":null,"attempts":1,"next_attempt_at":null,"delivery_started_at":null,"last_attempted_at":"2026-03-16T10:00:02Z","response_status":204,"response_body_excerpt":"","history":[{"at":"2026-03-16T10:00:02Z","manual":false,"status":204,"error":null,"duration_ms":182}],"created_at":"2026-03-16T10:00:00Z","updated_at":"2026-03-16T10:00:02Z"}],"meta":{"page":1,"per_page":25,"total_pages":1,"total_count":1}},"description":"One page of retained webhook deliveries."},"WebhookMembershipData":{"type":"object","additionalProperties":false,"required":["group_id","group_external_id","user_id","user_external_id","email","name","source","created_at"],"properties":{"group_id":{"type":"string","format":"uuid","description":"UUID of the group."},"group_external_id":{"$ref":"#/components/schemas/NullableExternalId","description":"Caller-owned identifier of the group, when set."},"user_id":{"type":"string","format":"uuid","description":"UUID of the learner or organisation user."},"user_external_id":{"$ref":"#/components/schemas/NullableExternalId","description":"Caller-owned identifier of the learner, when set."},"email":{"type":"string","format":"email","description":"The organisation contact email, normalised to lowercase."},"name":{"type":"string","description":"Human-readable name shown in Tayl."},"source":{"type":"string","enum":["direct","inclusion","automatic","integration","rule"],"description":"How the membership was created and whether callers can remove it."},"created_at":{"type":"string","format":"date-time","description":"When the record was created, as an ISO 8601 UTC timestamp."}},"description":"Group and user snapshot captured for a membership change event.","example":{"user_id":"019cf5b0-7c00-7000-8000-000000000002","user_external_id":"usr-1042","email":"alex.chen@example.com","name":"Alex Chen","source":"direct","created_at":"2026-03-12T14:30:00Z","group_id":"019cf5b0-7c00-7000-8000-000000000003","group_external_id":"loc-london"}},"WebhookSignableSignedData":{"type":"object","additionalProperties":false,"required":["id","task_id","user_id","user_external_id","assignable_type","assignable_id","assignable_version_id","signable_chapter_id","title","signed_at","time_spent_reading_seconds","created_at","updated_at"],"properties":{"id":{"type":"string","format":"uuid","description":"Stable UUID for this resource."},"task_id":{"type":"string","format":"uuid","description":"UUID of the learner task that produced this record."},"user_id":{"type":"string","format":"uuid","description":"UUID of the learner or organisation user."},"user_external_id":{"$ref":"#/components/schemas/NullableExternalId","description":"Caller-owned identifier of the learner, when set."},"assignable_type":{"type":"string","enum":["course","signable_document"],"description":"Kind of content represented by `assignable_id`."},"assignable_id":{"type":"string","format":"uuid","description":"UUID of the parent course, pathway, document, or resource."},"assignable_version_id":{"type":"string","format":"uuid","description":"UUID of the exact content version delivered to the learner."},"signable_chapter_id":{"type":["string","null"],"format":"uuid","description":"UUID of the signed chapter for an in-course signature; null for a standalone document."},"title":{"type":["string","null"],"description":"Title shown to managers and learners."},"signed_at":{"type":"string","format":"date-time","description":"When the learner signed the document."},"time_spent_reading_seconds":{"type":"integer","minimum":0,"description":"Active reading time recorded before signature, in seconds."},"created_at":{"type":"string","format":"date-time","description":"When the record was created, as an ISO 8601 UTC timestamp."},"updated_at":{"type":"string","format":"date-time","description":"When the represented record last changed, as an ISO 8601 UTC timestamp."}},"description":"Signature snapshot captured when a learner signs a document or signable course chapter.","example":{"id":"019cf5b0-7c00-7000-8000-000000000013","task_id":"019cf5b0-7c00-7000-8000-00000000000c","user_id":"019cf5b0-7c00-7000-8000-000000000002","user_external_id":"usr-1042","assignable_type":"signable_document","assignable_id":"019cf5b0-7c00-7000-8000-000000000009","assignable_version_id":"019cf5b0-7c00-7000-8000-00000000000a","signable_chapter_id":null,"title":"Employee handbook","signed_at":"2026-03-16T10:00:00Z","time_spent_reading_seconds":420,"created_at":"2026-03-16T10:00:00Z","updated_at":"2026-03-16T10:00:00Z"}}},"parameters":{"Page":{"name":"page","in":"query","description":"Page to fetch.","schema":{"type":"integer","minimum":1,"default":1}},"PerPage":{"name":"per_page","in":"query","description":"Records per page.","schema":{"type":"integer","minimum":1,"maximum":100,"default":25}},"Since":{"name":"since","in":"query","description":"Inclusive ISO 8601 cursor. Each endpoint documents which change timestamps it considers.","schema":{"type":"string","format":"date-time"}},"Order":{"name":"order","in":"query","description":"Sort direction.","schema":{"type":"string","enum":["asc","desc"],"default":"asc"}},"ReportGroupId":{"name":"group_id","in":"query","description":"Only the group's current members, including those in groups it includes. Any group the key can see, automatic ones included; another returns `404`.","schema":{"type":"string","format":"uuid"}},"ReportGroupExternalId":{"name":"group_external_id","in":"query","description":"As `group_id`, naming the group by its `external_id`.","schema":{"type":"string"}},"ReportCompletedAfter":{"name":"completed_after","in":"query","description":"Start of the window `completions` counts, as an ISO 8601 datetime. Defaults to the start of the day 29 days ago (UTC), so the window is the last 30 days, as on Home.","schema":{"type":"string","format":"date-time"}},"ReportCompletedBefore":{"name":"completed_before","in":"query","description":"End of the window, as an ISO 8601 datetime. Defaults to the end of today (UTC).","schema":{"type":"string","format":"date-time"}},"GroupId":{"name":"group_id","in":"query","description":"Only records about the group's current members, including those in groups it includes. A group the key can't see matches nothing.","schema":{"type":"string","format":"uuid"}},"GroupExternalId":{"name":"group_external_id","in":"query","description":"As `group_id`, naming the group by its `external_id`.","schema":{"type":"string"}}},"headers":{"Link":{"description":"RFC 8288 pagination links with rel=\"first\", \"last\", \"next\" and \"prev\", leaving out \"prev\" on the first page and \"next\" on the last.","schema":{"type":"string"}},"ETag":{"description":"Identifies the version of the course content returned. Send it back as `If-Match` when saving.","schema":{"type":"string"}}},"responses":{"BadRequest":{"description":"Malformed request: an unknown query parameter, an invalid filter value, a malformed body, or a body sent to an operation that takes none (`unexpected_request_body`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"errors":[{"code":"unknown_query_param","message":"Unknown query parameter: limit","documentation_url":"https://tayl.pro/api/v1/docs/errors#unknown_query_param"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}}}},"Unauthorized":{"description":"Missing, invalid, revoked, or expired bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"errors":[{"code":"missing_token","message":"Authentication required","documentation_url":"https://tayl.pro/api/v1/docs/errors#missing_token"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}}}},"PaymentRequired":{"description":"The organisation's account needs attention: its plan does (for example, it's over the Free plan's limit after a paid plan ended), or Tayl has put it on hold. Every request is refused until it's resolved in Tayl.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"errors":[{"code":"organisation_restricted","message":"The organisation's account needs attention in Tayl; GET /api/v1/api-keys/current says why","documentation_url":"https://tayl.pro/api/v1/docs/errors#organisation_restricted"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}}}},"Forbidden":{"description":"The token lacks the scope this endpoint requires, or a personal key's person can't do this in Tayl.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"errors":[{"code":"insufficient_scope","message":"Token lacks the required scope: <scope named in this operation>","documentation_url":"https://tayl.pro/api/v1/docs/errors#insufficient_scope"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}}}},"TooManyRequests":{"description":"Rate limit exceeded. Respect `Retry-After` and the `X-RateLimit-*` headers.","headers":{"Retry-After":{"description":"Seconds to wait before retrying.","schema":{"type":"integer"}},"X-RateLimit-Limit":{"description":"The key's request cap for the current window.","schema":{"type":"integer"}},"X-RateLimit-Remaining":{"description":"Requests left in the current window (0 when throttled).","schema":{"type":"integer"}},"X-RateLimit-Reset":{"description":"Unix timestamp at which the window resets.","schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"errors":[{"code":"rate_limited","message":"Rate limit exceeded","documentation_url":"https://tayl.pro/api/v1/docs/errors#rate_limited"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}}}},"Conflict":{"description":"The external_id is already in use in this organisation; `errors[0].existing_id` carries the conflicting record's UUID when the key can see it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"errors":[{"code":"duplicate_external_id","message":"is already in use in this organisation","field":"external_id","pointer":"/data/external_id","existing_id":"019cf5b0-7c00-7000-8000-000000000002","documentation_url":"https://tayl.pro/api/v1/docs/errors#duplicate_external_id"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}}}},"UnprocessableContent":{"description":"Validation failed or the operation is not allowed in the record's current state.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"errors":[{"code":"validation_error","message":"is invalid","field":"email","pointer":"/data/email","documentation_url":"https://tayl.pro/api/v1/docs/errors#validation_error"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}}}},"NotFound":{"description":"No matching resource in the key's organisation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"errors":[{"code":"not_found","message":"Resource not found","documentation_url":"https://tayl.pro/api/v1/docs/errors#not_found"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}}}},"ContentTooLarge":{"description":"The request body is larger than the endpoint accepts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"errors":[{"code":"request_too_large","message":"Request body must be 10 MB or smaller","documentation_url":"https://tayl.pro/api/v1/docs/errors#request_too_large"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}}}},"PreconditionFailed":{"description":"The course content changed after the `If-Match` etag was read, or the etag came from the published content while the course has a draft. Read the draft again and reapply your changes.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"errors":[{"code":"version_changed","message":"The course's draft changed since you read it. Read it again, then reapply your changes.","documentation_url":"https://tayl.pro/api/v1/docs/errors#version_changed"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}}}},"PreconditionRequired":{"description":"The request needs an `If-Match` header with the etag from your last read.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"},"example":{"errors":[{"code":"precondition_required","message":"Send the etag from your last read as If-Match","documentation_url":"https://tayl.pro/api/v1/docs/errors#precondition_required"}],"request_id":"019cf5b0-7c00-7000-8000-000000000099"}}}}}}}