Errors
Every error response from the Curviate API uses the same flat JSON envelope. Machine-readable codes let your agent handle failures programmatically.
Error envelope
{
"code": "UNAUTHORIZED",
"message": "Valid API key required. Use Authorization: Bearer cvt_live_<key>.",
"retry_hint": null,
"user_fixable": true,
"retry_likely_to_succeed": false
}The error body is a flat JSON object; there is no wrapper "error" key. The top-level properties are code, message, retry_hint, user_fixable, and retry_likely_to_succeed.
| Field | Type | Always present | Description |
|---|---|---|---|
code | string | Yes | Machine-readable error code from the taxonomy below |
message | string | Yes | Human-readable description |
retry_hint | object or null | Yes | null when no retry guidance; otherwise {"kind":"delay","delay_ms":N}, {"kind":"backoff"}, or {"kind":"never"} |
user_fixable | boolean | Yes | true when the caller can resolve the error (for example fix a bad parameter, add a seat) |
retry_likely_to_succeed | boolean | Yes | true when retrying the same request may succeed (for example a rate-limit window that will expire) |
retry_after_ms fieldWait time arrives in two places and neither is called retry_after_ms:
the Retry-After response header (IETF, seconds), and
the optional retry_hint.delay_ms in the body
(milliseconds, snake_case). Reading a field that does not exist
yields undefined, and arithmetic on it yields NaN, which
typically collapses your backoff to zero and retries straight back into an active
limit. The TypeScript SDK exposes the same value camelCased, as
err.retryHint?.delayMs.
HTTP status codes
| Status | Meaning |
|---|---|
400 | Bad request. Invalid parameters or body. |
401 | Unauthorized. Missing or invalid API key. |
402 | Payment required. No active subscription, a failed payment, or an expired trial. |
403 | Forbidden. Valid key, but no active seat covers the account, the LinkedIn subscription the operation needs is missing, the workspace has not opted into beta operations, or the account lacks permission on the target. |
404 | Not found. The resource does not exist, or is not yours. |
409 | Conflict. The request collides with existing state (already linked, already in progress, duplicate invitation). |
413 | Payload too large. The request body exceeds a size limit. Three things trigger it, smallest first: the platform's own ceiling on total request size, which rejects bodies from roughly 1 MB and is the common case with images; then the caps this API enforces before the call, 5 MiB per attachment and 9 MiB for the whole request body. |
415 | Unsupported media type. Wrong Content-Type header. |
422 | Unprocessable. The request is well-formed, but LinkedIn will not perform it in the account's current state, or this API cannot answer it under the retrieval mode you asked for. |
429 | Rate limited. Quota exceeded (see Rate limits). |
500 | Internal error. Unexpected server-side failure, safe to retry with backoff. |
501 | Not implemented. LinkedIn does not offer this operation for this account type. |
502 | Upstream failure. LinkedIn returned something unusable. Usually safe to retry with backoff, but read retry_likely_to_succeed before you do: some 502s never succeed on retry. |
503 | Service unavailable. Temporary issue, safe to retry. |
504 | Upstream timeout. Safe to retry with backoff. |
422 and 502 are the two statuses integrators most often forget to handle. 422 carries most of the "LinkedIn said no" outcomes, and 502 is where an upstream failure surfaces, not 500.
Error codes
The tables below cover the codes you are most likely to meet, not all of them,
and the taxonomy is explicitly additive: new codes are appended over time and
existing ones are never removed. A switch over error.code with no default
will silently fall through on a code added after you shipped. Branch on the
codes you handle, and treat everything else as "unknown failure, surface it".
Authentication and request validation
| Code | HTTP | Description |
|---|---|---|
UNAUTHORIZED | 401 | API key missing, malformed, or revoked |
INVALID_REQUEST | 400 | Request body or parameters failed schema validation. The message names the offending field. A body field the operation does not declare is rejected here too, never accepted and quietly discarded, so a filter you send is either applied or reported; operations that reject unknown keys carry additionalProperties: false in the OpenAPI spec. A common cause is a query parameter such as limit or cursor placed in the JSON body. On a structured search a filter value that matches no filter option is NOT an error: it is sent on as an id and reported in notices[] on the 200. |
FILTER_CANDIDATES_REQUIRED | 422 | A structured search filter value matched several options, so it cannot be resolved to one id without your choice. unresolved[] lists each offending field with its candidates, and next_action says what to do. Re-send with a chosen id. See Search. |
UNSUPPORTED_MEDIA_TYPE | 415 | Content-Type header is missing or not application/json |
PAYLOAD_TOO_LARGE | 413 | Three limits can trigger this. The platform's own ceiling on total request size is the lowest and the one you are most likely to hit: it starts rejecting at roughly 1 MB, so a handful of photo-sized images is refused even though it clears everything below. Above that, this API caps one attachment at 5 MiB of file content and the whole request body at 9 MiB. Attachments travel base64-encoded, which inflates them by about a third, so a 5 MiB file costs roughly 6.7 MiB of the body budget. Send fewer or smaller attachments; retrying unchanged will not help. |
Request validation runs before every entitlement check, so an INVALID_REQUEST says
nothing about entitlement. A malformed body is rejected while the seat, the LinkedIn
subscription and beta consent are all still unexamined, so a 400 is never evidence that
your entitlement is the problem: fix the request and send it again. The reverse is the more
useful half, and it is the one worth relying on: a 403 carrying one of the three
entitlement codes below proves the request itself parsed and validated cleanly, so there is
nothing to fix in the body.
Account state
| Code | HTTP | Description |
|---|---|---|
ACCOUNT_NOT_FOUND | 404 | The account_id does not exist or does not belong to this tenant |
RESOURCE_NOT_FOUND | 404 | A non-account resource (chat, message, invitation, webhook) was not found. Also what a mistyped path returns, so check the URL shape before you check your ids. |
NOT_FOUND | 404 | This API serves no route at that path at all, which is a different fact from a resource being absent: nothing was looked up. Check the path shape and the version prefix before you check your ids. |
ACCOUNT_RESTRICTED | 422 | The account exists but LinkedIn is restricting it from performing this operation |
RESOURCE_ACCESS_RESTRICTED | 403 | The account lacks admin or equivalent permission on the target (for example a company page it does not administer) |
REAUTH_REQUIRED | 409 | The stored session cannot be replayed for this change of scope. Re-authenticate with credentials. |
Reads and retrieval
| Code | HTTP | Description |
|---|---|---|
NOT_STORED | 422 | The read asked for a stored copy and nothing else (mode=cache_only), and nothing is stored for that resource. This is not the same fact as RESOURCE_NOT_FOUND: the resource may exist perfectly well on LinkedIn, and this API simply holds no copy of it, so re-checking the id is the wrong move. Re-read with mode=refill to fetch it once, or mode=auto to fetch it now. You will not see this code when the store itself could not be read: that is a retryable 502, because "we hold nothing" and "we could not look" are different answers and only one of them is worth retrying. |
Entitlement
Three separate refusals, all 403, all user_fixable, and fixed in three different
places. Branch on the code, never on the message.
There is no product tier. One ordinary paid seat entitles the whole API surface, Sales Navigator and Recruiter included. Nothing on a seat names a product, no refusal asks you to upgrade a plan, and no field on the error says which tier to buy, because there are no tiers to buy.
| Code | HTTP | Description |
|---|---|---|
NO_ACTIVE_SEAT | 403 | The targeted account is not on an active seat. Buy or attach a seat, then retry. |
LINKEDIN_FEATURE_NOT_SUBSCRIBED | 403 | The LinkedIn account itself does not have the premium feature the endpoint requires (InMail, Sales Navigator, Recruiter). Distinct from NO_ACTIVE_SEAT, which is the Curviate-side seat gate. |
BETA_NOT_ENABLED | 403 | The operation is beta-gated and this workspace has not opted into beta operations. Turn on "Allow beta operations" in Settings, or send X-Curviate-Beta: true on the request. Distinct from both codes above: nothing is missing from the seat or from LinkedIn, and the fix is entirely yours. An unchanged retry is refused identically. |
Rate limits
| Code | HTTP | Description |
|---|---|---|
RATE_LIMIT_TENANT | 429 | The per-tenant rate limit was exceeded. Wait for the Retry-After header. |
RATE_LIMIT_ACCOUNT | 429 | The per-LinkedIn-account rate limit was exceeded. Wait for the Retry-After header. |
PLATFORM_RATE_LIMIT | 429 | A platform-level limit was reached. Back off for Retry-After, or a minimum of 60 seconds. |
LINKEDIN_RATE_LIMITED | 429 | LinkedIn is rate-limiting this account directly. Back off substantially before retrying. |
BUDGET_EXHAUSTED | 429 | Not a rate limit. An account-safety ceiling you configured is spent, or the account is outside the hours it works in. Nothing reached LinkedIn and nothing was spent, so backing off is the wrong recovery: the body carries row, reason (ceiling or activity_window), reset_at and hint.parameter, the exact setting that lifts it. When reset_at is null and what to do instead are documented in one place, Account safety. On the default posture this is not an error at all: the action goes through and the same payload rides the 2xx body under safety_warning with blocked: false. See Account safety. |
Platform and upstream errors
| Code | HTTP | Description |
|---|---|---|
PLATFORM_ERROR | 502 | An upstream failure. Retrying after a short backoff is usually likely to succeed. Note the 502, not 500. Branch on the response, not on this row: retry_hint and retry_likely_to_succeed are per-response and authoritative. Three outcomes carry this code and must never be retried. Two are writes that may already have landed, where re-sending would duplicate them: an invitation the platform acknowledged without confirming, and a message whose send returned no usable identifier. Read the sent invitations or the conversation instead of re-sending. The third is a read whose upstream answered in a shape this API could not interpret, which every retry answers exactly the same way until a fix ships; report it rather than backing off. All three arrive with retry_likely_to_succeed: false and retry_hint: { kind: "never" }. |
PLATFORM_NOT_IMPLEMENTED | 501 | The operation is not offered for this account type or platform tier. |
LINKEDIN_OPERATION_NOT_SUPPORTED | 422 | LinkedIn structurally disallows this operation or parameter combination, for everyone. Not retryable, and not fixable by subscribing. |
LINKEDIN_SERVICE_UNAVAILABLE | 503 | LinkedIn is temporarily unavailable. Retry after a backoff. |
SUBSTRATE_LINK_FAILED | 502 | Connecting the LinkedIn account failed upstream rather than being refused. Read retry_likely_to_succeed before re-sending: a connect that may have partly landed is not safe to repeat blindly, so read the account back first. |
SUBSTRATE_CAP_REACHED | 503 | A capacity ceiling on the connection infrastructure, not on your plan. Nothing about the request is wrong; retry after a backoff, and if it persists it is ours to fix. |
BILLING_CHECKOUT_FAILED | 502 | The payment provider failed while opening a checkout or schedule. No charge was made. Retry after a short backoff. |
BILLING_PORTAL_UNAVAILABLE | 503 | The billing portal could not be reached. Nothing changed; retry after a short backoff. |
INTERNAL | 500 | An unexpected internal failure. Safe to retry with exponential backoff. |
Account connection (checkpoint)
These codes appear during the account-connect flow (POST /v1/auth/intent, POST /v1/auth/checkpoint/solve).
| Code | HTTP | Description |
|---|---|---|
CHECKPOINT_NOT_FOUND | 404 | No active checkpoint exists for this account. |
CHECKPOINT_EXPIRED | 422 | The checkpoint has expired. Restart the connection flow. |
CHECKPOINT_INVALID_CODE | 422 | The submitted verification code was incorrect. |
CHECKPOINT_MAX_ATTEMPTS | 429 | Too many incorrect code attempts. Restart the connection flow. |
CHECKPOINT_ALREADY_RESOLVED | 409 | The checkpoint has already been resolved. |
CHECKPOINT_UNSUPPORTED | 400 | This challenge type cannot be resolved through the API (for example a CAPTCHA). |
CONNECTION_IN_PROGRESS | 409 | A connection attempt for this LinkedIn account is already open. Wait for it to finish or expire before starting another. |
ACCOUNT_ALREADY_LINKED | 409 | This LinkedIn identity is already linked. When your tenant already owns it, the error names your own account_id; re-authenticate that account in place rather than linking again. Otherwise no id is named, because the identity is not yours to act on. A connect that resolves by reactivating an account you had previously disconnected returns that account with recovered: true instead of this error. |
ACCOUNT_LINKING_DISABLED | 403 | Account linking is disabled on this environment. |
LinkedIn session errors
| Code | HTTP | Description |
|---|---|---|
LINKEDIN_AUTH_FAILED | 401 | LinkedIn rejected the credentials. Verify email and password, then retry. |
LINKEDIN_COOKIE_INVALID | 401 | The li_at cookie is expired or invalid. Re-export it from your browser. |
LINKEDIN_SESSION_EVICTED | 401 | Someone signed into this LinkedIn account somewhere else, and LinkedIn allows only one session at a time for it. A person has to close the other session; reconnecting the account will not help while it is open, and retrying will not either. While it lasts, account_states on GET /v1/accounts/{account_id} carries recruiter_session_evicted, and it stays there until the account is reconnected. |
Messaging and engagement
| Code | HTTP | Description |
|---|---|---|
MESSAGE_WINDOW_EXPIRED | 422 | The edit or delete window has closed. The message is final; do not retry. |
RECIPIENT_UNREACHABLE | 422 | The recipient cannot receive a message from this account (no shared connection, privacy settings). |
CONNECTION_REQUEST_CONFLICT | 409 | A request to this member is already pending, or you are already connected. Never retry this: a send-withdraw-resend loop is exactly the pattern that gets an account flagged. |
REACTION_NOT_FOUND | 422 | No reaction of that value exists to remove. The post exists; your reaction on it does not. |
Billing and seats
| Code | HTTP | Description |
|---|---|---|
PAYMENT_REQUIRED | 402 | No active subscription or available seat. Add one in the dashboard. |
PAYMENT_FAILED | 402 | A payment attempt failed. Update your payment method in the dashboard. |
SUBSCRIPTION_BUSY | 503 | The subscription is being modified concurrently. Retry after a short delay; retry_likely_to_succeed is true. |
SUBSCRIPTION_NOT_FOUND | 404 | No subscription record exists for this tenant. |
SEAT_NOT_FOUND | 404 | The referenced seat does not exist or is not yours. |
SEAT_NOT_EMPTY | 400 | The seat already holds a connected account. Disconnect it first, or pick a seat with none attached. |
SEAT_PROVISIONAL | 400 | The seat is not fully provisioned yet. It is not an error you fix, only one you wait out; re-read the seat and retry. |
SEAT_CANCELLED | 403 | The referenced seat has been cancelled. |
SUBSCRIPTION_ALREADY_EXISTS | 409 | This tenant already has a subscription, so there is nothing to create. Modify the existing one instead. |
ALREADY_CANCELLED | 400 | The seat or subscription is already cancelled, so the cancellation has nothing to do. |
CANCELLATION_ALREADY_EFFECTIVE | 400 | The cancellation has already taken effect and cannot be changed. Distinct from ALREADY_CANCELLED, which is a pending cancellation. |
INVALID_CANCELLATION_SOURCE | 400 | The source value on a cancellation is not one this API accepts. A rejected field value, so correct it and re-send. |
PERIOD_LOCKED | 400 | The current billing period is locked against this change. Waiting for the period to roll is the only remedy; retrying sooner is refused identically. |
ACCOUNT_DISPUTED | 402 | A payment on this workspace is disputed, so operations that spend or provision are refused until it is resolved. Same family as PAYMENT_REQUIRED, and the dispute has to be settled with your bank or card issuer, not in the dashboard. |
ADMIN_BYPASS | 400 | An admin workspace has no Stripe billing, so the billing operations do not apply to it. Not something to fix in the request: this workspace type simply has no billing surface. |
STRIPE_DRIFT_DETECTED | 503 | Checkout is refused because the seat price configured on our side does not match the price we display, so completing it would charge an amount you were never shown. Nothing was charged. Not something you can fix, and retrying is refused identically until we correct the price, so stop and contact support rather than backing off. user_fixable and retry_likely_to_succeed are both false. |
Free trial
| Code | HTTP | Description |
|---|---|---|
TRIAL_EXPIRED | 402 | The trial seat has expired. Buy a seat to continue. |
TRIAL_SEAT_LIMIT | 409 | A trial provides one seat, and it is already occupied. |
TRIAL_ACTIVE_SEAT_LIMIT | 409 | Seats cannot be added, toggled, or cancelled while trialing. Convert to a paid plan first. |
TRIAL_IDENTITY_ALREADY_USED | 409 | That LinkedIn identity has already been used for a trial. |
TRIAL_IDENTITY_UNRESOLVED | 422 | The trial could not be completed because the member identity could not be resolved. |
A brand-new trial customer meets the TRIAL_* codes before almost anything else, so handle TRIAL_EXPIRED and TRIAL_SEAT_LIMIT explicitly if you onboard trial users.
SDK: CurviateError
When using the TypeScript SDK, every API-layer failure throws a CurviateError. The properties are camelCased: code, message, retryHint (with retryHint.delayMs), userFixable, retryLikelyToSucceed, and httpStatus.
The SDK ships a fixed union of error codes and maps anything outside it to
INTERNAL before your switch sees it. Codes added to the
API after an SDK release therefore arrive as INTERNAL. Read
err.httpStatus and err.message alongside
err.code when a failure does not match what you expected, and keep the
REST envelope above as the authoritative list.
import { Curviate, isCurviateError } from "@curviate/sdk";
const curviate = new Curviate({ apiKey: process.env.CURVIATE_API_KEY! });
try {
await curviate.accounts.list();
} catch (err) {
if (!isCurviateError(err)) throw err;
switch (err.code) {
case "RATE_LIMIT_TENANT":
case "RATE_LIMIT_ACCOUNT":
// delayMs is the camelCase view of retry_hint.delay_ms
await new Promise((r) => setTimeout(r, err.retryHint?.delayMs ?? 60_000));
break;
case "UNAUTHORIZED":
console.error("Check your API key.");
break;
case "ACCOUNT_NOT_FOUND":
console.error("Run accounts.list() and use an id from that response.");
break;
default:
// Required: the taxonomy is additive, so unknown codes will appear.
console.error(`Unhandled ${err.code} (HTTP ${err.httpStatus}): ${err.message}`);
throw err;
}
}Handling a 429
# A 429 response, rate limit exceeded
HTTP/2 429
Retry-After: 37
ratelimit: "tenant";r=0;t=37
ratelimit-policy: "tenant";q=2500;w=60
Content-Type: application/json
{
"code": "RATE_LIMIT_TENANT",
"message": "Tenant rate limit exceeded.",
"retry_hint": { "kind": "delay", "delay_ms": 37000 },
"user_fixable": false,
"retry_likely_to_succeed": true
}Read the wait from Retry-After (seconds) or from retry_hint.delay_ms (milliseconds); they carry the same value in different units. Retry-After is the canonical one, and it is present on every 429.
const res = await fetch(url, { headers: { Authorization: `Bearer ${key}` } });
if (res.status === 429) {
const header = res.headers.get("retry-after");
const body = await res.json();
const waitMs =
(header ? Number(header) * 1000 : undefined) ??
body.retry_hint?.delay_ms ??
60_000;
await new Promise((r) => setTimeout(r, waitMs));
}ratelimit and ratelimit-policy are returned on every
authenticated response. A 401 carries none, because
the limiter runs after authentication. Do not treat their absence as "no limit
applies"; treat it as "this request never authenticated".
Next steps
- Rate limits: the quota formula, the headers, and a worked backoff client.
- Getting started guides: the four calls most integrations start with.
- API reference: the per-endpoint error responses.