Upsert lead by CRM ID
curl --request POST \
--url https://app.forecastable.com/api/v1/leads/upsert \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"companyName": "<string>",
"description": "<string>",
"leadSourceDetail": "<string>",
"sfdcId": "<string>",
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"partnerAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"firstName": "<string>",
"lastName": "<string>",
"fullName": "<string>",
"email": "jsmith@example.com",
"title": "<string>",
"phone": "<string>",
"leadStatus": "<string>",
"salesforceUrl": "<string>",
"referringPartnerContactId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ownerUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ownerEmail": "jsmith@example.com",
"sfOwner": "<string>"
}
'import requests
url = "https://app.forecastable.com/api/v1/leads/upsert"
payload = {
"companyName": "<string>",
"description": "<string>",
"leadSourceDetail": "<string>",
"sfdcId": "<string>",
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"partnerAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"firstName": "<string>",
"lastName": "<string>",
"fullName": "<string>",
"email": "jsmith@example.com",
"title": "<string>",
"phone": "<string>",
"leadStatus": "<string>",
"salesforceUrl": "<string>",
"referringPartnerContactId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ownerUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ownerEmail": "jsmith@example.com",
"sfOwner": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
companyName: '<string>',
description: '<string>',
leadSourceDetail: '<string>',
sfdcId: '<string>',
accountId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
partnerAccountId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
firstName: '<string>',
lastName: '<string>',
fullName: '<string>',
email: 'jsmith@example.com',
title: '<string>',
phone: '<string>',
leadStatus: '<string>',
salesforceUrl: '<string>',
referringPartnerContactId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ownerUserId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ownerEmail: 'jsmith@example.com',
sfOwner: '<string>'
})
};
fetch('https://app.forecastable.com/api/v1/leads/upsert', 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://app.forecastable.com/api/v1/leads/upsert",
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([
'companyName' => '<string>',
'description' => '<string>',
'leadSourceDetail' => '<string>',
'sfdcId' => '<string>',
'accountId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'partnerAccountId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'firstName' => '<string>',
'lastName' => '<string>',
'fullName' => '<string>',
'email' => 'jsmith@example.com',
'title' => '<string>',
'phone' => '<string>',
'leadStatus' => '<string>',
'salesforceUrl' => '<string>',
'referringPartnerContactId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ownerUserId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ownerEmail' => 'jsmith@example.com',
'sfOwner' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://app.forecastable.com/api/v1/leads/upsert"
payload := strings.NewReader("{\n \"companyName\": \"<string>\",\n \"description\": \"<string>\",\n \"leadSourceDetail\": \"<string>\",\n \"sfdcId\": \"<string>\",\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"partnerAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"fullName\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"title\": \"<string>\",\n \"phone\": \"<string>\",\n \"leadStatus\": \"<string>\",\n \"salesforceUrl\": \"<string>\",\n \"referringPartnerContactId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerUserId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerEmail\": \"jsmith@example.com\",\n \"sfOwner\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://app.forecastable.com/api/v1/leads/upsert")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"companyName\": \"<string>\",\n \"description\": \"<string>\",\n \"leadSourceDetail\": \"<string>\",\n \"sfdcId\": \"<string>\",\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"partnerAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"fullName\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"title\": \"<string>\",\n \"phone\": \"<string>\",\n \"leadStatus\": \"<string>\",\n \"salesforceUrl\": \"<string>\",\n \"referringPartnerContactId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerUserId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerEmail\": \"jsmith@example.com\",\n \"sfOwner\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.forecastable.com/api/v1/leads/upsert")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"companyName\": \"<string>\",\n \"description\": \"<string>\",\n \"leadSourceDetail\": \"<string>\",\n \"sfdcId\": \"<string>\",\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"partnerAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"fullName\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"title\": \"<string>\",\n \"phone\": \"<string>\",\n \"leadStatus\": \"<string>\",\n \"salesforceUrl\": \"<string>\",\n \"referringPartnerContactId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerUserId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerEmail\": \"jsmith@example.com\",\n \"sfOwner\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"lead": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subscriberId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"companyName": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"description": "<string>",
"leadSource": "<string>",
"leadSourceDetail": "<string>",
"leadStatus": "<string>",
"ageDays": 1,
"createdDate": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"partnerAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sfdcId": "<string>",
"salesforceUrl": "<string>",
"fullName": "<string>",
"email": "jsmith@example.com",
"title": "<string>",
"phone": "<string>",
"referringPartnerContact": "<string>",
"referringPartnerContactId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sfOwner": "<string>",
"ownerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"history": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"changeType": "<string>",
"changedAt": "2023-11-07T05:31:56Z",
"changedById": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"beforeData": {},
"afterData": {}
}
]
},
"warnings": [
{
"message": "<string>",
"duplicateLeadIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
]
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Leads
Upsert lead by CRM ID
Create or update a lead matched by sfdcId within the organization (and optional account scope).
POST
/
leads
/
upsert
Upsert lead by CRM ID
curl --request POST \
--url https://app.forecastable.com/api/v1/leads/upsert \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"companyName": "<string>",
"description": "<string>",
"leadSourceDetail": "<string>",
"sfdcId": "<string>",
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"partnerAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"firstName": "<string>",
"lastName": "<string>",
"fullName": "<string>",
"email": "jsmith@example.com",
"title": "<string>",
"phone": "<string>",
"leadStatus": "<string>",
"salesforceUrl": "<string>",
"referringPartnerContactId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ownerUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ownerEmail": "jsmith@example.com",
"sfOwner": "<string>"
}
'import requests
url = "https://app.forecastable.com/api/v1/leads/upsert"
payload = {
"companyName": "<string>",
"description": "<string>",
"leadSourceDetail": "<string>",
"sfdcId": "<string>",
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"partnerAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"firstName": "<string>",
"lastName": "<string>",
"fullName": "<string>",
"email": "jsmith@example.com",
"title": "<string>",
"phone": "<string>",
"leadStatus": "<string>",
"salesforceUrl": "<string>",
"referringPartnerContactId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ownerUserId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"ownerEmail": "jsmith@example.com",
"sfOwner": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
companyName: '<string>',
description: '<string>',
leadSourceDetail: '<string>',
sfdcId: '<string>',
accountId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
partnerAccountId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
firstName: '<string>',
lastName: '<string>',
fullName: '<string>',
email: 'jsmith@example.com',
title: '<string>',
phone: '<string>',
leadStatus: '<string>',
salesforceUrl: '<string>',
referringPartnerContactId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ownerUserId: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
ownerEmail: 'jsmith@example.com',
sfOwner: '<string>'
})
};
fetch('https://app.forecastable.com/api/v1/leads/upsert', 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://app.forecastable.com/api/v1/leads/upsert",
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([
'companyName' => '<string>',
'description' => '<string>',
'leadSourceDetail' => '<string>',
'sfdcId' => '<string>',
'accountId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'partnerAccountId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'firstName' => '<string>',
'lastName' => '<string>',
'fullName' => '<string>',
'email' => 'jsmith@example.com',
'title' => '<string>',
'phone' => '<string>',
'leadStatus' => '<string>',
'salesforceUrl' => '<string>',
'referringPartnerContactId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ownerUserId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'ownerEmail' => 'jsmith@example.com',
'sfOwner' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://app.forecastable.com/api/v1/leads/upsert"
payload := strings.NewReader("{\n \"companyName\": \"<string>\",\n \"description\": \"<string>\",\n \"leadSourceDetail\": \"<string>\",\n \"sfdcId\": \"<string>\",\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"partnerAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"fullName\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"title\": \"<string>\",\n \"phone\": \"<string>\",\n \"leadStatus\": \"<string>\",\n \"salesforceUrl\": \"<string>\",\n \"referringPartnerContactId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerUserId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerEmail\": \"jsmith@example.com\",\n \"sfOwner\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://app.forecastable.com/api/v1/leads/upsert")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"companyName\": \"<string>\",\n \"description\": \"<string>\",\n \"leadSourceDetail\": \"<string>\",\n \"sfdcId\": \"<string>\",\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"partnerAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"fullName\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"title\": \"<string>\",\n \"phone\": \"<string>\",\n \"leadStatus\": \"<string>\",\n \"salesforceUrl\": \"<string>\",\n \"referringPartnerContactId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerUserId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerEmail\": \"jsmith@example.com\",\n \"sfOwner\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.forecastable.com/api/v1/leads/upsert")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"companyName\": \"<string>\",\n \"description\": \"<string>\",\n \"leadSourceDetail\": \"<string>\",\n \"sfdcId\": \"<string>\",\n \"accountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"partnerAccountId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"firstName\": \"<string>\",\n \"lastName\": \"<string>\",\n \"fullName\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"title\": \"<string>\",\n \"phone\": \"<string>\",\n \"leadStatus\": \"<string>\",\n \"salesforceUrl\": \"<string>\",\n \"referringPartnerContactId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerUserId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"ownerEmail\": \"jsmith@example.com\",\n \"sfOwner\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"lead": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"subscriberId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"companyName": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"description": "<string>",
"leadSource": "<string>",
"leadSourceDetail": "<string>",
"leadStatus": "<string>",
"ageDays": 1,
"createdDate": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"accountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"partnerAccountId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sfdcId": "<string>",
"salesforceUrl": "<string>",
"fullName": "<string>",
"email": "jsmith@example.com",
"title": "<string>",
"phone": "<string>",
"referringPartnerContact": "<string>",
"referringPartnerContactId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sfOwner": "<string>",
"ownerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"history": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"changeType": "<string>",
"changedAt": "2023-11-07T05:31:56Z",
"changedById": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"beforeData": {},
"afterData": {}
}
]
},
"warnings": [
{
"message": "<string>",
"duplicateLeadIds": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
]
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Authorizations
Partner OAuth2 flows for integration API access tokens. Claude MCP custom connectors use authorization code with PKCE S256.
Headers
Active organization UUID. Required for authenticated requests when the principal has access to multiple organizations.
Pattern:
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$Query Parameters
Read-only convenience alias for X-Organization-Id. Legacy subscriberId query param is also accepted.
Pattern:
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$Body
application/json
Minimum string length:
1Minimum string length:
1Minimum string length:
1Minimum string length:
1Pattern:
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$Pattern:
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$Pattern:
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$Pattern:
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$Was this page helpful?
⌘I