curl --request POST \
--url https://public-api.lonescale.com/trigger/crm-sync \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"settings_type": "<string>",
"contacts": [
{
"account_crm_id": "<string>",
"contact_crm_id": "<string>"
}
],
"companies": [
{
"account_crm_id": "<string>",
"contact_crm_id": "<string>"
}
],
"webhook_url": "<string>",
"webhook_id": "<string>",
"idempotency_key": "<string>",
"trigger_by": "<string>"
}
'import requests
url = "https://public-api.lonescale.com/trigger/crm-sync"
payload = {
"settings_type": "<string>",
"contacts": [
{
"account_crm_id": "<string>",
"contact_crm_id": "<string>"
}
],
"companies": [
{
"account_crm_id": "<string>",
"contact_crm_id": "<string>"
}
],
"webhook_url": "<string>",
"webhook_id": "<string>",
"idempotency_key": "<string>",
"trigger_by": "<string>"
}
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({
settings_type: '<string>',
contacts: [{account_crm_id: '<string>', contact_crm_id: '<string>'}],
companies: [{account_crm_id: '<string>', contact_crm_id: '<string>'}],
webhook_url: '<string>',
webhook_id: '<string>',
idempotency_key: '<string>',
trigger_by: '<string>'
})
};
fetch('https://public-api.lonescale.com/trigger/crm-sync', 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://public-api.lonescale.com/trigger/crm-sync",
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([
'settings_type' => '<string>',
'contacts' => [
[
'account_crm_id' => '<string>',
'contact_crm_id' => '<string>'
]
],
'companies' => [
[
'account_crm_id' => '<string>',
'contact_crm_id' => '<string>'
]
],
'webhook_url' => '<string>',
'webhook_id' => '<string>',
'idempotency_key' => '<string>',
'trigger_by' => '<string>'
]),
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://public-api.lonescale.com/trigger/crm-sync"
payload := strings.NewReader("{\n \"settings_type\": \"<string>\",\n \"contacts\": [\n {\n \"account_crm_id\": \"<string>\",\n \"contact_crm_id\": \"<string>\"\n }\n ],\n \"companies\": [\n {\n \"account_crm_id\": \"<string>\",\n \"contact_crm_id\": \"<string>\"\n }\n ],\n \"webhook_url\": \"<string>\",\n \"webhook_id\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"trigger_by\": \"<string>\"\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://public-api.lonescale.com/trigger/crm-sync")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"settings_type\": \"<string>\",\n \"contacts\": [\n {\n \"account_crm_id\": \"<string>\",\n \"contact_crm_id\": \"<string>\"\n }\n ],\n \"companies\": [\n {\n \"account_crm_id\": \"<string>\",\n \"contact_crm_id\": \"<string>\"\n }\n ],\n \"webhook_url\": \"<string>\",\n \"webhook_id\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"trigger_by\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public-api.lonescale.com/trigger/crm-sync")
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 \"settings_type\": \"<string>\",\n \"contacts\": [\n {\n \"account_crm_id\": \"<string>\",\n \"contact_crm_id\": \"<string>\"\n }\n ],\n \"companies\": [\n {\n \"account_crm_id\": \"<string>\",\n \"contact_crm_id\": \"<string>\"\n }\n ],\n \"webhook_url\": \"<string>\",\n \"webhook_id\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"trigger_by\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "processing",
"createdAt": "2023-11-07T05:31:56Z",
"records_received": 123,
"crm": "hubspot"
}{
"message": "Invalid API Key",
"error": "Unauthorized",
"statusCode": 401
}{
"message": "Multiple CRMs have mapping settings (hubspot, salesforce); pass \"crm\" to pick one",
"error": "Conflict",
"statusCode": 409
}{
"message": "No hubspot integration mapping settings found; configure the hubspot integration in LoneScale first",
"error": "Unprocessable Entity",
"statusCode": 422
}CRM Sync
Push contacts and/or companies directly into your connected CRM. LoneScale creates or updates the records asynchronously, applying the team-level integration field mappings already configured in LoneScale (create/update fields and unicity criteria). No workflow is involved.
Record keys must match the LoneScale field keys referenced by your configured mappings (for example lonescale_first_name, lonescale_company_domain, or any custom key you mapped); see Available Fields for the full list. For Salesforce the mapping also decides the object: map only the Lead section and the sync searches, updates or creates Leads instead of Contacts. Set account_crm_id on a record to target an existing CRM company by id instead of matching by unicity criteria.
Poll GET /trigger/crm-sync/{id} with the returned id, or pass a webhook_url to be called once with the run summary when every record has been processed.
curl --request POST \
--url https://public-api.lonescale.com/trigger/crm-sync \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"settings_type": "<string>",
"contacts": [
{
"account_crm_id": "<string>",
"contact_crm_id": "<string>"
}
],
"companies": [
{
"account_crm_id": "<string>",
"contact_crm_id": "<string>"
}
],
"webhook_url": "<string>",
"webhook_id": "<string>",
"idempotency_key": "<string>",
"trigger_by": "<string>"
}
'import requests
url = "https://public-api.lonescale.com/trigger/crm-sync"
payload = {
"settings_type": "<string>",
"contacts": [
{
"account_crm_id": "<string>",
"contact_crm_id": "<string>"
}
],
"companies": [
{
"account_crm_id": "<string>",
"contact_crm_id": "<string>"
}
],
"webhook_url": "<string>",
"webhook_id": "<string>",
"idempotency_key": "<string>",
"trigger_by": "<string>"
}
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({
settings_type: '<string>',
contacts: [{account_crm_id: '<string>', contact_crm_id: '<string>'}],
companies: [{account_crm_id: '<string>', contact_crm_id: '<string>'}],
webhook_url: '<string>',
webhook_id: '<string>',
idempotency_key: '<string>',
trigger_by: '<string>'
})
};
fetch('https://public-api.lonescale.com/trigger/crm-sync', 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://public-api.lonescale.com/trigger/crm-sync",
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([
'settings_type' => '<string>',
'contacts' => [
[
'account_crm_id' => '<string>',
'contact_crm_id' => '<string>'
]
],
'companies' => [
[
'account_crm_id' => '<string>',
'contact_crm_id' => '<string>'
]
],
'webhook_url' => '<string>',
'webhook_id' => '<string>',
'idempotency_key' => '<string>',
'trigger_by' => '<string>'
]),
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://public-api.lonescale.com/trigger/crm-sync"
payload := strings.NewReader("{\n \"settings_type\": \"<string>\",\n \"contacts\": [\n {\n \"account_crm_id\": \"<string>\",\n \"contact_crm_id\": \"<string>\"\n }\n ],\n \"companies\": [\n {\n \"account_crm_id\": \"<string>\",\n \"contact_crm_id\": \"<string>\"\n }\n ],\n \"webhook_url\": \"<string>\",\n \"webhook_id\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"trigger_by\": \"<string>\"\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://public-api.lonescale.com/trigger/crm-sync")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"settings_type\": \"<string>\",\n \"contacts\": [\n {\n \"account_crm_id\": \"<string>\",\n \"contact_crm_id\": \"<string>\"\n }\n ],\n \"companies\": [\n {\n \"account_crm_id\": \"<string>\",\n \"contact_crm_id\": \"<string>\"\n }\n ],\n \"webhook_url\": \"<string>\",\n \"webhook_id\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"trigger_by\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://public-api.lonescale.com/trigger/crm-sync")
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 \"settings_type\": \"<string>\",\n \"contacts\": [\n {\n \"account_crm_id\": \"<string>\",\n \"contact_crm_id\": \"<string>\"\n }\n ],\n \"companies\": [\n {\n \"account_crm_id\": \"<string>\",\n \"contact_crm_id\": \"<string>\"\n }\n ],\n \"webhook_url\": \"<string>\",\n \"webhook_id\": \"<string>\",\n \"idempotency_key\": \"<string>\",\n \"trigger_by\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"status": "processing",
"createdAt": "2023-11-07T05:31:56Z",
"records_received": 123,
"crm": "hubspot"
}{
"message": "Invalid API Key",
"error": "Unauthorized",
"statusCode": 401
}{
"message": "Multiple CRMs have mapping settings (hubspot, salesforce); pass \"crm\" to pick one",
"error": "Conflict",
"statusCode": 409
}{
"message": "No hubspot integration mapping settings found; configure the hubspot integration in LoneScale first",
"error": "Unprocessable Entity",
"statusCode": 422
}Authorizations
Provide your API key in the x-api-key header.
Body
Target CRM. Required only when more than one connected CRM has mapping settings.
hubspot, salesforce, pipedrive, sellsy Which team-level settings record to sync with when several exist for the CRM (settings are stored per use-case: api_sync, contact_sourcing, job_changes, ...). When omitted, resolution prefers the dedicated api_sync record (configured in the "API Sync" tab of the CRM integration), then falls back to contact_sourcing, then the only existing record.
Contacts to create/update (company fields may be embedded on each contact).
100Show child attributes
Show child attributes
Companies to create/update, without contacts.
100Show child attributes
Show child attributes
Called once with the run summary when every record has been processed.
Deliver every record to this platform webhook (id from GET /webhooks) instead of a CRM. No CRM connection or mapping is required. Mutually exclusive with crm / settings_type; distinct from webhook_url (the completion callback).
Reuse the same key to make client retries return the existing run instead of double-writing.

