# Method: providers.tasks.batchCreate

- [HTTP request](https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/tasks/rest/v1/providers.tasks/batchCreate#body.HTTP_TEMPLATE)
- [Path parameters](https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/tasks/rest/v1/providers.tasks/batchCreate#body.PATH_PARAMETERS)
- [Request body](https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/tasks/rest/v1/providers.tasks/batchCreate#body.request_body)
  - [JSON representation](https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/tasks/rest/v1/providers.tasks/batchCreate#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/tasks/rest/v1/providers.tasks/batchCreate#body.response_body)
  - [JSON representation](https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/tasks/rest/v1/providers.tasks/batchCreate#body.BatchCreateTasksResponse.SCHEMA_REPRESENTATION)
- [CreateTaskRequest](https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/tasks/rest/v1/providers.tasks/batchCreate#CreateTaskRequest)
  - [JSON representation](https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/tasks/rest/v1/providers.tasks/batchCreate#CreateTaskRequest.SCHEMA_REPRESENTATION)

Creates and returns a batch of new `Task` objects.

### HTTP request

`POST https://fleetengine.googleapis.com/v1/{parent=providers/*}/tasks:batchCreate`

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

### Path parameters

| Parameters ||
|---|---|
| `parent` | `string` Required. The parent resource shared by all tasks. This value must be in the format `providers/{provider}`. The `provider` must be the Google Cloud Project ID. For example, `sample-cloud-project`. The parent field in the `CreateTaskRequest` messages must either be empty, or it must match this field. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "header": { object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/tasks/rest/v1/DeliveryRequestHeader`) }, "requests": [ { object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/tasks/rest/v1/providers.tasks/batchCreate#CreateTaskRequest`) } ] } ``` |

| Fields ||
|---|---|
| `header` | ``object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/tasks/rest/v1/DeliveryRequestHeader`)`` Optional. The standard Delivery API request header. Note: If you set this field, then the header field in the `CreateTaskRequest` messages must either be empty, or it must match this field. |
| `requests[]` | ``object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/tasks/rest/v1/providers.tasks/batchCreate#CreateTaskRequest`)`` Required. The request message that specifies the resources to create. Note: You can create a maximum of 500 tasks in a batch. |

### Response body

The `BatchCreateTask` response message.

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

| JSON representation |
|---|
| ``` { "tasks": [ { object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/tasks/rest/v1/providers.tasks#Task`) } ] } ``` |

| Fields ||
|---|---|
| `tasks[]` | ``object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/tasks/rest/v1/providers.tasks#Task`)`` The created Tasks. |

## CreateTaskRequest

The `tasks.create` request message.

| JSON representation |
|---|
| ``` { "header": { object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/tasks/rest/v1/DeliveryRequestHeader`) }, "parent": string, "taskId": string, "task": { object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/tasks/rest/v1/providers.tasks#Task`) } } ``` |

| Fields ||
|---|---|
| `header` | ``object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/tasks/rest/v1/DeliveryRequestHeader`)`` Optional. The standard Delivery API request header. |
| `parent` | `string` Required. Must be in the format `providers/{provider}`. The `provider` must be the Google Cloud Project ID. For example, `sample-cloud-project`. |
| `taskId` | `string` Required. The Task ID must be unique, but it should be not a shipment tracking ID. To store a shipment tracking ID, use the `trackingId` field. Note that multiple tasks can have the same `trackingId`. Task IDs are subject to the following restrictions: - Must be a valid Unicode string. - Limited to a maximum length of 64 characters. - Normalized according to [Unicode Normalization Form C](http://www.unicode.org/reports/tr15/). - May not contain any of the following ASCII characters: '/', ':', '?', ',', or '#'. |
| `task` | ``object (`https://developers.google.com/maps/documentation/mobility/fleet-engine/reference/tasks/rest/v1/providers.tasks#Task`)`` Required. The Task entity to create. When creating a Task, the following fields are required: - `type` - `state` (must be set to `OPEN`) - `trackingId` (must not be set for `UNAVAILABLE` or `SCHEDULED_STOP` tasks, but required for all other task types) - `plannedLocation` (optional for `UNAVAILABLE` tasks) - `taskDuration` The following fields can be optionally set: - `targetTimeWindow` - `taskTrackingViewConfig` - `attributes` Note: The Task's `name` field is ignored. All other Task fields must not be set; otherwise, an error is returned. |