Queue an integration sync
Settings module
POST/integrations/{id}/syncsintegrations.sync
Queues a sync run on a Connected connection; the run is attempted by the platform job queue with retries. Requires `Idempotency-Key`; a replay returns the original response. A rule that refuses the request returns 422 with `refusal` and `reason`.
- Requires the capability org.integrations.manage.
- OAuth scopes: org.
- Send an Idempotency-Key header. A replay with the same key returns the original response.
- Error statuses: 400, 401, 404, 409, 422, 429. Errors are RFC 9457 problem details.
Path and query parameters
| Field | Type | Required | Description |
|---|---|---|---|
| id | string (uuid) | Yes | Identifier of the integration. |
Request body: IntegrationSyncRequest
| Field | Type | Required | Description |
|---|---|---|---|
| scope | "Ledger Export" | "Payment Sync" | "Calendar Sync" | "File Import" | "Notification Delivery" | "Payroll Export" | "Tracking Refresh" | "Attendance Import" | Yes | What to sync; must belong to the connection's category. |
| direction | "Inbound" | "Outbound" | "Two Way" | Yes | Direction of the sync. |
| project_id | string (uuid) | null | No | Identifier of the project. |
{
"scope": "Ledger Export",
"direction": "Outbound",
"project_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"
}Response 202: IntegrationSyncQueued
| Field | Type | Required | Description |
|---|---|---|---|
| sync_run_id | string (uuid) | Yes | Identifier of the sync run. |
{
"sync_run_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"
}Code samples
curl -X POST "$XOS_BASE_URL/integrations/0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f/syncs" \
-H "Authorization: Bearer $XOS_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"scope":"Ledger Export","direction":"Outbound","project_id":"0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"}'const { data } = await xos.integrations.sync("0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f", {
"scope": "Ledger Export",
"direction": "Outbound",
"project_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"
});response = xos.integrations.sync("0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f", {"scope": "Ledger Export", "direction": "Outbound", "project_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"})xos integrations sync 0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f --data '{"scope":"Ledger Export","direction":"Outbound","project_id":"0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"}'