Skip to main content
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>"
}
'
{
  "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
Idempotency-Key
string
Optional UUID used to deduplicate retried sync requests within 24 hours.

Body Parameters

mode
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.
provider
string
Optional provider override: gmail or microsoft. When omitted, all connected providers are synced.

Response

data
object
Every response returns 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 '{}'

Example Response

{
  "data": {
    "job_id": "sync_01HYVTB5QK8ZA1QH82R7Q9N2PD",
    "status": "queued",
    "mode": "incremental",
    "queued_at": "2026-04-17T10:30:00Z"
  }
}

Errors

StatusCodeDescription
401invalid_keyInvalid or expired API key
403insufficient_permissionsMissing write:email permission, or no mailbox connected
409sync_in_progressA full sync is already running; wait for it to finish before starting another
429rate_limitedToo many sync requests; on-demand sync is capped at 6 per hour per workspace