Skip to main content

Admin API: Scopes

Operations on scopes in the Odudu admin API, one section each. Every request carries a bearer token; the index says which audience it needs and how a refusal is shaped.

GET /admin/tenants/{tenant}/scopes​

Requires the "manage-tenant" capability.

Path parameters​

NameTypeRequiredDetails
tenantstringyesThe tenant being administered, addressed by name.

Query parameters​

NameTypeRequiredDetails
cursorstringnoThe next value of the previous page, to continue after it.
limitintegernoHow many items to return. A value over 200 is treated as 200; the default is 50. Constraints: at least 1.
namestringnoConstraints: at least 1 character.

Responses​

200 OK​

Body: application/json

FieldTypeRequiredDetails
itemsarray of objectyesThe entries of this answer.
items[]objectyes
items[].idstringyesThe scope’s identifier.
items[].namestringyesThe scope name clients request, such as profile.
items[].descriptionstring or nullyesFree text for administrators, or null.
items[].include_in_id_tokenbooleanyesWhether the claims this scope adds appear in the ID token.
items[].include_in_access_tokenbooleanyesWhether the claims this scope adds appear in the access token.
items[].default_client_assignmentstring or nullyesHow every new client gets this scope: default, optional, or null for neither. Constraints: one of default, optional.
items[].consent_textstring or nullyesThe sentence the consent screen shows for this scope, or null to use its name.
items[].display_orderintegeryesWhere the scope sorts on the consent screen; lowest first.
items[].created_atstringyesWhen the scope was created.
nextstringnoAn opaque cursor for the next page; absent on the last page.

401 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

403 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

POST /admin/tenants/{tenant}/scopes​

Requires the "manage-tenant" capability.

A tenant defines at most 1,000 scopes; one more is refused with 409. At most 200 scopes are marked (default_client_assignment) for every new client; marking another is refused with 409.

Path parameters​

NameTypeRequiredDetails
tenantstringyesThe tenant being administered, addressed by name.

Request body​

Body: application/json

FieldTypeRequiredDetails
namestringyesThe scope name clients will request. Unique in the tenant. Constraints: at least 1 character.
descriptionstring or nullnoFree text for administrators. Constraints: no bidirectional control characters, at least 1 character.
include_in_id_tokenbooleannoWhether its claims appear in the ID token.
include_in_access_tokenbooleannoWhether its claims appear in the access token.
default_client_assignmentstring or nullnoAssign it to every new client as default or optional. Constraints: one of default, optional.
consent_textstring or nullnoThe sentence the consent screen shows for it. Constraints: no bidirectional control characters, at least 1 character, at most 500 characters.
display_orderintegernoWhere it sorts on the consent screen; lowest first. Constraints: at least 0, at most 2147483647.

Responses​

201 Created​

Body: application/json

FieldTypeRequiredDetails
idstringyesThe scope’s identifier.
namestringyesThe scope name clients request, such as profile.
descriptionstring or nullyesFree text for administrators, or null.
include_in_id_tokenbooleanyesWhether the claims this scope adds appear in the ID token.
include_in_access_tokenbooleanyesWhether the claims this scope adds appear in the access token.
default_client_assignmentstring or nullyesHow every new client gets this scope: default, optional, or null for neither. Constraints: one of default, optional.
consent_textstring or nullyesThe sentence the consent screen shows for this scope, or null to use its name.
display_orderintegeryesWhere the scope sorts on the consent screen; lowest first.
created_atstringyesWhen the scope was created.

401 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

403 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

GET /admin/tenants/{tenant}/scopes/count​

Requires the "manage-tenant" capability.

Path parameters​

NameTypeRequiredDetails
tenantstringyesThe tenant being administered, addressed by name.

Query parameters​

NameTypeRequiredDetails
namestringnoConstraints: at least 1 character.

Responses​

200 OK​

Body: application/json

FieldTypeRequiredDetails
countintegeryesHow many items match, up to a cap.
cappedbooleanyesTrue when more match than count says, because counting stops at the cap.

401 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

403 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

GET /admin/tenants/{tenant}/scopes/{id}​

Requires the "manage-tenant" capability.

Path parameters​

NameTypeRequiredDetails
tenantstringyesThe tenant being administered, addressed by name.
idstringyesA row id. Constraints: a UUID.

Responses​

