POST /v1/deals/search
const url = 'https://seu-endereco-da-api/v1/deals/search';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"status":"open","sort":"moved_oldest","interval":"7d","q":"example","stageId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","outcome":"won","closedPeriod":"7d","closedFrom":"example","closedTo":"example","createdPeriod":"all","createdFrom":"example","createdTo":"example","cursor":"example","limit":1,"pipelineId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","filter":{}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://seu-endereco-da-api/v1/deals/search \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "status": "open", "sort": "moved_oldest", "interval": "7d", "q": "example", "stageId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "outcome": "won", "closedPeriod": "7d", "closedFrom": "example", "closedTo": "example", "createdPeriod": "all", "createdFrom": "example", "createdTo": "example", "cursor": "example", "limit": 1, "pipelineId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "filter": {} }'Permissão que a Chave de acesso precisa: Ler negócios (deals:read).
Authorizations
Seção intitulada “Authorizations”Request Bodyrequired
Seção intitulada “Request Bodyrequired”object
object
Responses
Seção intitulada “Responses”object
object
Deals in the stage that match the view, beyond the page
Sum in centavos of the same deals
Counted on the server within what the caller sees and the board filter
object
Deals of the column the filter parado would return
Deals of the column the filter tarefa overdue would return
Deals of the column the filter resposta esperando would return
object
Sequential per tenant, shown as #número
Data prevista de fechamento
object
object
Filled only while the deal sits in the intake stage
object
First inbound message of the conversation that opened the lead
Who is serving the conversation, when someone is
object
Whole days since the lead arrived
The lead’s contact is blocked; accept and restore refuse it until it is unblocked
object
Channel key derived from the contact’s provider
object
object
Set when the deal belongs to a group conversation instead of a contact
object
Public url for the user’s photo
object
Open task with the earliest due date
object
Se quem chama pode concluir esta tarefa (a mesma regra de POST /tasks/:id/complete)
Unread messages on the linked conversation
Days in the stage once past the stage’s staleDays, else null
The pipeline’s cardFields in order, only the filled ones; a sensitive custom field never comes
object
One of the pipeline’s cardFields
By key: expected_close the same text as expectedCloseAt; products { names (up to 3), count }; next_task { title, dueAt }; contact_tags [{ id, name, color }]; origin { label } from the contact origin or the ad of the deal’s conversation; charge { status, amountCents, dueDate } of the latest charge; attachments { count }; field:
object
The caller holds deals:manage and the deal policy lets them act on this deal (drag, stage select)
Null when the deal is not open or its stage is the last open one
object
Next open stage by position in the same pipeline
What blocks the move to the next stage, empty when nothing does
object
Assignee: the next stage requires an assignee and the deal has none; expected_close_date, value and products: the next stage requires them and the deal lacks them; company: the next stage requires a company field and the deal has no company
Task or custom field id
Field only: whose field it is
Task only
Task only: the caller may complete it (same rule as POST /tasks/:id/complete)
Task only: name of the person responsible for it
Field only: label of the field left blank
Attachment only: category the next stage requires, null for any
Null when the deal is not open, has no live conversation or nobody wrote yet
object
Customer_waiting: the customer wrote and nobody answered; customer_silent: our message was the last one
Customer_waiting: first unanswered customer message; customer_silent: our last message
Null when the deal is not open or has no live conversation
object
Cold: past the stage limit, customer silent for 3 days or an overdue open task; hot: the customer wrote in the last 24 h; warm: otherwise
Every rule that holds for the level, cold in the order stage limit, silence, task
object
Ai: read by the pipeline AI in the conversation, only while the heat reasons switch is on; it never changes the level
Ai only: the reason the AI read in the conversation
Null when the next step switch is off, the deal is not open or the AI has not read its conversation yet
object
What the seller should do next, written by the pipeline AI from the conversation
When the AI wrote it
The fixed Ganho and Perdido columns at the end of the board, won then lost; empty when paging a stage
object
Deals won or lost in the chosen closedPeriod, by the date they were closed, that match the board search and filter, beyond the page
Sum in centavos of the same deals
Most recently closed first
object
Sequential per tenant, shown as #número
Data prevista de fechamento
object
object
Filled only while the deal sits in the intake stage
object
First inbound message of the conversation that opened the lead
Who is serving the conversation, when someone is
object
Whole days since the lead arrived
The lead’s contact is blocked; accept and restore refuse it until it is unblocked
object
Channel key derived from the contact’s provider
object
object
Set when the deal belongs to a group conversation instead of a contact
object
Public url for the user’s photo
object
Open task with the earliest due date
object
Se quem chama pode concluir esta tarefa (a mesma regra de POST /tasks/:id/complete)
Unread messages on the linked conversation
Days in the stage once past the stage’s staleDays, else null
The pipeline’s cardFields in order, only the filled ones; a sensitive custom field never comes
object
One of the pipeline’s cardFields
By key: expected_close the same text as expectedCloseAt; products { names (up to 3), count }; next_task { title, dueAt }; contact_tags [{ id, name, color }]; origin { label } from the contact origin or the ad of the deal’s conversation; charge { status, amountCents, dueDate } of the latest charge; attachments { count }; field:
object
The caller holds deals:manage and the deal policy lets them act on this deal (drag, stage select)
Null when the deal is not open or its stage is the last open one
object
Next open stage by position in the same pipeline
What blocks the move to the next stage, empty when nothing does
object
Assignee: the next stage requires an assignee and the deal has none; expected_close_date, value and products: the next stage requires them and the deal lacks them; company: the next stage requires a company field and the deal has no company
Task or custom field id
Field only: whose field it is
Task only
Task only: the caller may complete it (same rule as POST /tasks/:id/complete)
Task only: name of the person responsible for it
Field only: label of the field left blank
Attachment only: category the next stage requires, null for any
Null when the deal is not open, has no live conversation or nobody wrote yet
object
Customer_waiting: the customer wrote and nobody answered; customer_silent: our message was the last one
Customer_waiting: first unanswered customer message; customer_silent: our last message
Null when the deal is not open or has no live conversation
object
Cold: past the stage limit, customer silent for 3 days or an overdue open task; hot: the customer wrote in the last 24 h; warm: otherwise
Every rule that holds for the level, cold in the order stage limit, silence, task
object
Ai: read by the pipeline AI in the conversation, only while the heat reasons switch is on; it never changes the level
Ai only: the reason the AI read in the conversation
Null when the next step switch is off, the deal is not open or the AI has not read its conversation yet
object
What the seller should do next, written by the pipeline AI from the conversation
When the AI wrote it
Send it back with outcome to read the next page of this column
Example
{ "columns": [ { "items": [ { "status": "open", "intake": { "source": "inbound_message" }, "advance": { "missing": [ { "kind": "task", "entity": "contact" } ] }, "reply": { "state": "customer_waiting" }, "heat": { "level": "hot", "reasons": [ { "code": "stage_limit_passed" } ] } } ] } ], "closed": [ { "outcome": "won", "items": [ { "status": "open", "intake": { "source": "inbound_message" }, "advance": { "missing": [ { "kind": "task", "entity": "contact" } ] }, "reply": { "state": "customer_waiting" }, "heat": { "level": "hot", "reasons": [ { "code": "stage_limit_passed" } ] } } ] } ]}