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

# Error codes

> Error codes that the Compliance API returns and what each one indicates

The Compliance API uses standard HTTP status codes and returns errors as JSON. The status code shows the kind of failure, such as a bad request, a failed credential, or a rate limit. For some errors, a `code` field names the exact cause. This page describes the error response, lists every error type, and explains the codes specific to the Compliance API.

## Error response

Every error response has an `error` object with the following fields:

| Field | What it indicates |
| - | - |
| `type` | The kind of error, based on the HTTP status code. |
| `message` | A description of what went wrong. |
| `code` | The specific cause. Present only for the codes listed in [Compliance API codes](#compliance-api-codes). |
| `required_scope` | The scope the method needs. Present only when `code` is `missing_scope`. |

This example is for a `403` caused by a missing scope:

```json theme={null}
{
  "error": {
    "type": "permission_error",
    "message": "This API key is not permitted to perform that request. Needed: [compliance:members:read]",
    "code": "missing_scope",
    "required_scope": "compliance:members:read"
  }
}
```

## Error types

| HTTP | `type` | What it indicates |
| - | - | - |
| 400 or 422 | `invalid_request_error` | The request is invalid, for example a malformed parameter or `cursor`. |
| 401 | `authentication_error` | A credential failed. The workspace API key is missing, unknown, or disabled, or the signed authentication token is missing or invalid. |
| 402 or 403 | `permission_error` | The workspace or the credentials aren't allowed to make the request. |
| 404 | `not_found_error` | The workspace doesn't exist. |
| 429 | `rate_limit_error` | The workspace sent too many requests. Wait the number of seconds in the `retry-after` header. See [Rate limits](https://docs.base44.com/developers/references/compliance-api/get-started/rate-limits.md). |
| 500 | `api_error` | An error on Base44's side. Retry with exponential backoff and a newly signed authentication token. |

## Compliance API codes

The following codes are specific to the Compliance API.

| HTTP | `code` | What it indicates |
| - | - | - |
| 401 | `partner_key_required` | The signed authentication token is missing, or Base44 can't verify it. The workspace API key isn't at fault, so don't ask a workspace owner or admin to create a new one. |
| 402 | `plan_not_included` | The workspace's plan doesn't include the API, or the subscription has lapsed. Learn more about [Base44 for enterprises](https://docs.base44.com/Enterprise/Base44-for-enterprises.md) and [what happens when a workspace leaves Enterprise](https://docs.base44.com/Enterprise/compliance-api.md#faqs). |
| 403 | `missing_scope` | The key doesn't include the scope the method needs. The `required_scope` field names it. Learn more about [choosing permissions](https://docs.base44.com/Enterprise/compliance-api.md#choosing-permissions). |
| 403 | `workspace_mismatch` | The key belongs to another workspace. |
| 403 | `feature_not_enabled` | Base44 hasn't enabled the API for this workspace. Ask your Base44 partner contact to enable it. |
| 403 | `partner_not_approved` | Base44 suspended your registration. Ask your Base44 partner contact for details, because a workspace owner or admin can't grant this. |
| 500 | `inventory_too_large` | The workspace has more items than the API can return. This limit is permanent. Ask your Base44 partner contact for help. |


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