CRM · Sales
Leads
Read and maintain leads records (crm.leads).
/api/crm/leadsPublished as /api/v1/leadsOverview
| Package | CRM |
|---|---|
| Authentication | Bearer token: a service account's token (POST /api/auth/service-token) or, for the published path, an API key |
| Authorization | The caller's roles must hold CRM › Leads on the Roles screen: display for GET, add for POST, change for PUT, delete for DELETE; an action needs the grant of the button that runs it on the screen. |
| Table | crm.leads · kept per company (and organisational unit where it has one) |
| Record | Created, changed and (where the screen allows) deleted; key id |
| Rules | The same as the screen: validation, numbering, approvals, posting, the company the caller belongs to, and the audit trail. |
API reference
17 operations. Open one for its parameters, bodies, responses and a sample request.
GET/api/crm/leadsList leads
Query parameters
| Name | Description | Example |
|---|---|---|
limit | Rows per page (50 by default, at most 200) | limit=100 |
offset | Rows to skip | offset=200 |
q | Free-text search over the search columns | q=acme |
sort | column:asc or column:desc, several separated by commas | sort=created_at:desc |
filter | A JSON condition or group (see the filter language), URL-encoded; any field below can be filtered and sorted | filter={"col":"status","op":"eq","value":"open"} |
<field>=<value> | Shorthand for "field is value" |
Response 200
{
"rows": [
{
"id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"source": "web",
"company": "text",
"contact_name": "Example",
"email": "someone@example.com",
"phone": "+1 555 0100",
"score": 10,
"score_factors": {},
"status": "draft",
"owner_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"converted_account_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"created_at": "2026-10-30T09:00:00Z",
"org_unit_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"location_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73"
}
],
"count": 1
}Sample request
curl "https://demo.tranxact.ai/api/crm/leads?limit=20" \
-H "Authorization: Bearer $TOKEN"GET/api/crm/leads/{id}Read one leads
Path parameters
| Name | Type | Description |
|---|---|---|
id | string (uuid) | The record's id, as a list returns it. |
Response 200
{
"id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"source": "web",
"company": "text",
"contact_name": "Example",
"email": "someone@example.com",
"phone": "+1 555 0100",
"score": 10,
"score_factors": {},
"status": "draft",
"owner_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"converted_account_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"created_at": "2026-10-30T09:00:00Z",
"org_unit_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"location_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73"
}404 when no record with that id is visible to the caller.
Sample request
curl "https://demo.tranxact.ai/api/crm/leads/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73" \
-H "Authorization: Bearer $TOKEN"POST/api/crm/leadsCreate a leads
Request body
The record as JSON. Fields marked Yes are required.
| Field | Type | Required | Description |
|---|---|---|---|
source | text | No | Source Allowed: web event referral partner import campaign outbound other |
company | text | Yes | Company |
contact_name | text | No | Contact name |
email | text | No | |
phone | text | No | Phone |
status | text | No | Status |
website | text | No | Website — The company’s web address, for example https://example.com |
job_title | text | No | Job title |
industry | text | No | Industry Allowed: Manufacturing Healthcare Financial services Retail Technology Professional services Education Government Construction Logistics Energy Hospitality |
company_size | text | No | Company size Allowed: 1-10 11-50 51-200 201-500 501-1000 1001-5000 5000+ |
linkedin_url | text | No | LinkedIn profile |
city | text | No | City |
country | text | No | Country |
notes | text | No | Notes |
state | text | No | State / province — Chosen from the country’s own list where there is one, typed where there is not. |
postal_code | text | No | Postal / ZIP code |
address_line1 | text | No | Address line 1 |
address_line2 | text | No | Address line 2 |
metro_area | text | No | Metro area |
annual_revenue | numeric | No | Annual revenue |
sic_code | text | No | SIC code — US Standard Industrial Classification. Shown for a company in the United States, Canada or Mexico. |
naics_code | text | No | NAICS code — North American Industry Classification System. Shown for a company in the United States, Canada or Mexico. |
locations_count | integer | No | Number of locations |
fiscal_year_end | text | No | Fiscal year end — As the company states it, e.g. December or 31-Mar. |
owner_name | text | No | Lead owner — Left empty, lead routing assigns an owner where it is set up. |
ownership_type | text | No | Ownership type Allowed: Public Private Subsidiary Government Partnership Non-profit Other |
description | text | No | About the company |
lead_group | text | No | Lead group |
contact_first_name | text | No | Contact first name — The person at the company, if you know one yet; the people at a lead are kept under Lead contacts. |
contact_last_name | text | No | Contact last name |
campaign_id | uuid | No | Campaign — The campaign that produced this lead. |
personal_email | text | No | Personal email |
Sample body
{
"company": "text",
"source": "web",
"contact_name": "Example",
"email": "someone@example.com",
"phone": "+1 555 0100"
}Response 201
{
"id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"source": "web",
"company": "text",
"contact_name": "Example",
"email": "someone@example.com",
"phone": "+1 555 0100",
"score": 10,
"score_factors": {},
"status": "draft",
"owner_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"converted_account_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"created_at": "2026-10-30T09:00:00Z",
"org_unit_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"location_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73"
}Sample request
curl -X POST "https://demo.tranxact.ai/api/crm/leads" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"company":"text","source":"web","contact_name":"Example","email":"someone@example.com","phone":"+1 555 0100"}'PUT/api/crm/leads/{id}Change a leads
Path parameters
| Name | Type | Description |
|---|---|---|
id | string (uuid) | The record's id, as a list returns it. |
Request body
Only the fields to change; fields left out keep their value.
| Field | Type | Required | Description |
|---|---|---|---|
source | text | No | Source Allowed: web event referral partner import campaign outbound other |
company | text | Yes | Company |
contact_name | text | No | Contact name |
email | text | No | |
phone | text | No | Phone |
status | text | No | Status |
website | text | No | Website — The company’s web address, for example https://example.com |
job_title | text | No | Job title |
industry | text | No | Industry Allowed: Manufacturing Healthcare Financial services Retail Technology Professional services Education Government Construction Logistics Energy Hospitality |
company_size | text | No | Company size Allowed: 1-10 11-50 51-200 201-500 501-1000 1001-5000 5000+ |
linkedin_url | text | No | LinkedIn profile |
city | text | No | City |
country | text | No | Country |
notes | text | No | Notes |
state | text | No | State / province — Chosen from the country’s own list where there is one, typed where there is not. |
postal_code | text | No | Postal / ZIP code |
address_line1 | text | No | Address line 1 |
address_line2 | text | No | Address line 2 |
metro_area | text | No | Metro area |
annual_revenue | numeric | No | Annual revenue |
sic_code | text | No | SIC code — US Standard Industrial Classification. Shown for a company in the United States, Canada or Mexico. |
naics_code | text | No | NAICS code — North American Industry Classification System. Shown for a company in the United States, Canada or Mexico. |
locations_count | integer | No | Number of locations |
fiscal_year_end | text | No | Fiscal year end — As the company states it, e.g. December or 31-Mar. |
owner_name | text | No | Lead owner — Left empty, lead routing assigns an owner where it is set up. |
ownership_type | text | No | Ownership type Allowed: Public Private Subsidiary Government Partnership Non-profit Other |
description | text | No | About the company |
lead_group | text | No | Lead group |
contact_first_name | text | No | Contact first name — The person at the company, if you know one yet; the people at a lead are kept under Lead contacts. |
contact_last_name | text | No | Contact last name |
campaign_id | uuid | No | Campaign — The campaign that produced this lead. |
personal_email | text | No | Personal email |
Sample body
{
"company": "text",
"source": "web"
}Response 200
{
"id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"source": "web",
"company": "text",
"contact_name": "Example",
"email": "someone@example.com",
"phone": "+1 555 0100",
"score": 10,
"score_factors": {},
"status": "draft",
"owner_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"converted_account_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"created_at": "2026-10-30T09:00:00Z",
"org_unit_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73",
"location_id": "3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73"
}Sample request
curl -X PUT "https://demo.tranxact.ai/api/crm/leads/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"company":"text","source":"web"}'DELETE/api/crm/leads/{id}Delete a leads
Path parameters
| Name | Type | Description |
|---|---|---|
id | string (uuid) | The record's id, as a list returns it. |
Response 200
{ "deleted": true }Many documents are cancelled or reversed instead; the API refuses a delete the screen would refuse.
Sample request
curl -X DELETE "https://demo.tranxact.ai/api/crm/leads/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73" \
-H "Authorization: Bearer $TOKEN"GET/api/crm/leads/{id}/score-explanationScore explanation
Path parameters
| Name | Type | Description |
|---|---|---|
id | string (uuid) | The record's id, as a list returns it. |
Response
200 with the data as JSON.
Sample request
curl "https://demo.tranxact.ai/api/crm/leads/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73/score-explanation" \
-H "Authorization: Bearer $TOKEN"POST/api/crm/leads/{id}/copyCopy
Path parameters
| Name | Type | Description |
|---|---|---|
id | string (uuid) | The record's id, as a list returns it. |
Request body
The keys this action reads (* = required; "one of" lists the only values):
overrides, preview, withLinesResponse
200 or 201 with the record or result as JSON; a refusal is 409 or 422 with a sentence saying why.
Sample request
curl -X POST "https://demo.tranxact.ai/api/crm/leads/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73/copy" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"overrides":"value","preview":"value","withLines":"value"}'GET/api/crm/leads/{parentId}/contactsContacts
Path parameters
| Name | Type | Description |
|---|---|---|
parentId | string (uuid) | The record's parentId, as a list returns it. |
Response
200 with the data as JSON.
Sample request
curl "https://demo.tranxact.ai/api/crm/leads/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73/contacts" \
-H "Authorization: Bearer $TOKEN"POST/api/crm/leads/{parentId}/contactsContacts
Path parameters
| Name | Type | Description |
|---|---|---|
parentId | string (uuid) | The record's parentId, as a list returns it. |
No body is required.
Response
200 or 201 with the record or result as JSON; a refusal is 409 or 422 with a sentence saying why.
Sample request
curl -X POST "https://demo.tranxact.ai/api/crm/leads/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73/contacts" \
-H "Authorization: Bearer $TOKEN"PUT/api/crm/leads/{parentId}/contacts/{lineId}Contacts
Path parameters
| Name | Type | Description |
|---|---|---|
parentId | string (uuid) | The record's parentId, as a list returns it. |
lineId | string (uuid) | The record's lineId, as a list returns it. |
No body is required.
Response
200 or 201 with the record or result as JSON; a refusal is 409 or 422 with a sentence saying why.
Sample request
curl -X PUT "https://demo.tranxact.ai/api/crm/leads/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73/contacts/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73" \
-H "Authorization: Bearer $TOKEN"DELETE/api/crm/leads/{parentId}/contacts/{lineId}Contacts
Path parameters
| Name | Type | Description |
|---|---|---|
parentId | string (uuid) | The record's parentId, as a list returns it. |
lineId | string (uuid) | The record's lineId, as a list returns it. |
No body is required.
Response
200 or 201 with the record or result as JSON; a refusal is 409 or 422 with a sentence saying why.
Sample request
curl -X DELETE "https://demo.tranxact.ai/api/crm/leads/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73/contacts/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73" \
-H "Authorization: Bearer $TOKEN"GET/api/crm/leads/{parentId}/activitiesActivities
Path parameters
| Name | Type | Description |
|---|---|---|
parentId | string (uuid) | The record's parentId, as a list returns it. |
Response
200 with the data as JSON.
Sample request
curl "https://demo.tranxact.ai/api/crm/leads/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73/activities" \
-H "Authorization: Bearer $TOKEN"POST/api/crm/leads/{parentId}/activitiesActivities
Path parameters
| Name | Type | Description |
|---|---|---|
parentId | string (uuid) | The record's parentId, as a list returns it. |
No body is required.
Response
200 or 201 with the record or result as JSON; a refusal is 409 or 422 with a sentence saying why.
Sample request
curl -X POST "https://demo.tranxact.ai/api/crm/leads/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73/activities" \
-H "Authorization: Bearer $TOKEN"PUT/api/crm/leads/{parentId}/activities/{lineId}Activities
Path parameters
| Name | Type | Description |
|---|---|---|
parentId | string (uuid) | The record's parentId, as a list returns it. |
lineId | string (uuid) | The record's lineId, as a list returns it. |
No body is required.
Response
200 or 201 with the record or result as JSON; a refusal is 409 or 422 with a sentence saying why.
Sample request
curl -X PUT "https://demo.tranxact.ai/api/crm/leads/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73/activities/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73" \
-H "Authorization: Bearer $TOKEN"DELETE/api/crm/leads/{parentId}/activities/{lineId}Activities
Path parameters
| Name | Type | Description |
|---|---|---|
parentId | string (uuid) | The record's parentId, as a list returns it. |
lineId | string (uuid) | The record's lineId, as a list returns it. |
No body is required.
Response
200 or 201 with the record or result as JSON; a refusal is 409 or 422 with a sentence saying why.
Sample request
curl -X DELETE "https://demo.tranxact.ai/api/crm/leads/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73/activities/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73" \
-H "Authorization: Bearer $TOKEN"POST/api/crm/leads/{id}/scoreScore
Path parameters
| Name | Type | Description |
|---|---|---|
id | string (uuid) | The record's id, as a list returns it. |
No body is required.
Response
200 or 201 with the record or result as JSON; a refusal is 409 or 422 with a sentence saying why.
Sample request
curl -X POST "https://demo.tranxact.ai/api/crm/leads/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73/score" \
-H "Authorization: Bearer $TOKEN"POST/api/crm/leads/{id}/convertConvert
Path parameters
| Name | Type | Description |
|---|---|---|
id | string (uuid) | The record's id, as a list returns it. |
Request body
The keys this action reads (* = required; "one of" lists the only values):
accountIdResponse
200 or 201 with the record or result as JSON; a refusal is 409 or 422 with a sentence saying why.
Sample request
curl -X POST "https://demo.tranxact.ai/api/crm/leads/3f1c2a9e-5b7d-4c1e-9a2f-0d4b8e6c1a73/convert" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"accountId":"value"}'Data model
Every field of a leads, as the API returns it. Field names are the JSON keys; any of them can be filtered and sorted on a list.
| Field | Type | Access | Description |
|---|---|---|---|
id | uuid | read only | Id |
org_id | uuid | read only | Org id |
source | text | read, write | Source Allowed: web event referral partner import campaign outbound other |
company | text | read, write | Company |
contact_name | text | read, write | Contact name |
email | text | read, write | |
phone | text | read, write | Phone |
score | integer | read only | Score |
score_factors | jsonb | read only | Score factors |
status | text | read, write | Status |
owner_id | uuid | read only | Owner id |
converted_account_id | uuid | read only | Converted account id |
created_at | timestamp with time zone | read only | Created at |
org_unit_id | uuid | read only | Org unit id |
location_id | uuid | read only | Location id |
warehouse_id | uuid | read only | Warehouse id |
website | text | read, write | Website — The company’s web address, for example https://example.com |
job_title | text | read, write | Job title |
industry | text | read, write | Industry Allowed: Manufacturing Healthcare Financial services Retail Technology Professional services Education Government Construction Logistics Energy Hospitality |
company_size | text | read, write | Company size Allowed: 1-10 11-50 51-200 201-500 501-1000 1001-5000 5000+ |
linkedin_url | text | read, write | LinkedIn profile |
city | text | read, write | City |
country | text | read, write | Country |
notes | text | read, write | Notes |
state | text | read, write | State / province — Chosen from the country’s own list where there is one, typed where there is not. |
postal_code | text | read, write | Postal / ZIP code |
address_line1 | text | read, write | Address line 1 |
address_line2 | text | read, write | Address line 2 |
metro_area | text | read, write | Metro area |
annual_revenue | numeric | read, write | Annual revenue |
sic_code | text | read, write | SIC code — US Standard Industrial Classification. Shown for a company in the United States, Canada or Mexico. |
naics_code | text | read, write | NAICS code — North American Industry Classification System. Shown for a company in the United States, Canada or Mexico. |
locations_count | integer | read, write | Number of locations |
fiscal_year_end | text | read, write | Fiscal year end — As the company states it, e.g. December or 31-Mar. |
owner_name | text | read, write | Lead owner — Left empty, lead routing assigns an owner where it is set up. |
ownership_type | text | read, write | Ownership type Allowed: Public Private Subsidiary Government Partnership Non-profit Other |
description | text | read, write | About the company |
lead_group | text | read, write | Lead group |
contact_first_name | text | read, write | Contact first name — The person at the company, if you know one yet; the people at a lead are kept under Lead contacts. |
contact_last_name | text | read, write | Contact last name |
xf_text_1 | text | read only | Xf text 1 |
xf_text_2 | text | read only | Xf text 2 |
xf_text_3 | text | read only | Xf text 3 |
xf_text_4 | text | read only | Xf text 4 |
xf_text_5 | text | read only | Xf text 5 |
xf_num_1 | numeric | read only | Xf num 1 |
xf_num_2 | numeric | read only | Xf num 2 |
xf_num_3 | numeric | read only | Xf num 3 |
xf_date_1 | date | read only | Xf date 1 |
xf_date_2 | date | read only | Xf date 2 |
created_by | uuid | read only | Created by |
updated_at | timestamp with time zone | read only | Updated at |
updated_by | uuid | read only | Updated by |
score_grade | text | read only | Score grade |
score_model_id | uuid | read only | Score model id |
scored_at | timestamp with time zone | read only | Scored at |
routed_at | timestamp with time zone | read only | Routed at |
closed_reason | text | read only | Closed reason |
campaign_id | uuid | read, write | Campaign — The campaign that produced this lead. |
personal_email | text | read, write | Personal email |
Errors
| Status | Meaning |
|---|---|
| 400 | The request could not be read: a filter that is not JSON, a bad parameter |
| 401 | No credential, or it is wrong, revoked or expired |
| 403 | The caller's roles do not hold CRM › Leads for this verb, or the address or origin is not allowed |
| 404 | No record with that id is visible to the caller |
| 409 | A conflict: a duplicate number, a document in a state that does not allow it, or a record changed or locked by someone else |
| 422 | Refused by the same validation as the screen; the error names the field and why |
Every error is JSON: {"error": "a sentence saying what was wrong"}, with field where it applies.