# Oauth Clients CLI Commands

> The soat CLI commands for the Oauth Clients module, with usage and every option, generated from the OpenAPI spec.

# Oauth Clients Commands

See [Oauth Clients module docs](../../modules/oauth-clients) for permissions and data model.

### `soat list-oauth-clients`

List OAuth clients

- Method: `GET`
- Path: `/api/v1/oauth-clients`

#### Usage

```bash
soat list-oauth-clients
```

#### Options

##### `--project-id`

Project ID (required if not using project key auth)

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

### `soat create-oauth-client`

Create an OAuth client

- Method: `POST`
- Path: `/api/v1/oauth-clients`

#### Usage

```bash
soat create-oauth-client --name <string> --authorize-url <string> --token-url <string> --client-id <string> --scopes <array<string>>
```

#### Options

##### `--project-id`

Project ID (required if not using project key auth)

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

##### `--name`

A label for the client, such as the provider's name.

- Source: `body`
- Required: yes
- Type: `string`
- Example: `x`

##### `--authorize-url`

The provider's authorization endpoint. Query parameters it already carries are kept.

- Source: `body`
- Required: yes
- Type: `string`
- Example: `https://x.com/i/oauth2/authorize`

##### `--token-url`

The provider's token endpoint.

- Source: `body`
- Required: yes
- Type: `string`
- Example: `https://api.x.com/2/oauth2/token`

##### `--revocation-url`

The provider's RFC 7009 revocation endpoint, called when a connection is deleted. `null` skips revocation.

- Source: `body`
- Required: no
- Type: `string \| null`
- Example: `https://api.x.com/2/oauth2/revoke`

##### `--client-id`

Your app's client ID at the provider.

- Source: `body`
- Required: yes
- Type: `string`
- Example: `Tm9ZWdEX2hQ`

##### `--client-secret`

A `\{\{secret:sec_...\}\}` reference to your app's client secret, never the value. `null` for a public client, which relies on PKCE.

- Source: `body`
- Required: no
- Type: `string \| null`
- Example: `\{\{secret:sec_V1StGXR8Z5jdHi6B\}\}`

##### `--scopes`

The scopes requested at authorization.

- Source: `body`
- Required: yes
- Type: `array<string>`
- Example: `["tweet.read","users.read","offline.access"]`

##### `--pkce`

Whether the authorization uses PKCE (`S256`).

- Source: `body`
- Required: no
- Type: `boolean`
- Default: `true`

##### `--token-endpoint-auth-method`

How the client authenticates at the token endpoint.

- Source: `body`
- Required: no
- Type: `enum("client_secret_basic", "client_secret_post")`
- Default: `client_secret_basic`

##### `--redirect-uri`

The callback the provider redirects to, as registered with the provider. Absent on create, or `null`, it is the deployment's `OAUTH_DEFAULT_REDIRECT_URI` when set, else stored `null`: this server's own `\{SOAT_BASE_URL\}/api/v1/oauth-connections/callback`. A front end that receives the redirect itself forwards `code` and `state` there.

- Source: `body`
- Required: no
- Type: `string \| null`
- Example: `https://app.example.com/oauth/callback`

##### `--authorize-params`

Extra query parameters for the authorize URL, such as Google's `access_type: offline` and `prompt: consent` for a refresh token.

- Source: `body`
- Required: no
- Type: `object<string, string>`
- Example: `\{"prompt":"consent"\}`

### `soat get-oauth-client`

Get an OAuth client

- Method: `GET`
- Path: `/api/v1/oauth-clients/{oauth_client_id}`

#### Usage

```bash
soat get-oauth-client
```

#### Options

This command has no options.

### `soat update-oauth-client`

Update an OAuth client

- Method: `PATCH`
- Path: `/api/v1/oauth-clients/{oauth_client_id}`

#### Usage

```bash
soat update-oauth-client
```

#### Options

##### `--name`

A label for the client, such as the provider's name.

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

##### `--authorize-url`

The provider's authorization endpoint. Query parameters it already carries are kept.

- Source: `body`
- Required: no
- Type: `string`
- Example: `https://x.com/i/oauth2/authorize`

##### `--token-url`

The provider's token endpoint.

- Source: `body`
- Required: no
- Type: `string`
- Example: `https://api.x.com/2/oauth2/token`

##### `--revocation-url`

The provider's RFC 7009 revocation endpoint, called when a connection is deleted. `null` skips revocation.

- Source: `body`
- Required: no
- Type: `string \| null`
- Example: `https://api.x.com/2/oauth2/revoke`

##### `--client-id`

Your app's client ID at the provider.

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

##### `--client-secret`

A `\{\{secret:sec_...\}\}` reference to your app's client secret, never the value. `null` for a public client, which relies on PKCE.

- Source: `body`
- Required: no
- Type: `string \| null`
- Example: `\{\{secret:sec_V1StGXR8Z5jdHi6B\}\}`

##### `--scopes`

The scopes requested at authorization.

- Source: `body`
- Required: no
- Type: `array<string>`
- Example: `["tweet.read","users.read","offline.access"]`

##### `--pkce`

Whether the authorization uses PKCE (`S256`).

- Source: `body`
- Required: no
- Type: `boolean`
- Default: `true`

##### `--token-endpoint-auth-method`

How the client authenticates at the token endpoint.

- Source: `body`
- Required: no
- Type: `enum("client_secret_basic", "client_secret_post")`
- Default: `client_secret_basic`

##### `--redirect-uri`

The callback the provider redirects to, as registered with the provider. Absent on create, or `null`, it is the deployment's `OAUTH_DEFAULT_REDIRECT_URI` when set, else stored `null`: this server's own `\{SOAT_BASE_URL\}/api/v1/oauth-connections/callback`. A front end that receives the redirect itself forwards `code` and `state` there.

- Source: `body`
- Required: no
- Type: `string \| null`
- Example: `https://app.example.com/oauth/callback`

##### `--authorize-params`

Extra query parameters for the authorize URL, such as Google's `access_type: offline` and `prompt: consent` for a refresh token.

- Source: `body`
- Required: no
- Type: `object<string, string>`
- Example: `\{"prompt":"consent"\}`

### `soat delete-oauth-client`

Delete an OAuth client

- Method: `DELETE`
- Path: `/api/v1/oauth-clients/{oauth_client_id}`

#### Usage

```bash
soat delete-oauth-client
```

#### Options

This command has no options.
