Skip to content

Errors

The API uses standard HTTP status codes to indicate success or failure. Error responses include a detail field with a human-readable message.


Error Response Format

{
"detail": "Company not found"
}

For validation errors, the response includes field-level details:

{
"detail": [
{
"loc": ["body", "work_email"],
"msg": "value is not a valid email address",
"type": "value_error.email"
}
]
}

Status Codes

Success

CodeMeaningUsed By
200OKGET, PATCH, DELETE
201CreatedPOST

Client Errors

CodeMeaningCommon Causes
400Bad RequestMissing required fields, invalid field values, no fields in update
401UnauthorizedMissing or invalid API key, expired API key, JWT token provided instead of API key
404Not FoundResource does not exist or was deleted
422Unprocessable EntityRequest body fails validation (wrong types, invalid email format)
429Too Many RequestsRate limit exceeded — see Rate Limits

Server Errors

CodeMeaningAction
500Internal Server ErrorRetry with backoff. If persistent, contact support.

Handling Errors

response = requests.get(f"{BASE_URL}/contacts/99999", headers=HEADERS)
if response.status_code == 200:
contact = response.json()["data"]
elif response.status_code == 404:
print("Contact not found")
elif response.status_code == 401:
print("Check your API key")
elif response.status_code == 429:
retry_after = int(response.headers.get("Retry-After", 5))
print(f"Rate limited. Retry after {retry_after}s")
else:
print(f"Error {response.status_code}: {response.json()}")

Common Error Scenarios

Authentication

ErrorCauseFix
Missing Authorization headerNo Authorization header sentAdd Authorization: Bearer <api_key>
JWT token provided instead of API keyPassed a browser session tokenUse an org API key from Settings > API
API key not associated with an organizationKey is malformed or revokedCreate a new key in Settings > API

Contacts

ErrorCauseFix
list_id is required when creating contactsPOST /contacts without list_idInclude list_id — every contact must belong to a list
Contact not foundContact ID doesn’t exist or was deletedVerify the contact ID

Companies

ErrorCauseFix
Company not foundCompany ID doesn’t exist or was deletedVerify the company ID
No fields to updatePATCH with empty bodyInclude at least one field to update

Lists

ErrorCauseFix
Invalid list typePOST /lists with unrecognized typeUse: contacts, companies, suppressions, deals, leads
List not foundList ID doesn’t exist or was deletedVerify the list ID