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

string
Deal UUID
integer
Human-readable sequential deal number (e.g. 1042)
string
Pipeline UUID
string
UUID of the current stage
string
UUID of the linked Lead
string
UUID of the responsible user, or null
number
Manual deal value. Only used when the deal has no products.
number
Calculated total: the sum of price × qty of the products, or value when there are no products
string
Deal origin (manual by default)
string
Loss reason. Present only on lost deals.
string
Free-form note
string
Date it entered the won stage (ISO 8601)
string
Date it entered the lost stage (ISO 8601)
string
Name of the linked Lead (resolved at read time)
string
Lead’s surname
string
Lead’s company
string
Lead’s email
string
Lead’s phone
string
URL of the Lead’s avatar
string
UUID of the Lead’s status
DealProduct[]
The deal’s product lines
Tag[]
Deal tags — they reuse the same tag catalog as Leads
integer
Number of pending activities
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
string
Restrict to a specific stage
string
default:"recent"
recent (newest first) or oldest
string
default:"created"
Which date the period filter considers: created, won or lost
string
7d, 30d, 1y or custom. With custom, also provide from and to.
string
Start of the period (ISO 8601). Used only with period=custom.
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:
integer
default:"1"
Desired page
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

string
required
Pipeline UUID
string
required
UUID of the initial stage. It must belong to the given pipeline, otherwise the response is 400.
string
UUID of an existing 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.
string
UUID of the responsible user
string
Loss reason. Required when stage_id points to the lost stage.
string
Status to apply to the linked Lead
DealProduct[]
The deal’s product lines
string[]
UUIDs of tags to associate
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

string
New owner
number
Manual value. Cannot be negative. Only affects total when the deal has no products.
string
Note
string
Origin
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

string
required
UUID of the destination stage. It must belong to the same pipeline as the deal, otherwise the response is 400.
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.