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.
| Status | Meaning |
|---|---|
| 400 | Invalid input. See fieldErrors. |
| 401 | Missing, invalid or revoked key. |
| 403 | The key lacks the scope or role, or the feature isn’t on your plan. |
| 404 | Not found in this workspace. |
| 429 | Rate limit or monthly quota reached. Back off and retry. |
- Rate limits are per workspace. Current usage comes back in the standard
RateLimitandRateLimit-Policyheaders. - Retries. Send an
Idempotency-Keyheader on channel sends, invoice and storage writes; a retry with the same key isn’t applied twice./events/triggertakesidempotencyKeyin the body. - SDK errors. Failed calls throw
APIError(withstatusandcode), withAuthenticationErrorandRateLimitErrorsubclasses. The SDK retries 429s and network errors up to 3 times with backoff.
{
"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);
}
}