> For the complete documentation index, see [llms.txt](https://123-87.gitbook.io/signgate-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://123-87.gitbook.io/signgate-api/documentation/errors.md).

# Error handling

Errors do not carry a policy decision and never authorize execution.

{% hint style="info" %}
**Primary constraint:** Every non-successful response stops the action.
{% endhint %}

## Status codes

| Status | Meaning                                         | Retry guidance                          |
| ------ | ----------------------------------------------- | --------------------------------------- |
| `400`  | Malformed JSON or UTF-8                         | Fix request                             |
| `401`  | Authentication failed                           | Fix credential                          |
| `403`  | Scope, authorization, or tenant mismatch        | Fix authorization                       |
| `409`  | Idempotency, reuse, expiry, or consume conflict | Inspect reason; keep identifiers stable |
| `422`  | Schema or contract invalid                      | Fix fields                              |
| `500`  | Invariant or persistence failure                | Retry safely or defer                   |
| `503`  | Policy or dependency unavailable                | Back off or defer                       |

## Error envelope

```json
{
  "contract_version": "0.1",
  "error": "SCHEMA_INVALID",
  "reason_codes": ["SCHEMA_INVALID"],
  "request_id": "req_preview_001",
  "enforcement_effect": "DENY",
  "audit_id": "audit_error_001"
}
```

## Client rule

Do not map a `500` or `503` to `DENY` as a policy conclusion. The enforcement effect is still non-execution, but no policy decision was produced.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://123-87.gitbook.io/signgate-api/documentation/errors.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
