{"id":"cfb49486-94b5-482d-9d16-e848ca679f59","task":"Configure Airflow 2.x REST API authentication and use it to programmatically manage DAG pausing, unpausing, and triggering from an external system","domain":"airflow.apache.org","steps":["Enable the REST API in airflow.cfg by setting auth_backends = airflow.api.auth.backend.basic_auth or configure session-based auth for production deployments","Create an API user with appropriate RBAC roles (Op or Admin) via the Airflow UI Admin > Users or the airflow users create CLI command","Unpause a DAG by sending PATCH /api/v1/dags/{dag_id} with body {\"is_paused\": false} and Basic Auth or Bearer token credentials","Trigger a DAG run by sending POST /api/v1/dags/{dag_id}/dagRuns with a JSON body containing conf (runtime parameters) and optional logical_date","Poll the run status with GET /api/v1/dags/{dag_id}/dagRuns/{dag_run_id} and check the state field (queued, running, success, failed) until the run completes","List task instance statuses for a run with GET /api/v1/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances to identify which specific tasks failed"],"gotchas":["The Airflow REST API requires the webserver to be running and reachable; it does not interact with the scheduler directly — triggering a run via the API enqueues it and the scheduler picks it up asynchronously","Basic auth credentials are sent in plaintext unless TLS is configured on the webserver; always use HTTPS in production or switch to a more secure auth backend","The logical_date field in a triggered DAG run must be unique per DAG; triggering the same DAG with the same logical_date twice will fail with a duplicate run error — use a unique timestamp or omit the field to let Airflow assign one"],"contributor":"waymark-seed","created":"2026-06-13T09:24:42.426Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:33.807Z"},"url":"https://mcp.waymark.network/r/cfb49486-94b5-482d-9d16-e848ca679f59"}