Skip to main content
The Lofty API uses standard HTTP status codes combined with a code field in the response body for detailed error identification.

Response format

Error responses follow this structure:
An error does not always arrive with an error status. Failures raised by the service behind an endpoint — a duplicate name, a quota that is full, a referenced record that does not exist — are returned with HTTP 200 and an error body. Only failures the API gateway itself detects, such as a malformed or missing parameter, use a 4xx status.This is long-standing behaviour kept for compatibility with existing integrations, and it is the rule almost everywhere. Newer endpoints may answer a 4xx for the same failures — each one’s reference page lists what it returns, and POST /v1.0/transaction/customfields is the first that does.To get an error status instead, send the header X-Error-Status: true. With it, a failed request answers with a 4xx or 5xx status rather than 200. Without it nothing changes, so existing integrations are unaffected. Most error bodies stay the same; a few endpoints return a more detailed body that carries a code, so decide success or failure by the status, not by the body’s shape. Endpoints that report an outcome in a field of a successful response (for example "success": false) still answer 200. Authentication and permission failures are not affected by the header: the API gateway rejects them before the request reaches the endpoint, so they always carry their 4xx status.Without the header, the status line alone is not a reliable success test. Test the body’s code instead — absent or 0 is success, anything else is the error — and it holds either way:

HTTP status codes

Authentication & permission errors

Restricted API keys

As part of ongoing security monitoring, Lofty may restrict an API key that matches one or more risk indicators. A restricted key only works from approved IP addresses; calls from any other address return HTTP 401 with code 200136 (TOKEN_AT_RISK). This is a precaution and does not mean your account was compromised.

When a key may be restricted

Lofty reviews API key usage on an ongoing basis. A key may be restricted when its usage matches one or more risk indicators, for example:
  • The key has appeared somewhere it should not be stored or shown in plain text.
  • The key is used from an unusually large number of different IP addresses, or the calling IP changes very frequently.
  • The key is used from locations that are geographically far apart within a short period of time.
  • Calls come from anonymizing networks (VPNs, proxies, Tor) or hosting providers that do not match your integration’s usual traffic.
  • The client fingerprint changes unexpectedly, for example a different User-Agent from the one your integration normally sends.
  • Request volume spikes suddenly, unusual endpoints are called, or requests look like bulk data enumeration.
  • A key that has been inactive for a long time suddenly becomes active again.
Lofty does not disclose which specific indicator triggered a restriction. Where possible, Lofty notifies the account owner in advance and restricts the key only after a grace period. To lower the chance of a restriction, call the API from stable server IP addresses, use a separate API key for each integration, keep keys out of source code, logs and client-side apps, and revoke keys you no longer use.

What to do

If you receive a TOKEN_AT_RISK error:
  1. Create a new API key in your account settings. See API Keys.
  2. Update your integration to use the new key and confirm it works.
  3. Revoke the old key.
If your integration must keep using the existing key from fixed server IP addresses, contact Lofty Support with those IP addresses (or CIDR ranges) and your account details.

Validation errors (400)

Resource not found (404)

Lead errors (400)

Lead pond errors

Returned by POST /v1.0/leads, PUT /v1.0/leads/{leadId} and POST /v1.0/leads/{leadId}/assignment when pondId is used. See Move a lead into a lead pond.

Retired endpoints and Sales Agent errors

Transaction errors (400)

Agent lifecycle errors (200 with error code)

POST /v2.0/agents/{agentId}/deactivate and POST /v2.0/agents/{agentId}/reactivate always return HTTP 200 once authentication passes. Check the response body’s code field (absent or 0 means success) rather than the status code.

Task errors (400)

Team & custom field errors (400)

Routing errors (400)

Webhook errors (400)

Rate limit (429)

When rate limited, the response includes:
See Rate Limiting for details.

Handling errors

Always check both the HTTP status code and the code field in the response body. Some business errors return specific codes (like 200100) that provide more detail than the HTTP status alone.