# Register a public OAuth client.

Register a public OAuth client.

Canonical: https://commentary.dev/docs/reference/api/register-oauth-client

`POST /oauth/register`

Register a public OAuth client.

## Access

This operation does not declare a credential requirement in the released API contract.

Provider access, workspace membership, and agent grants are enforced separately. A token does not expand access to a repository or resource. [Set up developer access](/docs/build/developer-access).

## Request body

Required. Supported content types: `application/json`.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `client_name` | string | No |  |
| `redirect_uris` | array of string | No |  |
| `grant_types` | array of string | No |  |
| `response_types` | array of string | No |  |
| `scope` | string | No |  |
| `token_endpoint_auth_method` | `"none"` | No |  |

## Call the endpoint

Replace path placeholders and your credential. For body operations, create `request.json` using the required fields above; this command does not invent resource identifiers or consent.

```bash
curl --request POST \
  'https://commentary.dev/oauth/register' \
  --header 'Content-Type: application/json' \
  --data-binary @request.json
```

## Responses

| Status | Meaning | Payload |
| --- | --- | --- |
| `201` | Successful response. | object |
| `400` | OAuth request error. | [OAuthError](/docs/reference/schemas/oauth-error) |
| `429` | The request was rate limited. | [OAuthError](/docs/reference/schemas/oauth-error) |

### Successful response fields

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `client_id` | string | No |  |
| `client_name` | string or null | No |  |
| `redirect_uris` | array of string | No |  |
| `token_endpoint_auth_method` | `"none"` | No |  |

## Recover from errors

Use the returned status and error body. Correct invalid fields before retrying; reconnect or narrow the target for authentication and permission errors. For conditional writes, reload the latest version before preparing a new request. Respect rate-limit headers and retry only when the operation’s idempotency contract permits it.

## Contract and related guidance

Operation ID: `registerOAuthClient`. [Download the OpenAPI contract](/docs/reference/openapi.json) for complete constraints and code generation. [Browse endpoints](/docs/reference/api-operations).
