Skip to main content
Opportunities

Endpoints

Available endpoints for managing opportunities.
MethodPathDescription
GET/api/opportunities/List opportunities
POST/api/opportunities/Create an opportunity
GET/api/opportunities/{id}/Get an opportunity
PATCH/api/opportunities/{id}/Update an opportunity
DELETE/api/opportunities/{id}/Delete an opportunity

Opportunities

List Opportunities

GET /api/opportunities/
Authorization: Bearer <token>
Retrieve a paginated list of opportunities with optional filters.
Query Parameters:
ParameterTypeDescription
pageintegerPage number
limitintegerResults per page (max: 100)
stagestringFilter by pipeline stage
accountIdstringFilter by account
assignedTostringFilter by assigned user ID
closeDateAfterISO8601Filter by expected close date
closeDateBeforeISO8601Filter by expected close date
valueMinnumberFilter by minimum deal value
valueMaxnumberFilter by maximum deal value
searchstringSearch by opportunity name
Response:
{
  "count": 18,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": "opp_01HX...",
      "name": "Acme Corp — Enterprise License",
      "accountId": "acc_01HX...",
      "accountName": "Acme Corp",
      "value": 48000,
      "stage": "negotiation",
      "probability": 70,
      "closeDate": "2025-04-30",
      "assignedTo": "usr_01HX...",
      "source": "inbound",
      "createdAt": "2025-01-20T10:00:00Z",
      "updatedAt": "2025-03-15T09:30:00Z"
    }
  ]
}

Creation

Create an Opportunity

POST /api/opportunities/
Authorization: Bearer <token>
Content-Type: application/json
Create a new opportunity linked to an account.
Request body:
{
  "name": "TechCorp — Professional Services Q2",
  "accountId": "acc_02HX...",
  "value": 24000,
  "stage": "qualification",
  "probability": 40,
  "closeDate": "2025-06-30",
  "assignedTo": "usr_01HX...",
  "source": "outbound",
  "contactIds": ["cnt_01HX...", "cnt_03HX..."],
  "description": "Professional services engagement for data migration project"
}
Required fields: name, accountId Response: 201 Created
Opportunity Details

Get an Opportunity

GET /api/opportunities/{id}/
Authorization: Bearer <token>
Retrieve full details of a specific opportunity.
Response:
{
  "id": "opp_01HX...",
  "name": "TechCorp — Professional Services Q2",
  "accountId": "acc_02HX...",
  "accountName": "TechCorp Inc",
  "value": 24000,
  "stage": "qualification",
  "probability": 40,
  "closeDate": "2025-06-30",
  "closedDate": null,
  "lossReason": null,
  "assignedTo": "usr_01HX...",
  "assignedToName": "Alex Johnson",
  "source": "outbound",
  "contactIds": ["cnt_01HX...", "cnt_03HX..."],
  "description": "Professional services engagement for data migration project",
  "createdAt": "2025-03-01T12:00:00Z",
  "updatedAt": "2025-03-01T12:00:00Z"
}

Updates

Update an Opportunity

PATCH /api/opportunities/{id}/
Authorization: Bearer <token>
Content-Type: application/json
Update fields such as stage, probability, or outcome.
Example — close a deal:
{
  "stage": "closed_won",
  "closedDate": "2025-03-25",
  "probability": 100
}
Example — log a loss:
{
  "stage": "closed_lost",
  "lossReason": "Chose competitor — price was primary objection"
}
Response: 200 OK with the updated opportunity object.
Deletion

Delete an Opportunity

DELETE /api/opportunities/{id}/
Authorization: Bearer <token>
Permanently remove an opportunity.
Response: 204 No Content
Pipeline

Pipeline Stage Values

ValueLabel
prospectingProspecting
qualificationQualification
needs_analysisNeeds Analysis
proposalProposal
negotiationNegotiation
closed_wonClosed Won
closed_lostClosed Lost