Queue an integration sync
Módulo Settings
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`.
- Requiere la capacidad org.integrations.manage.
- Alcances de OAuth: org.
- Envía el encabezado Idempotency-Key. Una repetición con la misma clave devuelve la respuesta original.
- Estados de error: 400, 401, 404, 409, 422, 429. Los errores son detalles de problema RFC 9457.
Parámetros de ruta y de consulta
| Campo | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| id | string (uuid) | Sí | Identifier of the integration. |
Cuerpo de la solicitud: IntegrationSyncRequest
| Campo | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| scope | "Ledger Export" | "Payment Sync" | "Calendar Sync" | "File Import" | "Notification Delivery" | "Payroll Export" | "Tracking Refresh" | "Attendance Import" | Sí | What to sync; must belong to the connection's category. |
| direction | "Inbound" | "Outbound" | "Two Way" | Sí | 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"
}Respuesta 202: IntegrationSyncQueued
| Campo | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| sync_run_id | string (uuid) | Sí | Identifier of the sync run. |
{
"sync_run_id": "0192f1e2-7c3a-7b4d-9e8f-1a2b3c4d5e6f"
}Ejemplos de código
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"}'