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

# Errors

> HTTP status codes and the shape of error responses.

The Enkryptify API uses standard HTTP status codes to indicate success or failure.

## Response shape

All error responses follow the same shape:

```json theme={"dark"}
{
  "message": "Human-readable description of what went wrong"
}
```

The `message` field is always a string. Use the HTTP status code for programmatic branching; use `message` to surface details to your users or logs.

## Status codes

| Status | Meaning               | When you see it                                                                     |
| ------ | --------------------- | ----------------------------------------------------------------------------------- |
| `200`  | OK                    | Request succeeded                                                                   |
| `201`  | Created               | Resource created successfully                                                       |
| `400`  | Bad Request           | Request body or query parameters failed validation                                  |
| `401`  | Unauthorized          | No token, expired token or invalid token                                            |
| `403`  | Forbidden             | Token is valid but lacks permission for this resource                               |
| `404`  | Not Found             | The resource does not exist or you do not have access                               |
| `409`  | Conflict              | A uniqueness or state constraint was violated                                       |
| `429`  | Too Many Requests     | You hit the rate limit. See [Rate limits](/api-reference/rate-limits)               |
| `500`  | Internal Server Error | Something went wrong on our side. Please retry, then contact support if it persists |

## Example error responses

**Validation error** (`400`):

```json theme={"dark"}
{ "message": "name: String must contain at least 1 character(s)" }
```

**Unauthorized** (`401`):

```json theme={"dark"}
{ "message": "Invalid or expired token" }
```

**Forbidden** (`403`):

```json theme={"dark"}
{ "message": "Insufficient permissions" }
```

**Not found** (`404`):

```json theme={"dark"}
{ "message": "Secret not found" }
```

## Retrying

`5xx` errors and `429` are safe to retry with exponential backoff. `4xx` errors other than `429` indicate a problem with your request. Retrying without changes will return the same error.