200 OK​

Body: application/json

FieldTypeRequiredDetails
idstringyesThe scope’s identifier.
namestringyesThe scope name clients request, such as profile.
descriptionstring or nullyesFree text for administrators, or null.
include_in_id_tokenbooleanyesWhether the claims this scope adds appear in the ID token.
include_in_access_tokenbooleanyesWhether the claims this scope adds appear in the access token.
default_client_assignmentstring or nullyesHow every new client gets this scope: default, optional, or null for neither. Constraints: one of default, optional.
consent_textstring or nullyesThe sentence the consent screen shows for this scope, or null to use its name.
display_orderintegeryesWhere the scope sorts on the consent screen; lowest first.
created_atstringyesWhen the scope was created.

401 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

403 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

PATCH /admin/tenants/{tenant}/scopes/{id}​

Requires the "manage-tenant" capability.

Marking a scope for every new client (default_client_assignment) is refused with 409 once 200 are marked.

Path parameters​

NameTypeRequiredDetails
tenantstringyesThe tenant being administered, addressed by name.
idstringyesA row id. Constraints: a UUID.

Request body​

Body: application/json

FieldTypeRequiredDetails
(body)objectyesConstraints: other fields accepted.

Responses​

200 OK​

Body: application/json

FieldTypeRequiredDetails
idstringyesThe scope’s identifier.
namestringyesThe scope name clients request, such as profile.
descriptionstring or nullyesFree text for administrators, or null.
include_in_id_tokenbooleanyesWhether the claims this scope adds appear in the ID token.
include_in_access_tokenbooleanyesWhether the claims this scope adds appear in the access token.
default_client_assignmentstring or nullyesHow every new client gets this scope: default, optional, or null for neither. Constraints: one of default, optional.
consent_textstring or nullyesThe sentence the consent screen shows for this scope, or null to use its name.
display_orderintegeryesWhere the scope sorts on the consent screen; lowest first.
created_atstringyesWhen the scope was created.

401 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

403 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

DELETE /admin/tenants/{tenant}/scopes/{id}​

Requires the "manage-tenant" capability.

Cascades to every client’s assignment and role mapping naming the scope; GET …/impact counts them first. A built-in scope — one every tenant is given, decided by its name alone — is deleted only when confirm names it again, refused with 422 builtin-scope-confirmation otherwise, the detail naming the scope and what would go with it; POST …/scopes/restore-builtins creates it again, without what the cascade took. Refused with 409 for the scope named openid, which every client’s assignment of it — the tenant’s built-in admin client included — would otherwise be stripped of in the same stroke, whatever confirm says. The audit row carries builtin and both counts. Refused with 403 when what it removes reaches an admin capability the caller does not hold.

Path parameters​

NameTypeRequiredDetails
tenantstringyesThe tenant being administered, addressed by name.
idstringyesA row id. Constraints: a UUID.

Query parameters​

NameTypeRequiredDetails
confirmstringnoConstraints: at least 1 character.

Responses​

204 OK​

Body: application/json

FieldTypeRequiredDetails
(body)anyyes

401 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

403 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

GET /admin/tenants/{tenant}/scopes/{id}/impact​

Requires the "manage-tenant" capability.

What deleting the scope would take with it: how many clients carry it and how many roles are mapped to it, each counted up to the same ceiling the list counts stop at, and whether it is a built-in scope, which its name alone decides. Two bounded index reads, whatever the tenant holds.

Path parameters​

NameTypeRequiredDetails
tenantstringyesThe tenant being administered, addressed by name.
idstringyesA row id. Constraints: a UUID.

Responses​

200 OK​

Body: application/json

FieldTypeRequiredDetails
builtinbooleanyesTrue for a scope every tenant has, which is deleted only when confirm names it.
client_assignmentsobjectyesHow many clients carry the scope, each of which loses it on deletion.
client_assignments.countintegeryesHow many items match, up to a cap.
client_assignments.cappedbooleanyesTrue when more match than count says, because counting stops at the cap.
role_mappingsobjectyesHow many roles are mapped to the scope, each unmapped on deletion.
role_mappings.countintegeryesHow many items match, up to a cap.
role_mappings.cappedbooleanyesTrue when more match than count says, because counting stops at the cap.

401 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

403 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

GET /admin/tenants/{tenant}/scopes/builtins​

