# Roles

The roles a grant can give: the standard roles and the workspace's own, each with its privileges.

Contains: [Grants](https://sparklogs.com/docs/api/reference/grants.md)

Ids: text.

- `GET /workspaces/{workspace_id}/roles` [List roles](#list-roles)

## Role object

A role is a named set of privileges a grant gives. Standard roles come with SparkLogs; a workspace can define its own.

- `id` (string): The role's id.
- `kind` (one of the values below): Who defines the role.
  - `standard`: A role SparkLogs defines.
  - `custom`: A role this workspace defines.
- `description` (string or null): What the role is for.
- `recommended_scope` (one of the values below, or null): The scope a grant of this role is usually given; null when there is none.
  - `all`: Every organization.
  - `selected`: Some organizations.
  - `workspace`: The workspace itself.
- `sort_order` (integer): Where the role sorts in a list of roles.
- `privileges` (array of RolePrivilege): Every privilege the role holds.

## List roles

`GET https://engine.sparklogs.app/app-api/workspaces/{workspace_id}/roles`

Preview

Returns every role a grant in the workspace can name, the standard roles and the workspace's own, each with its privileges, in sort order.

### Access

- Works with: Signed-in person, Personal token, OAuth token, Workspace token
- Scope: `workspace:read`
- Privilege: `workspace.read`

Needs `workspace.read`. Any grant in the workspace carries `workspace.read`.

### Behavior

- Retry: Safe to send again

### Path parameters

- `workspace_id` (uuid, required): The workspace's id.

### Query parameters

- `fields` (array of string): Comma-separated top-level fields of each object to return instead of the default set.

Sent by default: `id`, `kind`, `description`, `recommended_scope`, `sort_order`, `privileges`

### Response (200)

- `roles` (array of Role, required): Every one of the roles you can see.
- `message` (string, required): What the call did, as a short phrase for a person to read. Its wording may change: act on the HTTP status.

### Errors

| Status | Code | When | Send again? |
| - | - | - | - |
| 400 | `APP_API_ERR_BAD_PARAMETERS` | A query parameter it does not take, one given twice, or `fields` naming a field it does not have. | No |
| 400 | `APP_API_ERR_BAD_PARAMETERS` | `workspace_id` is not a UUID. | No |
| 401 | `APP_API_ERR_UNAUTHORIZED` | The token is missing, not valid, expired or revoked, or its workspace is deleted. | No |
| 403 | `APP_API_ERR_NO_PRIVILEGE` (cause `token_scope` or `no_privilege`) | You do not hold `workspace.read`. The same refusal comes when the path names a workspace other than the token's own. | No |
| 429 | `APP_API_ERR_TOO_MANY_REQUESTS` (cause `call_limit` or `invalid_token_attempts`) | The token made more calls than its limit (`cause` `call_limit`; `Retry-After` says when to try again), or the address it came from sent too many tokens that are not valid (`cause` `invalid_token_attempts`). | After `Retry-After` |
| 500 | `APP_API_ERR_TECHNICAL_ISSUE` | The call failed on the server. | Read first |
| 503 | `APP_API_ERR_MAINTENANCE` | SparkLogs is in scheduled maintenance. | After `Retry-After` |

Every call can also return the [common errors](https://sparklogs.com/docs/api/errors.md).

### Example

List the roles a grant can give, with their privileges

```bash
curl -X GET \
  "https://engine.sparklogs.app/app-api/workspaces/5e1f0a00-0000-4000-8000-000000000001/roles" \
  -H "Authorization: Bearer $SPARKLOGS_TOKEN"
```

Response (200)

```json
{
  "message": "roles retrieved",
  "roles": [
    {
      "id": "admin",
      "kind": "standard",
      "description": "Administrator with rights to everything, including managing users in the workspace and their roles",
      "recommended_scope": "all",
      "sort_order": 10,
      "privileges": [
        {
          "id": "workspace.read",
          "level": "self",
          "category": null,
          "access_kind": "view"
        },
        {
          "id": "workspace.write",
          "level": "workspace",
          "category": "organizations",
          "access_kind": "manage"
        },
        {
          "id": "member.read",
          "level": "org",
          "category": "people",
          "access_kind": "view"
        },
        {
          "id": "member.manage",
          "level": "org",
          "category": "people",
          "access_kind": "manage"
        },
        {
          "id": "group.read",
          "level": "org",
          "category": "people",
          "access_kind": "view"
        },
        {
          "id": "group.write",
          "level": "org",
          "category": "people",
          "access_kind": "manage"
        },
        {
          "id": "grant.write",
          "level": "org",
          "category": "people",
          "access_kind": "manage"
        },
        {
          "id": "auditlog.query",
          "level": "org",
          "category": "activity_log",
          "access_kind": "view"
        },
        {
          "id": "organization.read",
          "level": "org",
          "category": "organizations",
          "access_kind": "view"
        },
        {
          "id": "organization.create",
          "level": "org",
          "category": "organizations",
          "access_kind": "manage"
        },
        {
          "id": "organization.write",
          "level": "org",
          "category": "organizations",
          "access_kind": "manage"
        },
        {
          "id": "organization.move",
          "level": "org",
          "category": "organizations",
          "access_kind": "manage"
        },
        {
          "id": "organization.delete",
          "level": "org",
          "category": "organizations",
          "access_kind": "manage"
        },
        {
          "id": "agent.read",
          "level": "org",
          "category": "agents",
          "access_kind": "view"
        },
        {
          "id": "agent.write",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "agent.delete",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "agent_policy.write",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "agent_policy.assign",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "agent_policy.rule_write",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "agent_policy.enforce",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "agent_tag.define",
          "level": "workspace",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "agent_tag.attach",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "ingest_key.create",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "ingest_key.reveal",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "ingest_key.rotate",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "registration_token.create",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "registration_token.read",
          "level": "org",
          "category": "agents",
          "access_kind": "view"
        },
        {
          "id": "registration_token.reveal",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "registration_token.revoke",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "archive.config.read",
          "level": "org",
          "category": "organizations",
          "access_kind": "view"
        },
        {
          "id": "archive.config.write",
          "level": "org",
          "category": "organizations",
          "access_kind": "manage"
        },
        {
          "id": "event.query",
          "level": "org",
          "category": "event_data",
          "access_kind": "view"
        },
        {
          "id": "device.read",
          "level": "org",
          "category": "event_data",
          "access_kind": "view"
        },
        {
          "id": "event.read",
          "level": "org",
          "category": "raw_logs",
          "access_kind": "view"
        },
        {
          "id": "analytics.query",
          "level": "org",
          "category": "raw_logs",
          "access_kind": "view"
        },
        {
          "id": "ingestion.read",
          "level": "org",
          "category": "billing",
          "access_kind": "view"
        },
        {
          "id": "finance.admin",
          "level": "workspace",
          "category": "billing",
          "access_kind": "manage"
        },
        {
          "id": "user_token.create_own",
          "level": "self",
          "category": null,
          "access_kind": "manage"
        },
        {
          "id": "user_token.manage_own",
          "level": "self",
          "category": null,
          "access_kind": "manage"
        },
        {
          "id": "user_token.view_all",
          "level": "org",
          "category": "people",
          "access_kind": "view"
        },
        {
          "id": "user_token.manage_any",
          "level": "org",
          "category": "people",
          "access_kind": "manage"
        },
        {
          "id": "workspace_token.create",
          "level": "org",
          "category": "people",
          "access_kind": "manage"
        },
        {
          "id": "workspace_token.view",
          "level": "org",
          "category": "people",
          "access_kind": "view"
        },
        {
          "id": "workspace_token.manage",
          "level": "org",
          "category": "people",
          "access_kind": "manage"
        },
        {
          "id": "app_registration.create",
          "level": "workspace",
          "category": "people",
          "access_kind": "manage"
        },
        {
          "id": "app_registration.view",
          "level": "workspace",
          "category": "people",
          "access_kind": "view"
        },
        {
          "id": "app_registration.manage",
          "level": "workspace",
          "category": "people",
          "access_kind": "manage"
        }
      ]
    },
    {
      "id": "organization_admin",
      "kind": "standard",
      "description": "Delegated administrator of its organizations, with no workspace rights",
      "recommended_scope": "selected",
      "sort_order": 20,
      "privileges": [
        {
          "id": "workspace.read",
          "level": "self",
          "category": null,
          "access_kind": "view"
        },
        {
          "id": "member.read",
          "level": "org",
          "category": "people",
          "access_kind": "view"
        },
        {
          "id": "member.manage",
          "level": "org",
          "category": "people",
          "access_kind": "manage"
        },
        {
          "id": "group.read",
          "level": "org",
          "category": "people",
          "access_kind": "view"
        },
        {
          "id": "group.write",
          "level": "org",
          "category": "people",
          "access_kind": "manage"
        },
        {
          "id": "grant.write",
          "level": "org",
          "category": "people",
          "access_kind": "manage"
        },
        {
          "id": "auditlog.query",
          "level": "org",
          "category": "activity_log",
          "access_kind": "view"
        },
        {
          "id": "organization.read",
          "level": "org",
          "category": "organizations",
          "access_kind": "view"
        },
        {
          "id": "organization.create",
          "level": "org",
          "category": "organizations",
          "access_kind": "manage"
        },
        {
          "id": "organization.write",
          "level": "org",
          "category": "organizations",
          "access_kind": "manage"
        },
        {
          "id": "organization.move",
          "level": "org",
          "category": "organizations",
          "access_kind": "manage"
        },
        {
          "id": "organization.delete",
          "level": "org",
          "category": "organizations",
          "access_kind": "manage"
        },
        {
          "id": "agent.read",
          "level": "org",
          "category": "agents",
          "access_kind": "view"
        },
        {
          "id": "agent.write",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "agent.delete",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "agent_policy.write",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "agent_policy.assign",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "agent_policy.rule_write",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "agent_tag.attach",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "ingest_key.create",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "ingest_key.reveal",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "ingest_key.rotate",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "registration_token.create",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "registration_token.read",
          "level": "org",
          "category": "agents",
          "access_kind": "view"
        },
        {
          "id": "registration_token.reveal",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "registration_token.revoke",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "archive.config.read",
          "level": "org",
          "category": "organizations",
          "access_kind": "view"
        },
        {
          "id": "archive.config.write",
          "level": "org",
          "category": "organizations",
          "access_kind": "manage"
        },
        {
          "id": "event.query",
          "level": "org",
          "category": "event_data",
          "access_kind": "view"
        },
        {
          "id": "device.read",
          "level": "org",
          "category": "event_data",
          "access_kind": "view"
        },
        {
          "id": "event.read",
          "level": "org",
          "category": "raw_logs",
          "access_kind": "view"
        },
        {
          "id": "analytics.query",
          "level": "org",
          "category": "raw_logs",
          "access_kind": "view"
        },
        {
          "id": "ingestion.read",
          "level": "org",
          "category": "billing",
          "access_kind": "view"
        },
        {
          "id": "user_token.create_own",
          "level": "self",
          "category": null,
          "access_kind": "manage"
        },
        {
          "id": "user_token.manage_own",
          "level": "self",
          "category": null,
          "access_kind": "manage"
        },
        {
          "id": "user_token.view_all",
          "level": "org",
          "category": "people",
          "access_kind": "view"
        },
        {
          "id": "user_token.manage_any",
          "level": "org",
          "category": "people",
          "access_kind": "manage"
        },
        {
          "id": "workspace_token.create",
          "level": "org",
          "category": "people",
          "access_kind": "manage"
        },
        {
          "id": "workspace_token.view",
          "level": "org",
          "category": "people",
          "access_kind": "view"
        },
        {
          "id": "workspace_token.manage",
          "level": "org",
          "category": "people",
          "access_kind": "manage"
        }
      ]
    },
    {
      "id": "engineer",
      "kind": "standard",
      "description": "Engineer who can fully manage organizations, deploy agents, and query event data",
      "recommended_scope": null,
      "sort_order": 100,
      "privileges": [
        {
          "id": "workspace.read",
          "level": "self",
          "category": null,
          "access_kind": "view"
        },
        {
          "id": "organization.read",
          "level": "org",
          "category": "organizations",
          "access_kind": "view"
        },
        {
          "id": "organization.create",
          "level": "org",
          "category": "organizations",
          "access_kind": "manage"
        },
        {
          "id": "organization.write",
          "level": "org",
          "category": "organizations",
          "access_kind": "manage"
        },
        {
          "id": "organization.delete",
          "level": "org",
          "category": "organizations",
          "access_kind": "manage"
        },
        {
          "id": "agent.read",
          "level": "org",
          "category": "agents",
          "access_kind": "view"
        },
        {
          "id": "agent.write",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "agent.delete",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "ingest_key.create",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "ingest_key.reveal",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "ingest_key.rotate",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "registration_token.create",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "registration_token.read",
          "level": "org",
          "category": "agents",
          "access_kind": "view"
        },
        {
          "id": "registration_token.reveal",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "registration_token.revoke",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "archive.config.read",
          "level": "org",
          "category": "organizations",
          "access_kind": "view"
        },
        {
          "id": "archive.config.write",
          "level": "org",
          "category": "organizations",
          "access_kind": "manage"
        },
        {
          "id": "event.query",
          "level": "org",
          "category": "event_data",
          "access_kind": "view"
        },
        {
          "id": "device.read",
          "level": "org",
          "category": "event_data",
          "access_kind": "view"
        },
        {
          "id": "event.read",
          "level": "org",
          "category": "raw_logs",
          "access_kind": "view"
        },
        {
          "id": "analytics.query",
          "level": "org",
          "category": "raw_logs",
          "access_kind": "view"
        },
        {
          "id": "ingestion.read",
          "level": "org",
          "category": "billing",
          "access_kind": "view"
        },
        {
          "id": "user_token.create_own",
          "level": "self",
          "category": null,
          "access_kind": "manage"
        },
        {
          "id": "user_token.manage_own",
          "level": "self",
          "category": null,
          "access_kind": "manage"
        }
      ]
    },
    {
      "id": "analyst",
      "kind": "standard",
      "description": "Analyst who can only view and query data but not change anything",
      "recommended_scope": null,
      "sort_order": 110,
      "privileges": [
        {
          "id": "workspace.read",
          "level": "self",
          "category": null,
          "access_kind": "view"
        },
        {
          "id": "organization.read",
          "level": "org",
          "category": "organizations",
          "access_kind": "view"
        },
        {
          "id": "agent.read",
          "level": "org",
          "category": "agents",
          "access_kind": "view"
        },
        {
          "id": "archive.config.read",
          "level": "org",
          "category": "organizations",
          "access_kind": "view"
        },
        {
          "id": "event.query",
          "level": "org",
          "category": "event_data",
          "access_kind": "view"
        },
        {
          "id": "device.read",
          "level": "org",
          "category": "event_data",
          "access_kind": "view"
        },
        {
          "id": "event.read",
          "level": "org",
          "category": "raw_logs",
          "access_kind": "view"
        },
        {
          "id": "analytics.query",
          "level": "org",
          "category": "raw_logs",
          "access_kind": "view"
        },
        {
          "id": "ingestion.read",
          "level": "org",
          "category": "billing",
          "access_kind": "view"
        },
        {
          "id": "user_token.create_own",
          "level": "self",
          "category": null,
          "access_kind": "manage"
        },
        {
          "id": "user_token.manage_own",
          "level": "self",
          "category": null,
          "access_kind": "manage"
        }
      ]
    },
    {
      "id": "analyst_no_raw_logs",
      "kind": "standard",
      "description": "Analyst who can query counts, patterns and device health but not raw logs",
      "recommended_scope": null,
      "sort_order": 120,
      "privileges": [
        {
          "id": "workspace.read",
          "level": "self",
          "category": null,
          "access_kind": "view"
        },
        {
          "id": "organization.read",
          "level": "org",
          "category": "organizations",
          "access_kind": "view"
        },
        {
          "id": "agent.read",
          "level": "org",
          "category": "agents",
          "access_kind": "view"
        },
        {
          "id": "archive.config.read",
          "level": "org",
          "category": "organizations",
          "access_kind": "view"
        },
        {
          "id": "event.query",
          "level": "org",
          "category": "event_data",
          "access_kind": "view"
        },
        {
          "id": "device.read",
          "level": "org",
          "category": "event_data",
          "access_kind": "view"
        },
        {
          "id": "ingestion.read",
          "level": "org",
          "category": "billing",
          "access_kind": "view"
        },
        {
          "id": "user_token.create_own",
          "level": "self",
          "category": null,
          "access_kind": "manage"
        },
        {
          "id": "user_token.manage_own",
          "level": "self",
          "category": null,
          "access_kind": "manage"
        }
      ]
    },
    {
      "id": "deployment_manager",
      "kind": "standard",
      "description": "Deploys and manages organizations, agents, agent policy and enrollment, with no data access",
      "recommended_scope": null,
      "sort_order": 130,
      "privileges": [
        {
          "id": "workspace.read",
          "level": "self",
          "category": null,
          "access_kind": "view"
        },
        {
          "id": "organization.read",
          "level": "org",
          "category": "organizations",
          "access_kind": "view"
        },
        {
          "id": "organization.create",
          "level": "org",
          "category": "organizations",
          "access_kind": "manage"
        },
        {
          "id": "organization.write",
          "level": "org",
          "category": "organizations",
          "access_kind": "manage"
        },
        {
          "id": "organization.delete",
          "level": "org",
          "category": "organizations",
          "access_kind": "manage"
        },
        {
          "id": "agent.read",
          "level": "org",
          "category": "agents",
          "access_kind": "view"
        },
        {
          "id": "agent.write",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "agent.delete",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "agent_policy.write",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "agent_policy.assign",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "agent_policy.rule_write",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "agent_tag.attach",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "ingest_key.create",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "ingest_key.reveal",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "ingest_key.rotate",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "registration_token.create",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "registration_token.read",
          "level": "org",
          "category": "agents",
          "access_kind": "view"
        },
        {
          "id": "registration_token.reveal",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "registration_token.revoke",
          "level": "org",
          "category": "agents",
          "access_kind": "manage"
        },
        {
          "id": "user_token.create_own",
          "level": "self",
          "category": null,
          "access_kind": "manage"
        },
        {
          "id": "user_token.manage_own",
          "level": "self",
          "category": null,
          "access_kind": "manage"
        }
      ]
    },
    {
      "id": "auditor",
      "kind": "standard",
      "description": "Reads access and configuration, with no data access",
      "recommended_scope": "all",
      "sort_order": 140,
      "privileges": [
        {
          "id": "workspace.read",
          "level": "self",
          "category": null,
          "access_kind": "view"
        },
        {
          "id": "member.read",
          "level": "org",
          "category": "people",
          "access_kind": "view"
        },
        {
          "id": "group.read",
          "level": "org",
          "category": "people",
          "access_kind": "view"
        },
        {
          "id": "auditlog.query",
          "level": "org",
          "category": "activity_log",
          "access_kind": "view"
        },
        {
          "id": "organization.read",
          "level": "org",
          "category": "organizations",
          "access_kind": "view"
        },
        {
          "id": "agent.read",
          "level": "org",
          "category": "agents",
          "access_kind": "view"
        },
        {
          "id": "registration_token.read",
          "level": "org",
          "category": "agents",
          "access_kind": "view"
        },
        {
          "id": "archive.config.read",
          "level": "org",
          "category": "organizations",
          "access_kind": "view"
        },
        {
          "id": "ingestion.read",
          "level": "org",
          "category": "billing",
          "access_kind": "view"
        },
        {
          "id": "user_token.create_own",
          "level": "self",
          "category": null,
          "access_kind": "manage"
        },
        {
          "id": "user_token.manage_own",
          "level": "self",
          "category": null,
          "access_kind": "manage"
        },
        {
          "id": "user_token.view_all",
          "level": "org",
          "category": "people",
          "access_kind": "view"
        },
        {
          "id": "workspace_token.view",
          "level": "org",
          "category": "people",
          "access_kind": "view"
        },
        {
          "id": "app_registration.view",
          "level": "workspace",
          "category": "people",
          "access_kind": "view"
        }
      ]
    },
    {
      "id": "finance_admin",
      "kind": "standard",
      "description": "Fully manage all financial data and functions, with read access to organizations and no access to event data",
      "recommended_scope": "all",
      "sort_order": 400,
      "privileges": [
        {
          "id": "workspace.read",
          "level": "self",
          "category": null,
          "access_kind": "view"
        },
        {
          "id": "organization.read",
          "level": "org",
          "category": "organizations",
          "access_kind": "view"
        },
        {
          "id": "ingestion.read",
          "level": "org",
          "category": "billing",
          "access_kind": "view"
        },
        {
          "id": "finance.admin",
          "level": "workspace",
          "category": "billing",
          "access_kind": "manage"
        },
        {
          "id": "user_token.create_own",
          "level": "self",
          "category": null,
          "access_kind": "manage"
        },
        {
          "id": "user_token.manage_own",
          "level": "self",
          "category": null,
          "access_kind": "manage"
        }
      ]
    }
  ]
}
```

## RolePrivilege object

- `id` (string, required): The privilege's id.
- `level` (one of the values below, required): Where the privilege takes effect.
  - `org`: At the organizations it reaches.
  - `workspace`: On the workspace itself.
  - `self`: On the caller's own things.
- `category` (string or null, required): The area the privilege belongs to.
- `access_kind` (one of the values below, required): Whether the privilege reads or changes something.
  - `view`: It reads.
  - `manage`: It changes something.

---

Source: <https://sparklogs.com/docs/api/reference/roles>
All SparkLogs documentation in Markdown: <https://sparklogs.com/llms.txt>
