Leads
Leads are inbound inquiries captured from the marketing site and other sources. On creation, SM API auto-creates a contact and logs an activity.
Routes
POST /api/leads
Create a new lead. Public — no auth required (used by contact forms).
Auth: Public
Request body:
| Field | Type | Required | Description |
|---|---|---|---|
email | string | yes | Lead's email address |
name | string | no | Full name (defaults to email prefix) |
company | string | no | Company name |
phone | string | no | Phone number |
source | string | no | Traffic source. Default: website |
source_detail | string | no | Additional source info (e.g. page name) |
project_description | string | no | What they're looking for |
timeline | string | no | Project timeline |
budget_range | string | no | Budget range |
product | string | no | Product tag (studios, mode, hub, etc.) |
Behavior:
- Creates a
leadsrow - Auto-creates a contact if none exists for that email
- Links lead to contact
- Logs a
lead_submittedactivity - Posts to Slack
#web-leadsifSLACK_BOT_TOKEN+SLACK_CHANNEL_IDare set
Response: 201 Created
json
{
"ok": true,
"data": {
"id": "ld_a1b2c3d4",
"contact_id": "c_e5f6g7h8",
"submitted": true
}
}Example curl:
bash
curl -X POST https://api.sprintmode.ai/api/leads \
-H "Content-Type: application/json" \
-d '{
"email": "jane@acme.com",
"name": "Jane Smith",
"company": "Acme Corp",
"product": "studios",
"project_description": "Need a team to build our mobile app"
}'GET /api/leads
List leads with optional filters.
Auth: Required (CF Access or API key)
Query params:
| Param | Type | Description |
|---|---|---|
status | string | Filter by status (new, contacted, qualified, closed) |
source | string | Filter by source |
product | string | Filter by product tag |
search | string | Full-text search on name, email, company |
limit | number | Max results. Default: 50 |
Response:
json
{
"ok": true,
"data": [
{
"id": "ld_a1b2c3d4",
"name": "Jane Smith",
"email": "jane@acme.com",
"company": "Acme Corp",
"source": "website",
"product": "studios",
"status": "new",
"project_description": "...",
"contact_id": "c_e5f6g7h8",
"created_at": "2026-05-13T10:00:00Z"
}
]
}PATCH /api/leads/:id
Update a lead's status or assignment.
Auth: Required
Path params: id — lead ID
Request body (any subset):
| Field | Type | Description |
|---|---|---|
status | string | new, contacted, qualified, closed |
assigned_to | string | Assignee email |
notes | string | Internal notes |
contact_id | string | Link to CRM contact |
company_id | string | Link to CRM company |
Response:
json
{ "ok": true, "data": { "id": "ld_a1b2c3d4", "updated": true } }