Every answer is JSON, errors too:
{
"error": {
"code": "invalid",
"message": "Some of what was sent can't be used; see fields.",
"fields": { "phone": "Send a 10-digit US phone number, or another country's number starting with + and its country code." }
}
}
A lead with a problem isn't added at all. Fix what fields names and send it again.
| Status | Code | What to do |
|---|---|---|
| 400 | bad_json | The body isn't a JSON object. Check the quotes and commas, or send a form post. |
| 400 | key_in_url | The key was in the address. Make a new key, revoke that one, and send keys in a header. |
| 401 | no_key, bad_key | No key, or one that was revoked or mistyped. Check the whole key was copied. |
| 403 | posting_key | That call needs a full key. Posting keys only add leads. |
| 404 | not_found | No lead or appointment with that id in this account. |
| 413 | too_large | Over 64 KB. Leave out what LeadVault doesn't need. |
| 415 | content_type | Send Content-Type: application/json, or a form post. |
| 422 | invalid | Something can't be used. fields says what, field by field. |
| 429 | slow_down | Over 120 calls a minute. Wait as long as the Retry-After header says. |
| 429 | too_many_bad_keys | 20 wrong keys in 10 minutes from one address. Wait 10 minutes, and fix the key. |
| 500 | server_error | Our fault. Nothing was saved; try again. |
Common 422s
- phone: a US number needs 10 digits; another country's starts with
+and its country code. - type: use a lead type's key from
GET /api/v1/lead-types, likemortgage. - answers: a choice must be one of the question's choices (its value or its label); amounts are numbers.
- No phone and no email: a lead needs one or the other.
Names LeadVault doesn't use aren't errors: they come back in ignored, so check it when an answer seems to go missing.
Didn't answer it? Ask us.