Keystone Developers
Open Keystone
API reference

Auth service

Roles

7 endpoints.

GET/api/v1/roles/

List Roles

List all roles.

Parameters

NameInTypeDescription
skipqueryintegerdefault 0
limitqueryintegerdefault 100

Responses

200Successful Response
application/jsonRoleResponse[]
FieldTypeDescription
namerequiredstring
descriptionstring | null
idrequiredinteger
permissionsPermissionResponse[]default []
PermissionResponse[] fields

PermissionResponse (not expanded)

  • 422Validation Error

Error bodies: HTTPValidationError. See Errors.

POST/api/v1/roles/

Create Role

Create new role. Admin only.

Request bodyrequired

application/jsonRoleCreate
FieldTypeDescription
namerequiredstring
descriptionstring | null
idrequiredinteger
permission_idsinteger[] | nulldefault []
integer[] | null fields

Responses

201Successful Response
application/jsonRoleResponse

RoleResponse, expanded above.

  • 422Validation Error

Error bodies: HTTPValidationError. See Errors.

GET/api/v1/roles/{role_id}

Get Role

Get role by ID.

Parameters

NameInTypeDescription
role_idrequiredpathinteger

Responses

200Successful Response
application/jsonRoleResponse

RoleResponse, expanded above.

  • 422Validation Error

Error bodies: HTTPValidationError. See Errors.

PUT/api/v1/roles/{role_id}

Update Role

Update role. Admin only.

Parameters

NameInTypeDescription
role_idrequiredpathinteger

Request bodyrequired

application/jsonRoleUpdate
FieldTypeDescription
namestring | null
descriptionstring | null

Responses

200Successful Response
application/jsonRoleResponse

RoleResponse, expanded above.

  • 422Validation Error

Error bodies: HTTPValidationError. See Errors.

DELETE/api/v1/roles/{role_id}

Delete Role

Delete role. Admin only.

Parameters

NameInTypeDescription
role_idrequiredpathinteger

Responses

204Successful Response
  • 422Validation Error

Error bodies: HTTPValidationError. See Errors.

POST/api/v1/roles/{role_id}/permissions

Assign Permissions To Role

Assign permissions to a role. Admin only. Replaces all existing permissions with the provided list.

Parameters

NameInTypeDescription
role_idrequiredpathinteger

Request bodyrequired

application/jsonRolePermissionAssign
FieldTypeDescription
permission_idsrequiredinteger[]
integer[] fields

Responses

200Successful Response
application/jsonRoleResponse

RoleResponse, expanded above.

  • 422Validation Error

Error bodies: HTTPValidationError. See Errors.

DELETE/api/v1/roles/{role_id}/permissions/{permission_id}

Remove Permission From Role

Remove a specific permission from a role. Admin only.

Parameters

NameInTypeDescription
role_idrequiredpathinteger
permission_idrequiredpathinteger

Responses

200Successful Response
application/jsonRoleResponse

RoleResponse, expanded above.

  • 422Validation Error

Error bodies: HTTPValidationError. See Errors.