Update an opportunity
curl --request PATCH \
--url https://api.gospott.com/opportunities/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"companyId": "<string>",
"name": "<string>",
"description": "<string>",
"stageId": "<string>",
"ownerId": "<string>",
"closeDate": {
"target": "2023-11-07T05:31:56Z"
},
"clientTeam": [
{
"id": "<string>"
}
],
"locations": [
{
"street1": "<string>",
"street2": "<string>",
"postalCode": "<string>",
"city": "<string>",
"region": "<string>",
"state": "<string>",
"country": "<string>",
"latitude": 123,
"longitude": 123
}
]
}
'import requests
url = "https://api.gospott.com/opportunities/{id}"
payload = {
"companyId": "<string>",
"name": "<string>",
"description": "<string>",
"stageId": "<string>",
"ownerId": "<string>",
"closeDate": { "target": "2023-11-07T05:31:56Z" },
"clientTeam": [{ "id": "<string>" }],
"locations": [
{
"street1": "<string>",
"street2": "<string>",
"postalCode": "<string>",
"city": "<string>",
"region": "<string>",
"state": "<string>",
"country": "<string>",
"latitude": 123,
"longitude": 123
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
companyId: '<string>',
name: '<string>',
description: '<string>',
stageId: '<string>',
ownerId: '<string>',
closeDate: {target: '2023-11-07T05:31:56Z'},
clientTeam: [{id: '<string>'}],
locations: [
{
street1: '<string>',
street2: '<string>',
postalCode: '<string>',
city: '<string>',
region: '<string>',
state: '<string>',
country: '<string>',
latitude: 123,
longitude: 123
}
]
})
};
fetch('https://api.gospott.com/opportunities/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gospott.com/opportunities/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'companyId' => '<string>',
'name' => '<string>',
'description' => '<string>',
'stageId' => '<string>',
'ownerId' => '<string>',
'closeDate' => [
'target' => '2023-11-07T05:31:56Z'
],
'clientTeam' => [
[
'id' => '<string>'
]
],
'locations' => [
[
'street1' => '<string>',
'street2' => '<string>',
'postalCode' => '<string>',
'city' => '<string>',
'region' => '<string>',
'state' => '<string>',
'country' => '<string>',
'latitude' => 123,
'longitude' => 123
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gospott.com/opportunities/{id}"
payload := strings.NewReader("{\n \"companyId\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"stageId\": \"<string>\",\n \"ownerId\": \"<string>\",\n \"closeDate\": {\n \"target\": \"2023-11-07T05:31:56Z\"\n },\n \"clientTeam\": [\n {\n \"id\": \"<string>\"\n }\n ],\n \"locations\": [\n {\n \"street1\": \"<string>\",\n \"street2\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.gospott.com/opportunities/{id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"companyId\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"stageId\": \"<string>\",\n \"ownerId\": \"<string>\",\n \"closeDate\": {\n \"target\": \"2023-11-07T05:31:56Z\"\n },\n \"clientTeam\": [\n {\n \"id\": \"<string>\"\n }\n ],\n \"locations\": [\n {\n \"street1\": \"<string>\",\n \"street2\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gospott.com/opportunities/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"companyId\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"stageId\": \"<string>\",\n \"ownerId\": \"<string>\",\n \"closeDate\": {\n \"target\": \"2023-11-07T05:31:56Z\"\n },\n \"clientTeam\": [\n {\n \"id\": \"<string>\"\n }\n ],\n \"locations\": [\n {\n \"street1\": \"<string>\",\n \"street2\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": 0,
"message": "<string>",
"requestId": "<string>"
}{
"status": 0,
"message": "<string>",
"requestId": "<string>"
}{
"status": 0,
"message": "<string>",
"requestId": "<string>"
}{
"status": 0,
"message": "<string>",
"requestId": "<string>"
}Opportunities
Update an opportunity
Updates the opportunity with the specified ID. You can update stage, close date, and other opportunity properties.
PATCH
/
opportunities
/
{id}
Update an opportunity
curl --request PATCH \
--url https://api.gospott.com/opportunities/{id} \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"companyId": "<string>",
"name": "<string>",
"description": "<string>",
"stageId": "<string>",
"ownerId": "<string>",
"closeDate": {
"target": "2023-11-07T05:31:56Z"
},
"clientTeam": [
{
"id": "<string>"
}
],
"locations": [
{
"street1": "<string>",
"street2": "<string>",
"postalCode": "<string>",
"city": "<string>",
"region": "<string>",
"state": "<string>",
"country": "<string>",
"latitude": 123,
"longitude": 123
}
]
}
'import requests
url = "https://api.gospott.com/opportunities/{id}"
payload = {
"companyId": "<string>",
"name": "<string>",
"description": "<string>",
"stageId": "<string>",
"ownerId": "<string>",
"closeDate": { "target": "2023-11-07T05:31:56Z" },
"clientTeam": [{ "id": "<string>" }],
"locations": [
{
"street1": "<string>",
"street2": "<string>",
"postalCode": "<string>",
"city": "<string>",
"region": "<string>",
"state": "<string>",
"country": "<string>",
"latitude": 123,
"longitude": 123
}
]
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
companyId: '<string>',
name: '<string>',
description: '<string>',
stageId: '<string>',
ownerId: '<string>',
closeDate: {target: '2023-11-07T05:31:56Z'},
clientTeam: [{id: '<string>'}],
locations: [
{
street1: '<string>',
street2: '<string>',
postalCode: '<string>',
city: '<string>',
region: '<string>',
state: '<string>',
country: '<string>',
latitude: 123,
longitude: 123
}
]
})
};
fetch('https://api.gospott.com/opportunities/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.gospott.com/opportunities/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'companyId' => '<string>',
'name' => '<string>',
'description' => '<string>',
'stageId' => '<string>',
'ownerId' => '<string>',
'closeDate' => [
'target' => '2023-11-07T05:31:56Z'
],
'clientTeam' => [
[
'id' => '<string>'
]
],
'locations' => [
[
'street1' => '<string>',
'street2' => '<string>',
'postalCode' => '<string>',
'city' => '<string>',
'region' => '<string>',
'state' => '<string>',
'country' => '<string>',
'latitude' => 123,
'longitude' => 123
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.gospott.com/opportunities/{id}"
payload := strings.NewReader("{\n \"companyId\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"stageId\": \"<string>\",\n \"ownerId\": \"<string>\",\n \"closeDate\": {\n \"target\": \"2023-11-07T05:31:56Z\"\n },\n \"clientTeam\": [\n {\n \"id\": \"<string>\"\n }\n ],\n \"locations\": [\n {\n \"street1\": \"<string>\",\n \"street2\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://api.gospott.com/opportunities/{id}")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"companyId\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"stageId\": \"<string>\",\n \"ownerId\": \"<string>\",\n \"closeDate\": {\n \"target\": \"2023-11-07T05:31:56Z\"\n },\n \"clientTeam\": [\n {\n \"id\": \"<string>\"\n }\n ],\n \"locations\": [\n {\n \"street1\": \"<string>\",\n \"street2\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gospott.com/opportunities/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"companyId\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"stageId\": \"<string>\",\n \"ownerId\": \"<string>\",\n \"closeDate\": {\n \"target\": \"2023-11-07T05:31:56Z\"\n },\n \"clientTeam\": [\n {\n \"id\": \"<string>\"\n }\n ],\n \"locations\": [\n {\n \"street1\": \"<string>\",\n \"street2\": \"<string>\",\n \"postalCode\": \"<string>\",\n \"city\": \"<string>\",\n \"region\": \"<string>\",\n \"state\": \"<string>\",\n \"country\": \"<string>\",\n \"latitude\": 123,\n \"longitude\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": 0,
"message": "<string>",
"requestId": "<string>"
}{
"status": 0,
"message": "<string>",
"requestId": "<string>"
}{
"status": 0,
"message": "<string>",
"requestId": "<string>"
}{
"status": 0,
"message": "<string>",
"requestId": "<string>"
}Authorizations
API key for authentication. Get your API key from Settings → API Keys in your Spott dashboard.
Path Parameters
Body
application/json
The ID of the company this opportunity belongs to
Minimum string length:
1The name of the opportunity
Minimum string length:
1Detailed description of the opportunity
The pipeline stage ID
Minimum string length:
1The user ID of the opportunity owner. Set to null to remove the owner.
Minimum string length:
1The target close date. Set to null to clear the close date.
Show child attributes
Show child attributes
Client contacts to associate with this opportunity
Show child attributes
Show child attributes
Physical locations for the opportunity (0 to 15). Omit to leave unchanged; send an empty array to clear all.
Maximum array length:
15Show child attributes
Show child attributes
Response
Opportunity updated successfully
⌘I

