Skip to main content
Update Opportunity
PUT https://services.leadconnectorhq.com/opportunities/{id}

Autorización

Authorization
string
required
Bearer token generado desde el portal Leadway. Ver Autenticación.
Version
string
default:"2021-07-28"
required
Versión de la API.

Path parameters

id
string
default:"yWQobCRIhRguQtD2llvk"
required
Opportunity Id

Body

pipelineId
string
default:"bCkKGpDsyPP4peuKowkG"
pipeline Id
name
string
default:"First Opps"
pipelineStageId
string
default:"7915dedc-8f18-44d5-8bc3-77c04e994a10"
status
string
Posibles valores: ‘open’, ‘won’, ‘lost’, ‘abandoned’, ‘all’
monetaryValue
number
default:"220"
assignedTo
string
default:"082goXVW3lIExEQPOnd3"
customFields
object[]
Update custom fields to opportunities.

Respuestas

opportunity
object
{
  "opportunity": {
    "id": "yWQobCRIhRguQtD2llvk",
    "name": "testing",
    "monetaryValue": 500,
    "pipelineId": "VDm7RPYC2GLUvdpKmBfC",
    "pipelineStageId": "e93ba61a-53b3-45e7-985a-c7732dbcdb69",
    "assignedTo": "zT46WSCPbudrq4zhWMk6",
    "status": "open",
    "source": "",
    "lastStatusChangeAt": "2021-08-03T04:55:17.355Z",
    "lastStageChangeAt": "2021-08-03T04:55:17.355Z",
    "lastActionDate": "2021-08-03T04:55:17.355Z",
    "indexVersion": 1,
    "createdAt": "2021-08-03T04:55:17.355Z",
    "updatedAt": "2021-08-03T04:55:17.355Z",
    "contactId": "zT46WSCPbudrq4zhWMk6",
    "locationId": "zT46WSCPbudrq4zhW",
    "contact": {
      "id": "byMEV0NQinDhq8ZfiOi2",
      "name": "John Deo",
      "companyName": "Tesla Inc",
      "email": "john@deo.com",
      "phone": "+1202-555-0107",
      "tags": [
        "string"
      ]
    },
    "notes": [
      []
    ],
    "tasks": [
      []
    ],
    "calendarEvents": [
      []
    ],
    "lostReasonId": "zT46WSCPbudrq4zhWMk6",
    "customFields": [
  // truncado: 10 lineas mas
}
{}
{}
{}

Ejemplo

curl -X PUT 'https://services.leadconnectorhq.com/opportunities/YOUR_id' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Version: 2021-07-28' \
  -H 'Content-Type: application/json' \
  -d '{
  "pipelineId": "bCkKGpDsyPP4peuKowkG",
  "name": "First Opps",
  "pipelineStageId": "7915dedc-8f18-44d5-8bc3-77c04e994a10",
  "status": "open",
  "monetaryValue": 220,
  "assignedTo": "082goXVW3lIExEQPOnd3",
  "customFields": []
}'
const response = await fetch('https://services.leadconnectorhq.com/opportunities/YOUR_id', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
    Version: '2021-07-28',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"pipelineId": "bCkKGpDsyPP4peuKowkG", "name": "First Opps", "pipelineStageId": "7915dedc-8f18-44d5-8bc3-77c04e994a10", "status": "open", "monetaryValue": 220, "assignedTo": "082goXVW3lIExEQPOnd3", "customFields": []}),
});
const data = await response.json();
import os, requests
response = requests.request(
    'PUT',
    'https://services.leadconnectorhq.com/opportunities/YOUR_id',
    headers={
        'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
        'Version': '2021-07-28',
        'Content-Type': 'application/json',
    },
    json={"pipelineId": "bCkKGpDsyPP4peuKowkG", "name": "First Opps", "pipelineStageId": "7915dedc-8f18-44d5-8bc3-77c04e994a10", "status": "open", "monetaryValue": 220, "assignedTo": "082goXVW3lIExEQPOnd3", "customFields": []},
)
data = response.json()
<?php
$ch = curl_init('https://services.leadconnectorhq.com/opportunities/YOUR_id');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
        'Version: 2021-07-28',
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode({'pipelineId': 'bCkKGpDsyPP4peuKowkG', 'name': 'First Opps', 'pipelineStageId': '7915dedc-8f18-44d5-8bc3-77c04e994a10', 'status': 'open', 'monetaryValue': 220, 'assignedTo': '082goXVW3lIExEQPOnd3', 'customFields': []}),
]);
$data = json_decode(curl_exec($ch), true);