Skip to content

Errors

All API errors return a JSON body:

{
"error": "provider config not found",
"code": "not_found"
}
FieldDescription
errorHuman-readable error message
codeMachine-readable error code

The X-Request-Id response header is included on every response for debugging and support.

StatusMeaning
400Bad request — invalid parameters or missing required fields
401Unauthorized — missing or invalid API key
403Forbidden — API key doesn’t have permission (e.g., publishable key on a secret-only endpoint)
404Not found — resource doesn’t exist in this workspace
409Conflict — duplicate resource (e.g., provider config already exists for this provider)
422Unprocessable — request is well-formed but semantically invalid
429Rate limited — too many requests
500Internal server error
502Bad gateway
503Service unavailable
504Gateway timeout
CodeDescription
not_foundResource not found
already_existsResource already exists (duplicate)
invalid_requestMissing or invalid parameters
unauthorizedAuthentication failed
forbiddenInsufficient permissions
rate_limitedToo many requests
provider_errorUpstream provider returned an error
refresh_failedToken refresh failed
needs_reauthConnection requires re-authorization

The SDKs automatically retry on these status codes with exponential backoff:

StatusRetry?Notes
429YesRespect Retry-After header if present
500YesServer error, may be transient
502YesBad gateway
503YesService temporarily unavailable
504YesGateway timeout
400-404NoClient error, fix the request

Retry strategy: up to 3 attempts with exponential backoff (500ms, 1s, 2s base delay, capped at 4s). The Go SDK adds random jitter.

// Node
import { AuthpipeApiError } from "@authpipe/node";
try {
await authpipe.getCredential({ provider: "slack", tenantId: "org_acme" });
} catch (err) {
if (err instanceof AuthpipeApiError) {
err.statusCode // 404
err.code // "not_found"
err.message // "connection not found"
err.requestId // "req_abc123"
}
}
// Go
var apiErr *authpipe.APIError
if errors.As(err, &apiErr) {
apiErr.StatusCode // 404
apiErr.Code // "not_found"
apiErr.Message // "connection not found"
apiErr.RequestID // "req_abc123"
}
# Python
from authpipe.errors import AuthpipeAPIError
try:
client.get_credential(provider="slack", tenant_id="org_acme")
except AuthpipeAPIError as e:
e.status_code # 404
e.code # "not_found"
e.message # "connection not found"