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

Body Parameters

mode
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.
provider
string
Optional provider override: google or microsoft. When omitted, every connected calendar in the workspace is refreshed.
from_date
string
ISO 8601 lower bound when mode is full. Defaults to 90 days before the current date.
to_date
string
ISO 8601 upper bound when mode is full. Defaults to 180 days after the current date.

Response

data
object
Responses include 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"}'

Example Response

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

Errors

StatusCodeDescription
401invalid_keyInvalid or expired API key
403insufficient_permissionsMissing write:calendar permission, or no connected calendar
409sync_in_progressA full sync is already running
429rate_limitedOn-demand sync is capped at 6 per hour per workspace