directory
25 endpoints.
/api/organizations Bearer tokenList organizations
Lists every organization in the directory, archived ones included. Requires a valid access token.
Responses
| Status | Description | Body |
|---|---|---|
| 200 | Every organization, ordered by name. | array of OrganizationSummary |
| 401 | The access token is missing or invalid. | ErrorResponse |
| 500 | The directory database could not be read. | ErrorResponse |
/api/organizations Bearer tokenCreate an organization
Creates a new top-level organization. Requires a superuser's access token.
| Field | Type | Required | Description |
|---|---|---|---|
| slug | string | yes | Unique across all organizations. Slugs are lowercase letters and digits in words separated by single hyphens, like customer-success. 1–100 characters · matches ^[a-z0-9]+(-[a-z0-9]+)*$ |
| name | string | yes | 1–200 characters |
| description | string | no | Omit or send empty for no description. at most 2000 characters |
Responses
| Status | Description | Body |
|---|---|---|
| 201 | The created organization. | Organization |
| 400 | The request body failed validation. | ErrorResponse |
| 401 | The access token is missing or invalid. | ErrorResponse |
| 403 | The access token's subject is not a superuser. | ErrorResponse |
| 409 | An organization with that slug already exists. | ErrorResponse |
| 500 | The directory database could not be reached, or the write failed. | ErrorResponse |
/api/organizations/{organizationId} Bearer tokenUpdate an organization
Changes an organization's slug, name or description; omitted fields keep their values. Requires a superuser's access token, like creating one.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| organizationId | path | string (uuid) | yes | e.g. 6f3b34d8-3c5e-4dd9-9f4e-2b52f0d9a1c7 |
| Field | Type | Required | Description |
|---|---|---|---|
| slug | string | no | Unique across all organizations. Slugs are lowercase letters and digits in words separated by single hyphens, like customer-success. 1–100 characters · matches ^[a-z0-9]+(-[a-z0-9]+)*$ |
| name | string | no | 1–200 characters |
| description | string | null | no | Send null or empty to clear the description. at most 2000 characters |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | The updated organization. | Organization |
| 400 | The request body failed validation. | ErrorResponse |
| 401 | The access token is missing or invalid. | ErrorResponse |
| 403 | The access token's subject is not a superuser. | ErrorResponse |
| 404 | No organization has that id. | ErrorResponse |
| 409 | Another organization already has that slug. | ErrorResponse |
| 500 | The directory database could not be reached, or the write failed. | ErrorResponse |
/api/organizations/{organizationId}/departments Bearer tokenCreate a department
Creates a department in an organization, optionally nested under a parent department in the same organization. Requires a superuser's access token, or one whose subject holds the directory:write permission in a scope covering the parent — the organization for a top-level department, the parent department for a nested one.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| organizationId | path | string (uuid) | yes | e.g. 6f3b34d8-3c5e-4dd9-9f4e-2b52f0d9a1c7 |
| Field | Type | Required | Description |
|---|---|---|---|
| slug | string | yes | Unique within the organization. Slugs are lowercase letters and digits in words separated by single hyphens, like customer-success. 1–100 characters · matches ^[a-z0-9]+(-[a-z0-9]+)*$ |
| name | string | yes | 1–200 characters |
| description | string | no | Omit or send empty for no description. at most 2000 characters |
| parent_department_id | string (uuid) | no | Nests the new department under one in the same organization. |
Responses
| Status | Description | Body |
|---|---|---|
| 201 | The created department. | Department |
| 400 | The request body failed validation. | ErrorResponse |
| 401 | The access token is missing or invalid. | ErrorResponse |
| 403 | The access token's subject is neither a superuser nor a directory:write holder whose scope covers the parent. | ErrorResponse |
| 404 | The organization does not exist, or the parent department is not in that organization. | ErrorResponse |
| 409 | The organization already has a department with that slug. | ErrorResponse |
| 500 | The directory database could not be reached, or the write failed. | ErrorResponse |
/api/organizations/{organizationId}/departments/{departmentId} Bearer tokenUpdate a department
Changes a department's slug, name or description, or moves it under another parent in the same organization; omitted fields keep their values. Requires a superuser's access token, or one whose subject holds the directory:write permission in a scope covering the department — and, when moving it, the new parent too.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| organizationId | path | string (uuid) | yes | e.g. 6f3b34d8-3c5e-4dd9-9f4e-2b52f0d9a1c7 |
| departmentId | path | string (uuid) | yes | e.g. 0b8f9a3e-97a4-4f2f-b3a3-51f2f8f0f7f4 |
| Field | Type | Required | Description |
|---|---|---|---|
| slug | string | no | Unique within the organization. Slugs are lowercase letters and digits in words separated by single hyphens, like customer-success. 1–100 characters · matches ^[a-z0-9]+(-[a-z0-9]+)*$ |
| name | string | no | 1–200 characters |
| description | string | null | no | Send null or empty to clear the description. at most 2000 characters |
| parent_department_id | string (uuid) | null | no | Moves the department under another in the same organization — never itself or anything nested beneath it. Send null to make it top level. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | The updated department. | Department |
| 400 | The request body failed validation. | ErrorResponse |
| 401 | The access token is missing or invalid. | ErrorResponse |
| 403 | The access token's subject is neither a superuser nor a directory:write holder whose scope covers the department (and the new parent, when moving it). | ErrorResponse |
| 404 | The organization does not exist, the department is not in that organization, or the new parent is not in that organization. | ErrorResponse |
| 409 | The organization already has a department with that slug, or the move would nest the department beneath itself. | ErrorResponse |
| 500 | The directory database could not be reached, or the write failed. | ErrorResponse |
/api/organizations/{organizationId}/departments/{departmentId}/roles Bearer tokenCreate a department role
Creates a role in a department of an organization, with the permission strings it grants. Requires a superuser's access token, or one whose subject holds the directory:write permission in a scope covering the department.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| organizationId | path | string (uuid) | yes | e.g. 6f3b34d8-3c5e-4dd9-9f4e-2b52f0d9a1c7 |
| departmentId | path | string (uuid) | yes | e.g. 0b8f9a3e-97a4-4f2f-b3a3-51f2f8f0f7f4 |
| Field | Type | Required | Description |
|---|---|---|---|
| slug | string | yes | Unique within the department. Slugs are lowercase letters and digits in words separated by single hyphens, like customer-success. 1–100 characters · matches ^[a-z0-9]+(-[a-z0-9]+)*$ |
| name | string | yes | 1–200 characters |
| description | string | no | Omit or send empty for no description. at most 2000 characters |
| permissions | array of string | no | The permissions the role grants, from the set the code understands. Duplicates are collapsed; an empty array grants nothing. at most 34 items · defaults to [] |
Responses
| Status | Description | Body |
|---|---|---|
| 201 | The created role. | DepartmentRole |
| 400 | The request body failed validation. | ErrorResponse |
| 401 | The access token is missing or invalid. | ErrorResponse |
| 403 | The access token's subject is neither a superuser nor a directory:write holder whose scope covers the department. | ErrorResponse |
| 404 | The organization does not exist, or the department is not in that organization. | ErrorResponse |
| 409 | The department already has a role with that slug. | ErrorResponse |
| 500 | The directory database could not be reached, or the write failed. | ErrorResponse |
/api/organizations/{organizationId}/departments/{departmentId}/roles/{roleId} Bearer tokenUpdate a department role
Changes a role's slug, name or description, or replaces the permission set it grants; omitted fields keep their values. Requires a superuser's access token, or one whose subject holds the directory:write permission in a scope covering the department.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| organizationId | path | string (uuid) | yes | e.g. 6f3b34d8-3c5e-4dd9-9f4e-2b52f0d9a1c7 |
| departmentId | path | string (uuid) | yes | e.g. 0b8f9a3e-97a4-4f2f-b3a3-51f2f8f0f7f4 |
| roleId | path | string (uuid) | yes | e.g. 4c1d2f6a-8e0b-45c7-9a92-6d84a4f4c9b1 |
| Field | Type | Required | Description |
|---|---|---|---|
| slug | string | no | Unique within the department. Slugs are lowercase letters and digits in words separated by single hyphens, like customer-success. 1–100 characters · matches ^[a-z0-9]+(-[a-z0-9]+)*$ |
| name | string | no | 1–200 characters |
| description | string | null | no | Send null or empty to clear the description. at most 2000 characters |
| permissions | array of string | no | Replaces the whole permission set, from the set the code understands. Duplicates are collapsed; an empty array grants nothing. at most 34 items |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | The updated role. | DepartmentRole |
| 400 | The request body failed validation. | ErrorResponse |
| 401 | The access token is missing or invalid. | ErrorResponse |
| 403 | The access token's subject is neither a superuser nor a directory:write holder whose scope covers the department. | ErrorResponse |
| 404 | The organization does not exist, the department is not in that organization, or the department has no role with that id. | ErrorResponse |
| 409 | The department already has a role with that slug. | ErrorResponse |
| 500 | The directory database could not be reached, or the write failed. | ErrorResponse |
/api/organizations/{organizationId}/departments/{departmentId}/roles/{roleId}/permanent-deletion Bearer tokenPreview permanently deleting a department role
Counts everything DELETE on this path would remove: the people currently holding the role (who lose every permission it grants), every grant of it on record, the reporting lines it sits on either end of, its certification requirements, and the quiz and learning pathway assignments that reached its holders. Nothing is changed. Requires a superuser's access token, or one whose subject holds directory:delete in a scope covering the department — a grant separate from directory:write, which only edits roles.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| organizationId | path | string (uuid) | yes | e.g. 6f3b34d8-3c5e-4dd9-9f4e-2b52f0d9a1c7 |
| departmentId | path | string (uuid) | yes | e.g. 0b8f9a3e-97a4-4f2f-b3a3-51f2f8f0f7f4 |
| roleId | path | string (uuid) | yes | e.g. 4c1d2f6a-8e0b-45c7-9a92-6d84a4f4c9b1 |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | What the deletion would take with it. | DeletionImpact |
| 401 | The access token is missing or invalid. | ErrorResponse |
| 403 | The access token's subject is neither a superuser nor a directory:delete holder whose scope covers the department. | ErrorResponse |
| 404 | The organization does not exist, the department is not in that organization, or the department has no role with that id. | ErrorResponse |
| 500 | The directory database could not be read. | ErrorResponse |
/api/organizations/{organizationId}/departments/{departmentId}/roles/{roleId}/permanent-deletion Bearer tokenPermanently delete a department role
Hard-deletes the role and everything that depends on it. Everyone holding it loses it, and with it every permission it granted; every grant of it on record is deleted, so nothing says who ever held it. Its reporting lines, certification requirements, and quiz and learning pathway assignments go with it; certification awards, learning records and attempts already on record stay. Irreversible — roles have no archive. Preview the cost with GET first. Requires a superuser's access token, or one whose subject holds directory:delete in a scope covering the department — a grant separate from directory:write, which only edits roles.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| organizationId | path | string (uuid) | yes | e.g. 6f3b34d8-3c5e-4dd9-9f4e-2b52f0d9a1c7 |
| departmentId | path | string (uuid) | yes | e.g. 0b8f9a3e-97a4-4f2f-b3a3-51f2f8f0f7f4 |
| roleId | path | string (uuid) | yes | e.g. 4c1d2f6a-8e0b-45c7-9a92-6d84a4f4c9b1 |
Responses
| Status | Description | Body |
|---|---|---|
| 204 | The role and its dependent rows are gone. | — |
| 401 | The access token is missing or invalid. | ErrorResponse |
| 403 | The access token's subject is neither a superuser nor a directory:delete holder whose scope covers the department. | ErrorResponse |
| 404 | The organization does not exist, the department is not in that organization, or the department has no role with that id. | ErrorResponse |
| 500 | The directory database could not be reached, or the write failed. | ErrorResponse |
/api/organizations/{org_id}/users/import Bearer tokenImport directory members from a CSV file
Adds every row of an uploaded CSV file to the organization's user directory in one request. The file needs a header row naming a user id, name and email column; rows whose subject is already in the directory are skipped rather than overwritten, so an import can safely be re-run. A file with any invalid row imports nothing and reports the problems, so a corrected file can simply be uploaded again. With `allow_email_only`, rows may name a member by email alone (see the form field). Requires a superuser's access token.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| org_id | path | string | yes | Organization UUID id or slug. |
| Field | Type | Required | Description |
|---|---|---|---|
| provider_id | string | yes | Sign-in provider UUID id or slug; every row's user_id is the OIDC `sub` claim the member will present at this provider. at least 1 character |
| allow_email_only | string | no | Set true to accept rows with a blank (or absent) user_id and an email: each resolves to the account a pending email link or a single live profile email already names, or else creates an account with a pending email link at the provider, so that person's first sign-in there lands in it. Default false. one of "true" | "false" |
| file | string (binary) | yes | CSV file, at most 1 MB: a header row naming a `user_id` (the OIDC `sub` claim at the named provider; `user_subject`, `subject` and `sub` are accepted too), `name` (or `display_name`) and `email` column in any order, then one member per row. Header matching is case-insensitive and extra columns are ignored. A member's name and email cells may be left blank; they seed a newly created account's profile. With `allow_email_only`, the user_id column may be blank or missing and rows are matched by email instead. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | The import's outcome: what was added and what was already present. | DirectoryImportSummary |
| 400 | The file is not parseable CSV, a required column is missing from the header, a row failed validation, a subject or email appears twice, an email-only row's address is carried by several live accounts, or the file has no (or too many) data rows. | ErrorResponse |
| 401 | The access token is missing or invalid. | ErrorResponse |
| 403 | The access token's subject is not a superuser. | ErrorResponse |
| 404 | No organization or sign-in provider has that id or slug. | ErrorResponse |
| 409 | A concurrent sign-in or import raced this one; re-run the import. | ErrorResponse |
| 413 | The file is larger than 1 MB. | ErrorResponse |
| 500 | The directory database could not be reached, or the write failed. | ErrorResponse |
/api/organizations/{org_id}/users Bearer tokenList an organization's user directory
Lists every member of the organization's user directory, named members first, each with the number of roles they currently hold. `trainers=true` narrows the list to the members holding a trainer role — an unexpired grant of a role that manages another role through a reporting line — the people an event's trainer pickers offer. Requires a valid access token.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| org_id | path | string | yes | Organization UUID id or slug. |
| trainers | query | string | no | Set true to list only the members holding a trainer role: an unexpired grant of a role that manages another role through a reporting line. Defaults to false. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | The directory's members. | array of DirectoryUser |
| 401 | The access token is missing or invalid. | ErrorResponse |
| 404 | No organization has that id or slug. | ErrorResponse |
| 500 | The directory database could not be read. | ErrorResponse |
/api/organizations/{org_id}/users Bearer tokenAdd a user to the directory
Adds a user to the organization's directory: an existing account by user_id, or a pre-provisioned identity by provider_id + subject — the account is created on the spot when that identity is new. Requires a superuser's access token.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| org_id | path | string | yes | Organization UUID id or slug. |
| Field | Type | Required | Description |
|---|---|---|---|
| user_id | string (uuid) | no | The member's account id (`users.id`). Mutually exclusive with provider_id/subject. |
| provider_id | string | no | Sign-in provider UUID id or slug. at least 1 character |
| subject | string | no | OIDC `sub` claim the member will present at that provider. 1–255 characters |
| display_name | string | no | Starting profile for a newly created account; ignored for an existing one. 1–300 characters |
| string | no | 1–300 characters |
Responses
| Status | Description | Body |
|---|---|---|
| 201 | The added member. | DirectoryUser |
| 400 | The request body failed validation. | ErrorResponse |
| 401 | The access token is missing or invalid. | ErrorResponse |
| 403 | The access token's subject is not a superuser. | ErrorResponse |
| 404 | The organization, the named user, or the named provider does not exist. | ErrorResponse |
| 409 | That user is already in the organization's directory. | ErrorResponse |
| 500 | The directory database could not be reached, or the write failed. | ErrorResponse |
/api/organizations/{org_id}/users/{user_id} Bearer tokenGet a directory member
Returns one member of the organization's directory, with every role grant they hold there — expired ones included. Requires a valid access token.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| org_id | path | string | yes | Organization UUID id or slug. |
| user_id | path | string (uuid) | yes | The member's account id (`users.id`). |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | The member and their grants. | DirectoryUserWithRoles |
| 401 | The access token is missing or invalid. | ErrorResponse |
| 404 | The organization does not exist, or that user is not in its directory. | ErrorResponse |
| 500 | The directory database could not be read. | ErrorResponse |
/api/organizations/{org_id}/users/{user_id} Bearer tokenRemove a user from the directory
Removes a member from the organization's directory, revoking every role they hold there. The account itself (and its history) remains. Requires a superuser's access token.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| org_id | path | string | yes | Organization UUID id or slug. |
| user_id | path | string (uuid) | yes | The member's account id (`users.id`). |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | The removed member, with the grants that were revoked. | DirectoryUserWithRoles |
| 401 | The access token is missing or invalid. | ErrorResponse |
| 403 | The access token's subject is not a superuser. | ErrorResponse |
| 404 | The organization does not exist, or that user is not in its directory. | ErrorResponse |
| 500 | The directory database could not be reached, or the write failed. | ErrorResponse |
/api/organizations/{org_id}/users/{user_id}/roles Bearer tokenList a directory member's roles
Lists every role grant a member holds in the organization, expired ones included — check expires_at. Requires a valid access token.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| org_id | path | string | yes | Organization UUID id or slug. |
| user_id | path | string (uuid) | yes | The member's account id (`users.id`). |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | The member's grants, by department and role name. | array of DirectoryUserRole |
| 401 | The access token is missing or invalid. | ErrorResponse |
| 404 | The organization does not exist, or that user is not in its directory. | ErrorResponse |
| 500 | The directory database could not be read. | ErrorResponse |
/api/organizations/{org_id}/users/{user_id}/roles Bearer tokenAssign a role to a directory member
Grants a member one of the roles defined by a department of the organization, open-ended or until an expiry. Requires a superuser's access token, or one whose subject holds directory:write in a scope covering the role's department — and then only for a member who already holds a role in a department that scope covers.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| org_id | path | string | yes | Organization UUID id or slug. |
| user_id | path | string (uuid) | yes | The member's account id (`users.id`). |
| Field | Type | Required | Description |
|---|---|---|---|
| department_id | string | yes | Department UUID id or slug, resolved within the organization. at least 1 character |
| role_id | string | yes | Role UUID id or slug, resolved within the department. at least 1 character |
| expires_at | string (date-time) | no | When the grant lapses; omit for an open-ended one. Must be in the future. |
Responses
| Status | Description | Body |
|---|---|---|
| 201 | The created grant. | DirectoryUserRole |
| 400 | The request body failed validation, or expires_at is not in the future. | ErrorResponse |
| 401 | The access token is missing or invalid. | ErrorResponse |
| 403 | The access token's subject is neither a superuser nor holds directory:write over the role's department, or the member holds no role in a department that grant covers. | ErrorResponse |
| 404 | The organization, the member in its directory, the department, or the role does not exist. | ErrorResponse |
| 409 | The member already holds that role. | ErrorResponse |
| 500 | The directory database could not be reached, or the write failed. | ErrorResponse |
/api/organizations/{org_id}/users/{user_id}/roles/{role_id} Bearer tokenUpdate a directory member's role grant
Changes when a member's grant expires — renewing a lapsed one, scheduling an end, or making it open-ended with null. Requires a superuser's access token.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| org_id | path | string | yes | Organization UUID id or slug. |
| user_id | path | string (uuid) | yes | The member's account id (`users.id`). |
| role_id | path | string | yes | Role UUID id or slug, resolved among the member's grants. A member holding identically-slugged roles in two departments must be addressed by the UUID. |
| Field | Type | Required | Description |
|---|---|---|---|
| expires_at | string (date-time) | null | yes | New expiry of the grant; null makes it open-ended. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | The updated grant. | DirectoryUserRole |
| 400 | The request body failed validation, expires_at does not follow the grant time, or the role slug is ambiguous across the member's departments. | ErrorResponse |
| 401 | The access token is missing or invalid. | ErrorResponse |
| 403 | The access token's subject is not a superuser. | ErrorResponse |
| 404 | The organization, the member in its directory, or the member's grant of that role does not exist. | ErrorResponse |
| 500 | The directory database could not be reached, or the write failed. | ErrorResponse |
/api/organizations/{org_id}/users/{user_id}/roles/{role_id} Bearer tokenRevoke a directory member's role
Removes one of a member's role grants. Requires a superuser's access token.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| org_id | path | string | yes | Organization UUID id or slug. |
| user_id | path | string (uuid) | yes | The member's account id (`users.id`). |
| role_id | path | string | yes | Role UUID id or slug, resolved among the member's grants. A member holding identically-slugged roles in two departments must be addressed by the UUID. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | The revoked grant. | DirectoryUserRole |
| 400 | The role slug is ambiguous across the member's departments. | ErrorResponse |
| 401 | The access token is missing or invalid. | ErrorResponse |
| 403 | The access token's subject is not a superuser. | ErrorResponse |
| 404 | The organization, the member in its directory, or the member's grant of that role does not exist. | ErrorResponse |
| 500 | The directory database could not be reached, or the write failed. | ErrorResponse |
/api/organizations/{organizationId}/departments/{departmentId}/roles/{roleId}/managers Bearer tokenList a role's reporting lines
Lists the roles managing this role and the roles it manages. Holders of a manager role (or of any role above it in the chain) may approve or reject the pending learning-record submissions of the subordinate role's holders.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| organizationId | path | string (uuid) | yes | e.g. 6f3b34d8-3c5e-4dd9-9f4e-2b52f0d9a1c7 |
| departmentId | path | string (uuid) | yes | e.g. 0b8f9a3e-97a4-4f2f-b3a3-51f2f8f0f7f4 |
| roleId | path | string (uuid) | yes | e.g. 9c2f1f7e-4a35-4b8f-8d21-3f5b2a7c9d10 |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | The role's reporting lines, both directions. | RoleManagers |
| 401 | The access token is missing or invalid. | ErrorResponse |
| 404 | The organization, department, or role does not exist there. | ErrorResponse |
| 500 | The directory database could not be read. | ErrorResponse |
/api/organizations/{organizationId}/departments/{departmentId}/roles/{roleId}/managers Bearer tokenMake a role a manager of this role
Adds a reporting line: the named role becomes a manager of the role in the path. Both roles must belong to the same organization; a line that would close a cycle is refused. Requires a superuser's access token, or one whose user holds directory:write in a scope covering both roles' departments.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| organizationId | path | string (uuid) | yes | e.g. 6f3b34d8-3c5e-4dd9-9f4e-2b52f0d9a1c7 |
| departmentId | path | string (uuid) | yes | e.g. 0b8f9a3e-97a4-4f2f-b3a3-51f2f8f0f7f4 |
| roleId | path | string (uuid) | yes | e.g. 9c2f1f7e-4a35-4b8f-8d21-3f5b2a7c9d10 |
| Field | Type | Required | Description |
|---|---|---|---|
| manager_role_id | string (uuid) | yes | The role to make a manager of this one. Any role of the same organization except this role itself, or one that would close a cycle. |
Responses
| Status | Description | Body |
|---|---|---|
| 201 | The created reporting line, manager side resolved. | RoleManagerEdge |
| 400 | The request body failed validation. | ErrorResponse |
| 401 | The access token is missing or invalid. | ErrorResponse |
| 403 | The caller is neither a superuser nor a directory:write holder whose scope covers both roles' departments. | ErrorResponse |
| 404 | The organization, department, or role does not exist there, or the manager role is not in that organization. | ErrorResponse |
| 409 | The role already reports to that manager, or the line would close a cycle. | ErrorResponse |
| 500 | The directory database could not be reached, or the write failed. | ErrorResponse |
/api/organizations/{organizationId}/departments/{departmentId}/roles/{roleId}/managers/{managerRoleId} Bearer tokenRemove a manager from this role
Removes the reporting line between this role and the named manager role. Requires a superuser's access token, or one whose user holds directory:write in a scope covering both roles' departments.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| organizationId | path | string (uuid) | yes | e.g. 6f3b34d8-3c5e-4dd9-9f4e-2b52f0d9a1c7 |
| departmentId | path | string (uuid) | yes | e.g. 0b8f9a3e-97a4-4f2f-b3a3-51f2f8f0f7f4 |
| roleId | path | string (uuid) | yes | e.g. 9c2f1f7e-4a35-4b8f-8d21-3f5b2a7c9d10 |
| managerRoleId | path | string (uuid) | yes | e.g. 2e6d0c4a-8b1f-4e7a-9c3d-5a4b6c7d8e9f |
Responses
| Status | Description | Body |
|---|---|---|
| 204 | The reporting line is gone. | — |
| 401 | The access token is missing or invalid. | ErrorResponse |
| 403 | The caller is neither a superuser nor a directory:write holder whose scope covers both roles' departments. | ErrorResponse |
| 404 | No such reporting line — a path segment or the line itself does not exist. | ErrorResponse |
| 500 | The directory database could not be reached, or the write failed. | ErrorResponse |
/api/organizations/{org_id} Bearer tokenGet an organization
Returns one organization and every department inside it. Requires a valid access token.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| org_id | path | string | yes | Organization UUID id or slug. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | The organization and its departments. | OrganizationWithDepartments |
| 401 | The access token is missing or invalid. | ErrorResponse |
| 404 | No organization has that id or slug. | ErrorResponse |
| 500 | The directory database could not be read. | ErrorResponse |
/api/organizations/{org_id}/departments/{dept_id} Bearer tokenGet a department
Returns one department of an organization. Requires a valid access token.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| org_id | path | string | yes | Organization UUID id or slug. |
| dept_id | path | string | yes | Department UUID id or slug, resolved within the organization. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | The department. | DepartmentSummary |
| 401 | The access token is missing or invalid. | ErrorResponse |
| 404 | The organization, or the department within it, does not exist. | ErrorResponse |
| 500 | The directory database could not be read. | ErrorResponse |
/api/organizations/{org_id}/departments/{dept_id}/roles Bearer tokenList a department's roles
Lists the roles a department defines, with the permissions each grants and how many users currently hold it. Requires a valid access token.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| org_id | path | string | yes | Organization UUID id or slug. |
| dept_id | path | string | yes | Department UUID id or slug, resolved within the organization. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | The department's roles, ordered by name. | array of DepartmentRoleSummary |
| 401 | The access token is missing or invalid. | ErrorResponse |
| 404 | The organization, or the department within it, does not exist. | ErrorResponse |
| 500 | The directory database could not be read. | ErrorResponse |
/api/organizations/{org_id}/departments/{dept_id}/roles/{role_id} Bearer tokenGet a department role
Returns one role of a department, with the permissions it grants and how many users currently hold it. Requires a valid access token.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| org_id | path | string | yes | Organization UUID id or slug. |
| dept_id | path | string | yes | Department UUID id or slug, resolved within the organization. |
| role_id | path | string | yes | Role UUID id or slug, resolved within the department. |
Responses
| Status | Description | Body |
|---|---|---|
| 200 | The role. | DepartmentRoleSummary |
| 401 | The access token is missing or invalid. | ErrorResponse |
| 404 | The organization, department or role does not exist. | ErrorResponse |
| 500 | The directory database could not be read. | ErrorResponse |