> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jurat.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Errors And Webhooks

> Handle Jurat API errors and recovery status notifications.

## Error Shape

Structured API errors use this shape:

```json theme={null}
{
  "error": {
    "code": "INVALID_SIGNER",
    "message": "Invalid signer",
    "requestId": "req_abc123"
  }
}
```

Some validation errors may also include a `details` array.

Future SDK methods should throw an `Error` when the API returns a non-2xx response. Log the backend `requestId` when support needs to trace a request.

## Common Error Codes

Jurat API errors may include codes such as:

* `INVALID_SIGNER`
* `INVALID_AUTH`
* `INVALID_TOKEN`
* `EXPIRED_TOKEN`
* `INVALID_PASSWORD`
* `UNAUTHORIZED`
* `INPUT_VALIDATION_ERROR`
* `NO_RECOVERY_CASE_TXS`
* `RECOVERY_STATUS_ERROR`
* `UNMATCHED_JRC_HASH`
* `API_KEY_NOT_FOUND`
* `EXCEEDED_API_KEY_AMOUNT`
* `USER_FOUND`
* `USER_NOT_FOUND`
* `RESOURCE_NOT_FOUND`
* `NO_FILE_UPLOADED`
* `INVALID_FILE_FORMAT`
* `NO_FILE_BUFFER`
* `INTERNAL_SERVER_ERROR`

## Webhooks

Webhooks notify integrators when long-running recovery state changes.

Recommended endpoint format:

```http theme={null}
POST https://partner.example.com/webhooks/jurat
```

Recommended event envelope:

```json theme={null}
{
  "id": "evt_abc123",
  "type": "recovery_case.executed",
  "createdAt": "2026-06-01T12:00:00.000Z",
  "data": {
    "caseId": "case-uuid",
    "jrcHash": "0x...",
    "status": "executed",
    "txHash": "0x..."
  }
}
```

## Event Types

* `recovery_case.created`
* `recovery_case.pending`
* `recovery_case.rejected`
* `recovery_case.executed`
* `recovery_case.action_required`

## Webhook Security

Each webhook should include:

```txt theme={null}
Jurat-Webhook-Id
Jurat-Webhook-Timestamp
Jurat-Webhook-Signature
```

The signature should be an HMAC over:

```txt theme={null}
{timestamp}.{rawBody}
```

Partners should reject old timestamps and replayed event IDs.