Requires the "manage-tenant" capability.

Every built-in scope, in the order a new tenant is given them, and whether this tenant has it. One read over the name index.

Path parameters​

NameTypeRequiredDetails
tenantstringyesThe tenant being administered, addressed by name.

Responses​

200 OK​

Body: application/json

FieldTypeRequiredDetails
itemsarray of objectyesEvery built-in scope, in the order a new tenant is given them.
items[]objectyes
items[].namestringyesThe scope’s name.
items[].presentbooleanyesFalse when the tenant has no scope of that name, so a restore would create it.

401 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

403 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

POST /admin/tenants/{tenant}/scopes/restore-builtins​

Requires the "manage-tenant" capability.

Creates each built-in scope the tenant is missing with the settings a new tenant is given, and answers the names it created, none when none was missing: repeating it is harmless. A name that exists is not recreated, whatever scope holds it, and that scope is not read or changed, edited or not, and the client assignments and role mappings a deletion took are not recreated. Refused with 409, creating nothing, when the missing ones would pass the tenant’s scope limit or the limit on scopes marked for every new client.

Path parameters​

NameTypeRequiredDetails
tenantstringyesThe tenant being administered, addressed by name.

Responses​

200 OK​

Body: application/json

FieldTypeRequiredDetails
createdarray of stringyesThe built-in scopes the call created, in order; empty when none was missing.

401 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

403 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

GET /admin/tenants/{tenant}/scopes/{id}/roles​

Requires the "manage-tenant" capability.

Each role carries admin_reach, what it reaches of the admin vocabulary however deep it nests it. Derived on every read and outside the ETag.

Path parameters​

NameTypeRequiredDetails
tenantstringyesThe tenant being administered, addressed by name.
idstringyesA row id. Constraints: a UUID.

Responses​

200 OK​

Body: application/json

FieldTypeRequiredDetails
itemsarray of objectyesEvery built-in scope, in the order a new tenant is given them.
items[]objectyes
items[].idstringyesThe role’s identifier.
items[].namestringyesThe role name.
items[].client_idstring or nullyesFor a role scoped to a client, that client’s internal id; null for a tenant-wide role.
items[].client_keystring or nullyesFor a client role, the client’s client_id.
items[].admin_reacharray of stringyes

401 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

403 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

PUT /admin/tenants/{tenant}/scopes/{id}/roles​

Requires the "manage-tenant" capability.

More than 200 entries is refused with 400. The answer carries each role’s admin_reach, as the GET does. Replaces the whole list. If-Match is mandatory: the matching GET answers an ETag, an absent header is refused with 428, and a stale one with 412 — a last-write-wins here would silently reinstate what another administrator has just removed. Refused with 403 when a role it adds or leaves out reaches an admin capability the caller does not hold; a role it keeps is not counted.

Path parameters​

NameTypeRequiredDetails
tenantstringyesThe tenant being administered, addressed by name.
idstringyesA row id. Constraints: a UUID.

Request body​

Body: application/json

FieldTypeRequiredDetails
role_idsarray of stringyesThe identifiers of every role the subject should hold. Replaces the current set. Constraints: at most 200 items.

Responses​

200 OK​

Body: application/json

FieldTypeRequiredDetails
itemsarray of objectyesEvery built-in scope, in the order a new tenant is given them.
items[]objectyes
items[].idstringyesThe role’s identifier.
items[].namestringyesThe role name.
items[].client_idstring or nullyesFor a role scoped to a client, that client’s internal id; null for a tenant-wide role.
items[].client_keystring or nullyesFor a client role, the client’s client_id.
items[].admin_reacharray of stringyes

401 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

403 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

GET /admin/tenants/{tenant}/scopes/{id}/mappers​

Requires the "manage-tenant" capability.

declared names the mappers that declare the scope: what issuance runs for it while bound is empty. The ETag covers bound alone.

Path parameters​

NameTypeRequiredDetails
tenantstringyesThe tenant being administered, addressed by name.
idstringyesA row id. Constraints: a UUID.

Responses​

200 OK​

Body: application/json

FieldTypeRequiredDetails
availablearray of stringyesEvery claim mapper the server has.
boundarray of stringyesThe mappers the scope uses now.
declaredarray of stringyesThe mapper names stored for the scope, including any the server no longer has.

401 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

403 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

