Lead intake API
Send qualified small-business funding leads to Cashifi over HTTPS. Every partner gets their own URL + API key — request yours by emailing your Cashifi account contact.
Endpoint
POST {ENDPOINT_URL}
Content-Type: application/json
Authorization: Bearer {YOUR_API_KEY}
{ENDPOINT_URL} is the URL we sent you in the welcome email. {YOUR_API_KEY}
is your secret bearer token — treat it like a password and never commit it to
a public repo.
Request body
Send a JSON object with the borrower's contact + business info. At minimum
either contact_email or contact_phone is required; everything else is
optional but helps us match them to lenders faster.
| Field | Type | Description |
|---|---|---|
contact_name | string | Full name of the borrower (≤ 120 chars). |
contact_email | string | Borrower's email — must look like name@example.com. |
contact_phone | string | Borrower's phone — any reasonable format; we'll normalize. |
company_name | string | Business name (≤ 200 chars). |
monthly_revenue | number | Monthly gross revenue in USD. JSON number, not a string. |
amount_requested | number | How much funding the borrower is asking for, in USD. |
desired_loan_amount | number | Alias for amount_requested if you already use that field. |
business_type | string | Industry / vertical (≤ 50 chars). |
utm | object | Optional flat object of UTM tags (utm_source, utm_campaign, …). |
sms_consent | boolean | True if the borrower opted in to SMS. |
email_consent | boolean | True if the borrower opted in to email. |
Extra fields you send are ignored — sending unknown keys won't fail the request.
Example request
curl -X POST {ENDPOINT_URL} \
-H "Authorization: Bearer {YOUR_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"contact_name": "Jane Doe",
"contact_email": "jane@acme.com",
"contact_phone": "555-123-4567",
"company_name": "Acme Trucking LLC",
"monthly_revenue": 85000,
"amount_requested": 150000,
"business_type": "trucking",
"utm": { "utm_source": "your_brand", "utm_campaign": "q3" },
"sms_consent": true,
"email_consent": true
}'
Success response
{
"ok": true,
"lead_id": "9c2f4d1e-8a8b-4f3e-9f2a-2b0d6c1c1e7a"
}
Status code is 201. Save the lead_id if you want to reference the lead in
a support ticket.
Error responses
Every error has the same shape so you can branch on error.code instead of
parsing the message string. Codes are stable and won't change without notice.
{
"ok": false,
"error": {
"code": "missing_required_field",
"message": "Either \"contact_email\" or \"contact_phone\" is required.",
"hint": "Every lead needs at least one way for us to reach the borrower."
}
}
| HTTP | error.code | What happened | How to fix |
|---|---|---|---|
| 400 | invalid_json | Body wasn't valid JSON. | Set Content-Type: application/json and send a real JSON object. |
| 400 | invalid_body | Body was JSON but not an object. | Wrap the lead in { ... } — arrays and bare strings aren't accepted. |
| 400 | missing_required_field | Neither email nor phone provided. | Include at least one of contact_email or contact_phone. |
| 400 | invalid_field_format | A field had the right type but a bad value (e.g. malformed email). | See error.field for the offender and error.hint for the fix. |
| 400 | invalid_field_type | A field had the wrong JSON type (e.g. number sent as string). | Send the type listed in the table above. |
| 400 | value_out_of_range | A numeric field was negative or absurdly large. | Use a sane value under 1,000,000,000. |
| 401 | missing_authorization | No Authorization header. | Add Authorization: Bearer YOUR_API_KEY. |
| 401 | invalid_api_key | The bearer token didn't match. | Double-check the key from the welcome email — they're case-sensitive. |
| 403 | endpoint_paused | Your endpoint is temporarily disabled. | Contact your Cashifi account contact. |
| 404 | endpoint_not_found | The URL token in the path isn't recognized. | Make sure you're hitting the URL we sent you exactly. |
| 429 | rate_limited | You're sending too fast. | Back off and retry — see the Retry-After response header. |
| 5xx | server_error | Something broke on our side. | Safe to retry after a few seconds; reach out if it persists. |
Idempotency & retries
Lead submissions are not idempotent today — retrying the same payload will
create a second lead. If you need at-most-once delivery, store the lead_id
on your side and skip the resend after a successful response.
Need help?
Email your Cashifi account contact and include:
- A sample of the JSON you tried to send (redact PII).
- The error response we returned.
- The approximate time the request was made.
We log every request — including the failed ones — so we can pinpoint exactly what went wrong.