A deal represents a sales opportunity with a monetary value. A pipeline defines the ordered stages that deals progress through.
Every deal tracks a potential sale from first conversation to close.
| Status | Description |
|---|---|
open | Active opportunity |
won | Closed-won — revenue realized |
lost | Closed-lost — opportunity dead |
stalled | No activity for a defined period |
| Field | Type | Description |
|---|---|---|
id | string | TypeID with deal_ prefix |
name | string | Deal name (e.g., "Acme Corp - Enterprise Plan") |
value | integer | Deal value in cents (e.g., 500000 = $5,000.00) |
status | enum | Current deal status |
contact_id | string | Primary contact for this deal |
pipeline_id | string | Pipeline this deal belongs to |
stage_id | string | Current stage within the pipeline |
expected_close | date | Expected close date |
owner_id | string | Assigned team member |
metadata | object | Arbitrary key-value pairs |
All monetary values in Rex are stored as int64 in cents. This avoids floating-point precision issues:
| Display | API Value |
|---|---|
| $5,000.00 | 500000 |
| $99.50 | 9950 |
| $1,000,000.00 | 100000000 |
A pipeline is an ordered list of stages that deals move through. Each org can have multiple pipelines (e.g., "Sales Pipeline", "Partnership Pipeline").
Each stage has:
| Field | Type | Description |
|---|---|---|
id | string | Stage ID |
name | string | Stage name (e.g., "Discovery", "Proposal", "Negotiation") |
color | string | Hex color for UI display |
position | integer | Order in the pipeline (0-indexed) |
Discovery → Qualification → Proposal → Negotiation → Closed
(0) (1) (2) (3) (4)
stage_id as conversations advancewon or lost| Operation | Method | Endpoint |
|---|---|---|
| Create a deal | POST | /deals |
| List deals | GET | /deals |
| Get a deal | GET | /deals/:id |
| Update a deal | PATCH | /deals/:id |
| Delete a deal | DELETE | /deals/:id |
| Create a pipeline | POST | /pipelines |
| List pipelines | GET | /pipelines |
| Get a pipeline | GET | /pipelines/:id |
| Update a pipeline | PATCH | /pipelines/:id |
See the full Deals API reference and Pipelines API reference.