Skip to main content
The Leonar API uses standard HTTP status codes and returns structured error responses.

Error format

Error codes

CodeHTTP statusDescription
validation_error400Invalid request data
invalid_api_key401Missing or invalid API key
insufficient_credits402The workspace does not have enough credits to cover this request. Returned by POST /sourcing/advanced/profiles/search when the sourcing credit balance is empty.
insufficient_scope403API key lacks the required scope
billing_required403No active subscription on the workspace
plan_upgrade_required403The current plan does not include this feature
not_found404Resource not found
rate_limit_exceeded429Too many requests
internal_error500Server error

insufficient_credits payload

When credits are missing, the response includes an error.details object describing the credit type and the gap:

Handling errors