crm
Base path: /api/v1/crm
The CRM module is your lead and audience layer. It manages LeadContact records, segments (under /crm/lists), companies, capture forms, list memberships, and form submissions. Bulk-import endpoints accept JSON or CSV; the CSV path streams through the worker so very large imports don’t time out. Public form submission is mounted under /api/v1/public and accepts unauthenticated POSTs from your hosted forms. Schemas live in app/modules/crm/schemas.py.
What you can do with the crm API
- Create, update, search, and archive leads
- Build segments with rule-based or static membership
- Bulk-import leads from JSON or CSV (streamed via worker for large files)
- Maintain a company graph (firmographic data, parent/subsidiary)
- Create and embed capture forms that auto-write into leads and segments
- Enrich a lead with third-party data via configured enrichment connectors
- Export a segment for handoff to ads or email tools
Common operations
- List leads filtered by segment, score, source, or last-activity timestamp
- Create a single lead or bulk-import a list
- Search leads by email, company, or custom field
- Add or remove leads from a segment
- Create a form, fetch its embed snippet, and accept submissions on the public endpoint
- Export a segment as CSV for an ad platform upload
Authentication & scoping
Workspace-scoped via API key in the Authorization: Bearer tnx_... header. Public form submission endpoints under /api/v1/public/forms are intentionally unauthenticated and use the form’s slug + signed origin checks instead.
Pagination & filtering
Lead and segment list endpoints paginate with cursor-based limit + next_cursor. Filters cover lead score, segment ID, source, custom fields, and date ranges. See Pagination.
What you can do with the crm API beyond CRUD
CRM events feed flows. When a lead crosses a score threshold or lands in a specific segment, an ExternalTrigger from the flows module can fire a sequence, an enrichment, or a Slack notification. See Behavioral lead scoring for the model.
MCP equivalents
create_lead({ email, first_name, last_name, company, source: "manual" })
search_leads({ query: "head of growth", segment_id })
create_segment({ name: "ICP - VP Growth, US, 50-500 FTE", rules: { ... } })
Related
- Guides: CRM for product context
- Concepts: Behavioral lead scoring for the scoring model
flowsfor CRM-event-triggered automationsmarketingfor sending to a segment