For the complete documentation index, see llms.txt. This page is also available as Markdown.

Roles

Create Role Endpoint

post

Endpoint to create a role.

Args: role: The role to create. user: The authenticated user. rbac: RBAC component.

Raises: IllegalOperationError: If the role is an organization role. IllegalOperationError: If the role has no permissions.

Returns: The created role.

Authorizations
OAuth2clientCredentialsRequired
Token URL:

OAuth2authorizationCodeRequired
Authorization URL: Token URL: Refresh URL:
Body

Model for creating roles.

namestring · min: 1 · max: 50 · nullableOptional
descriptionstring · min: 1 · max: 256 · nullableOptional
organization_idstring · uuidRequired
levelstring · enumRequired

Scope levels.

Possible values:
system_managedbooleanRequired
typestring · enumOptional

Enum that represents the type of a role.

Default: normalPossible values:
Responses
200

Successful Response

application/json

Model for viewing roles.

namestring · min: 1 · max: 50 · nullableOptional
descriptionstring · min: 1 · max: 256 · nullableOptional
idstring · uuidRequired
organization_idstring · uuidRequired
levelstring · enumRequired

Scope levels.

Possible values:
system_managedbooleanRequired
typestring · enumRequired

Enum that represents the type of a role.

Possible values:
post/roles
POST /roles HTTP/1.1
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 250

{
  "name": "text",
  "description": "text",
  "organization_id": "123e4567-e89b-12d3-a456-426614174000",
  "level": "organization",
  "system_managed": true,
  "type": "normal",
  "permissions": [
    {
      "resource": {
        "level": "organization",
        "type": "text",
        "id": "text"
      },
      "action": "text"
    }
  ]
}
{
  "name": "text",
  "description": "text",
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "organization_id": "123e4567-e89b-12d3-a456-426614174000",
  "level": "organization",
  "system_managed": true,
  "type": "normal"
}

Get Role Endpoint

get

Endpoint to get a role.

Args: role_id: ID of the role to get. user: The authenticated user. rbac: RBAC component.

Returns: The role.

Authorizations
OAuth2clientCredentialsRequired
Token URL:

OAuth2authorizationCodeRequired
Authorization URL: Token URL: Refresh URL:
Path parameters
role_idstring · uuidRequired
Responses
200

Successful Response

application/json

Model for viewing roles.

namestring · min: 1 · max: 50 · nullableOptional
descriptionstring · min: 1 · max: 256 · nullableOptional
idstring · uuidRequired
organization_idstring · uuidRequired
levelstring · enumRequired

Scope levels.

Possible values:
system_managedbooleanRequired
typestring · enumRequired

Enum that represents the type of a role.

Possible values:
get/roles/{role_id}
GET /roles/{role_id} HTTP/1.1
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
  "name": "text",
  "description": "text",
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "organization_id": "123e4567-e89b-12d3-a456-426614174000",
  "level": "organization",
  "system_managed": true,
  "type": "normal"
}

Delete Role Endpoint

delete

Endpoint to delete a role.

Args: role_id: ID of the role to delete. user: The authenticated user. rbac: RBAC component.

Raises: IllegalOperationError: If the role is system managed.

Authorizations
OAuth2clientCredentialsRequired
Token URL:

OAuth2authorizationCodeRequired
Authorization URL: Token URL: Refresh URL:
Path parameters
role_idstring · uuidRequired
Responses
200

Successful Response

application/json
anyOptional
delete/roles/{role_id}
DELETE /roles/{role_id} HTTP/1.1
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*

No content

Update Role Endpoint

patch

Endpoint to update a role.

Args: role_id: ID of the role to update. update: The role update. user: The authenticated user. rbac: RBAC component.

Raises: IllegalOperationError: If the role has no permissions.

Returns: The updated role.

Authorizations
OAuth2clientCredentialsRequired
Token URL:

OAuth2authorizationCodeRequired
Authorization URL: Token URL: Refresh URL:
Path parameters
role_idstring · uuidRequired
Body

Model for updating roles.

namestring · min: 1 · max: 50 · nullableOptional
descriptionstring · min: 1 · max: 256 · nullableOptional
Responses
200

Successful Response

application/json

Model for viewing roles.

namestring · min: 1 · max: 50 · nullableOptional
descriptionstring · min: 1 · max: 256 · nullableOptional
idstring · uuidRequired
organization_idstring · uuidRequired
levelstring · enumRequired

Scope levels.

Possible values:
system_managedbooleanRequired
typestring · enumRequired

Enum that represents the type of a role.

Possible values:
patch/roles/{role_id}
PATCH /roles/{role_id} HTTP/1.1
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 132

{
  "name": "text",
  "description": "text",
  "permissions": [
    {
      "resource": {
        "level": "organization",
        "type": "text",
        "id": "text"
      },
      "action": "text"
    }
  ]
}
{
  "name": "text",
  "description": "text",
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "organization_id": "123e4567-e89b-12d3-a456-426614174000",
  "level": "organization",
  "system_managed": true,
  "type": "normal"
}
ZenML Scarf

Last updated

Was this helpful?