# Method: projects.locations.environments.executeAirflowCommand

- [HTTP request](https://docs.cloud.google.com/composer/docs/reference/rest/v1/projects.locations.environments/executeAirflowCommand#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/composer/docs/reference/rest/v1/projects.locations.environments/executeAirflowCommand#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/composer/docs/reference/rest/v1/projects.locations.environments/executeAirflowCommand#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/composer/docs/reference/rest/v1/projects.locations.environments/executeAirflowCommand#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/composer/docs/reference/rest/v1/projects.locations.environments/executeAirflowCommand#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/composer/docs/reference/rest/v1/projects.locations.environments/executeAirflowCommand#body.ExecuteAirflowCommandResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/composer/docs/reference/rest/v1/projects.locations.environments/executeAirflowCommand#body.aspect)
- [Try it!](https://docs.cloud.google.com/composer/docs/reference/rest/v1/projects.locations.environments/executeAirflowCommand#try-it)

Executes Airflow CLI command.

### HTTP request

`POST https://composer.googleapis.com/v1/{environment=projects/*/locations/*/environments/*}:executeAirflowCommand`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Path parameters

| Parameters ||
|---|---|
| `environment` | `string` The resource name of the environment in the form: "projects/{projectId}/locations/{locationId}/environments/{environmentId}". Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `environment`: - `composer.environments.executeAirflowCommand` |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "command": string, "subcommand": string, "parameters": [ string ] } ``` |

| Fields ||
|---|---|
| `command` | `string` Airflow command. |
| `subcommand` | `string` Airflow subcommand. |
| `parameters[]` | `string` Parameters for the Airflow command/subcommand as an array of arguments. It may contain positional arguments like `["my-dag-id"]`, key-value parameters like `["--foo=bar"]` or `["--foo","bar"]`, or other flags like `["-f"]`. |

### Response body

Response to ExecuteAirflowCommandRequest.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "executionId": string, "pod": string, "podNamespace": string, "error": string } ``` |

| Fields ||
|---|---|
| `executionId` | `string` The unique ID of the command execution for polling. |
| `pod` | `string` The name of the pod where the command is executed. |
| `podNamespace` | `string` The namespace of the pod where the command is executed. |
| `error` | `string` Error message. Empty if there was no error. |

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloudcomposer`
- `
  https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).