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
Use the token in the 'Authorization: Bearer YOUR_TOKEN' header for all subsequent requests
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)
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
For automated sync, configure 'syncPolicy.automated' in the Application CR with 'prune' and 'selfHeal' flags rather than triggering manual syncs
Known gotchas
Argo CD API tokens expire based on server configuration; token lifetime is set via 'server.rbac.policy.default' and JWT expiry settings — build token refresh into long-running automation
Syncing with 'prune: true' will delete Kubernetes resources no longer in Git; this is destructive and should be used carefully, especially in production environments
The REST API may return success before all resources are fully reconciled; always poll application health status rather than relying solely on the sync response status code
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp