Skip to content

Update Opportunity

PUT /external/v1/opportunities/:id

Updates an existing opportunity. Only provided fields will be updated.

Authentication

Requires opportunities:write permission.

Path Parameters

ParameterTypeRequiredDescription
idstringYesThe unique identifier of the opportunity

Request Body

All fields are optional. Only include fields you want to update.

FieldTypeDescription
namestringFull name
emailstringEmail address
phonestringPhone number
companystringCompany name
positionstringJob title
deal_valuenumberDeal value
deal_currencystringCurrency code
notesstringAdditional notes
responsible_user_idstringAssigned user ID

TIP

To update the opportunity status/stage, use the Update Stage endpoint instead.

Request

bash
curl --request PUT \
  --url "https://app.getraze.com/external/v1/opportunities/opp_abc123def456" \
  --header "Content-Type: application/json" \
  --header "X-API-Key: YOUR_API_KEY" \
  --data '{
    "deal_value": 100000,
    "notes": "Upgraded to enterprise package"
  }'
javascript
const axios = require('axios');

const opportunityId = 'opp_abc123def456';

const response = await axios.put(
  `https://app.getraze.com/external/v1/opportunities/${opportunityId}`,
  {
    deal_value: 100000,
    notes: 'Upgraded to enterprise package'
  },
  {
    headers: {
      'X-API-Key': 'YOUR_API_KEY',
      'Content-Type': 'application/json'
    }
  }
);

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

opportunity_id = 'opp_abc123def456'

response = requests.put(
    f'https://app.getraze.com/external/v1/opportunities/{opportunity_id}',
    headers={
        'X-API-Key': 'YOUR_API_KEY',
        'Content-Type': 'application/json'
    },
    json={
        'deal_value': 100000,
        'notes': 'Upgraded to enterprise package'
    }
)

print(response.json())

Response

json
{
  "success": true,
  "data": {
    "id": "opp_abc123def456",
    "name": "John Doe",
    "email": "john@example.com",
    "company": "Acme Inc",
    "status": "qualified",
    "deal_value": 100000.00,
    "deal_currency": "BRL",
    "notes": "Upgraded to enterprise package",
    "updated_at": "2024-01-25T10:00:00Z"
  }
}

Errors

StatusCodeDescription
400VALIDATION_ERRORInvalid field values
404NOT_FOUNDOpportunity not found

GetRaze - AI-Powered Lead Generation