Skip to Content
Messaging APIError Handling

Error Handling

HTTP status codes, error response format, and common errors.

Error Response Format

All error responses from the Warm AI API follow a consistent JSON structure:

{ "error": true, "message": "A human-readable description of the error", "code": "ERROR_CODE" }
FieldTypeDescription
errorbooleanAlways true for error responses
messagestringHuman-readable error description
codestringMachine-readable error code

HTTP Status Codes

StatusMeaningDescription
200SuccessRequest completed successfully
202AcceptedRequest accepted and is being processed asynchronously
400Bad RequestInvalid request body, missing required fields, or malformed input
401UnauthorisedMissing or invalid x-access-key or x-user-id header
402Payment RequiredInsufficient credit balance to complete the operation
403ForbiddenValid credentials but insufficient permissions for this action
404Not FoundThe requested resource does not exist
409ConflictThe request conflicts with the current state (e.g. duplicate idempotency key)
429Too Many RequestsRate limit exceeded
500Server ErrorAn unexpected error occurred on the server

Common Errors

INVALID_ACCESS_KEY

Cause: The x-access-key header is missing, malformed, or does not match any active API key.

Solution: Verify your access key is correct and has not been revoked. Regenerate a new key from the dashboard if needed.


INVALID_USER_ID

Cause: The x-user-id header does not match any user connected to your API key.

Solution: Use the List Users endpoint to get valid user IDs, or check that the user has completed the connect flow.


INVALID_PROSPECT_URL

Cause: The provided LinkedIn URL is not a valid LinkedIn profile URL.

Solution: Ensure the URL follows the format https://linkedin.com/in/username or https://www.linkedin.com/in/username. Remove any query parameters or trailing slashes.


RESEARCH_NOT_FOUND

Cause: The specified research_id does not exist or has expired.

Solution: Research results are retained for a limited time. Re-run the research operation if the original result has expired.


USER_NOT_CONFIGURED

Cause: The user has not completed the Setup Wizard or is missing required settings (e.g. product, CTA preference).

Solution: Ensure the user has completed all 4 steps of the Setup Wizard, or configure their settings via the User Settings API.


INSUFFICIENT_BALANCE

Cause: Your account does not have enough credits to complete the requested operation.

Solution: Top up your credit balance from the dashboard, or enable auto-reload in your Account Settings.


RATE_LIMITED

Cause: Too many requests sent in a short period of time.

Solution: Back off and retry after the period indicated in the response. See Rate Limiting below.


Best Practices

Follow these guidelines to build a resilient integration with the Warm AI API:

  • Generate a new idempotency key for each unique request to avoid duplicate operations.
  • Reuse the same idempotency key when retrying a failed request to ensure it is not processed twice.
  • Use exponential backoff when retrying after errors — start with 1 second and double the delay each attempt.
  • Store the research_id returned from research operations so you can retrieve results later without re-running.
  • Cache User Research results on your side to reduce API calls and credit usage.
  • Validate LinkedIn URLs before sending them to the API to avoid unnecessary INVALID_PROSPECT_URL errors.

Rate Limiting

When you exceed the rate limit, the API returns a 429 Too Many Requests response.

Response Headers:

HeaderDescription
Retry-AfterNumber of seconds to wait before retrying

Response Body:

{ "error": true, "message": "Rate limit exceeded. Please retry after the specified period.", "code": "RATE_LIMITED", "retry_after_ms": 5000 }
FieldTypeDescription
retry_after_msnumberMilliseconds to wait before retrying

Implement exponential backoff in your retry logic and respect the Retry-After header to avoid further throttling.

Last updated on