Skip to main content
The Grain API uses standard HTTP status codes. Error responses include a JSON body with a message field describing what went wrong.

Error response format

Some validation errors may include additional fields depending on the endpoint.

Common status codes

Authentication errors

Refresh your OAuth access token, re-run OAuth, or rotate the organization API key. API-key failures use one generic response so callers cannot probe key state.
Add the header to OAuth requests. It is optional for organization API keys. See Organizations.
A valid API key does not include the scope required by the endpoint. Create a replacement key with the needed scope; existing key scopes cannot be edited.
Organization API keys and REST API requests require an active Enterprise subscription. MCP access is available on Growth and Enterprise.
The authenticated user is not a member of the organization in X-Organization-Id.

Handling errors in your integration

Log the status code and message field for debugging. Do not log full Bearer tokens.

Rate limiting

When you exceed the per-organization rate limit, the API returns 429 with rate limit headers. Wait until X-RateLimit-Reset before retrying. See Introduction for default limits.
Last modified on August 5, 2026