Error Codes

The API uses standard HTTP status codes and structured error payloads to help clients diagnose failures.

Error Response Format

{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable error message",
    "details": {}
  }
}

HTTP Status Codes

CodeMeaning
200Request completed successfully.
201Resource created successfully.
204Request succeeded without a response body.
400The request parameters are invalid.
401Authentication is missing or invalid.
403The credential lacks permission or the account is blocked.
404The requested resource does not exist.
422Validation failed.
429The rate limit was exceeded.
500An unexpected server error occurred.
503The API is temporarily unavailable.

Error Code Reference

CodeStatusDescription
UNAUTHORIZED401The API key or token is invalid, expired, or revoked.
FORBIDDEN403The key lacks the required scope, the account is inactive, or API access is disabled.
ACCOUNT_SUSPENDED403The company account is suspended and API operations are blocked.
NOT_FOUND404The resource does not exist or does not belong to your account.
VALIDATION_ERROR422The submitted request data failed validation.
HAS_ACTIVE_USERS422The company cannot be deleted while active users still exist.
SSO_DOMAIN_CLAIMED422The email domain is managed by another company through SSO.
INSUFFICIENT_SEATS422The reseller seat pool does not have enough available seats.
SEAT_LIMIT_REACHED422The company has reached its hard seat limit.
SEATS_IN_USE422The seat limit cannot be reduced below current usage.
RATE_LIMIT_EXCEEDED429The client exceeded the allowed request rate.

Handling Errors

try {
    const response = await fetch('/api/v1/reseller/companies', {
        method: 'POST',
        headers: {
            Authorization: `Bearer ${apiKey}`,
            'Content-Type': 'application/json',
        },
        body: JSON.stringify(data),
    });

    if (! response.ok) {
        const error = await response.json();

        if (error.error.code === 'RATE_LIMIT_EXCEEDED') {
            retryLater(error.error.details?.reset_at);
        }
    }
} catch (error) {
    reportNetworkFailure(error);
}