Auth service
Roles
7 endpoints.
/api/v1/roles/List Roles
List all roles.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
skip | query | integer | default 0 |
limit | query | integer | default 100 |
Responses
200Successful Responseapplication/jsonRoleResponse[]| Field | Type | Description |
|---|---|---|
namerequired | string | |
description | string | null | |
idrequired | integer | |
permissions | PermissionResponse[] | default []PermissionResponse[] fieldsPermissionResponse (not expanded) |
422Validation Error
Error bodies: HTTPValidationError. See Errors.
/api/v1/roles/Create Role
Create new role. Admin only.
Request bodyrequired
application/jsonRoleCreate| Field | Type | Description |
|---|---|---|
namerequired | string | |
description | string | null | |
idrequired | integer | |
permission_ids | integer[] | null | default []integer[] | null fields |
Responses
201Successful Responseapplication/jsonRoleResponseRoleResponse, expanded above.
422Validation Error
Error bodies: HTTPValidationError. See Errors.
/api/v1/roles/{role_id}Get Role
Get role by ID.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
role_idrequired | path | integer |
Responses
200Successful Responseapplication/jsonRoleResponseRoleResponse, expanded above.
422Validation Error
Error bodies: HTTPValidationError. See Errors.
/api/v1/roles/{role_id}Update Role
Update role. Admin only.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
role_idrequired | path | integer |
Request bodyrequired
application/jsonRoleUpdate| Field | Type | Description |
|---|---|---|
name | string | null | |
description | string | null |
Responses
200Successful Responseapplication/jsonRoleResponseRoleResponse, expanded above.
422Validation Error
Error bodies: HTTPValidationError. See Errors.
/api/v1/roles/{role_id}Delete Role
Delete role. Admin only.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
role_idrequired | path | integer |
Responses
204Successful Response422Validation Error
Error bodies: HTTPValidationError. See Errors.
/api/v1/roles/{role_id}/permissionsAssign Permissions To Role
Assign permissions to a role. Admin only. Replaces all existing permissions with the provided list.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
role_idrequired | path | integer |
Request bodyrequired
application/jsonRolePermissionAssign| Field | Type | Description |
|---|---|---|
permission_idsrequired | integer[] | integer[] fields |
Responses
200Successful Responseapplication/jsonRoleResponseRoleResponse, expanded above.
422Validation Error
Error bodies: HTTPValidationError. See Errors.
/api/v1/roles/{role_id}/permissions/{permission_id}Remove Permission From Role
Remove a specific permission from a role. Admin only.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
role_idrequired | path | integer | |
permission_idrequired | path | integer |
Responses
200Successful Responseapplication/jsonRoleResponseRoleResponse, expanded above.
422Validation Error
Error bodies: HTTPValidationError. See Errors.