- [HTTP request](https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/tasks/subscribe#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/tasks/subscribe#body.PATH_PARAMETERS)
- [Query parameters](https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/tasks/subscribe#body.QUERY_PARAMETERS)
- [Request body](https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/tasks/subscribe#body.request_body)
- [Response body](https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/tasks/subscribe#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/tasks/subscribe#body.aspect)

Subscribes to task updates for tasks not in a terminal state. Returns `UnsupportedOperationError` if the task is already in a terminal state (completed, failed, canceled, rejected).

### HTTP request

`GET https://ces.googleapis.com/tasks/{id}:subscribe`

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

### Path parameters

| Parameters ||
|---|---|
| `id` | `string` Required. The resource ID of the task to subscribe to. |

### Query parameters

| Parameters ||
|---|---|
| `tenant` | `string` Optional. Opaque routing identifier. Must match the `tenant` value from the selected `AgentInterface` in the Agent Card when that field is set. |

### Request body

The request body must be empty.

### Response body

If successful, the response body contains a stream of `https://docs.cloud.google.com/gemini-enterprise-cx/cx-agent-studio/reference/rest/v1/StreamResponse` instances.

### Authorization scopes

Requires one of the following OAuth scopes:

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

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