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

Creates a Cloud Dataflow job from a template. Do not enter confidential information when you supply string values using the API.

To create a job, we recommend using `projects.locations.templates.create` with a [regional endpoint](https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using `projects.templates.create` is not recommended, because your job will always start in `us-central1`.

### IAM Permissions

Requires the following IAM permission(s) on the project:

- `dataflow.jobs.create`
- `resourcemanager.projects.get`

### HTTP request

Choose an endpoint:
global   
`POST https://dataflow.googleapis.com/v1b3/projects/{projectId}/locations/{location}/templates`

<br />

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

### Path parameters

| Parameters ||
|---|---|
| `projectId` | `string` Required. The ID of the Cloud Platform project that the job belongs to. |
| `location` | `string` The [regional endpoint](https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) to which to direct the request. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "jobName": string, "parameters": { string: string, ... }, "environment": { object (`https://docs.cloud.google.com/dataflow/docs/reference/rest/v1b3/RuntimeEnvironment`) }, // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "gcsPath": string // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| `jobName` | `string` Required. The job name to use for the created job. |
| `parameters` | `map (key: string, value: string)` The runtime parameters to pass to the job. |
| `environment` | ``object (`https://docs.cloud.google.com/dataflow/docs/reference/rest/v1b3/RuntimeEnvironment`)`` The runtime environment for the job. |
| The template from which to create the job. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `gcsPath` | `string` Required. A Cloud Storage path to the template from which to create the job. Must be a valid Cloud Storage URL, beginning with `gs://`. |
| End of mutually exclusive fields. ||

### Response body

If successful, the response body contains a newly created instance of `https://docs.cloud.google.com/dataflow/docs/reference/rest/v1b3/projects.jobs#Job`.

### Authorization scopes

Requires one of the following OAuth scopes:

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

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