Create an opportunity
curl --request POST \
--url https://api.gospott.com/opportunities \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"companyId": "<string>",
"name": "<string>",
"description": "<string>",
"stageId": "<string>",
"closeDate": {
"target": "2023-11-07T05:31:56Z"
},
"ownerId": "<string>",
"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"
payload = {
"companyId": "<string>",
"name": "<string>",
"description": "<string>",
"stageId": "<string>",
"closeDate": { "target": "2023-11-07T05:31:56Z" },
"ownerId": "<string>",
"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.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
companyId: '<string>',
name: '<string>',
description: '<string>',
stageId: '<string>',
closeDate: {target: '2023-11-07T05:31:56Z'},
ownerId: '<string>',
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', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'companyId' => '<string>',
'name' => '<string>',
'description' => '<string>',
'stageId' => '<string>',
'closeDate' => [
'target' => '2023-11-07T05:31:56Z'
],
'ownerId' => '<string>',
'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"
payload := strings.NewReader("{\n \"companyId\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"stageId\": \"<string>\",\n \"closeDate\": {\n \"target\": \"2023-11-07T05:31:56Z\"\n },\n \"ownerId\": \"<string>\",\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("POST", 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.post("https://api.gospott.com/opportunities")
.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 \"closeDate\": {\n \"target\": \"2023-11-07T05:31:56Z\"\n },\n \"ownerId\": \"<string>\",\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")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.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 \"closeDate\": {\n \"target\": \"2023-11-07T05:31:56Z\"\n },\n \"ownerId\": \"<string>\",\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{
"id": "<string>"
}{
"status": 0,
"message": "Company ID is required for creating an opportunity",
"requestId": "<string>",
"statusCode": 400,
"error": "Bad Request"
}{
"status": 0,
"message": "<string>",
"requestId": "<string>"
}{
"status": 0,
"message": "<string>",
"requestId": "<string>"
}Opportunities
Create an opportunity
Creates a new opportunity. Provide the company, pipeline stage, estimated value, and other opportunity details.
POST
/
opportunities
Create an opportunity
curl --request POST \
--url https://api.gospott.com/opportunities \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"companyId": "<string>",
"name": "<string>",
"description": "<string>",
"stageId": "<string>",
"closeDate": {
"target": "2023-11-07T05:31:56Z"
},
"ownerId": "<string>",
"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"
payload = {
"companyId": "<string>",
"name": "<string>",
"description": "<string>",
"stageId": "<string>",
"closeDate": { "target": "2023-11-07T05:31:56Z" },
"ownerId": "<string>",
"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.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
companyId: '<string>',
name: '<string>',
description: '<string>',
stageId: '<string>',
closeDate: {target: '2023-11-07T05:31:56Z'},
ownerId: '<string>',
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', 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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'companyId' => '<string>',
'name' => '<string>',
'description' => '<string>',
'stageId' => '<string>',
'closeDate' => [
'target' => '2023-11-07T05:31:56Z'
],
'ownerId' => '<string>',
'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"
payload := strings.NewReader("{\n \"companyId\": \"<string>\",\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"stageId\": \"<string>\",\n \"closeDate\": {\n \"target\": \"2023-11-07T05:31:56Z\"\n },\n \"ownerId\": \"<string>\",\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("POST", 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.post("https://api.gospott.com/opportunities")
.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 \"closeDate\": {\n \"target\": \"2023-11-07T05:31:56Z\"\n },\n \"ownerId\": \"<string>\",\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")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.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 \"closeDate\": {\n \"target\": \"2023-11-07T05:31:56Z\"\n },\n \"ownerId\": \"<string>\",\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{
"id": "<string>"
}{
"status": 0,
"message": "Company ID is required for creating an opportunity",
"requestId": "<string>",
"statusCode": 400,
"error": "Bad Request"
}{
"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.
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 to assign to this opportunity
Minimum string length:
1The target closing date for this opportunity
Show child attributes
Show child attributes
The user ID of the opportunity owner
Minimum string length:
1Client contacts to associate with this opportunity
Show child attributes
Show child attributes
Physical locations for the opportunity (0 to 15).
Maximum array length:
15Show child attributes
Show child attributes
Response
Opportunity created successfully. Returns the opportunity ID.
Minimum string length:
1⌘I

