# Work cases and appeals

Work the adjuster queue, move a claim's case through review to a disposition with a reason code, and let a policyholder appeal with a signed, single-use link.

Use cases to move each claim from triage to a decision with an audit trail, and appeal links to let a policyholder answer a decision without an account.

Every claim has a case with a status, an assignee and an append-only history. A case is created the first time you view the queue or the claim, so there's nothing to backfill. Cases are scoped to your carrier key.

**Before you begin:** export the full-access sandbox key. Reading cases needs the `attest` scope; changing them needs `escalate`.

```bash
export PROVENANCE_API=https://sandbox-api.provenanceauth.com
export PROVENANCE_KEY=prv_test_full_K7mN3xQp9RbT2vWm8sYd4cFjLhXn6gAe
```

## 1. Read the queue

[`GET /v1/attest/cases`](https://provenanceauth.com/docs/api/cases.md#get-v1-attest-cases) lists cases highest risk first. Filter with `status` or `assignee`, or sort by `age`. Here, the escalated cases:

**curl**

```bash
curl "$PROVENANCE_API/v1/attest/cases?status=escalated&limit=1" \
  -H "Authorization: Bearer $PROVENANCE_KEY"
```

**Node**

```ts
import { Provenance } from "@provenanceauth/sdk";

const prov = new Provenance({ apiKey: process.env.PROVENANCE_KEY!, baseUrl: process.env.PROVENANCE_API });
const queue = await prov.attest.cases.list({ status: "escalated", limit: 1 });
```

**Python**

```python
import os
import httpx

api, headers = os.environ["PROVENANCE_API"], {"Authorization": f"Bearer {os.environ['PROVENANCE_KEY']}"}
queue = httpx.get(f"{api}/v1/attest/cases", params={"status": "escalated", "limit": 1}, headers=headers).json()
```

```json
{
  "object": "list",
  "data": [
    {
      "id": "01M5Q06YQY97SYKM316M08X099",
      "object": "case",
      "claim_id": "CLM-SANDBOX-FRAUD",
      "status": "escalated",
      "assignee_account_id": null,
      "risk_snapshot": 100,
      "overall_risk_score": 100,
      "asset_count": 2,
      "submitted_at": "2026-10-24T13:04:44.283Z",
      "opened_at": "2026-10-24T13:04:44.255Z",
      "updated_at": "2026-10-24T13:04:44.255Z"
    }
  ]
}
```

## 2. Start a review

Cases are addressed by claim ID. Move one to `in_review` with [`POST /v1/attest/cases/{claim_id}/transition`](https://provenanceauth.com/docs/api/cases.md#post-v1-attest-cases-claim-id-transition):

**curl**

```bash
curl $PROVENANCE_API/v1/attest/cases/CLM-SANDBOX-PARTIAL/transition \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "to_status": "in_review", "note": "Checking the two web uploads." }'
```

**Node**

```ts
await prov.attest.cases.transition("CLM-SANDBOX-PARTIAL", { toStatus: "in_review", note: "Checking the two web uploads." });
```

**Python**

```python
httpx.post(f"{api}/v1/attest/cases/CLM-SANDBOX-PARTIAL/transition", headers=headers,
           json={"to_status": "in_review", "note": "Checking the two web uploads."})
```

The response, trimmed:

```json
{
  "object": "case",
  "claim_id": "CLM-SANDBOX-PARTIAL",
  "status": "in_review",
  "assignee_account_id": null
}
```

Assign a case with [`POST /v1/attest/cases/{claim_id}/assign`](https://provenanceauth.com/docs/api/cases.md#post-v1-attest-cases-claim-id-assign), and add a note to its history with [`POST /v1/attest/cases/{claim_id}/notes`](https://provenanceauth.com/docs/api/cases.md#post-v1-attest-cases-claim-id-notes).

## 3. Decide the case

Approving, denying or escalating a case needs a reason code, the record of why:

| `reason_code` | Use it when |
| --- | --- |
| `provenance_verified` | The media verified and the claim stands. |
| `risk_accepted` | You accept the claim despite open signals. |
| `signature_invalid` | The media was changed after capture. |
| `suspected_fraud` | The evidence points to fraud. |
| `insufficient_evidence` | The policyholder couldn't support the claim. |
| `policyholder_withdrew` | The claim was withdrawn. |
| `other` | Anything else; it requires a `note`. |

**curl**

```bash
curl $PROVENANCE_API/v1/attest/cases/CLM-SANDBOX-PARTIAL/transition \
  -H "Authorization: Bearer $PROVENANCE_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "to_status": "denied", "reason_code": "insufficient_evidence", "note": "The policyholder could not provide the originals." }'
```

**Node**

```ts
await prov.attest.cases.transition("CLM-SANDBOX-PARTIAL", { toStatus: "denied", reasonCode: "insufficient_evidence", note: "The policyholder could not provide the originals." });
```

**Python**

```python
httpx.post(f"{api}/v1/attest/cases/CLM-SANDBOX-PARTIAL/transition", headers=headers, json={
    "to_status": "denied", "reason_code": "insufficient_evidence", "note": "The policyholder could not provide the originals.",
})
```

The response, trimmed:

```json
{
  "object": "case",
  "claim_id": "CLM-SANDBOX-PARTIAL",
  "status": "denied"
}
```

Cases move along a fixed graph: `new` and `in_review` lead to a decision; `approved` and `denied` can be `reopened`; `escalated` can be approved, denied or reopened. An illegal move is a `400`. Every move is a row in the case's history and fires the `attest.case.status_changed` [webhook](https://provenanceauth.com/docs/integrate/webhooks.md).

## 4. Send the policyholder an appeal link

When a claim is denied, as `CLM-SANDBOX-PARTIAL` was in step 3, [`POST /v1/attest/claims/{id}/appeal_links`](https://provenanceauth.com/docs/api/appeals.md#post-v1-attest-claims-id-appeal-links) mints a signed link the policyholder opens without logging in. It is valid for seven days and files once:

**curl**

```bash
curl -s -X POST $PROVENANCE_API/v1/attest/claims/CLM-SANDBOX-PARTIAL/appeal_links \
  -H "Authorization: Bearer $PROVENANCE_KEY" | tee appeal-link.json
```

**Node**

```ts
const link = await prov.attest.claims.appealLink("CLM-SANDBOX-PARTIAL");
```

**Python**

```python
from provenanceauth import Provenance

prov = Provenance(os.environ["PROVENANCE_KEY"], base_url=api)
link = prov.attest.claims.appeal_link("CLM-SANDBOX-PARTIAL")
```

```json
{
  "object": "appeal_link",
  "claim_id": "CLM-SANDBOX-PARTIAL",
  "appeal_url": "https://app.provenanceauth.com/appeal/eyJjbGFpbV9pZCI6IkNMTS1TQU5EQk9YLUZSQVVEIn0~RPB-oMWuD-8fCpnx2vb40xRohn8vmcx7PyVfRtfBVlI",
  "token": "eyJjbGFpbV9pZCI6IkNMTS1TQU5EQk9YLUZSQVVEIn0~RPB-oMWuD-8fCpnx2vb40xRohn8vmcx7PyVfRtfBVlI",
  "expires_at": "2026-10-31T13:24:30.000Z"
}
```

The appeal page shows the claim's [explanation](https://provenanceauth.com/docs/attest/guides/review-claims.md#2-explain-the-result).

## 5. Receive the appeal

The policyholder's page files the appeal with [`POST /v1/attest/appeals`](https://provenanceauth.com/docs/api/appeals.md#post-v1-attest-appeals), which needs only the token:

**curl**

```bash
export APPEAL_TOKEN=$(jq -r .token appeal-link.json)
curl $PROVENANCE_API/v1/attest/appeals \
  -H "Content-Type: application/json" \
  -d '{ "token": "'"$APPEAL_TOKEN"'", "statement": "The damage is real. I can send the original photos." }'
```

**Node**

```ts
const appeal = await (await fetch(`${process.env.PROVENANCE_API}/v1/attest/appeals`, {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({ token: link.token, statement: "The damage is real. I can send the original photos." }),
})).json();
```

**Python**

```python
appeal = httpx.post(f"{api}/v1/attest/appeals", json={"token": link["token"], "statement": "The damage is real. I can send the original photos."}).json()
```

```json
{
  "id": "apl_01M5Q1BNYSG7C2D1RVFNMPY928",
  "object": "appeal",
  "claim_id": "CLM-SANDBOX-PARTIAL",
  "status": "filed",
  "case_status": "reopened",
  "created_at": "2026-10-24T13:24:47.705Z"
}
```

Filing reopens the case, so it returns to the queue for a person to decide. Provenance doesn't decide appeals.

## Appeals in your portal

To take the appeal inside your policyholder portal instead of on the hosted link, render [`<provenance-appeal>`](https://provenanceauth.com/docs/embeds.md#8-agents-and-appeals-in-your-product). Mint an `appeal` embed token for the claim with your `verify` key (the same key the explanation uses):

```html
<!-- your backend: POST /v1/embed/tokens { "widget": "appeal", "object_id": "CLM-20481" } -->
<provenance-appeal base-url="…" publishable-key="prv_pub_…" embed-token="emb_…"></provenance-appeal>
```

The component shows the plain-language explanation from the same fixed, versioned templates as [`GET /v1/attest/claims/{id}/explanation`](https://provenanceauth.com/docs/api/claims.md#get-v1-attest-claims-id-explanation), and records the same `explanation_rendered` event on the case.

The policyholder writes a reason (up to 2,000 characters), can add up to 3 photos or PDFs (5 MB each), and sends it. The appeal is the same row and the same case reopen as the hosted link, with `surface: "embed"`; the component fires `pv:appealed { appeal_id }`. While that appeal is open, the component shows its reference instead of a second form.

Read the appeals on a claim, from either surface, with [`GET /v1/attest/claims/{id}/appeals`](https://provenanceauth.com/docs/api/appeals.md#get-v1-attest-claims-id-appeals). Each lists its files; download one with [`GET /v1/attest/claims/{id}/appeals/{appeal_id}/files/{file_id}`](https://provenanceauth.com/docs/api/appeals.md#get-v1-attest-claims-id-appeals-appeal-id-files-file-id). Appeals are free on every plan.

## Errors you might see

| Symptom | Cause | Fix |
| --- | --- | --- |
| `400` [`parameter_invalid`](https://provenanceauth.com/docs/platform/errors.md#parameter_invalid) on `to_status` | An illegal transition, or a decision without a reason code | Follow the graph in step 3 and send `reason_code`. |
| `409` [`appeal_already_filed`](https://provenanceauth.com/docs/platform/errors.md#appeal_already_filed) | The link was already used | Send a new appeal link. |
| `401` [`appeal_token_invalid`](https://provenanceauth.com/docs/platform/errors.md#appeal_token_invalid) | The link expired or was altered | Send a new appeal link. |
| `403` [`insufficient_scope`](https://provenanceauth.com/docs/platform/errors.md#insufficient_scope) | Changing a case needs the `escalate` scope | Use a key with `escalate`. |

## See also

- [Insurance claims](https://provenanceauth.com/docs/attest/guides/review-claims.md)
- [Claim-system connectors](https://provenanceauth.com/docs/attest/guides/connectors.md)
- [Webhooks](https://provenanceauth.com/docs/integrate/webhooks.md)
