# API Errors

The Public API returns errors in **RFC 9457 — Problem Details for HTTP APIs** format ([rfc-editor.org/rfc/rfc9457](https://www.rfc-editor.org/rfc/rfc9457)), with `Content-Type: application/problem+json`.

## Error response structure

Each error response is a JSON object with the standard RFC 9457 fields and, where applicable, extension fields.

| Field | Type | Required | Description |
|  --- | --- | --- | --- |
| `type` | string | yes | URI that identifies the error **type**. It points to the error’s documentation page (see [Error types](#error-types)). |
| `title` | string | yes | Short human-readable description of the problem type. |
| `status` | number | yes | HTTP status code (e.g. 400, 404, 500). |
| `detail` | string | yes | Human-readable message specific to this occurrence. |
| `code` | string | yes | Application error code (`TS-xxx`), useful for logging and automation. |


## Error types

The response **`type`** field contains a URI that identifies the error category and points to the corresponding documentation page.

| type | HTTP status | Description | Page |
|  --- | --- | --- | --- |
| `.../errors/validation-error` | 400 | Invalid payload or parameters | [Validation error](/errors/validation-error) |
| `.../errors/not-found-error` | 404 | Resource not found | [Not found error](/errors/not-found-error) |
| `.../errors/resource-gone-error` | 410 | Resource deleted | [Resource gone error](/errors/resource-gone-error) |
| `.../errors/server-error` | 500 | Internal server error | [Server error](/errors/server-error) |


Each page lists the associated `TS-xxx` codes, response examples, and guidance for resolving the issue.

## Full error code list

| Code | HTTP status | type | Detail |
|  --- | --- | --- | --- |
| `TS-000` | 500 | [server-error](/errors/server-error) | Internal server error. |
| `TS-001` | 400 | [validation-error](/errors/validation-error) | Malformed payload. |
| `TS-002` | 400 | [validation-error](/errors/validation-error) | Validation data error. |
| `TS-003` | 400 | [validation-error](/errors/validation-error) | Relative resource not found. |
| `TS-004` | 400 | [validation-error](/errors/validation-error) | Flow data validation error. |
| `TS-005` | 400 | [validation-error](/errors/validation-error) | Sign data validation error. |
| `TS-006` | 400 | [validation-error](/errors/validation-error) | Attachment already linked to Template. |
| `TS-007` | 400 | [validation-error](/errors/validation-error) | On before create function not found. |
| `TS-008` | 400 | [validation-error](/errors/validation-error) | Insufficient credits available. |
| `TS-009` | 410 | [resource-gone-error](/errors/resource-gone-error) | Certification deleted. |
| `TS-010` | 404 | [not-found-error](/errors/not-found-error) | Certification not found. |
| `TS-011` | 400 | [validation-error](/errors/validation-error) | No certification attachments found. |
| `TS-012` | 400 | [validation-error](/errors/validation-error) | A certification has already been created for this upload session token. |
| `TS-013` | 400 | [validation-error](/errors/validation-error) | Not all files have been uploaded. |
| `TS-014` | 500 | [server-error](/errors/server-error#certification-processing-failure) | The certification could not be completed after creation. |
| `TS-901` | 400 | [validation-error](/errors/validation-error) | This True Link has already been used to create a certification. |


## Certification GET: async processing failure

When **`GET /v1/certifications/{reportId}`** refers to a certification that was **created successfully** but **failed during asynchronous processing**, the API returns an **HTTP status appropriate to the error** (for example **5xx**). The body is **`application/problem+json`** (RFC 9457), with the same fields as other errors.

If you supplied a **`webhook_url`** on creation, the **failure** callback uses the **same** `problem+json` payload this `GET` would return.

## Handling errors in the client

1. Check the response **Content-Type**: if it is `application/problem+json`, parse the body as an RFC 9457 object.
2. Use **`status`** to distinguish 4xx (client error) from 5xx (server error).
3. Use **`type`** to identify the error category and consult the corresponding documentation page.
4. Use **`code`** (`TS-xxx`) for logging, analytics, or localized messages.
5. Show the user **`detail`**; use **`title`** for generic labels.


## Reference

- [RFC 9457 — Problem Details for HTTP APIs](https://www.rfc-editor.org/rfc/rfc9457)
- Error response Content-Type: `application/problem+json`