Trigger Email Sync
curl --request POST \
--url https://api.example.com/v1/email/sync \
--header 'Content-Type: application/json' \
--data '
{
"mode": "<string>",
"provider": "<string>"
}
'import requests
url = "https://api.example.com/v1/email/sync"
payload = {
"mode": "<string>",
"provider": "<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>'})
};
fetch('https://api.example.com/v1/email/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/email/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>'
]),
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/email/sync"
payload := strings.NewReader("{\n \"mode\": \"<string>\",\n \"provider\": \"<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/email/sync")
.header("Content-Type", "application/json")
.body("{\n \"mode\": \"<string>\",\n \"provider\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/email/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}"
response = http.request(request)
puts response.read_body{
"data": {
"job_id": "<string>",
"status": "<string>",
"mode": "<string>",
"queued_at": "<string>"
}
}Email
Trigger Email Sync
Force an on-demand synchronization of the workspace’s connected mailbox
POST
/
v1
/
email
/
sync
Trigger Email Sync
curl --request POST \
--url https://api.example.com/v1/email/sync \
--header 'Content-Type: application/json' \
--data '
{
"mode": "<string>",
"provider": "<string>"
}
'import requests
url = "https://api.example.com/v1/email/sync"
payload = {
"mode": "<string>",
"provider": "<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>'})
};
fetch('https://api.example.com/v1/email/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/email/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>'
]),
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/email/sync"
payload := strings.NewReader("{\n \"mode\": \"<string>\",\n \"provider\": \"<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/email/sync")
.header("Content-Type", "application/json")
.body("{\n \"mode\": \"<string>\",\n \"provider\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/email/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}"
response = http.request(request)
puts response.read_body{
"data": {
"job_id": "<string>",
"status": "<string>",
"mode": "<string>",
"queued_at": "<string>"
}
}Request
LeadLex continuously synchronizes connected Gmail and Office 365 mailboxes in the background. This endpoint lets you enqueue an immediate sync when you need fresh data (for example, just before running an outreach report).Headers
Authorization: Bearer wbk_your_api_key_here
Content-Type: application/json
string
Optional UUID used to deduplicate retried sync requests within 24 hours.
Body Parameters
string
default:"incremental"
incremental (default) fetches only messages newer than the last successful sync. full rebuilds the entire mailbox index and may take several minutes.string
Optional provider override:
gmail or microsoft. When omitted, all connected providers are synced.Response
object
X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, and X-Request-ID headers. Jobs typically complete within 10 seconds for incremental mode; long-running full syncs are reported via the email.sync.completed webhook event.
curl -X POST \
https://data.leadlex.com/functions/v1/api-gateway/v1/email/sync \
-H "Authorization: Bearer wbk_your_api_key_here" \
-H "Content-Type: application/json" \
-d '{}'
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/email/sync",
headers={
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json",
},
json={},
)
print(r.json()["data"]["job_id"])
const res = await fetch(
'https://data.leadlex.com/functions/v1/api-gateway/v1/email/sync',
{
method: 'POST',
headers: {
'Authorization': 'Bearer wbk_your_api_key_here',
'Content-Type': 'application/json',
},
body: '{}',
}
);
const { data } = await res.json();
console.log(data.job_id);
Example Response
{
"data": {
"job_id": "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:email permission, or no mailbox connected |
| 409 | sync_in_progress | A full sync is already running; wait for it to finish before starting another |
| 429 | rate_limited | Too many sync requests; on-demand sync is capped at 6 per hour per workspace |