Create opportunity
/api/v1/ext/opportunities
Create an opportunity for a contact.
The contact must be in the workspace. Without pipeline_id the default pipeline is used; without stage_id the stage named in stage_name is used, else the pipeline's first stage.
Creating one runs any workflow that triggers on Opportunity created, as in the dashboard.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
| workspace_id | body | number | yes | The workspace. |
| contact_id | body | number | yes | A contact in that workspace. |
| name | body | string | yes | Up to 191 characters. |
| pipeline_id | body | number | no | Default: the default pipeline. |
| stage_id | body | number | no | A stage of that pipeline. |
| stage_name | body | string | no | Or the stage by name (case-insensitive). |
| value | body | number | no | Default 0. |
| currency | body | string | no | Default USD. |
| status | body | enum | no | Default open. |
| source | body | string | no | Where it came from. |
| owner_id | body | number | no | The assigned user. |
| tags | body | array<string> | no | Opportunity tags. |
| custom_fields | body | object | no | Opportunity custom field values by key. |
Responses
| Status | When |
|---|---|
201 | Created |
400 | Missing field, or a contact / pipeline / stage that does not fit |
401 | Missing or invalid token |
403 | Missing scope |
404 | workspace_id does not exist or is not owned by the installer (same response for both) |
Response schema
opportunityobjectidnumberOpportunity id.
55workspace_idnumberThe workspace it belongs to.
7namestringOpportunity name.
Website redesignvaluenumberDeal value.
1200currencystringISO currency code.
USDstatusstring"open", "won", "lost" or "abandoned".
openlost_reasonstringSet while status is "lost".
pipelineobjectid and name of its pipeline.
stageobjectid, name, color, position, is_won, is_lost of its stage.
contactobjectThe linked contact: id, first_name, last_name, email, phone_number, company_name.
owner_idnumberThe assigned user, when set.
sourcestringFree text: where the deal came from.
tagsarray<string>Opportunity tags.
custom_fieldsobjectOpportunity custom field values by key.
closed_atstring (ISO 8601)When it was won / lost / abandoned; null while open.
stage_changed_atstring (ISO 8601)When it entered its current stage.
last_activity_atstring (ISO 8601)Last change of any kind.
curl -X POST "https://backend.mysmsgateway.app/api/v1/ext/opportunities" \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"workspace_id": 7,
"contact_id": 1234,
"name": "Website redesign",
"value": 1200,
"stage_name": "Qualified",
"source": "website"
}'{
"success": true,
"message": "Opportunity created",
"data": {
"id": 55,
"workspace_id": 7,
"name": "Website redesign",
"value": 1200,
"currency": "USD",
"status": "open",
"lost_reason": null,
"pipeline_id": 3,
"pipeline": {
"id": 3,
"name": "Sales"
},
"stage_id": 9,
"stage": {
"id": 9,
"name": "Qualified",
"color": "#22c55e",
"position": 1,
"is_won": false,
"is_lost": false
},
"contact_id": 1234,
"contact": {
"id": 1234,
"first_name": "Ann",
"last_name": "Lee",
"email": "ann@example.com",
"phone_number": "+61412345678",
"company_name": "Lee Studio"
},
"owner_id": null,
"source": "website",
"tags": [
"web"
],
"custom_fields": {},
"closed_at": null,
"stage_changed_at": "2026-10-27T09:00:00.000Z",
"last_activity_at": "2026-10-27T09:00:00.000Z",
"created_at": "2026-10-27T09:00:00.000Z",
"updated_at": "2026-10-27T09:00:00.000Z"
}
}« Get opportunity
Update opportunity »
