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

# Act on a representative appointment

Available when canonical API access is enabled. The shared operation rechecks current authority and pinned Rules. Partner writes require representatives:manage and are confined to the membership side. Existing grants gain no authority. Invitation replay returns invitationEmail: not_repeated without sending another email.

Reference

Party procedure

PATCH

partial

`/api/cases/{id}/representatives`

`updateRepresentativePreview`

## 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.

`CanonicalPartnerBearer`

Partner key issued after partner access is approved. The key’s role and current case membership determine which actions it authorizes.

`AccountOAuth`

Account tokens authorize only their approving account and approved scopes. S256 PKCE is mandatory on the code flow. Client credentials require a registered autonomous-agent account and cannot request offline_access; on the MCP resource they permit only cases:read for the registered existing case. Connector clients use authorization code on the MCP resource with its supported connector permissions. Explicit reacceptance is required after Rules or disclosure changes.

## Parameters

Name

Location

Requirement

Schema

`id`

path

Required

{"type":"string"}

`Idempotency-Key`

Reuse for an identical retry to recover the same result. Changed input conflicts.

header

Optional

{"type":"string"}

## Request body

Required request body.

application/json

```json
{
  "$ref": "#/components/schemas/RepresentativeChangePreview",
  "type": "object",
  "required": [
    "grantId",
    "action"
  ],
  "properties": {
    "grantId": {
      "type": "string"
    },
    "action": {
      "type": "string",
      "enum": [
        "accept",
        "revoke",
        "withdraw"
      ]
    },
    "professionalStatus": {
      "type": "string",
      "enum": [
        "licensed_lawyer",
        "not_lawyer"
      ]
    },
    "licenseJurisdictions": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "description": "Partner membership authority permits only own-side revocation. Acceptance and withdrawal require the representative account."
}
```

## Responses

### 200

Authorized operation result.

application/json

```json
{
  "$ref": "#/components/schemas/CanonicalUpdateRepresentativePreviewResponse",
  "type": "object",
  "properties": {
    "data": {
      "$ref": "#/components/schemas/CanonicalRepresentativeResult",
      "type": "object",
      "properties": {
        "grant": {
          "$ref": "#/components/schemas/CanonicalRepresentative",
          "type": "object",
          "properties": {
            "id": {
              "type": "string"
            },
            "party": {
              "type": "string",
              "enum": [
                "claimant",
                "respondent"
              ]
            },
            "representativeEmail": {
              "type": "string"
            },
            "basisOfAuthority": {
              "type": "string"
            },
            "scopes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "status": {
              "type": "string"
            },
            "createdAt": {
              "type": "string"
            },
            "acceptedAt": {
              "type": "string"
            },
            "revokedAt": {
              "type": "string"
            },
            "expiresAt": {
              "type": "string"
            }
          },
          "required": [
            "id",
            "party",
            "representativeEmail",
            "basisOfAuthority",
            "scopes",
            "status",
            "createdAt"
          ]
        },
        "invitationEmail": {
          "type": "string",
          "enum": [
            "sent",
            "not_configured",
            "failed",
            "not_repeated"
          ]
        }
      },
      "required": [
        "grant"
      ]
    },
    "requestId": {
      "type": "string"
    }
  },
  "required": [
    "data",
    "requestId"
  ]
}
```

### 404

The resource is unavailable or the caller lacks access.

### default

RFC 9457 style problem response.

application/problem+json

```json
{
  "$ref": "#/components/schemas/Problem",
  "type": "object",
  "required": [
    "type",
    "title",
    "status",
    "code",
    "detail",
    "requestId"
  ],
  "properties": {
    "type": {
      "type": "string",
      "format": "uri"
    },
    "title": {
      "type": "string"
    },
    "status": {
      "type": "integer"
    },
    "code": {
      "type": "string"
    },
    "detail": {
      "type": "string"
    },
    "requestId": {
      "type": "string"
    },
    "details": {
      "description": "Account-readiness refusals include a value-free checklist and exact account-page link. Other error codes may provide different details.",
      "anyOf": [
        {
          "$ref": "#/components/schemas/AccountReadinessDetails",
          "type": "object",
          "additionalProperties": false,
          "required": [
            "ready",
            "accountSetupUrl",
            "missing"
          ],
          "properties": {
            "ready": {
              "type": "boolean"
            },
            "accountSetupUrl": {
              "type": "string",
              "format": "uri"
            },
            "missing": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/AccountReadinessRequirement",
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "code",
                  "label",
                  "section",
                  "accountUrl"
                ],
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "label": {
                    "type": "string"
                  },
                  "section": {
                    "type": "string",
                    "enum": [
                      "email",
                      "identity",
                      "legal_documents"
                    ]
                  },
                  "accountUrl": {
                    "type": "string",
                    "format": "uri"
                  }
                }
              }
            }
          }
        },
        {
          "$ref": "#/components/schemas/LegalDocumentsRequiredDetails",
          "type": "object",
          "additionalProperties": false,
          "required": [
            "legalDocumentsUrl"
          ],
          "properties": {
            "legalDocumentsUrl": {
              "type": "string",
              "format": "uri",
              "description": "Absolute account-page URL where the person reviews and accepts the current Terms and Privacy Notice. Uses the configured public application origin. After accepting the documents, retry the original operation."
            },
            "ready": {
              "type": "boolean"
            },
            "accountSetupUrl": {
              "type": "string",
              "format": "uri"
            },
            "missing": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/AccountReadinessRequirement",
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "code",
                  "label",
                  "section",
                  "accountUrl"
                ],
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "label": {
                    "type": "string"
                  },
                  "section": {
                    "type": "string",
                    "enum": [
                      "email",
                      "identity",
                      "legal_documents"
                    ]
                  },
                  "accountUrl": {
                    "type": "string",
                    "format": "uri"
                  }
                }
              }
            }
          }
        },
        {}
      ]
    }
  }
}
```

## Example response

### Successful response

```json
{
  "data": {
    "grant": {
      "id": "id_test",
      "party": "claimant",
      "representativeEmail": "maya.chen@example.com",
      "basisOfAuthority": "basisOfAuthority_test",
      "scopes": [
        "scopes_test"
      ],
      "status": "status_test",
      "createdAt": "createdAt_test"
    }
  },
  "requestId": "requestId_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.
- Send a unique Idempotency-Key. An exact retry returns the stored result; reusing the key with a different request fails.
- 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 PATCH \
  --url 'https://peoplescourt.ai/api/cases/pcase_test_123/representatives' \
  --header 'Cookie: arb_session=COPY_ACCOUNT_SESSION' \
  --header 'Origin: https://peoplescourt.ai' \
  --header 'Content-Type: application/json' \
  --data '{
  "grantId": "grantId_test",
  "action": "accept"
}'
```

```ts
const input = {
  "grantId": "grantId_test",
  "action": "accept"
};

const response = await fetch("https://peoplescourt.ai/api/cases/pcase_test_123/representatives", {
  method: "PATCH",
  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.patch(
    "https://peoplescourt.ai/api/cases/pcase_test_123/representatives",
    headers={
      "Cookie": "arb_session=COPY_ACCOUNT_SESSION",
      "Origin": "https://peoplescourt.ai",
      "Content-Type": "application/json"
    },
    json={"grantId": "grantId_test", "action": "accept"},
    timeout=30,
)
response.raise_for_status()
result = response.json()
```
