Skip to content

Update Opportunity Stage

PATCH /external/v1/opportunities/:id/stage

Updates only the status/stage of an opportunity in the pipeline.

Authentication

Requires opportunities:write permission.

Path Parameters

ParameterTypeRequiredDescription
idstringYesThe unique identifier of the opportunity

Request Body

FieldTypeRequiredDescription
statusstringYesNew pipeline status

Available Status Values

StatusDescription
newNew lead, not yet contacted
contactedFirst contact has been made
qualifiedLead has been qualified
proposalProposal has been sent
negotiationIn active negotiation
wonDeal closed successfully
lostDeal lost

INFO

When setting status to won, the won_at timestamp is automatically set. When setting status to lost, the lost_at timestamp is automatically set.

Request

bash
curl --request PATCH \
  --url "https://app.getraze.com/external/v1/opportunities/opp_abc123def456/stage" \
  --header "Content-Type: application/json" \
  --header "X-API-Key: YOUR_API_KEY" \
  --data '{
    "status": "won"
  }'
javascript
const axios = require('axios');

const opportunityId = 'opp_abc123def456';

const response = await axios.patch(
  `https://app.getraze.com/external/v1/opportunities/${opportunityId}/stage`,
  {
    status: 'won'
  },
  {
    headers: {
      'X-API-Key': 'YOUR_API_KEY',
      'Content-Type': 'application/json'
    }
  }
);

console.log(response.data);
python
import requests

opportunity_id = 'opp_abc123def456'

response = requests.patch(
    f'https://app.getraze.com/external/v1/opportunities/{opportunity_id}/stage',
    headers={
        'X-API-Key': 'YOUR_API_KEY',
        'Content-Type': 'application/json'
    },
    json={
        'status': 'won'
    }
)

print(response.json())

Response

json
{
  "success": true,
  "data": {
    "id": "opp_abc123def456",
    "name": "John Doe",
    "status": "won",
    "won_at": "2024-01-25T10:00:00Z",
    "updated_at": "2024-01-25T10:00:00Z"
  }
}

Errors

StatusCodeDescription
400INVALID_STATUSStatus value is not valid
404NOT_FOUNDOpportunity not found

GetRaze - AI-Powered Lead Generation