Trigger Calendar Sync
curl --request POST \
--url https://api.example.com/v1/calendar/sync \
--header 'Content-Type: application/json' \
--data '
{
"mode": "<string>",
"provider": "<string>",
"from_date": "<string>",
"to_date": "<string>"
}
'import requests
url = "https://api.example.com/v1/calendar/sync"
payload = {
"mode": "<string>",
"provider": "<string>",
"from_date": "<string>",
"to_date": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
mode: '<string>',
provider: '<string>',
from_date: '<string>',
to_date: '<string>'
})
};
fetch('https://api.example.com/v1/calendar/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://api.example.com/v1/calendar/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([
'mode' => '<string>',
'provider' => '<string>',
'from_date' => '<string>',
'to_date' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://api.example.com/v1/calendar/sync"
payload := strings.NewReader("{\n \"mode\": \"<string>\",\n \"provider\": \"<string>\",\n \"from_date\": \"<string>\",\n \"to_date\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/v1/calendar/sync")
.header("Content-Type", "application/json")
.body("{\n \"mode\": \"<string>\",\n \"provider\": \"<string>\",\n \"from_date\": \"<string>\",\n \"to_date\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/calendar/sync")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"mode\": \"<string>\",\n \"provider\": \"<string>\",\n \"from_date\": \"<string>\",\n \"to_date\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"job_id": "<string>",
"status": "<string>",
"mode": "<string>",
"queued_at": "<string>"
}
}Calendar
Trigger Calendar Sync
Force an on-demand synchronization of the connected calendars in the workspace
POST
/
v1
/
calendar
/
sync
Trigger Calendar Sync
curl --request POST \
--url https://api.example.com/v1/calendar/sync \
--header 'Content-Type: application/json' \
--data '
{
"mode": "<string>",
"provider": "<string>",
"from_date": "<string>",
"to_date": "<string>"
}
'import requests
url = "https://api.example.com/v1/calendar/sync"
payload = {
"mode": "<string>",
"provider": "<string>",
"from_date": "<string>",
"to_date": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
mode: '<string>',
provider: '<string>',
from_date: '<string>',
to_date: '<string>'
})
};
fetch('https://api.example.com/v1/calendar/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://api.example.com/v1/calendar/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([
'mode' => '<string>',
'provider' => '<string>',
'from_date' => '<string>',
'to_date' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://api.example.com/v1/calendar/sync"
payload := strings.NewReader("{\n \"mode\": \"<string>\",\n \"provider\": \"<string>\",\n \"from_date\": \"<string>\",\n \"to_date\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.example.com/v1/calendar/sync")
.header("Content-Type", "application/json")
.body("{\n \"mode\": \"<string>\",\n \"provider\": \"<string>\",\n \"from_date\": \"<string>\",\n \"to_date\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/calendar/sync")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"mode\": \"<string>\",\n \"provider\": \"<string>\",\n \"from_date\": \"<string>\",\n \"to_date\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"job_id": "<string>",
"status": "<string>",
"mode": "<string>",
"queued_at": "<string>"
}
}Request
Calendar events are continuously synchronized in the background. Use this endpoint when you need the most recent events immediately (for example, before generating a day-start briefing).Headers
Authorization: Bearer wbk_your_api_key_here
Content-Type: application/json
string
Optional UUID to deduplicate retried sync requests within 24 hours.
Body Parameters
string
default:"incremental"
incremental (default) syncs only changes since the last successful sync. full rebuilds the entire calendar index; use sparingly as it can take several minutes on large accounts.string
Optional provider override:
google or microsoft. When omitted, every connected calendar in the workspace is refreshed.string
ISO 8601 lower bound when
mode is full. Defaults to 90 days before the current date.string
ISO 8601 upper bound when
mode is full. Defaults to 180 days after the current date.Response
object
X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, and X-Request-ID. When the job completes, a calendar.sync.completed webhook event is delivered if you have a matching subscription.
curl -X POST \
https://data.leadlex.com/functions/v1/api-gateway/v1/calendar/sync \
-H "Authorization: Bearer wbk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"mode": "incremental"}'
import requests
API_KEY = "wbk_your_api_key_here"
BASE_URL = "https://data.leadlex.com/functions/v1/api-gateway"
r = requests.post(
f"{BASE_URL}/v1/calendar/sync",
headers={
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
},
json={"mode": "incremental"},
)
print(r.json()["data"]["job_id"])
const res = await fetch(
'https://data.leadlex.com/functions/v1/api-gateway/v1/calendar/sync',
{
method: 'POST',
headers: {
'Authorization': 'Bearer wbk_your_api_key_here',
'Content-Type': 'application/json',
},
body: JSON.stringify({ mode: 'incremental' }),
}
);
const { data } = await res.json();
console.log(data.job_id);
Example Response
{
"data": {
"job_id": "cal_sync_01HYVTB5QK8ZA1QH82R7Q9N2PD",
"status": "queued",
"mode": "incremental",
"queued_at": "2026-04-17T10:30:00Z"
}
}
Errors
| Status | Code | Description |
|---|---|---|
| 401 | invalid_key | Invalid or expired API key |
| 403 | insufficient_permissions | Missing write:calendar permission, or no connected calendar |
| 409 | sync_in_progress | A full sync is already running |
| 429 | rate_limited | On-demand sync is capped at 6 per hour per workspace |