# Policies Commands

> See [Policies module docs](../../modules/policies) for permissions and data model.

# Policies Commands

See [Policies module docs](../../modules/policies) for permissions and data model.

### `soat list-policies`

List all policies

- Method: `GET`
- Path: `/api/v1/policies`

#### Usage

```bash
soat list-policies
```

#### Options

##### `--user-id`

Return only policies attached to this user (user_...)

- Source: `query`
- Required: no
- Type: `string`

##### `--limit`

Maximum number of results to return

- Source: `query`
- Required: no
- Type: `integer`
- Default: `50`

##### `--offset`

Number of results to skip

- Source: `query`
- Required: no
- Type: `integer`
- Default: `0`

### `soat create-policy`

Create a policy

- Method: `POST`
- Path: `/api/v1/policies`

#### Usage

```bash
soat create-policy --document <object>
```

#### Options

##### `--name`

—

- Source: `body`
- Required: no
- Type: `string`
- Example: `ReadOnlyAccess`

##### `--description`

—

- Source: `body`
- Required: no
- Type: `string`
- Example: `Allows read-only access to all resources`

##### `--document`

—

- Source: `body`
- Required: yes
- Type: `object`

### `soat get-policy`

Get a policy

- Method: `GET`
- Path: `/api/v1/policies/{policy_id}`

#### Usage

```bash
soat get-policy --policy-id <string>
```

#### Options

##### `--policy-id`

Policy public ID (pol_ prefix)

- Source: `path`
- Required: yes
- Type: `string`
- Example: `pol_V1StGXR8Z5jdHi6B`

### `soat update-policy`

Update a policy

- Method: `PUT`
- Path: `/api/v1/policies/{policy_id}`

#### Usage

```bash
soat update-policy --policy-id <string> --document <object>
```

#### Options

##### `--policy-id`

Policy public ID (pol_ prefix)

- Source: `path`
- Required: yes
- Type: `string`
- Example: `pol_V1StGXR8Z5jdHi6B`

##### `--name`

—

- Source: `body`
- Required: no
- Type: `string`

##### `--description`

—

- Source: `body`
- Required: no
- Type: `string`

##### `--document`

—

- Source: `body`
- Required: yes
- Type: `object`

### `soat delete-policy`

Delete a policy

- Method: `DELETE`
- Path: `/api/v1/policies/{policy_id}`

#### Usage

```bash
soat delete-policy --policy-id <string>
```

#### Options

##### `--policy-id`

Policy public ID (pol_ prefix)

- Source: `path`
- Required: yes
- Type: `string`
- Example: `pol_V1StGXR8Z5jdHi6B`
