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

Creates and buffers a new task without the need to explicitly define a Task message. The queue must have `https://docs.cloud.google.com/tasks/docs/reference/rest/v2beta3/projects.locations.queues#HttpTarget`. To create the task with a custom ID, use the following format and set TASK_ID to your desired ID: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID:buffer To create the task with an automatically generated ID, use the following format: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks:buffer.

### HTTP request

`POST https://cloudtasks.googleapis.com/v2beta3/{queue=projects/*/locations/*/queues/*}/tasks/{taskId}:buffer`

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

### Path parameters

| Parameters ||
|---|---|
| `queue` | `string` Required. The parent queue name. For example: projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID\` The queue must already exist. Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `queue`: - `cloudtasks.tasks.create` |
| `taskId` | `string` Optional. Task ID for the task being created. If not provided, a random task ID is assigned to the task. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "body": { object (`https://docs.cloud.google.com/tasks/docs/reference/rest/Shared.Types/HttpBody`) } } ``` |

| Fields ||
|---|---|
| `body` | ``object (`https://docs.cloud.google.com/tasks/docs/reference/rest/Shared.Types/HttpBody`)`` Optional. Body of the HTTP request. The body can take any generic value. The value is written to the \[HttpRequest\]\[payload\] of the \[Task\]. |

### Response body

Response message for `https://docs.cloud.google.com/tasks/docs/reference/rest/v2beta3/projects.locations.queues.tasks/buffer#google.cloud.tasks.v2beta3.CloudTasks.BufferTask`.

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

| JSON representation |
|---|
| ``` { "task": { object (`https://docs.cloud.google.com/tasks/docs/reference/rest/v2beta3/projects.locations.queues.tasks#Task`) } } ``` |

| Fields ||
|---|---|
| `task` | ``object (`https://docs.cloud.google.com/tasks/docs/reference/rest/v2beta3/projects.locations.queues.tasks#Task`)`` The created task. |

### Authorization scopes

Requires one of the following OAuth scopes:

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

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