Errors
The responses of the token endpoint and the integration management endpoints, with their causes and fixes.
Two surfaces return errors, and they use different formats.
- The token endpoint,
POST /oauth/token, returns OAuth 2.0 error bodies (erroranderror_description). - The integration management endpoints under
/api/v2/integrationsuse the standard Flavours envelope (metaanddata) described on the Errors page.
Token endpoint
An error body has an error code and an error_description. Some also carry a
hint. Branch your code on the HTTP status and the error code, not on the
description text.
| Status | error | Cause | What to do |
|---|---|---|---|
401 | invalid_client | The client ID is unknown, the client secret is wrong or missing, the secret was rotated, or the integration was revoked. | Check both values. If they worked before, see Token lifecycle. Do not retry in a loop. |
400 | unsupported_grant_type | grant_type is missing, or it is not client_credentials. | Send grant_type=client_credentials. |
400 | invalid_request | A required parameter is missing, for example client_id. | Send all three fields. |
429 | none (Flavours envelope) | Too many token requests. | Wait for Retry-After seconds. |
Invalid client or secret
{
"error": "invalid_client",
"error_description": "Client authentication failed"
}A missing client_secret returns the same response.
Wrong or missing grant type
{
"error": "unsupported_grant_type",
"error_description": "The authorization grant type is not supported by the authorization server.",
"hint": "Check that all required parameters have been provided"
}Only client_credentials is supported. Other grants, such as password, return
this response.
Missing client ID
{
"error": "invalid_request",
"error_description": "The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed.",
"hint": "Check the `client_id` parameter"
}Rate limit
The token endpoint allows 10 requests per minute for each client_id and 30
requests per minute for each IP address. Every attempt counts, including failed
ones. Every token response carries X-RateLimit-Limit and
X-RateLimit-Remaining. When you exceed a limit, the endpoint returns 429
with a Retry-After header and the standard envelope:
{
"meta": {
"code": 429,
"status": "error",
"message": "Too many token requests. Please try again shortly."
},
"data": null
}See Rate limiting for the headers.
Integration management
You create, edit, rotate, and revoke integrations in the Flavours web app, which calls these endpoints with your signed-in session. The errors below are what the web app surfaces. All use the standard envelope.
| Endpoint | Purpose |
|---|---|
GET /api/v2/integrations | List integrations. Never returns a secret. |
POST /api/v2/integrations | Create an integration. Returns the secret once. |
PATCH /api/v2/integrations/{clientId} | Replace the scopes. |
POST /api/v2/integrations/{clientId}/rotate | Issue a new secret. Returns it once. |
DELETE /api/v2/integrations/{clientId} | Revoke. |
| Status | Message | Cause | What to do |
|---|---|---|---|
403 | Only a business owner or manager can manage integrations. | The user is limited to a branch. | Use an owner or manager account. |
403 | Please confirm your password to create an integration. | No password sent, and none confirmed in the last 10 minutes. data.reason is PASSWORD_REQUIRED. | Send the account password. |
403 | Please confirm your password to rotate the integration secret. | Same, on rotate. | Send the account password. |
403 | The password you entered is incorrect. | Wrong password on create or rotate. | Retry with the correct password. |
404 | Resource not found. | The integration does not exist in this market. | Check the client ID. |
422 | An integration with this name already exists. | Duplicate name in the market. | Choose another name. |
422 | This integration has already been revoked. | Edit, rotate, or revoke on a revoked integration. | Create a new integration. |
422 | A validation message; data lists the failing scopes entry (see validation errors) | A scope key is unknown, or a key repeats. | Use keys from Scopes. |
429 | Too Many Requests | More than 10 create or rotate requests per minute, or repeated wrong passwords. | Wait, then retry. |
The password rule on create and rotate has a 10-minute window: after a correct password, further create and rotate requests by the same user need no password for 10 minutes. Edit, revoke, and list never ask for it.
An admin account that has no market of its own must also send market_id;
otherwise the response is 422 with field set to market.
Example 403 for a missing password:
{
"meta": {
"code": 403,
"status": "error",
"message": "Please confirm your password to create an integration."
},
"data": {
"reason": "PASSWORD_REQUIRED"
}
}Example 422 for a duplicate name:
{
"meta": {
"code": 422,
"status": "error",
"message": "An integration with this name already exists."
},
"data": null
}