Deals & Pipeline
Deals track sales opportunities through stages. Pipelines group deals by entity and product.
Routes
GET /api/deals
List deals with filters.
Auth: Required
Query params:
| Param | Type | Description |
|---|---|---|
company_id | string | Filter by company |
stage | string | Filter by pipeline stage |
pipeline | string | Filter by pipeline (sales, lp_fundraise, sm_investors, osma_customers, recruiting) |
assigned_to | string | Filter by assigned user email |
limit | number | Default: 50 |
Response:
{
"ok": true,
"data": [
{
"id": "deal_a1b2c3d4",
"company_id": "co_...",
"contact_id": "ct_...",
"title": "Acme Corp — $15k/mo",
"stage": "proposal",
"pipeline": "sales",
"value": 15000,
"probability": 60,
"close_date": "2026-06-01",
"assigned_to": "dani@sprintmode.co",
"created_at": "..."
}
]
}GET /api/deals/:id
Get a single deal.
Auth: Required
POST /api/deals
Create a new deal.
Auth: Required
Request body:
| Field | Type | Required | Description |
|---|---|---|---|
title | string | yes | Deal title |
company_id | string | no | Associated company |
contact_id | string | no | Primary contact |
pipeline | string | no | Pipeline name |
stage | string | no | Initial stage |
value | number | no | Deal value |
probability | number | no | Win probability (0–100) |
close_date | string | no | Expected close date |
assigned_to | string | no | Assignee email |
notes | string | no | Notes |
Response: 201 Created
PATCH /api/deals/:id
Update deal fields: title, stage, value, probability, close_date, assigned_to, notes, won_at, lost_at, lost_reason.
Auth: Required
GET /api/pipelines
List all configured pipelines with their stage definitions.
Auth: Required
Response:
{
"ok": true,
"data": [
{
"id": "sales",
"label": "Studios Sales",
"owner": "Dani",
"entity": "sprint_studios",
"stages": [
{ "key": "lead", "label": "Lead" },
{ "key": "qualified", "label": "Qualified" },
{ "key": "proposal", "label": "Proposal" },
{ "key": "negotiation", "label": "Negotiation" },
{ "key": "closed_won", "label": "Closed Won" },
{ "key": "closed_lost", "label": "Closed Lost" }
]
}
]
}Pipelines: sales (Studios Sales), lp_fundraise (LP Fundraise), sm_investors (SM Investors), osma_customers (Osma Customers), recruiting (Recruiting)
GET /api/pipelines/:pipeline/summary
Get aggregate stats for a pipeline: deal counts, total value, and per-stage breakdown.
Auth: Required
Path params: pipeline — pipeline ID
Response:
{
"ok": true,
"data": {
"pipeline": "sales",
"label": "Studios Sales",
"target": null,
"stages": [
{
"key": "lead",
"label": "Lead",
"count": 12,
"total_value": 0
}
],
"total_deals": 45,
"total_value": 280000
}
}