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

# Errors

> Error responses, status codes and how to handle them.

Errors use standard HTTP status codes and return a JSON body with an `error` object and a `requestId`:

```json theme={null}
{
  "error": {
    "type": "invalid_request_error",
    "message": "Field \"Member name\" is required."
  },
  "requestId": "req_8f3a2c1d9e7b6a54"
}
```

<ResponseField name="error.type" type="string">
  The category of error. See the table below.
</ResponseField>

<ResponseField name="error.code" type="string">
  A stable, machine-readable code, such as `missing_idempotency_key`. Only some errors have one.
</ResponseField>

<ResponseField name="error.message" type="string">
  A readable explanation. Don't match on it, because the wording can change.
</ResponseField>

<ResponseField name="error.issues" type="array">
  Returned when a template `definition` is invalid. Lists each problem and where it is.
</ResponseField>

<ResponseField name="requestId" type="string">
  Identifies the request. Include it when you contact support.
</ResponseField>

## Status codes

| Status | Type | Meaning |
| - | - | - |
| `200`, `201` | | Success. |
| `400` | `invalid_request_error` | The request is invalid, for example an unknown field or a missing required value. |
| `401` | | The API key is missing or invalid. The body carries the code `invalid_api_key`. |
| `403` | `authorization_error` | The key can't do this. |
| `404` | `not_found_error` | The resource doesn't exist in this key's organization or environment. |
| `409` | `conflict_error` or `idempotency_error` | The request conflicts with the current state, such as voiding a pass twice or a reused idempotency key. |
| `413` | `invalid_request_error` | The upload is too large. |
| `422` | `api_error` | The request is valid but can't be done yet, usually because a live certificate or issuer isn't set up. |
| `429` | `rate_limit_error` | Too many requests. Wait and retry. |
| `500` | `api_error` | Something went wrong on our side. Retry with the same idempotency key. |

## Error codes

| Code | Status | Meaning |
| - | - | - |
| `invalid_api_key` | `401` | The key is missing, malformed, unknown or revoked. |
| `missing_idempotency_key` | `400` | A `POST`, `PATCH` or `DELETE` was sent without an `Idempotency-Key`. |
| `idempotency_conflict` | `409` | The idempotency key was used with a different body, or its first request is still running. |

## Debugging

Every API request is listed in the dashboard under **Developers → Request logs**, with its status and response.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.