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

# API Errors

> Error codes returned by the Validio API and what to do about each one.

Errors returned by the GraphQL API carry a stable code in `extensions.code` alongside a human-readable `message`, as the [rate limit example](https://docs.validio.io/v11.0/developer/validio-api/graphql-api/pagination-and-rate-limits.md#api-rate-limits) shows. Branch on the code, not the message: messages may be reworded, but codes do not change.

All codes except `RATE_LIMITED` are returned in namespaces with [approval workflows](https://docs.validio.io/v11.0/docs/access-and-settings/approval-workflows.md) enabled, where every change to a source, validator, filter, window, or segmentation has to be approved by a second person.

| Code | Meaning | What to do |
| :- | :- | :- |
| `RATE_LIMITED` | Too many requests for this API key. | Wait for `Retry-After`. See [API rate limits](https://docs.validio.io/v11.0/developer/validio-api/graphql-api/pagination-and-rate-limits.md#api-rate-limits). |
| `DIRECT_MUTATION_IN_PROTECTED_NAMESPACE` | An immediate create, update, or delete was sent to a namespace that requires approval. | Use the draft operations, or keep IaC-managed namespaces unprotected. |
| `DRAFT_MUTATION_IN_UNPROTECTED_NAMESPACE` | A draft operation was sent to a namespace that does not require approval. | Use the direct operation. |
| `API_KEY_CANNOT_AUTHOR_DRAFT` | API keys cannot create, update, or submit drafts. | A user has to make the change in the Validio UI. |
| `API_KEY_CANNOT_APPROVE` | API keys can never approve or request changes. | A user with the Approve permission decides in the Validio UI. |
| `NO_ELIGIBLE_APPROVERS` | Nobody other than the creator and submitter holds the Approve permission for this resource type. | Grant another member the permission, or leave the draft unsubmitted. |
| `PENDING_CHANGE_EXISTS` | The resource already has an open change. | Withdraw, approve, or discard it first. |
| `UNEXPECTED_DRAFT_STATE` | The change is not in a state where this action applies, usually because someone else acted first. | Re-read the resource and retry the applicable action. |
| `SUBMITTER_CANNOT_APPROVE` | The caller submitted this change. | Another user has to decide it. |
| `CREATOR_CANNOT_APPROVE` | The caller created this change, even if someone else submitted it. | Another user has to decide it. |
| `REVIEWER_COMMENT_REQUIRED` | Request changes was sent without a comment. | Include a non-empty comment. |
| `DEPENDENCY_NOT_PUBLISHED` | A resource this change depends on (its source, filter, window, or segmentation) is not published. | Approve the dependency first. |
| `OPEN_DRAFTS_IN_NAMESPACE` | Approval workflows cannot be turned off while the namespace has open changes. | Resolve or discard them first. |
| `OPEN_DRAFTS_ON_SOURCE` | A source cannot be moved while it, or a resource built on it, has an open change. | Resolve or discard them first. |

Top-level list queries return published resources only, so a pending change is never returned as if it were live.
