Permissions: opportunities:read to read opportunities and pipelines, opportunities:write to change them. All paths below start with https://YOUR-CRM-ADDRESS.
Method | Path | What it does |
|---|
GET
| /api/v1/pipelines
| List pipelines with their stages |
GET
| /api/v1/opportunities
| List opportunities |
POST
| /api/v1/opportunities
| Create an opportunity |
GET
| /api/v1/opportunities/{id}
| Get one opportunity |
PATCH
| /api/v1/opportunities/{id}
| Update an opportunity |
PUT
| /api/v1/opportunities/{id}/stage
| Move it to another stage |
PUT
| /api/v1/opportunities/{id}/status
| Mark it open, won, lost or abandoned |
DELETE
| /api/v1/opportunities/{id}
| Delete it |
Pipelines and stages
GET /api/v1/pipelines returns every pipeline with its stages in order. You need a pipeline id and a stage id to create an opportunity. A stage's position is a sort key (text), not a number: use the order of the stages list.
{
"data": [
{
"id": "kp1a2b3c4d5e6f7g8h9i0j1k",
"name": "Sales",
"isDefault": true,
"allowDuplicateOpportunities": false,
"stages": [
{ "id": "kg1a2b3c4d5e6f7g8h9i0j1k", "name": "New lead", "position": "a0", "probability": 10, "isTerminal": false, "requiredFields": [] },
{ "id": "kg2a2b3c4d5e6f7g8h9i0j1k", "name": "Quote sent", "position": "a1", "probability": 50, "isTerminal": false, "requiredFields": [] }
]
}
]
}
List opportunities
GET /api/v1/opportunities with any of pipelineId, stageId, contactId, assignedTo, status (open, won, lost or abandoned), limit and cursor.
Create an opportunity
POST /api/v1/opportunities. pipelineId, stageId, contactId and name are required.
{
"pipelineId": "kp1a2b3c4d5e6f7g8h9i0j1k",
"stageId": "kg1a2b3c4d5e6f7g8h9i0j1k",
"contactId": "jd7a1b2c3d4e5f6g7h8i9j0k",
"name": "Doe roof replacement",
"value": 12500,
"currency": "USD",
"assignedTo": "jh72m0k9n8p7q6r5s4t3u2v1w0x9y8z7",
"tags": ["roofing"],
"source": "website",
"expectedCloseDate": 1777593600000
}
currency is a 3-letter code and defaults to your account's currency.
expectedCloseDate is Unix milliseconds.
Your lead routing rules run on new opportunities, so assignedTo may be set for you.
If the pipeline allows only one open opportunity per contact and this contact already has one, you get 409 DUPLICATE_OPPORTUNITY with the existing one's ID in error.details.existingOpportunityId. Update that one instead.
A pipeline, stage or contact from another account is refused (404 for the pipeline, 400 for the stage or contact).
Returns 201 with the opportunity, including its id, status: "open" and timestamps.
Move it to another stage
PUT /api/v1/opportunities/{id}/stage:
{ "stageId": "kg2a2b3c4d5e6f7g8h9i0j1k" }
The stage must be in the same pipeline. Optionally send beforeDealId or afterDealId to place it next to another opportunity in that stage.
Win, lose or reopen
PUT /api/v1/opportunities/{id}/status:
{ "status": "lost", "lostReason": "Went with another contractor" }
status is open, won, lost or abandoned. lostReason is required when the status is lost.
Update or delete
PATCH /api/v1/opportunities/{id} with any of name, value, currency, assignedTo, tags, customFields, source, expectedCloseDate, lostReason or probabilityOverride (0 to 100).
DELETE /api/v1/opportunities/{id} deletes it. Deleted opportunities no longer appear in lists.
Create and change pipelines
A token with pipelines:write can create pipelines (POST /api/v1/pipelines), change them (PATCH /api/v1/pipelines/{id}), add stages (POST /api/v1/pipelines/{id}/stages) and change stages (PATCH /api/v1/pipeline-stages/{id}). pipelines:delete deletes pipelines and stages. Opportunity notes have their own permissions (notes:read, notes:write, notes:delete) and live at /api/v1/opportunity-notes. See the full reference at https://YOUR-CRM-ADDRESS/developers for the fields.
opportunity.created, opportunity.updated, opportunity.stage_changed, opportunity.won, opportunity.lost and opportunity.deleted.