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

# Request a principal’s approval to delegate an existing case

Confidential approved partner client authentication required. The one-hour, single-use hosted approval link creates the same case-bound delegate grant as ordinary OAuth. Approval binds the current case membership and side; each token use rechecks that membership. Approval or denial consumes the link. A new case is never created.

Reference

Authorizations

POST

partial

`/api/oauth/link-requests`

`requestAccountCaseLink`

## Authentication and authority

No bearer credential is required.

## Parameters

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

## Request body

Required request body.

application/x-www-form-urlencoded

```json
{
  "type": "object",
  "properties": {
    "client_id": {
      "type": "string"
    },
    "client_secret": {
      "type": "string",
      "writeOnly": true
    },
    "case_id": {
      "type": "string"
    },
    "party": {
      "type": "string",
      "enum": [
        "claimant",
        "respondent"
      ],
      "description": "Requested case side. Use respondent for a respondent handoff."
    },
    "redirect_uri": {
      "type": "string"
    },
    "scope": {
      "type": "string"
    },
    "state": {
      "type": "string"
    },
    "code_challenge_method": {
      "type": "string",
      "const": "S256"
    },
    "code_challenge": {
      "type": "string"
    }
  },
  "required": [
    "case_id",
    "redirect_uri",
    "scope",
    "state",
    "code_challenge_method",
    "code_challenge"
  ],
  "example": {
    "client_id": "COPY_REGISTERED_CLIENT_ID",
    "client_secret": "COPY_CONFIDENTIAL_CLIENT_SECRET",
    "case_id": "pcase_existing",
    "party": "respondent",
    "redirect_uri": "https://your-app.example/callback",
    "scope": "cases:read",
    "state": "COPY_FRESH_STATE",
    "code_challenge_method": "S256",
    "code_challenge": "COPY_FRESH_S256_CHALLENGE"
  }
}
```

## Responses

### 200

Successful operation.

application/json

```json
{
  "type": "object",
  "properties": {
    "approvalUrl": {
      "type": "string"
    },
    "expiresAt": {
      "type": "string"
    }
  },
  "required": [
    "approvalUrl",
    "expiresAt"
  ]
}
```

### 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
{
  "approvalUrl": "https://partner.test.example/callbacks/peoples-court",
  "expiresAt": "expiresAt_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/link-requests' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data "client_id=COPY_REGISTERED_CLIENT_ID&client_secret=COPY_CONFIDENTIAL_CLIENT_SECRET&case_id=pcase_existing&party=respondent&redirect_uri=https%3A%2F%2Fyour-app.example%2Fcallback&scope=cases%3Aread&state=COPY_FRESH_STATE&code_challenge_method=S256&code_challenge=COPY_FRESH_S256_CHALLENGE"
```

```ts
const response = await fetch("https://peoplescourt.ai/api/oauth/link-requests", {
  method: "POST",
  headers: {
    "Content-Type": "application/x-www-form-urlencoded"
  },
  body: new URLSearchParams({"client_id":"COPY_REGISTERED_CLIENT_ID","client_secret":"COPY_CONFIDENTIAL_CLIENT_SECRET","case_id":"pcase_existing","party":"respondent","redirect_uri":"https://your-app.example/callback","scope":"cases:read","state":"COPY_FRESH_STATE","code_challenge_method":"S256","code_challenge":"COPY_FRESH_S256_CHALLENGE"}).toString(),
});
if (!response.ok) throw await response.json();
const result = await response.json();
```

```python
import requests

response = requests.post(
    "https://peoplescourt.ai/api/oauth/link-requests",
    headers={
      "Content-Type": "application/x-www-form-urlencoded"
    },
    data={"client_id": "COPY_REGISTERED_CLIENT_ID", "client_secret": "COPY_CONFIDENTIAL_CLIENT_SECRET", "case_id": "pcase_existing", "party": "respondent", "redirect_uri": "https://your-app.example/callback", "scope": "cases:read", "state": "COPY_FRESH_STATE", "code_challenge_method": "S256", "code_challenge": "COPY_FRESH_S256_CHALLENGE"},
    timeout=30,
)
response.raise_for_status()
result = response.json()
```
