API Reference
The data layer for your agent or app. Search business records, enrich data, and manage lists.
Common Workflows
- Agent quick start: GET /help (no key required)
- Search records: GET /api/published-leads/search
- Enrich with AI: POST /augment with data + prompt
- Form submission: POST /lists/{list_id}/rows
- CRM sync: POST /lists/{list_id}/rows/upsert
- Export data: GET /lists/{list_id}/rows
Rows and integration sync
Response shapes are endpoint-specific: GET /lists returns an array; GET rows returns a rows array plus pagination; single-row reads and writes return the row directly. A row's data object contains its custom column values.
email, firstName and company are example column names, not a fixed contact schema. Configure a field mapping for each list. Discover known keys through GET list's fields_schema and the union of row.data keys; essentialColumns describes visible/preferred columns, not every field. Preserve unmapped values as custom fields.
For sync, explicitly send use_view_state=false. Page with limit and offset until rows is empty. Offset pagination is not a snapshot: concurrent writes can move rows, so deduplicate by _id and reconcile periodically. updated_since finds changed existing rows; it does not report deletions.
Create and update rows with { "data": { "title": "CEO" } }. Batch updates use { "updates": [{ "row_id": "...", "data": { "title": "CEO" } }] }. Check failed/errors for partial batch outcomes. Do not automatically retry a create after an ambiguous network error.
Authentication
Include your API key in the X-API-Key header. Keep it on your server and enforce your clients’ permissions there.
https://api.detris.aiWebhooks
For generation and import events, use Settings → Webhooks. Choose all lists or a specific list.
curl -fsS https://api.detris.ai/help
claude mcp add --transport http detris https://detris.ai/mcp \ --header "Authorization: Bearer sk_live_..."
claude mcp add detris \ -e DETRIS_API_KEY=sk_live_... \ -- npx -y detris-mcp
curl -G https://api.detris.ai/api/published-leads/search \ -H "X-API-Key: sk_live_..." \ --data-urlencode "q=Jane Doe" \ --data-urlencode "companies=Acme" \ -d page_size=5
q searches names, titles and companies; companies narrows to the employer. No model runs. If nobody matches, POST /agent/run researches the web (30-120 s).curl -X POST https://api.detris.ai/augment \
-H "X-API-Key: sk_live_..." \
-H "Content-Type: application/json" \
-d '{
"data": [{"name": "John", "company": "Acme"}],
"prompt": "Score 1-10: {name} at {company}",
"ai_column": "lead_score",
"list_name": "Leads"
}'/listsCreate an empty list
Create a list without running AI. Add rows separately. Normal plan and storage limits apply; this does not invoke augmentation.
Request Body
namestringrequiredList name
curl -X POST 'https://api.detris.ai/lists' \
-H 'X-API-Key: sk_live_your_api_key_here' \
-H 'Content-Type: application/json' \
-d '{
"name": "Enterprise Leads"
}'{
"_id": "692397ea61746762ff5d587e",
"name": "Enterprise Leads",
"stats": {
"rowCount": 0
},
"fields_schema": []
}/lists/{list_id}/rows/{row_id}Get one row
Read one row in an accessible list. Returns the row object directly, not a data/rows envelope. Missing row or wrong list returns 404.
Path Parameters
list_idstringrequiredList ID returned by GET /lists
row_idstringrequiredRow _id returned by GET rows (24-character hexadecimal ID)
curl -X GET 'https://api.detris.ai/lists/692397ea61746762ff5d587e/rows/692397ea61746762ff5d587f' \
-H 'X-API-Key: sk_live_your_api_key_here'{
"_id": "692397ea61746762ff5d587f",
"listId": "692397ea61746762ff5d587e",
"data": {
"email": "[email protected]",
"firstName": "John",
"company": "Acme Inc"
}
}/lists/{list_id}/rows/{row_id}Update one row
Merge supplied data fields into one row; omitted fields are preserved. Wrap fields in data. Requires edit access. Use PATCH, not PUT; returns the updated row directly.
Path Parameters
list_idstringrequiredList ID returned by GET /lists
row_idstringrequiredRow _id returned by GET rows (24-character hexadecimal ID)
Request Body
dataobjectrequiredOnly the custom fields to change
curl -X PATCH 'https://api.detris.ai/lists/692397ea61746762ff5d587e/rows/692397ea61746762ff5d587f' \
-H 'X-API-Key: sk_live_your_api_key_here' \
-H 'Content-Type: application/json' \
-d '{
"data": {
"title": "CEO"
}
}'{
"_id": "692397ea61746762ff5d587f",
"listId": "692397ea61746762ff5d587e",
"data": {
"email": "[email protected]",
"firstName": "John",
"company": "Acme Inc",
"title": "CEO"
}
}/lists/{list_id}/rows/{row_id}Delete one row
Permanently delete one row in an editable list. No request body. Returns a confirmation object; deleting it again returns 404.
Path Parameters
list_idstringrequiredList ID returned by GET /lists
row_idstringrequiredRow _id returned by GET rows (24-character hexadecimal ID)
curl -X DELETE 'https://api.detris.ai/lists/692397ea61746762ff5d587e/rows/692397ea61746762ff5d587f' \
-H 'X-API-Key: sk_live_your_api_key_here'{
"detail": "Row deleted successfully"
}/lists/{list_id}/rows/bulk-deleteDelete selected rows
Permanently delete selected rows in this list. Compare deleted_count with requested_count; already missing IDs are not deleted again. Requires edit access.
Path Parameters
list_idstringrequiredList ID returned by GET /lists
Request Body
row_idsarrayrequiredRow _id strings to delete; must not be empty
curl -X POST 'https://api.detris.ai/lists/692397ea61746762ff5d587e/rows/bulk-delete' \
-H 'X-API-Key: sk_live_your_api_key_here' \
-H 'Content-Type: application/json' \
-d '{
"row_ids": [
"692397ea61746762ff5d587f"
]
}'{
"detail": "Successfully deleted 1 rows",
"deleted_count": 1,
"requested_count": 1
}/augmentAugment with data
Create a list, import rows, and enrich them with one data-and-prompt request.
Request Body
dataarrayrequiredRow objects to import. Row limits depend on your plan; see /docs#rate-limits.
promptstringrequiredAI prompt with {field} placeholders referencing your data fields
ai_columnstringrequiredColumn name where generated content will be stored
list_namestringrequiredName for the new list that will be created
modelstringAI model: gpt-5.4-mini (default), gpt-5.4, gpt-5.4-nano, gpt-5.3-codex, claude-haiku-4.5
enable_web_searchbooleanEnable web search for each row (adds $0.01/row)
Response
statusstringrequired"started" when generation begins
messagestringrequiredHuman-readable status message
list_idstringrequiredID of the newly created list
list_namestringrequiredName of the created list
rows_importedintegerrequiredNumber of rows imported
curl -X POST https://api.detris.ai/augment \
-H "X-API-Key: sk_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"data": [
{"name": "John Smith", "company": "Acme Inc"},
{"name": "Jane Doe", "company": "Tech Corp"}
],
"prompt": "Score this lead 1-10: {name} at {company}",
"ai_column": "lead_score",
"list_name": "Q4 Leads"
}'{
"status": "started",
"message": "Created list 'Q4 Leads' with 2 rows. AI generation started.",
"list_id": "new_list_abc123",
"list_name": "Q4 Leads",
"rows_imported": 2
}/lists/{list_id}/augmentAugment existing list
Add AI-generated columns to an existing list.
Path Parameters
list_idstringrequiredThe unique identifier of the list
Request Body
promptstringrequiredAI prompt with {field} placeholders referencing row data
ai_columnstringrequiredColumn name where generated content will be stored
row_idsarraySpecific row IDs to process (defaults to all rows in list)
modelstringAI model: gpt-5.4-mini (default), gpt-5.4, gpt-5.4-nano, gpt-5.3-codex, claude-haiku-4.5
enable_web_searchbooleanEnable web search for each row (adds $0.01/row)
Response
statusstringrequired"started" when generation begins
messagestringrequiredHuman-readable status message
list_idstringrequiredList being processed
ai_columnstringrequiredColumn being populated
rows_queuedintegerrequiredNumber of rows queued for processing
curl -X POST https://api.detris.ai/lists/692397ea61746762ff5d587e/augment \
-H "X-API-Key: sk_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Score this lead 1-10 based on {name} at {company}",
"ai_column": "lead_score"
}'{
"status": "started",
"message": "AI generation started for 100 rows",
"list_id": "692397ea61746762ff5d587e",
"ai_column": "lead_score",
"rows_queued": 100
}/listsGet all lists
Retrieve all lists in your account. Use this to find the list_id for other operations.
Response
(response)arrayrequiredBare JSON array of list objects; there is no top-level data envelope
_idstringrequiredUnique list identifier
namestringrequiredList name
stats.rowCountintegerNumber of rows, when list statistics are available
created_atstringrequiredISO 8601 creation timestamp
curl https://api.detris.ai/lists \
-H "X-API-Key: sk_live_your_api_key_here"[
{
"_id": "692397ea61746762ff5d587e",
"name": "Enterprise Leads",
"stats": { "rowCount": 1234 },
"created_at": "2025-01-15T10:30:00Z"
}
]/lists/{list_id}Get list by ID
Retrieve a specific list by its ID. fields_schema lists known column keys; settings.columnTypes holds available display/type hints. Columns are custom, not a fixed contact schema.
Path Parameters
list_idstringrequiredThe unique identifier of the list
Response
_idstringrequiredUnique list identifier
namestringrequiredList name
statsobjectList statistics, including rowCount when available
fields_schemaarrayKnown custom column keys, including sparse columns
settings.columnTypesobjectOptional column display/type hints, not a required contact schema
created_atstringrequiredISO 8601 creation timestamp
curl https://api.detris.ai/lists/692397ea61746762ff5d587e \
-H "X-API-Key: sk_live_your_api_key_here"{
"_id": "692397ea61746762ff5d587e",
"name": "Enterprise Leads",
"stats": { "rowCount": 1234 },
"fields_schema": ["email", "firstName", "company"],
"created_at": "2025-01-15T10:30:00Z"
}/lists/{list_id}/rowsGet rows
Read custom rows from a list. For a complete integration sync, explicitly set use_view_state=false so saved dashboard filters cannot hide rows. updated_since reads changed existing rows, not a deletion feed.
Path Parameters
list_idstringrequiredThe unique identifier of the list
Query Parameters
limitintegerMax rows to return (default: 50, max: 10000)
offsetintegerNumber of rows to skip (default: 0)
sort_bystring"row_order" or "updated_at"
updated_sincestringISO 8601 timestamp for delta sync
use_view_statebooleanSet false for sync. Ignores saved UI sorting/filtering; explicit query filters still apply. Set true to opt into the saved view.
Response
rowsarrayrequiredArray of row objects (not a top-level data envelope)
_idstringrequiredUnique row identifier
dataobjectrequiredRow field values as key-value pairs
created_atstringrequiredISO 8601 creation timestamp
updated_atstringISO 8601 last update timestamp
totalintegerrequiredTotal number of rows in the list
limitintegerrequiredLimit used in the request
offsetintegerrequiredOffset used in the request
essentialColumnsarrayVisible/preferred column keys, not an exhaustive or fixed contact schema
filteredTotalintegerMatching count when the active view filters rows; total may include hidden rows
curl "https://api.detris.ai/lists/692397ea61746762ff5d587e/rows?limit=100&use_view_state=false" \
-H "X-API-Key: sk_live_your_api_key_here"{
"rows": [
{
"_id": "692397ea61746762ff5d587f",
"data": {
"email": "[email protected]",
"firstName": "John",
"company": "Acme Inc"
},
"created_at": "2025-01-15T10:30:00Z"
}
],
"total": 1234,
"limit": 100,
"offset": 0
}/lists/{list_id}/rowsCreate row
Add a single row. Put all custom column values inside data. A flat body is not supported. An empty data object intentionally creates a blank row.
Path Parameters
list_idstringrequiredThe unique identifier of the list
Request Body
dataobjectrequiredCustom column keys and values. email, firstName and company below are examples, not reserved or guaranteed fields.
insertAfterRowIdstringOptional existing row ID for insertion position
Response
_idstringrequiredUnique row identifier
dataobjectrequiredThe row data you provided
created_atstringrequiredISO 8601 creation timestamp
curl -X POST https://api.detris.ai/lists/692397ea61746762ff5d587e/rows \
-H "X-API-Key: sk_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"data": {
"email": "[email protected]",
"firstName": "John",
"company": "Acme Inc"
}
}'{
"_id": "692397ea61746762ff5d587f",
"data": {
"email": "[email protected]",
"firstName": "John",
"company": "Acme Inc"
},
"created_at": "2025-01-15T10:30:00Z"
}/lists/{list_id}/rows/batchBatch update
Patch multiple rows using updates: [{row_id, data}]. Updates may partially succeed; inspect updated and failed, then errors when present. Not an all-or-nothing transaction.
Path Parameters
list_idstringrequiredThe unique identifier of the list
Request Body
updatesarrayrequiredArray of update objects
row_idstringrequiredRow ID to update
dataobjectrequiredKey-value pairs of fields to update
Response
updatedintegerrequiredNumber of rows successfully updated
failedintegerrequiredNumber of rows that failed to update
totalintegerrequiredTotal rows in the request
errorsarrayArray of error messages for failed updates
curl -X PATCH https://api.detris.ai/lists/692397ea61746762ff5d587e/rows/batch \
-H "X-API-Key: sk_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"updates": [
{ "row_id": "692397ea61746762ff5d587f", "data": { "status": "qualified" } },
{ "row_id": "692397ea61746762ff5d5880", "data": { "status": "contacted" } }
]
}'{
"updated": 2,
"failed": 0,
"total": 2
}/lists/{list_id}/rows/upsertBulk upsert (import)
Import data in bulk or sync from your CRM. Matches rows by a field (like email) - updates existing rows, creates new ones. Perfect for periodic syncs from Salesforce, HubSpot, or your database.
Path Parameters
list_idstringrequiredThe unique identifier of the list
Request Body
rowsarrayrequiredArray of row objects to upsert
match_fieldstringrequiredField name to match on (e.g., "email")
dataobjectrequiredRow data as key-value pairs
Response
insertedintegerrequiredNumber of new rows created
updatedintegerrequiredNumber of existing rows updated
failedintegerrequiredNumber of rows that failed
totalintegerrequiredTotal rows in the request
curl -X POST https://api.detris.ai/lists/692397ea61746762ff5d587e/rows/upsert \
-H "X-API-Key: sk_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"rows": [
{
"match_field": "email",
"data": { "email": "[email protected]", "firstName": "John" }
}
]
}'{
"inserted": 150,
"updated": 850,
"failed": 0,
"total": 1000
}/aitemplates/Get templates
Retrieve all AI templates in your account. Templates define reusable AI prompts for data augmentation.
Response
_idstringrequiredUnique template identifier
namestringrequiredTemplate name (used as column name)
custom_user_messagestringrequiredThe AI prompt with {field} placeholders
modelstringAI model to use (default: gpt-5.4-mini)
enable_web_searchbooleanWhether web search is enabled
created_atstringrequiredISO 8601 creation timestamp
curl https://api.detris.ai/aitemplates/ \
-H "X-API-Key: sk_live_your_api_key_here"[
{
"_id": "template_123",
"name": "lead_score",
"custom_user_message": "Rate this lead from 1-10...",
"created_at": "2025-01-15T10:30:00Z"
}
]/aitemplates/Create template
Create an AI template for data augmentation. Use {field_name} placeholders to reference row data in your prompt.
Request Body
namestringrequiredTemplate name (becomes the column name when applied)
custom_user_messagestringrequiredAI prompt with {field} placeholders
modelstringAI model: gpt-5.4-mini (default), gpt-5.4, gpt-5.4-nano, gpt-5.3-codex, claude-haiku-4.5, etc.
enable_web_searchbooleanEnable web search for each row (adds $0.01/row)
Response
_idstringrequiredUnique template identifier
namestringrequiredTemplate name
custom_user_messagestringrequiredThe AI prompt
created_atstringrequiredISO 8601 creation timestamp
curl -X POST https://api.detris.ai/aitemplates/ \
-H "X-API-Key: sk_live_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{
"name": "lead_score",
"custom_user_message": "Rate this lead from 1-10: {name} at {company}"
}'{
"_id": "template_123",
"name": "lead_score",
"custom_user_message": "Rate this lead from 1-10: {name} at {company}",
"created_at": "2025-01-15T10:30:00Z"
}