how to manually trigger syncs through api
# ask-ai
a
how to manually trigger syncs through api
k
You can manually trigger an Airbyte sync by calling the Connections Sync endpoint with your connectionId. Option 1 — OSS (local API on the Airbyte server) - Get your connectionId from the Airbyte UI URL of the connection. - Execute:
Copy code
curl -u 'airbyte:password' -X POST "http://localhost:8000/api/v1/connections/sync" \   -H "Accept: application/json" \   -H "Content-Type: application/json" \   -d '{"connectionId":"<YOUR_CONNECTION_ID>"}'
A successful call returns a job payload indicating the sync has started. [[Airflow tutorial](https://airbyte.com/tutorials/how-to-use-airflow-and-airbyte-together)]. You can also schedule this via cron to trigger on your own cadence. [[Forum 379](https://discuss.airbyte.io/t/379)]. Option 2 — Airbyte Cloud/Public API - Use the Jobs endpoint to start a sync:
Copy code
POST https://api.airbyte.com/v1/jobs Authorization: Bearer <YourApiKey> Content-Type: application/json  {   "connectionId": "YourConnectionID",   "jobType": "sync" }
Example (C# RestSharp):
Copy code
var client = new RestClient("https://api.airbyte.com/v1/jobs"); var request = new RestRequest(); request.AddHeader("accept", "application/json"); request.AddHeader("content-type", "application/json"); request.AddHeader("Authorization", "Bearer {YourApiKey}"); request.AddParameter("application/json", "{\"connectionId\":\"YourConnectionID\",\"jobType\":\"sync\"}", ParameterType.RequestBody); var response = client.ExecutePost(request);
You can then poll job status using the returned jobId. [[API pipeline tutorial](https://airbyte.com/tutorials/create-and-monitor-a-data-pipeline-using-the-airbyte-api)]. Related notes - If you orchestrate with external tools, set the connection’s schedule to Manual so it won’t auto-run. [[Sync schedules](https://docs.airbyte.com/platform/using-airbyte/core-concepts/sync-schedules); [Airflow tutorial](https://airbyte.com/tutorials/how-to-use-airflow-and-airbyte-together)]. - Webhooks (e.g., from Apify) can also call the same manual trigger endpoint. [[Apify Dataset](https://docs.airbyte.com/integrations/sources/apify-dataset)]. - In Prefect, you can also trigger via the Airbyte task (AirbyteConnectionTask) pointing to your connectionId. [[Prefect task](https://docs.airbyte.com/platform/operator-guides/using-prefect-task)].
a
@kapa.ai will ui method work if webapp is disabled
k
A message from kapa.ai
Short answer: no—you don’t need the UI to manually trigger syncs, and the “UI method” (clicking Sync now) won’t be available if the web app is disabled. - If the WebApp/UI is disabled, you can still trigger syncs via the API. For OSS/local, call POST /api/v1/connections/sync with the connectionId to start a job. [[Airflow tutorial](https://airbyte.com/tutorials/how-to-use-airflow-and-airbyte-together)]. - Manual schedule mode is specifically designed so syncs only run when triggered via UI or API—so with the UI off, you’d use the API route. [[Core concepts](https://docs.airbyte.com/platform/using-airbyte/core-concepts#sync-schedule); [Sync schedules](https://docs.airbyte.com/platform/using-airbyte/core-concepts/sync-schedules)]. If you’re on Self-Managed Enterprise and using the public API, authenticate first (create application keys, obtain an access token), then call the API endpoints with the Bearer token. [[API access](https://docs.airbyte.com/platform/enterprise-setup/api-access-config); [Next API access](https://docs.airbyte.com/platform/next/enterprise-setup/api-access-config)].