Skip to content

Getting started

Errors and limits

Responses are JSON. Success is { "success": true, "data": … }. Failures carry success: false, a readable message and a machine code in error or code. Validation failures add fieldErrors.

StatusMeaning
400Invalid input. See fieldErrors.
401Missing, invalid or revoked key.
403The key lacks the scope or role, or the feature isn’t on your plan.
404Not found in this workspace.
429Rate limit or monthly quota reached. Back off and retry.
  • Rate limits are per workspace. Current usage comes back in the standard RateLimit and RateLimit-Policy headers.
  • Retries. Send an Idempotency-Key header on channel sends, invoice and storage writes; a retry with the same key isn’t applied twice. /events/trigger takes idempotencyKey in the body.
  • SDK errors. Failed calls throw APIError (with status and code), with AuthenticationError and RateLimitError subclasses. The SDK retries 429s and network errors up to 3 times with backoff.
Error response
{
  "success": false,
  "error": "INVALID_KEY",
  "message": "Invalid, expired, or revoked API key."
}
import { APIError, RateLimitError } from "@ecodrix/erix-api";

try {
  await ecod.product.erix.leads.create({ firstName: "Asha", phone: "+91XXXXXXXXXX" });
} catch (err) {
  if (err instanceof RateLimitError) {
    // back off, then retry
  } else if (err instanceof APIError) {
    console.error(err.status, err.code, err.message);
  }
}