> For the complete Lynkow documentation index in agent-friendly format, see [llms.txt](/llms.txt).

# SDK Types: Errors

**Publié le** : 2026-08-20
**Catégorie** : Types

# SDK Types: Errors

## `ApiErrorDetail`

*Interface*

A single error detail from the API's response body.
The API returns an array of these in the `errors` field of error responses.
For validation errors, each detail corresponds to one invalid field.

| Property | Type | Optional | Description |
| --- | --- | --- | --- |
| `code` | `string` | Yes | Machine-readable error rule or code from the validation layer.<br>Can be used for programmatic error handling or i18n error message lookups.<br>`undefined` when the API does not provide a structured code. |
| `field` | `string` | Yes | Name of the form/request field that caused the validation error.<br>Only present for `VALIDATION_ERROR` responses.<br>`undefined` for non-field-specific errors (e.g. auth, rate limiting).<br>Use this to display inline validation errors next to form fields. |
| `message` | `string` | No | Human-readable error message describing what went wrong.<br>Suitable for display to end users or logging. |


---

## `ErrorCode`

*TypeAlias*

Error codes for Lynkow SDK errors.

Each code maps to a specific category of failure. Use these in `catch` blocks
to handle different error types:

| Code | HTTP Status | When it occurs |
| --- | --- | --- |
| `BAD_REQUEST` | 400 | Malformed request (missing required fields, bad format) |
| `VALIDATION_ERROR` | 400 | Request body fails server-side validation (see `details`) |
| `UNAUTHORIZED` | 401 | Missing or invalid authentication (bad site ID) |
| `FORBIDDEN` | 403 | Valid auth but insufficient permissions |
| `NOT_FOUND` | 404 | Resource does not exist or is not published |
| `CONFLICT` | 409 | Concurrent or uniqueness conflict |
| `RATE_LIMITED` | 429 | Too many requests; retry after the indicated delay |
| `TOO_MANY_REQUESTS` | 429 | Alias for `RATE_LIMITED` |
| `TIMEOUT` | - | Request was aborted due to timeout (client-side) |
| `NETWORK_ERROR` | - | DNS failure, connection refused, or network offline |
| `INTERNAL_ERROR` | 500 | Server-side error (bug or infrastructure issue) |
| `SERVICE_UNAVAILABLE` | 503 | API is temporarily down for maintenance |
| `UNKNOWN` | other | Unrecognized HTTP status or unexpected error |


```typescript
type ErrorCode = "BAD_REQUEST" | "VALIDATION_ERROR" | "UNAUTHORIZED" | "FORBIDDEN" | "NOT_FOUND" | "CONFLICT" | "RATE_LIMITED" | "TOO_MANY_REQUESTS" | "TIMEOUT" | "NETWORK_ERROR" | "INTERNAL_ERROR" | "SERVICE_UNAVAILABLE" | "UNKNOWN"
```