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

# Errors & Status

> HTTP status codes and the in-body status markers Nikiwa tools return.

Nikiwa signals outcomes at two levels: standard HTTP status codes for transport and auth, and in-body status markers for tool-level results.

## HTTP status codes

| Status                     | Meaning                                                              | What to do                                                                |
| -------------------------- | -------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `200 OK`                   | Request handled. Check the body for a tool-level status marker.      | Read the body.                                                            |
| `401 Unauthorized`         | Missing, malformed, or revoked [key](/api-reference/authentication). | Check the `Authorization` header; rotate the key if revoked.              |
| `404 Not Found`            | The tool name is unknown or not public.                              | Verify the name against [discovery](/api-reference/discovery).            |
| `422 Unprocessable Entity` | Invalid arguments for the tool.                                      | Check the tool's input schema from [discovery](/api-reference/discovery). |
| `429 Too Many Requests`    | Per-key [rate limit](/api-reference/rate-limits) exceeded.           | Back off and retry.                                                       |
| `5xx`                      | Server-side error.                                                   | Retry with backoff.                                                       |

## Tool-level status markers

A tool call can return `200 OK` and still contain no data. Nikiwa tools return their data object on success, or one of these markers:

<CodeGroup>
  ```json Success theme={null}
  {
    "...": "the tool's structured data"
  }
  ```

  ```json No data theme={null}
  {
    "status": "no_data"
  }
  ```

  ```json Error theme={null}
  {
    "status": "error",
    "message": "Human-readable explanation"
  }
  ```
</CodeGroup>

<Warning>
  Always branch on the body, not just the HTTP code. A `200` with `{"status": "no_data"}` means the query was valid but nothing matched, for example a wallet with no activity on the requested network.
</Warning>

## Recommended handling

<Steps>
  <Step title="Check the HTTP status">
    Handle `401`, `404`, and `429` before parsing the body.
  </Step>

  <Step title="Check for a status marker">
    If the body has `status: "error"` or `status: "no_data"`, handle it explicitly.
  </Step>

  <Step title="Otherwise, use the data">
    A body with no error or no-data marker is a successful data result.
  </Step>
</Steps>
