- [HTTP request](https://docs.cloud.google.com/dataflow/docs/reference/rest/v1b3/projects.jobs/update#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/dataflow/docs/reference/rest/v1b3/projects.jobs/update#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/dataflow/docs/reference/rest/v1b3/projects.jobs/update#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/dataflow/docs/reference/rest/v1b3/projects.jobs/update#body.request_body)
- [Response body](https://docs.cloud.google.com/dataflow/docs/reference/rest/v1b3/projects.jobs/update#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/dataflow/docs/reference/rest/v1b3/projects.jobs/update#body.aspect)
- [Try it!](https://docs.cloud.google.com/dataflow/docs/reference/rest/v1b3/projects.jobs/update#try-it)

Updates the state of an existing Cloud Dataflow job.

To update the state of an existing job, we recommend using `projects.locations.jobs.update` with a [regional endpoint](https://cloud.google.com/dataflow/docs/concepts/regional-endpoints). Using `projects.jobs.update` is not recommended, as you can only update the state of jobs that are running in `us-central1`.

### IAM Permissions

1. Requires the `dataflow.jobs.cancel` permission to cancel a job.
2. Requires the `dataflow.jobs.updateContents` permission to update runtime parameters.

### HTTP request

Choose an endpoint:
global   
`PUT https://dataflow.googleapis.com/v1b3/projects/{projectId}/jobs/{jobId}`

<br />

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

### Path parameters

| Parameters ||
|---|---|
| `projectId` | `string` The ID of the Cloud Platform project that the job belongs to. |
| `jobId` | `string` The job ID. |

### Query parameters

| Parameters ||
|---|---|
| `location` | `string` The [regional endpoint](https://cloud.google.com/dataflow/docs/concepts/regional-endpoints) that contains this job. |
| `updateMask` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#field-mask` format)`` The list of fields to update relative to Job. If empty, only RequestedJobState will be considered for update. If the FieldMask is not empty and RequestedJobState is none/empty, The fields specified in the update mask will be the only ones considered for update. If both RequestedJobState and updateMask are specified, an error will be returned as we cannot update both state and mask. This is a comma-separated list of fully qualified names of fields. Example: `"user.displayName,photo"`. |

### Request body

The request body contains an instance of `https://docs.cloud.google.com/dataflow/docs/reference/rest/v1b3/projects.jobs#Job`.

### Response body

If successful, the response body contains an 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).