curl --request GET \
--url https://api.sapt.ai/projects/{projectId}/integrations/close/journey \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sapt.ai/projects/{projectId}/integrations/close/journey"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sapt.ai/projects/{projectId}/integrations/close/journey', 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.sapt.ai/projects/{projectId}/integrations/close/journey",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sapt.ai/projects/{projectId}/integrations/close/journey"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sapt.ai/projects/{projectId}/integrations/close/journey")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sapt.ai/projects/{projectId}/integrations/close/journey")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"close_lead_id": "<string>",
"matched": true,
"match_method": "close_lead_id",
"visitor_ids": [
"<string>"
],
"journey": {
"items": [
{
"id": "<string>",
"source": "ledger",
"kind": "web",
"type": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"title": "<string>",
"detail": {},
"scheduledFor": "2023-11-07T05:31:56Z",
"status": "sent",
"channel": "<string>",
"direction": "inbound",
"recordId": "<string>",
"workflowId": "<string>",
"provenance": {
"workflowId": "<string>",
"runId": "<string>",
"stepIndex": 123,
"totalSteps": 123,
"campaignId": "<string>"
},
"cancel": {
"kind": "workflow_run_v2",
"id": "<string>"
}
}
],
"nextCursor": "<string>",
"header": {
"firstTouch": {
"utm_source": "<string>",
"utm_medium": "<string>",
"utm_campaign": "<string>",
"utm_term": "<string>",
"utm_content": "<string>",
"gclid": "<string>",
"fbclid": "<string>",
"msclkid": "<string>",
"ttclid": "<string>",
"wbraid": "<string>",
"gbraid": "<string>",
"li_fat_id": "<string>",
"twclid": "<string>",
"epik": "<string>",
"dclid": "<string>",
"sapt_cid": "<string>",
"referrer": "<string>",
"landingPath": "<string>",
"userAgent": "<string>",
"ip": "<string>",
"fbc": "<string>",
"fbp": "<string>"
},
"lastTouch": {
"utm_source": "<string>",
"utm_medium": "<string>",
"utm_campaign": "<string>",
"utm_term": "<string>",
"utm_content": "<string>",
"gclid": "<string>",
"fbclid": "<string>",
"msclkid": "<string>",
"ttclid": "<string>",
"wbraid": "<string>",
"gbraid": "<string>",
"li_fat_id": "<string>",
"twclid": "<string>",
"epik": "<string>",
"dclid": "<string>",
"sapt_cid": "<string>",
"referrer": "<string>",
"landingPath": "<string>",
"userAgent": "<string>",
"ip": "<string>",
"fbc": "<string>",
"fbp": "<string>"
},
"firstSeenAt": "2023-11-07T05:31:56Z",
"lastSeenAt": "2023-11-07T05:31:56Z",
"webSessions": 123,
"pageviews": 123,
"revenueCents": 123,
"orderCount": 123,
"totalTouches": 123,
"deviceCount": 123,
"identities": {
"email": "<string>",
"phone": "<string>",
"socials": [
"<string>"
]
}
}
}
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}Get a Close lead journey
Return the Sapt web journey for one native Close lead without importing it into Sapt CRM. Sapt reads the lead from the project Close connection, then resolves every tracked browser by exact Close id, normalized email/phone, or a single-candidate fbclid. A valid lead with no tracked visit returns matched: false and an empty journey. Authenticate with Authorization: ApiKey <key> using a project service-account key scoped to crm_objects:read.
curl --request GET \
--url https://api.sapt.ai/projects/{projectId}/integrations/close/journey \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.sapt.ai/projects/{projectId}/integrations/close/journey"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.sapt.ai/projects/{projectId}/integrations/close/journey', 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.sapt.ai/projects/{projectId}/integrations/close/journey",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.sapt.ai/projects/{projectId}/integrations/close/journey"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sapt.ai/projects/{projectId}/integrations/close/journey")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sapt.ai/projects/{projectId}/integrations/close/journey")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"close_lead_id": "<string>",
"matched": true,
"match_method": "close_lead_id",
"visitor_ids": [
"<string>"
],
"journey": {
"items": [
{
"id": "<string>",
"source": "ledger",
"kind": "web",
"type": "<string>",
"occurredAt": "2023-11-07T05:31:56Z",
"title": "<string>",
"detail": {},
"scheduledFor": "2023-11-07T05:31:56Z",
"status": "sent",
"channel": "<string>",
"direction": "inbound",
"recordId": "<string>",
"workflowId": "<string>",
"provenance": {
"workflowId": "<string>",
"runId": "<string>",
"stepIndex": 123,
"totalSteps": 123,
"campaignId": "<string>"
},
"cancel": {
"kind": "workflow_run_v2",
"id": "<string>"
}
}
],
"nextCursor": "<string>",
"header": {
"firstTouch": {
"utm_source": "<string>",
"utm_medium": "<string>",
"utm_campaign": "<string>",
"utm_term": "<string>",
"utm_content": "<string>",
"gclid": "<string>",
"fbclid": "<string>",
"msclkid": "<string>",
"ttclid": "<string>",
"wbraid": "<string>",
"gbraid": "<string>",
"li_fat_id": "<string>",
"twclid": "<string>",
"epik": "<string>",
"dclid": "<string>",
"sapt_cid": "<string>",
"referrer": "<string>",
"landingPath": "<string>",
"userAgent": "<string>",
"ip": "<string>",
"fbc": "<string>",
"fbp": "<string>"
},
"lastTouch": {
"utm_source": "<string>",
"utm_medium": "<string>",
"utm_campaign": "<string>",
"utm_term": "<string>",
"utm_content": "<string>",
"gclid": "<string>",
"fbclid": "<string>",
"msclkid": "<string>",
"ttclid": "<string>",
"wbraid": "<string>",
"gbraid": "<string>",
"li_fat_id": "<string>",
"twclid": "<string>",
"epik": "<string>",
"dclid": "<string>",
"sapt_cid": "<string>",
"referrer": "<string>",
"landingPath": "<string>",
"userAgent": "<string>",
"ip": "<string>",
"fbc": "<string>",
"fbp": "<string>"
},
"firstSeenAt": "2023-11-07T05:31:56Z",
"lastSeenAt": "2023-11-07T05:31:56Z",
"webSessions": 123,
"pageviews": 123,
"revenueCents": 123,
"orderCount": 123,
"totalTouches": 123,
"deviceCount": 123,
"identities": {
"email": "<string>",
"phone": "<string>",
"socials": [
"<string>"
]
}
}
}
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}{
"message": "<string>",
"code": "<string>"
}Authorizations
JWT token obtained from /api/auth/token endpoint. Token is verified using JWKS and must include a valid user identifier.
Path Parameters
Query Parameters
5001 <= x <= 100Comma-separated journey kinds: web, communication, engagement, commerce, lifecycle, advertising, system.
Close lead id, for example lead_6ANU.
1 - 200Response
Success
Whether this Close lead resolved to at least one tracked Sapt visitor.
Strongest resolution signal used: an exact stamped Close id, normalized email/phone, or a single-candidate first-touch fbclid.
close_lead_id, identity, fbclid, null Every first-party browser/device included in the returned journey.
Show child attributes
Show child attributes