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 unmanaged OAuth REST requests require an active Scale subscription. Grain-managed OAuth apps with an active grant can call /api/v1 on Starter and Growth. MCP access is available on Growth and Scale.
The authenticated user is not a member of the organization in X-Organization-Id.
Start a new Grain OAuth authorization-code flow. This can occur when an MFA-enrolled user authorized the app before the grant recorded MFA assurance. Grain also requires reconnection if the verified phone factor is removed after authorization.

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 September 15, 2026