Skip to main content
A deal is an opportunity inside a stage. It always points to a real Lead — contact data comes from the Lead, it is not copied.

The Deal object

id
string
Deal UUID
number
integer
Human-readable sequential deal number (e.g. 1042)
pipeline_id
string
Pipeline UUID
stage_id
string
UUID of the current stage
lead_id
string
UUID of the linked Lead
owner_id
string
UUID of the responsible user, or null
value
number
Manual deal value. Only used when the deal has no products.
total
number
Calculated total: the sum of price × qty of the products, or value when there are no products
origin
string
Deal origin (manual by default)
loss_reason
string
Loss reason. Present only on lost deals.
note
string
Free-form note
won_at
string
Date it entered the won stage (ISO 8601)
lost_at
string
Date it entered the lost stage (ISO 8601)
lead_name
string
Name of the linked Lead (resolved at read time)
lead_surname
string
Lead’s surname
lead_company
string
Lead’s company
lead_email
string
Lead’s email
lead_phone
string
Lead’s phone
lead_avatar
string
URL of the Lead’s avatar
lead_status_id
string
UUID of the Lead’s status
products
DealProduct[]
The deal’s product lines
tags
Tag[]
Deal tags — they reuse the same tag catalog as Leads
pending_todos
integer
Number of pending activities
overdue_todos
integer
Number of activities that are pending and overdue

Board

GET /backend/pipelines/{id}/board
Returns the board metadata: the pipeline with its stages and, per column, the deal count and the money total. It does not return the deals themselves — use List deals to load each column.

Query Parameters

Search by deal number or by the linked Lead’s name/company
stage_id
string
Restrict to a specific stage
sort
string
default:"recent"
recent (newest first) or oldest
mode
string
default:"created"
Which date the period filter considers: created, won or lost
period
string
7d, 30d, 1y or custom. With custom, also provide from and to.
from
string
Start of the period (ISO 8601). Used only with period=custom.
to
string
End of the period (ISO 8601). Used only with period=custom.

List deals

GET /backend/pipelines/{id}/deals
Returns a page of deals. The board paginates per column — pass stage_id to load one stage at a time instead of the whole pipeline.

Query Parameters

Accepts every filter of the board, plus:
page
integer
default:"1"
Desired page
limit
integer
default:"20"
Items per page. Values outside 1–100 fall back to the default of 20.

Get a deal

GET /backend/pipeline/deals/{id}
Returns the full deal, with products, tags and Lead data.

Create a deal

POST /backend/pipeline/deals
Requires the pipeline.deals.create permission.

Request Body

pipeline_id
string
required
Pipeline UUID
stage_id
string
required
UUID of the initial stage. It must belong to the given pipeline, otherwise the response is 400.
lead_id
string
UUID of an existing Lead
new_lead
object
Data to create a new Lead along with the deal
Provide lead_id or new_lead. Without either one, the response is 400 — a deal never exists without a Lead.
owner_id
string
UUID of the responsible user
loss_reason
string
Loss reason. Required when stage_id points to the lost stage.
lead_status_id
string
Status to apply to the linked Lead
products
DealProduct[]
The deal’s product lines
tag_ids
string[]
UUIDs of tags to associate
origin
string
Deal origin. Default: manual.
Returns 201 Created with the deal.

Update a deal

PUT /backend/pipeline/deals/{id}
Requires pipeline.deals.edit. Omitted fields stay unchanged.

Request Body

owner_id
string
New owner
value
number
Manual value. Cannot be negative. Only affects total when the deal has no products.
note
string
Note
origin
string
Origin
products
DealProduct[]
When sent, it replaces the entire list of products. Send [] to remove them all.
The stage is not changed by this endpoint. Use Move between stages.

Move between stages

PUT /backend/pipeline/deals/{id}/stage
Moves the deal between board columns. Requires pipeline.deals.edit.

Request Body

stage_id
string
required
UUID of the destination stage. It must belong to the same pipeline as the deal, otherwise the response is 400.
loss_reason
string
Loss reason. Required when the destination stage has kind: "lost".
Moving to the lost stage without loss_reason returns 400. There is no path that loses a deal silently.
Side effects of moving. Every move always clears won_at and lost_at first before applying the destination, so pulling a deal out of Won/Lost discards the marking with it: The reason can be one of the loss_reasons configured on the pipeline or free text — the “Other” option is not stored in the list of reasons.
Error message strings are returned by the API in Portuguese. Match on code (ERR_INVALID_INPUT), never on the message text.

Deal tags

Deal tags reuse the same tag catalog as Leads — there is no separate catalog.

Add a tag

POST /backend/pipeline/deals/{id}/tags/{tagID}

Remove a tag

DELETE /backend/pipeline/deals/{id}/tags/{tagID}
Both require pipeline.deals.edit and return { "success": true }.

Delete a deal

DELETE /backend/pipeline/deals/{id}
Requires pipeline.deals.delete.
Deletes the deal and everything hanging off it: products, tags, activities, files and history. The linked Lead is not deleted.