> ## Documentation Index
> Fetch the complete documentation index at: https://hc.saas-manager.biz.nuro.jp/llms.txt
> Use this file to discover all available pages before exploring further.

# Errors

> The AI Helpdesk API returns appropriate HTTP status codes and a consistent error body when something goes wrong.

## HTTP Status Codes

The API uses standard HTTP status codes. Because the AI Helpdesk API is read-only, only `200` is used in the `2xx` range.

| Status Code | Meaning      | Description                                               |
| ----------- | ------------ | --------------------------------------------------------- |
| 200         | OK           | Request succeeded                                         |
| 400         | Bad Request  | Invalid query parameter or missing required configuration |
| 401         | Unauthorized | `X-API-Key` header is missing or invalid                  |
| 404         | Not Found    | The requested resource does not exist                     |

## Error Response Body

When an error occurs, the API returns the following JSON body:

```json theme={null}
{
  "ok": false,
  "error": "Missing or invalid API key"
}
```

### Response Fields

| Field   | Type    | Description                  |
| ------- | ------- | ---------------------------- |
| `ok`    | boolean | `false` on error             |
| `error` | string  | Human-readable error message |

## Common Errors

### Authentication Error (401)

```json theme={null}
{
  "ok": false,
  "error": "Missing or invalid API key"
}
```

Cause: The `X-API-Key` header is missing or contains an invalid value.

### Resource Not Found (404)

```json theme={null}
{
  "ok": false,
  "error": "Not found"
}
```

Cause: The path parameter (`sessionKey`, `docId`, `typePath`, `integrationId`, …) does not exist or belongs to a different tenant.

### Invalid Parameters (400)

```json theme={null}
{
  "ok": false,
  "error": "Invalid query parameters"
}
```

Cause: An enum query parameter such as `status` or `assigneeType` is out of range, or `limit` is outside the allowed range (`1..100`, or `1..500` for procedures).

## Best Practices

1. Always branch on the `ok` field — do not infer success purely from HTTP code.
2. Log the `error` message and translate it into a user-facing message as appropriate.
3. Do not auto-retry 401 — it requires a key rotation. Surface it to operators.
4. Do not auto-retry 404 — the caller logic is at fault.
5. Avoid logging sensitive information such as full API keys.
