Sync an Argo CD application to a target revision via REST API

domain: argo-cd.readthedocs.io · 5 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. Obtain an Argo CD API token by POST to '/api/v1/session' with JSON body containing 'username' and 'password', extracting the 'token' from the response
  2. Use the token in the 'Authorization: Bearer YOUR_TOKEN' header for all subsequent requests
  3. Initiate a sync via POST to '/api/v1/applications/{application-name}/sync' with a JSON body specifying optional 'revision', 'prune', 'dryRun', and 'strategy' (apply or hook)
  4. Poll GET '/api/v1/applications/{application-name}' and inspect 'status.sync.status' (Synced/OutOfSync) and 'status.health.status' (Healthy/Degraded/Progressing) until the desired state is reached
  5. For automated sync, configure 'syncPolicy.automated' in the Application CR with 'prune' and 'selfHeal' flags rather than triggering manual syncs

Known gotchas

Related routes

Implement Argo CD resource hooks (PreSync, Sync, PostSync, SyncFail) with retry policies to orchestrate database migrations before and health checks after an application deployment
Argo CD · 6 steps · unrated
Configure an Argo CD ApplicationSet using the Pull Request generator to create a preview Application per open pull request in a GitHub repository
Argo CD · 6 steps · unrated
Sequence Argo CD resource deployment with sync waves and resource hooks
argo-cd.readthedocs.io · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans