Airflow API Endpoints (vX.Y.Z)
This document outlines the available API endpoints for interacting with Apache Airflow. These endpoints allow you to programmatically manage DAGs, tasks, connections, variables, and monitor the state of your Airflow environment.
Authentication
API requests require authentication. Airflow supports Basic Authentication. You can generate an API token or use your Airflow username and password.
Base URL
The base URL for the Airflow API is typically http://localhost:8080/api/v1, assuming Airflow is running on the default port. Replace localhost:8080 with your Airflow webserver's address and port.
API Endpoints
DAGs
/dags
List all DAGs.
/dags/{dag_id}
Get details of a specific DAG.
/dags/{dag_id}
Update a DAG's properties (e.g., enable/disable).
/dags/{dag_id}/dagRuns
Trigger a new DAG run.
/dags/{dag_id}/dagRuns
List DAG runs for a specific DAG.
/dags/{dag_id}/dagRuns/{dag_run_id}
Get details of a specific DAG run.
/dags/{dag_id}/dagRuns/{dag_run_id}
Delete a DAG run.
Tasks
/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances
List task instances for a specific DAG run.
/dags/{dag_id}/dagRuns/{dag_run_id}/taskInstances/{task_id}
Get details of a specific task instance.
/dags/{dag_id}/taskInstances/{task_id}/logs
Get the logs for a specific task instance.
/dags/{dag_id}/tasks/{task_id}/clear
Clear task state.
/dags/{dag_id}/tasks/{task_id}/run
Manually run a task.
Connections
/connections
List all connections.
/connections
Create a new connection.
/connections/{conn_id}
Get details of a specific connection.
/connections/{conn_id}
Update an existing connection.
/connections/{conn_id}
Delete a connection.
Variables
/variables
List all variables.
/variables
Create a new variable.
/variables/{key}
Get a specific variable by key.
/variables/{key}
Update an existing variable.
/variables/{key}
Delete a variable.
Pools
/pools
List all pools.
/pools
Create a new pool.
/pools/{pool_name}
Get details of a specific pool.
/pools/{pool_name}
Update an existing pool.
/pools/{pool_name}
Delete a pool.
Users
/users
List all users (requires admin privileges).
/users
Create a new user (requires admin privileges).
/users/{username}
Get details of a specific user (requires admin privileges).
/users/{username}
Update an existing user (requires admin privileges).
/users/{username}
Delete a user (requires admin privileges).
Configuration
/config
Get Airflow configuration properties.