Update stages for multiple leads
curl --request PATCH \
--url https://{host}/primula/api/v3/leads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"lead_id": "44444444-4444-4444-8444-444444444444",
"stages": {
"stage_tour_completed": true
}
}
]
'import requests
url = "https://{host}/primula/api/v3/leads"
payload = [
{
"lead_id": "44444444-4444-4444-8444-444444444444",
"stages": { "stage_tour_completed": True }
}
]
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
lead_id: '44444444-4444-4444-8444-444444444444',
stages: {stage_tour_completed: true}
}
])
};
fetch('https://{host}/primula/api/v3/leads', 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://{host}/primula/api/v3/leads",
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([
[
'lead_id' => '44444444-4444-4444-8444-444444444444',
'stages' => [
'stage_tour_completed' => true
]
]
]),
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://{host}/primula/api/v3/leads"
payload := strings.NewReader("[\n {\n \"lead_id\": \"44444444-4444-4444-8444-444444444444\",\n \"stages\": {\n \"stage_tour_completed\": true\n }\n }\n]")
req, _ := http.NewRequest("PATCH", 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.patch("https://{host}/primula/api/v3/leads")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"lead_id\": \"44444444-4444-4444-8444-444444444444\",\n \"stages\": {\n \"stage_tour_completed\": true\n }\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/primula/api/v3/leads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"lead_id\": \"44444444-4444-4444-8444-444444444444\",\n \"stages\": {\n \"stage_tour_completed\": true\n }\n }\n]"
response = http.request(request)
puts response.read_body[
{
"lead_id": "<string>",
"stages": [
{
"stage": "<string>",
"value": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}
]
}
]Leads
Update stages for multiple leads
Requires school_id assigned to the session. The body is an array of 1 to 200 items, each with lead_id and at least one non-null stage. All items are validated before writes. Missing leads are omitted from the response. Repeated lead IDs are allowed; each appears once in the response in first-occurrence order with its final stages. The batch is not atomic: a database failure returns 500 and stops processing after any earlier writes.
PATCH
/
leads
Update stages for multiple leads
curl --request PATCH \
--url https://{host}/primula/api/v3/leads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
[
{
"lead_id": "44444444-4444-4444-8444-444444444444",
"stages": {
"stage_tour_completed": true
}
}
]
'import requests
url = "https://{host}/primula/api/v3/leads"
payload = [
{
"lead_id": "44444444-4444-4444-8444-444444444444",
"stages": { "stage_tour_completed": True }
}
]
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
lead_id: '44444444-4444-4444-8444-444444444444',
stages: {stage_tour_completed: true}
}
])
};
fetch('https://{host}/primula/api/v3/leads', 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://{host}/primula/api/v3/leads",
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([
[
'lead_id' => '44444444-4444-4444-8444-444444444444',
'stages' => [
'stage_tour_completed' => true
]
]
]),
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://{host}/primula/api/v3/leads"
payload := strings.NewReader("[\n {\n \"lead_id\": \"44444444-4444-4444-8444-444444444444\",\n \"stages\": {\n \"stage_tour_completed\": true\n }\n }\n]")
req, _ := http.NewRequest("PATCH", 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.patch("https://{host}/primula/api/v3/leads")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("[\n {\n \"lead_id\": \"44444444-4444-4444-8444-444444444444\",\n \"stages\": {\n \"stage_tour_completed\": true\n }\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/primula/api/v3/leads")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"lead_id\": \"44444444-4444-4444-8444-444444444444\",\n \"stages\": {\n \"stage_tour_completed\": true\n }\n }\n]"
response = http.request(request)
puts response.read_body[
{
"lead_id": "<string>",
"stages": [
{
"stage": "<string>",
"value": "<string>",
"updated_at": "2023-11-07T05:31:56Z"
}
]
}
]Authorizations
Access token issued by POST /sessions and associated with a valid server-side session.
Query Parameters
Company UUID. Must equal the authenticated session company when that session has a company assigned; the equality check is skipped for sessions without one.
School UUID. Must be assigned to the authenticated session.
Body
application/json