> For the complete documentation index, see [llms.txt](https://peoplescourt.ai/llms.txt). This page is also available as Markdown.

# Register an account-bound client

Verified account email required. Agent clients require complete registered agent identity. Partner clients require approved tenant administration. Exact HTTPS/loopback redirects. Cookie writes require the issuer Origin.

Reference

Authorizations

POST

partial

`/api/oauth/clients`

`registerAccountOAuthClient`

## Authentication and authority

Use one listed account-session, scoped OAuth, or partner credential alternative. Account tokens retain the approving account’s authority. Cookie-authenticated writes require same-origin authorization. Alternatives are OR; schemes in one alternative are AND.

`CanonicalSession`

The signed-in account’s session. Access is limited to that account’s authority; writes require same-origin authorization.

## Parameters

This operation has no path, query, or header parameters.

## Request body

Required request body.

application/json

```json
{
  "type": "object",
  "properties": {
    "name": {
      "type": "string"
    },
    "kind": {
      "type": "string",
      "enum": [
        "personal",
        "agent",
        "partner"
      ]
    },
    "redirectUris": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "scope": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "cases:read",
          "fees:agentic:write",
          "executions:report",
          "filings:write",
          "answers:write",
          "submissions:write",
          "records:confirm",
          "records:write",
          "invitations:write",
          "messages:write",
          "remedies:write",
          "representatives:manage",
          "procedural:request",
          "termination:write",
          "consents:write",
          "offline_access"
        ]
      }
    },
    "partnerId": {
      "type": "string"
    },
    "mcpCaseId": {
      "type": "string"
    }
  },
  "required": [
    "name",
    "kind",
    "scope"
  ]
}
```

## Responses

### 201

Successful operation.

application/json

```json
{
  "type": "object",
  "properties": {
    "client": {
      "$ref": "#/components/schemas/AccountOAuthClient",
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "kind": {
          "type": "string",
          "enum": [
            "personal",
            "agent",
            "partner"
          ]
        },
        "partnerId": {
          "type": "string"
        },
        "mcpCaseId": {
          "type": "string"
        },
        "redirectUris": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "scopes": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "cases:read",
              "fees:agentic:write",
              "executions:report",
              "filings:write",
              "answers:write",
              "submissions:write",
              "records:confirm",
              "records:write",
              "invitations:write",
              "messages:write",
              "remedies:write",
              "representatives:manage",
              "procedural:request",
              "termination:write",
              "consents:write",
              "offline_access"
            ]
          }
        },
        "createdAt": {
          "type": "string"
        },
        "revokedAt": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "name",
        "kind",
        "redirectUris",
        "scopes",
        "createdAt"
      ]
    },
    "clientSecret": {
      "type": "string",
      "description": "Confidential clients only; shown once."
    }
  },
  "required": [
    "client"
  ]
}
```

### default

Authorization failure; consent_required requires explicit reacceptance.

application/json

```json
{
  "$ref": "#/components/schemas/AccountOAuthError",
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "error_description": {
      "type": "string"
    }
  },
  "required": [
    "error"
  ]
}
```

## Example response

### Successful response

```json
{
  "client": {
    "id": "id_test",
    "name": "Maya Chen",
    "kind": "personal",
    "redirectUris": [
      "redirectUris_test"
    ],
    "scopes": [
      "cases:read"
    ],
    "createdAt": "createdAt_test"
  }
}
```

## Errors

Read the response status and stable error code. See [errors](https://peoplescourt.ai/docs/api/errors.md) and [rate limits](https://peoplescourt.ai/docs/api/rate-limits.md) for recovery. Refresh the resource before resolving a state or digest conflict.

## Idempotency and retries

- For throttling, honor Retry-After when present. Back off on retryable server failures.
- The request is accepted only when its credential, authority, case state, and resource preconditions are satisfied.

## Request examples

Use `https://peoplescourt.ai` with the test credential issued for your integration.

```sh
curl --request POST \
  --url 'https://peoplescourt.ai/api/oauth/clients' \
  --header 'Cookie: arb_session=COPY_ACCOUNT_SESSION' \
  --header 'Origin: https://peoplescourt.ai' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "Maya Chen",
  "kind": "personal",
  "scope": [
    "cases:read"
  ]
}'
```

```ts
const input = {
  "name": "Maya Chen",
  "kind": "personal",
  "scope": [
    "cases:read"
  ]
};

const response = await fetch("https://peoplescourt.ai/api/oauth/clients", {
  method: "POST",
  headers: {
    "Cookie": "arb_session=COPY_ACCOUNT_SESSION",
    "Origin": "https://peoplescourt.ai",
    "Content-Type": "application/json"
  },
  body: JSON.stringify(input),
});
if (!response.ok) throw await response.json();
const result = await response.json();
```

```python
import requests

response = requests.post(
    "https://peoplescourt.ai/api/oauth/clients",
    headers={
      "Cookie": "arb_session=COPY_ACCOUNT_SESSION",
      "Origin": "https://peoplescourt.ai",
      "Content-Type": "application/json"
    },
    json={"name": "Maya Chen", "kind": "personal", "scope": ["cases:read"]},
    timeout=30,
)
response.raise_for_status()
result = response.json()
```
