Qubit API v1

Errors

One envelope, stable codes, a request id on everything.

Every error, from a missing scope to a database that is down, has the same shape. Branch on the code; show the message to a person; keep the request_id for support.

The envelope

{
  "error": {
    "code": "outside_service_window",
    "message": "More than 24 hours have passed since this customer last wrote. Send an approved template instead.",
    "details": { "expires_at": null },
    "request_id": "2c0d8f0e-6a1b-4c3d-9e8f-7a6b5c4d3e2f"
  }
}

Codes

CodeHTTP statusMeaning
unauthenticated401Authentication is required.
forbidden403You do not have permission to perform this action.
not_found404The requested resource was not found.
validation_failed422The given data was invalid.
rate_limited429Too many requests.
idempotency_conflict409This idempotency key was used with a different request body.
identity_already_claimed409That handle already belongs to another contact. Merge the contacts instead of reassigning it.
connection_owned_elsewhere409That account is already connected to another workspace. Disconnect it there first.
channel_unavailable422The channel connection is not available.
provider_error502The upstream provider returned an error.
template_not_approved422The message template is not approved for sending.
outside_service_window422The customer service window has expired; send an approved template instead.
account_suspended403This account is suspended.
method_not_allowed405The HTTP method is not supported for this route.
payload_too_large413The request payload is too large.
internal_error500An unexpected error occurred.
bad_request400The request could not be understood.
service_unavailable503The service is temporarily unavailable. Try again shortly.
google_email_not_invited403No one in this workspace has been invited with that Google account. Ask an administrator to invite you, then sign in with Google again.
channel_setup_failed422The provider refused a step of the channel set-up.
insufficient_balance422The wallet cannot cover this.
invitation_not_found404This invitation does not exist.
invitation_expired410This invitation has expired.
invitation_revoked410This invitation was withdrawn.
invitation_resend_throttled429This invitation was sent recently. Wait before sending it again.
google_email_mismatch422The Google account does not match the invited address.
invitation_not_accepted403This account has been invited but the invitation has not been accepted yet. Use the link in the invitation email to set up your sign-in.
registration_closed403New sign-ups are closed.
verification_failed422That code is wrong or has expired. Request a new one.
workspace_unavailable423This workspace is not available right now.
workspace_suspended423This workspace is suspended. You can view your data, but changes are paused until billing is settled.
invalid_tenant_transition409The workspace cannot move to that state from where it is.
invalid_transition409That change is not possible from its current state.
mode_switch_in_progress409A platform mode switch is already running.
ownership_required403Only the workspace owner can do this.
feature_not_in_plan402This feature is not included in your plan.
limit_reached402Your plan limit for this has been reached.
plan_change_refused422That plan change is not possible.
plan_in_use409This plan has subscribers. Archive it instead.
nothing_owed422Nothing is owed on this subscription.
refund_refused422That refund is not possible.
method_disabled_by_platform422That sign-in method is turned off for the whole platform.
whatsapp_sender_not_configured422The platform WhatsApp sender is not set up.
coupon_invalid422That coupon code is not valid.
coupon_expired422That coupon has expired.
coupon_exhausted422That coupon has been used up.
coupon_not_applicable422That coupon does not apply to this plan.
coupon_already_used422This coupon has already been used on this workspace.

Validation errors

422 validation_failed carries every field problem at once under details, keyed by field, so a form can show all of them:

{
  "error": {
    "code": "validation_failed",
    "message": "The given data was invalid.",
    "details": {
      "to": ["The to field is required."],
      "message.template": ["The message.template field is required when type is template."]
    },
    "request_id": "…"
  }
}

What to retry

Status Retry?
429 Yes, after Retry-After seconds.
500, 502, 503 Yes, with backoff and the same Idempotency-Key.
401, 403 No - fix the credential or the scope.
404, 409, 413, 422 No - the request itself is wrong.

A 502 provider_error means the channel's provider refused or timed out. The message row, if one was created, is marked failed with the platform's code; the raw provider reason is in the dashboard for the business.

OAuth2 token errors

POST /oauth/token speaks the OAuth2 error shape instead, because that is the contract token libraries expect: { "error": "invalid_client", "error_description": "…" } with 400 or 401.

Base URL https://communication-api.artofluminaire.com Every response carries X-Request-ID; quote it when you write to support.