---
title: "tractorbeam role"
description: "The Tractorbeam API's role operations."
sidebar:
  label: "role"
  order: 24
---

```sh
tractorbeam role <subcommand> [flags]
```

## Shared flags

Every subcommand takes these flags.

| Flag | Description |
| --- | --- |
| `--config <string>` | The Project's `tractorbeam.config.ts`. Defaults to the one in the current directory or its nearest ancestor. |
| `--workspace <string>` | Workspace name. Environment variable: `TRACTORBEAM_WORKSPACE`. |
| `--origin <string>` | The Tractorbeam origin to call instead of the default, such as a proxy's. Environment variable: `TRACTORBEAM_ORIGIN`. |
| `--token <string>` | Access token. Defaults to the saved interactive session. Environment variable: `TRACTORBEAM_TOKEN`. |

## `role list`

Returns the roles members of the Workspace's organization can hold, each with the permissions it grants: Tractorbeam's, then the organization's custom roles. Needs `identity:manage`. Any principal of the Workspace's organization holding it can call it; an App token can't.

```sh
tractorbeam role list [flags]
```

## `role create`

Creates a custom role of the Workspace's organization with the permissions the request names. A slug the organization already has returns 409. Workspaces sharing an organization share its roles. Members' requests use the change at most a minute later. Also needs every permission the role grants. Needs `identity:manage`. Any principal of the Workspace's organization holding it can call it; an App token can't.

```sh
tractorbeam role create [flags]
```

| Flag | Description |
| --- | --- |
| `--slug <string>` |  |
| `--name <string>` |  |
| `--description <string>` |  |
| `--permissions <json>` | The permissions the role grants. |
| `--json <json>` | The body's fields as one JSON object. Flags given as well override its fields. |

## `role get`

Returns one of the roles members of the Workspace's organization can hold. Needs `identity:manage`. Any principal of the Workspace's organization holding it can call it; an App token can't.

```sh
tractorbeam role get [flags] <role>
```

| Argument | Description |
| --- | --- |
| `<role>` |  |

## `role update`

Changes a custom role's name, description, or permissions. Tractorbeam's roles can't change. Workspaces sharing an organization share its roles. Members' requests use the change at most a minute later. Also needs every permission the role grants afterward, including those it keeps. Needs `identity:manage`. Any principal of the Workspace's organization holding it can call it; an App token can't.

```sh
tractorbeam role update [flags] <role>
```

| Argument | Description |
| --- | --- |
| `<role>` |  |

| Flag | Description |
| --- | --- |
| `--name <string>` |  |
| `--description <string>` |  |
| `--permissions <json>` | The permissions the role grants. |
| `--json <json>` | The body's fields as one JSON object. Flags given as well override its fields. |

## `role delete`

Deletes a custom role. A role members still hold returns 409; assign them another first. Tractorbeam's roles can't be deleted. Workspaces sharing an organization share its roles. Members' requests use the change at most a minute later. Also needs every permission the role grants. Needs `identity:manage`. Any principal of the Workspace's organization holding it can call it; an App token can't.

```sh
tractorbeam role delete [flags] <role>
```

| Argument | Description |
| --- | --- |
| `<role>` |  |
