SpareSpare Docs
GuidesAPI Reference
Quick Start

Error Codes

HTTP status codes and error response shape used across every endpoint.

Every non-2xx response uses the same error shape, regardless of which endpoint or market you're calling.

HTTP status codes

RangeMeaning
2xxSuccess
4xxClient error. Review the request before retrying
5xxServer error, safe to retry with backoff
CodeMeaning
200OK, request succeeded
400Bad Request, missing or invalid parameters
401Unauthenticated, missing, expired, or invalid access token
403Permission Denied, token is valid but lacks access to this resource
404Not Found, the resource doesn't exist
409Already Exists, a conflicting resource already exists
5xxInternal / Unavailable. A platform-side issue; retry after a short wait

Error response shape

{
  "code": "not_found",
  "message": "consent not found",
  "details": {}
}
FieldTypeMeaning
codeStringMachine-readable error code, safe to branch on in code
messageStringHuman-readable description for logs and debugging
detailsObjectOptional structured context about the failure

Common error codes

codeTypical cause
invalid_argumentRequest body or query parameter failed validation
not_foundThe requested resource doesn't exist for your tenant
already_existsA resource with the same unique identifier already exists
permission_deniedYour token doesn't have access to this resource
unauthenticatedMissing or expired access token, re-authenticate
failed_preconditionThe request is valid but the resource isn't in a state that allows it (e.g. consent not yet authorized)
resource_exhaustedYou've sent too many requests. Wait a moment, then retry
unavailableThe platform or a provider is temporarily unavailable. Retry shortly
internalUnexpected server-side error, contact support with the request details

Branch on code, not message

message is for humans and may change. Always branch your error handling on code, never on the text of message.

Key takeaways

  • Every error response has the same shape: code, message, details.
  • 4xx means fix your request; 5xx means retry with backoff.
  • Branch your handling on code, it's stable across releases.

On this page