> ## Documentation Index
> Fetch the complete documentation index at: https://emotion-trac.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Retries and errors

> Recover safely from timeouts, validation errors and rate limits.

## Safe creation retries

Generate one `requestId` when your system starts a new form. Persist the exact
request body and retry it unchanged if the network times out or the API returns
a transient error. Do not generate a new ID just because a response was lost.

Requests with the same ID are scoped to your partner account. Concurrent
identical requests converge on one draft; the first creation returns `201`, and
replays return `200`. Replays return current lifecycle information and never
overwrite attorney edits.

Text is trimmed and emails are lowercased before comparison. Object key order
does not matter. Reuse with different creation data, including a different
`sendEmail` value, returns `409 request_id_conflict`.

Use a **new** request ID for a new intentional form. Multiple forms for the same
case are supported. IDs remain reserved while the original draft is retained,
including after submission or deletion.

## Error format

```json theme={null}
{
  "error": {
    "code": "validation_error",
    "message": "Correct the indicated fields.",
    "fields": [
      {
        "path": "form.materials.uploadedFiles",
        "message": "Unsupported field."
      }
    ]
  }
}
```

`fields` appears on validation errors. A field path identifies the nested
property or array entry that needs correction. Unknown fields are rejected.

| HTTP | Code | What to do |
| - | - | - |
| `400` | `invalid_json` | Send a valid JSON object |
| `401` | `unauthorized` | Check the bearer key or request a replacement |
| `404` | `draft_not_found` | Check your saved ID; unavailable work cannot be revived by retrying |
| `409` | `request_id_conflict` | Restore the original body, or use a new ID for an intentional new form |
| `413` | `request_too_large` | Reduce the body to at most 64 KiB |
| `415` | `unsupported_media_type` | Set `Content-Type: application/json` |
| `422` | `validation_error` | Correct the listed fields, then retry |
| `429` | `rate_limited` | Wait at least the `Retry-After` value in seconds |
| `503` | `temporarily_unavailable` | Wait at least 30 seconds; retry the same ID and body |

For network failures or other transient `5xx` responses, use exponential
backoff with jitter and the original request ID. Stop automatic retries for
mapping and authentication errors until they are corrected.

## Notification delivery

Request retries do not enqueue duplicate logical notifications. A separate
worker retries failed initial emails. If a provider accepts a message but its
acknowledgment is lost, a retry can still cause a duplicate delivery. Absolute
exactly-once email or webhook delivery is not guaranteed.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.