PUT /admin/tenants/{tenant}/scopes/{id}/mappers​

Requires the "manage-tenant" capability.

Replaces the whole binding set for the scope. Binding an unregistered mapper name is refused with 400, listing the registry’s own known names. The answer carries declared as the GET does. Replaces the whole list. If-Match is mandatory: the matching GET answers an ETag, an absent header is refused with 428, and a stale one with 412 — a last-write-wins here would silently reinstate what another administrator has just removed.

Path parameters​

NameTypeRequiredDetails
tenantstringyesThe tenant being administered, addressed by name.
idstringyesA row id. Constraints: a UUID.

Request body​

Body: application/json

FieldTypeRequiredDetails
mapper_namesarray of stringyesThe mappers the scope should use. Replaces the current set.

Responses​

200 OK​

Body: application/json

FieldTypeRequiredDetails
availablearray of stringyesEvery claim mapper the server has.
boundarray of stringyesThe mappers the scope uses now.
declaredarray of stringyesThe mapper names stored for the scope, including any the server no longer has.

401 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

403 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

GET /admin/tenants/{tenant}/scopes/{id}/clients​

Requires the "manage-tenant" capability.

The clients the scope is assigned to, each by its row id, client_id, name and assignment, in row-id order — and nothing else of the client, which reading takes manage-clients.

Path parameters​

NameTypeRequiredDetails
tenantstringyesThe tenant being administered, addressed by name.
idstringyesA row id. Constraints: a UUID.

Query parameters​

NameTypeRequiredDetails
cursorstringnoThe next value of the previous page, to continue after it.
limitintegernoHow many items to return. A value over 200 is treated as 200; the default is 50. Constraints: at least 1.

Responses​

200 OK​

Body: application/json

FieldTypeRequiredDetails
itemsarray of objectyesThe entries of this answer.
items[]objectyes
items[].idstringyesThe client’s internal identifier.
items[].client_idstringyesThe client’s client_id.
items[].namestringyesThe client’s display name.
items[].assignmentstringyesHow the scope is assigned to it. Constraints: one of default, optional.
nextstringnoAn opaque cursor for the next page; absent on the last page.

401 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

403 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

PUT /admin/tenants/{tenant}/scopes/{id}/clients/{clientId}​

Requires the "manage-tenant" capability.

Assigns the scope to the client as default or optional, replacing any existing assignment. A client carries at most 200 scopes: a new one past that is refused with 409, while changing one it already carries is not. Answers the client’s new ETag, since the client’s representation carries its scopes. Refused with 403 when the client’s service account holds an admin capability the caller does not (the target ceiling).

Path parameters​

NameTypeRequiredDetails
tenantstringyesThe tenant being administered, addressed by name.
idstringyesA row id. Constraints: a UUID.
clientIdstringyesA row id. Constraints: a UUID.

Request body​

Body: application/json

FieldTypeRequiredDetails
assignmentstringyesdefault or optional. Constraints: one of default, optional.

Responses​

200 OK​

Body: application/json

FieldTypeRequiredDetails
client_idstringyesThe client’s internal identifier.
scopesarray of objectyesThe client’s scopes after the change.
scopes[]objectyes
scopes[].idstringyesThe scope’s identifier.
scopes[].namestringyesThe scope name.
scopes[].assignmentstringyesdefault is requested for the client without being asked for, optional only when the request names it. Constraints: one of default, optional.

401 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

403 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

DELETE /admin/tenants/{tenant}/scopes/{id}/clients/{clientId}​

Requires the "manage-tenant" capability.

Removes the client’s assignment of the scope, whether default or optional. Refused with 409 on the tenant’s built-in admin client, which could otherwise lock every administrator of the tenant out of /authorize. Answers the client’s new ETag. Refused with 403 when the client’s service account holds an admin capability the caller does not (the target ceiling).

Path parameters​

NameTypeRequiredDetails
tenantstringyesThe tenant being administered, addressed by name.
idstringyesA row id. Constraints: a UUID.
clientIdstringyesA row id. Constraints: a UUID.

Responses​

204 OK​

Body: application/json

FieldTypeRequiredDetails
(body)anyyes

401 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

403 RFC 9457 problem details​

Body: application/problem+json, an RFC 9457 problem document described under problem details.

Documentation coverage: 92 of 97 fields described (94%).