Replace the roles an organization's directory may grant
/api/v1/organizations/{id}/directory/grantable-rolesReplaces the whole list in one act. Withdrawing a role unmaps the groups that name it and releases the grants those mappings produced. An empty list removes the organization's own list: it then holds the Environment's identity-provider arrival roles when those are set, and otherwise directory sync is disabled for it, which is refused with 409 while its directory is live.
Authentication
Authorization Option A JWT access token. Never send alongside X-API-Key: a request carrying both is refused.
X-API-Key Option B API key for management-tier access. Never send alongside an Authorization header: a request carrying both is refused.
Path Parameters
idstring Required Request body
application/json
role_idsstring[] Required The roles this organization's directory may grant. An empty list disables directory sync for the organization.
default_role_idstring Optional The role somebody arrives with when no mapped group says otherwise. Required unless the list is empty, and must be one of `role_ids`.
Responses
application/json
items *DirectoryGrantableRoleResponseDto[]
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
application/json
error *ApiErrorBodyDto
Returned object
curl -X PUT "https://auth.canopy-io.com/api/v1/organizations/value/directory/grantable-roles" \ -H "X-API-Key: $CANOPY_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "role_ids": [ "string" ], "default_role_id": "string" }'
{ "items": [ { "id": "string", "name": "string", "description": "string", "is_default": false } ] }
Tell us how we can improve this guide.