Opportunities
Deals moving through a pipeline.
- GET List opportunities
- POST Create an opportunity
- GET Get an opportunity
- PATCH Update an opportunity
- DELETE Archive an opportunity
#List opportunities
GET/api/v1/opportunities
| Parameter | In | Type | Notes |
|---|---|---|---|
limit | query | integer | Page size, at most 100. |
cursor | query | string | pagination.nextCursor from the previous page. |
sort | query | -updated_at | updated_at | -created_at | created_at | Sort order. A leading minus sorts descending. |
updated_since | query | datetime | Only records updated at or after this instant. |
q | query | string | Free-text search over the object's main columns. |
owner | query | string | Only records whose owner equals this. |
pipeline | query | string | Only records whose pipeline id equals this. |
stage | query | string | Only records whose stage id equals this. |
stage_kind | query | string | Only records whose stage_kind equals this. |
currency | query | string | Only records whose currency equals this. |
source | query | string | Only records whose source equals this. |
person | query | string | Only records linked to this person (public id). |
company | query | string | Only records linked to this company (public id). |
curl https://synconone.com/api/v1/opportunities \
-H "Authorization: Bearer sk_live_YOUR_KEY"{
"data": [
{
"id": "pr_1a2b3c4d5e6f7a8b",
"object": "string",
"name": "Emily Carter",
"company": "string",
"person": "string",
"pipeline": "string",
"stage": "string",
"stage_kind": "open",
"amount": 1,
"currency": "string"
}
],
"pagination": {
"nextCursor": null,
"hasMore": false
}
}Errors: 401: Missing, invalid, revoked or expired API key. · 403: The key lacks the scope, or its role cannot do this. · 422: Validation failed. · 429: Rate limited. Honour Retry-After.. See errors.
#Create an opportunity
POST/api/v1/opportunities
Built-in and custom fields by key. Relations take public ids. Changing stage moves the opportunity through the pipeline's rules; when an approval policy applies the response is 409 approval_required and the opportunity does not move. lost_reason / win_reason in the same body travel with the move.
| Body field | Type | Notes |
|---|---|---|
name | string | Name |
company | string | Company |
person | string | Primary contact |
stage | string | Stage |
amount | number | Amount |
currency | string | Currency |
probability | number | Probability |
close_date | string | Expected close |
owner | string | Owner |
next_step | string | Next step |
next_step_due_at | string | Next step due |
competitor | string | Competitor |
source | string | Source |
description | string | Notes |
win_reason | string | Why we won |
lost_reason | string | Why we lost |
curl -X POST https://synconone.com/api/v1/opportunities \
-H "Authorization: Bearer sk_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Emily Carter","company":"string","person":"string","stage":"string","amount":1}'{
"data": {
"id": "pr_1a2b3c4d5e6f7a8b",
"object": "string",
"name": "Emily Carter",
"company": "string",
"person": "string",
"pipeline": "string",
"stage": "string",
"stage_kind": "open",
"amount": 1,
"currency": "string"
}
}Errors: 401: Missing, invalid, revoked or expired API key. · 403: The key lacks the scope, or its role cannot do this. · 409: Conflict, approval required, or idempotent request in progress. · 422: Validation failed. · 429: Rate limited. Honour Retry-After.. See errors.
#Get an opportunity
GET/api/v1/opportunities/{id}
| Parameter | In | Type | Notes |
|---|---|---|---|
id required | path | string | Public id of the opportunity. |
curl https://synconone.com/api/v1/opportunities/pr_1a2b3c4d5e6f7a8b \
-H "Authorization: Bearer sk_live_YOUR_KEY"{
"data": {
"id": "pr_1a2b3c4d5e6f7a8b",
"object": "string",
"name": "Emily Carter",
"company": "string",
"person": "string",
"pipeline": "string",
"stage": "string",
"stage_kind": "open",
"amount": 1,
"currency": "string"
}
}Errors: 401: Missing, invalid, revoked or expired API key. · 403: The key lacks the scope, or its role cannot do this. · 404: Not found, or not visible to this key. · 422: Validation failed. · 429: Rate limited. Honour Retry-After.. See errors.
#Update an opportunity
PATCH/api/v1/opportunities/{id}
Only the keys sent are changed. Fields are applied in order; the first refusal stops the request and details.applied lists what was already changed. Changing stage moves the opportunity through the pipeline's rules; when an approval policy applies the response is 409 approval_required and the opportunity does not move. lost_reason / win_reason in the same body travel with the move.
| Parameter | In | Type | Notes |
|---|---|---|---|
id required | path | string | Public id of the opportunity. |
| Body field | Type | Notes |
|---|---|---|
name | string | Name |
company | string | Company |
stage | string | Stage |
amount | number | Amount |
currency | string | Currency |
probability | number | Probability |
close_date | string | Expected close |
owner | string | Owner |
next_step | string | Next step |
next_step_due_at | string | Next step due |
competitor | string | Competitor |
source | string | Source |
description | string | Notes |
win_reason | string | Why we won |
lost_reason | string | Why we lost |
curl -X PATCH https://synconone.com/api/v1/opportunities/pr_1a2b3c4d5e6f7a8b \
-H "Authorization: Bearer sk_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"Emily Carter","company":"string","stage":"string","amount":1,"currency":"string"}'{
"data": {
"id": "pr_1a2b3c4d5e6f7a8b",
"object": "string",
"name": "Emily Carter",
"company": "string",
"person": "string",
"pipeline": "string",
"stage": "string",
"stage_kind": "open",
"amount": 1,
"currency": "string"
}
}Errors: 401: Missing, invalid, revoked or expired API key. · 403: The key lacks the scope, or its role cannot do this. · 404: Not found, or not visible to this key. · 409: Conflict, approval required, or idempotent request in progress. · 422: Validation failed. · 429: Rate limited. Honour Retry-After.. See errors.
#Archive an opportunity
DELETE/api/v1/opportunities/{id}
Archives the record (it can be restored in the app). Nothing is destroyed.
| Parameter | In | Type | Notes |
|---|---|---|---|
id required | path | string | Public id of the opportunity. |
curl -X DELETE https://synconone.com/api/v1/opportunities/pr_1a2b3c4d5e6f7a8b \
-H "Authorization: Bearer sk_live_YOUR_KEY"{
"data": {
"id": "pr_1a2b3c4d5e6f7a8b",
"object": "string",
"archived": true
}
}Errors: 401: Missing, invalid, revoked or expired API key. · 403: The key lacks the scope, or its role cannot do this. · 404: Not found, or not visible to this key. · 422: Validation failed. · 429: Rate limited. Honour Retry-After.. See errors.