---
title: "POST /v1/projects/{projectsId}/locations/{locationsId}/lakes/{lakesId}/tasks"
method: POST
path: "/v1/projects/{projectsId}/locations/{locationsId}/lakes/{lakesId}/tasks"
tags: ["projects"]
---

# POST /v1/projects/{projectsId}/locations/{locationsId}/lakes/{lakesId}/tasks

`POST /v1/projects/{projectsId}/locations/{locationsId}/lakes/{lakesId}/tasks`

## Request

- Base URL: `https://dataplex.googleapis.com`
- URL: `https://dataplex.googleapis.com/v1/projects/{projectsId}/locations/{locationsId}/lakes/{lakesId}/tasks`
- Auth: one of:
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/cloud-platform`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud-platform`
  - OAuth 2 and OAuth 2
    - Implicit: `https://accounts.google.com/o/oauth2/auth`
    - Scopes: `https://www.googleapis.com/auth/dataplex.read-write`
    - Authorization code: `https://accounts.google.com/o/oauth2/auth`
    - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/dataplex.read-write`

Creates a task resource within a lake.

## Path parameters

- `projectsId` string, required
- `locationsId` string, required
- `lakesId` string, required

## Query parameters

- `$.xgafv` '1' | '2'
- `access_token` string
- `alt` 'json' | 'media' | 'proto'
- `callback` string
- `fields` string
- `key` string
- `oauth_token` string
- `prettyPrint` boolean
- `quotaUser` string
- `uploadType` string
- `upload_protocol` string
- `taskId` string
- `validateOnly` boolean

## Request body

- GoogleCloudDataplexV1Task: A task represents a user-visible job.
  - `createTime` string, google-datetime: Output only. The time when the task was created.
  - `description` string: Optional. Description of the task.
  - `displayName` string: Optional. User friendly display name.
  - `executionSpec` GoogleCloudDataplexV1TaskExecutionSpec: Execution related settings, like retry and service_account.
    - `args` object: Optional. The arguments to pass to the task. The args can use placeholders of the format ${placeholder} as part of key/value string. These will be interpolated before passing the args to the driver. Currently supported placeholders: - ${task_id} - ${job_time} To pass positional args, set the key as TASK_ARGS. The value should be a comma-separated string of all the positional arguments. To use a delimiter other than comma, refer to https://cloud.google.com/sdk/gcloud/reference/topic/escaping. In case of other keys being present in the args, then TASK_ARGS will be passed as the last argument.
    - `kmsKey` string: Optional. The Cloud KMS key to use for encryption, of the form: projects/{project_number}/locations/{location_id}/keyRings/{key-ring-name}/cryptoKeys/{key-name}.
    - `maxJobExecutionLifetime` string, google-duration: Optional. The maximum duration after which the job execution is expired.
    - `project` string: Optional. The project in which jobs are run. By default, the project containing the Lake is used. If a project is provided, the ExecutionSpec.service_account must belong to this project.
    - `serviceAccount` string: Required. Service account to use to execute a task. If not provided, the default Compute service account for the project is used.
  - `executionStatus` GoogleCloudDataplexV1TaskExecutionStatus: Status of the task execution (e.g. Jobs).
    - `latestJob` GoogleCloudDataplexV1Job: A job represents an instance of a task.
      - `endTime` string, google-datetime: Output only. The time when the job ended.
      - `executionSpec` GoogleCloudDataplexV1TaskExecutionSpec: Execution related settings, like retry and service_account.
        - `args` object: Optional. The arguments to pass to the task. The args can use placeholders of the format ${placeholder} as part of key/value string. These will be interpolated before passing the args to the driver. Currently supported placeholders: - ${task_id} - ${job_time} To pass positional args, set the key as TASK_ARGS. The value should be a comma-separated string of all the positional arguments. To use a delimiter other than comma, refer to https://cloud.google.com/sdk/gcloud/reference/topic/escaping. In case of other keys being present in the args, then TASK_ARGS will be passed as the last argument.
        - `kmsKey` string: Optional. The Cloud KMS key to use for encryption, of the form: projects/{project_number}/locations/{location_id}/keyRings/{key-ring-name}/cryptoKeys/{key-name}.
        - `maxJobExecutionLifetime` string, google-duration: Optional. The maximum duration after which the job execution is expired.
        - `project` string: Optional. The project in which jobs are run. By default, the project containing the Lake is used. If a project is provided, the ExecutionSpec.service_account must belong to this project.
        - `serviceAccount` string: Required. Service account to use to execute a task. If not provided, the default Compute service account for the project is used.
      - `labels` object: Output only. User-defined labels for the task.
      - `message` string: Output only. Additional information about the current state.
      - `name` string: Output only. The relative resource name of the job, of the form: projects/{project_number}/locations/{location_id}/lakes/{lake_id}/tasks/{task_id}/jobs/{job_id}.
      - `retryCount` integer: Output only. The number of times the job has been retried (excluding the initial attempt).
      - `service` 'SERVICE_UNSPECIFIED' | 'DATAPROC': Output only. The underlying service running a job.
      - `serviceJob` string: Output only. The full resource name for the job run under a particular service.
      - `startTime` string, google-datetime: Output only. The time when the job was started.
      - `state` 'STATE_UNSPECIFIED' | 'RUNNING' | 'CANCELLING' | 'CANCELLED' | 'SUCCEEDED' | 'FAILED' | 'ABORTED': Output only. Execution state for the job.
      - `trigger` 'TRIGGER_UNSPECIFIED' | 'TASK_CONFIG' | 'RUN_REQUEST': Output only. Job execution trigger.
      - `uid` string: Output only. System generated globally unique ID for the job.
    - `updateTime` string, google-datetime: Output only. Last update time of the status.
  - `labels` object: Optional. User-defined labels for the task.
  - `name` string: Output only. The relative resource name of the task, of the form: projects/{project_number}/locations/{location_id}/lakes/{lake_id}/ tasks/{task_id}.
  - `notebook` GoogleCloudDataplexV1TaskNotebookTaskConfig: Config for running scheduled notebooks.
    - `archiveUris` string[]: Optional. Cloud Storage URIs of archives to be extracted into the working directory of each executor. Supported file types: .jar, .tar, .tar.gz, .tgz, and .zip.
    - `fileUris` string[]: Optional. Cloud Storage URIs of files to be placed in the working directory of each executor.
    - `infrastructureSpec` GoogleCloudDataplexV1TaskInfrastructureSpec: Configuration for the underlying infrastructure used to run workloads.
      - `batch` GoogleCloudDataplexV1TaskInfrastructureSpecBatchComputeResources: Batch compute resources associated with the task.
        - `executorsCount` integer: Optional. Total number of job executors. Executor Count should be between 2 and 100. Default=2
        - `maxExecutorsCount` integer: Optional. Max configurable executors. If max_executors_count > executors_count, then auto-scaling is enabled. Max Executor Count should be between 2 and 1000. Default=1000
      - `containerImage` GoogleCloudDataplexV1TaskInfrastructureSpecContainerImageRuntime: Container Image Runtime Configuration used with Batch execution.
        - `image` string: Optional. Container image to use.
        - `javaJars` string[]: Optional. A list of Java JARS to add to the classpath. Valid input includes Cloud Storage URIs to Jar binaries. For example, gs://bucket-name/my/path/to/file.jar
        - `properties` object: Optional. Override to common configuration of open source components installed on the Dataproc cluster. The properties to set on daemon config files. Property keys are specified in prefix:property format, for example core:hadoop.tmp.dir. For more information, see Cluster properties (https://cloud.google.com/dataproc/docs/concepts/cluster-properties).
        - `pythonPackages` string[]: Optional. A list of python packages to be installed. Valid formats include Cloud Storage URI to a PIP installable library. For example, gs://bucket-name/my/path/to/lib.tar.gz
      - `vpcNetwork` GoogleCloudDataplexV1TaskInfrastructureSpecVpcNetwork: Cloud VPC Network used to run the infrastructure.
        - `network` string: Optional. The Cloud VPC network in which the job is run. By default, the Cloud VPC network named Default within the project is used.
        - `networkTags` string[]: Optional. List of network tags to apply to the job.
        - `subNetwork` string: Optional. The Cloud VPC sub-network in which the job is run.
    - `notebook` string: Required. Path to input notebook. This can be the Cloud Storage URI of the notebook file or the path to a Notebook Content. The execution args are accessible as environment variables (TASK_key=value).
  - `spark` GoogleCloudDataplexV1TaskSparkTaskConfig: User-specified config for running a Spark task.
    - `archiveUris` string[]: Optional. Cloud Storage URIs of archives to be extracted into the working directory of each executor. Supported file types: .jar, .tar, .tar.gz, .tgz, and .zip.
    - `fileUris` string[]: Optional. Cloud Storage URIs of files to be placed in the working directory of each executor.
    - `infrastructureSpec` GoogleCloudDataplexV1TaskInfrastructureSpec: Configuration for the underlying infrastructure used to run workloads.
      - `batch` GoogleCloudDataplexV1TaskInfrastructureSpecBatchComputeResources: Batch compute resources associated with the task.
        - `executorsCount` integer: Optional. Total number of job executors. Executor Count should be between 2 and 100. Default=2
        - `maxExecutorsCount` integer: Optional. Max configurable executors. If max_executors_count > executors_count, then auto-scaling is enabled. Max Executor Count should be between 2 and 1000. Default=1000
      - `containerImage` GoogleCloudDataplexV1TaskInfrastructureSpecContainerImageRuntime: Container Image Runtime Configuration used with Batch execution.
        - `image` string: Optional. Container image to use.
        - `javaJars` string[]: Optional. A list of Java JARS to add to the classpath. Valid input includes Cloud Storage URIs to Jar binaries. For example, gs://bucket-name/my/path/to/file.jar
        - `properties` object: Optional. Override to common configuration of open source components installed on the Dataproc cluster. The properties to set on daemon config files. Property keys are specified in prefix:property format, for example core:hadoop.tmp.dir. For more information, see Cluster properties (https://cloud.google.com/dataproc/docs/concepts/cluster-properties).
        - `pythonPackages` string[]: Optional. A list of python packages to be installed. Valid formats include Cloud Storage URI to a PIP installable library. For example, gs://bucket-name/my/path/to/lib.tar.gz
      - `vpcNetwork` GoogleCloudDataplexV1TaskInfrastructureSpecVpcNetwork: Cloud VPC Network used to run the infrastructure.
        - `network` string: Optional. The Cloud VPC network in which the job is run. By default, the Cloud VPC network named Default within the project is used.
        - `networkTags` string[]: Optional. List of network tags to apply to the job.
        - `subNetwork` string: Optional. The Cloud VPC sub-network in which the job is run.
    - `mainClass` string: The name of the driver's main class. The jar file that contains the class must be in the default CLASSPATH or specified in jar_file_uris. The execution args are passed in as a sequence of named process arguments (--key=value).
    - `mainJarFileUri` string: The Cloud Storage URI of the jar file that contains the main class. The execution args are passed in as a sequence of named process arguments (--key=value).
    - `pythonScriptFile` string: The Gcloud Storage URI of the main Python file to use as the driver. Must be a .py file. The execution args are passed in as a sequence of named process arguments (--key=value).
    - `sqlScript` string: The query text. The execution args are used to declare a set of script variables (set key="value";).
    - `sqlScriptFile` string: A reference to a query file. This should be the Cloud Storage URI of the query file. The execution args are used to declare a set of script variables (set key="value";).
  - `state` 'STATE_UNSPECIFIED' | 'ACTIVE' | 'CREATING' | 'DELETING' | 'ACTION_REQUIRED': Output only. Current state of the task.
  - `triggerSpec` GoogleCloudDataplexV1TaskTriggerSpec: Task scheduling and trigger settings.
    - `disabled` boolean: Optional. Prevent the task from executing. This does not cancel already running tasks. It is intended to temporarily disable RECURRING tasks.
    - `maxRetries` integer: Optional. Number of retry attempts before aborting. Set to zero to never attempt to retry a failed task.
    - `schedule` string: Optional. Cron schedule (https://en.wikipedia.org/wiki/Cron) for running tasks periodically. To explicitly set a timezone to the cron tab, apply a prefix in the cron tab: "CRON_TZ=${IANA_TIME_ZONE}" or "TZ=${IANA_TIME_ZONE}". The ${IANA_TIME_ZONE} may only be a valid string from IANA time zone database. For example, CRON_TZ=America/New_York 1 * * * *, or TZ=America/New_York 1 * * * *. This field is required for RECURRING tasks.
    - `startTime` string, google-datetime: Optional. The first run of the task will be after this time. If not specified, the task will run shortly after being submitted if ON_DEMAND and based on the schedule if RECURRING.
    - `type` 'TYPE_UNSPECIFIED' | 'ON_DEMAND' | 'RECURRING': Required. Immutable. Trigger type of the user-specified Task.
  - `uid` string: Output only. System generated globally unique ID for the task. This ID will be different if the task is deleted and re-created with the same name.
  - `updateTime` string, google-datetime: Output only. The time when the task was last updated.

## Response `200`

Successful response

- GoogleLongrunningOperation: This resource represents a long-running operation that is the result of a network API call.
  - `done` boolean: If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.
  - `error` GoogleRpcStatus: The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC (https://github.com/grpc). Each Status message contains three pieces of data: error code, error message, and error details.You can find out more about this error model and how to work with it in the API Design Guide (https://cloud.google.com/apis/design/errors).
    - `code` integer: The status code, which should be an enum value of google.rpc.Code.
    - `details` object[]: A list of messages that carry the error details. There is a common set of message types for APIs to use.
    - `message` string: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
  - `metadata` object: Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
  - `name` string: The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the name should be a resource name ending with operations/{unique_id}.
  - `response` object: The normal, successful response of the operation. If the original method returns no data on success, such as Delete, the response is google.protobuf.Empty. If the original method is standard Get/Create/Update, the response should be the resource. For other methods, the response should have the type XxxResponse, where Xxx is the original method name. For example, if the original method name is TakeSnapshot(), the inferred response type is TakeSnapshotResponse.

## Changes

- **2026-12-05** `5d0894669d35`: 4 info
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was added to the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was added to the endpoint's security scheme `Oauth2c`
  - the security scope `https://www.googleapis.com/auth/dataplex.read-write` was removed from the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/dataplex.read-write` was removed from the endpoint's security scheme `Oauth2c`
- **2026-11-09** `a87e571d134a`: 4 info
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was added to the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/cloud-platform` was added to the endpoint's security scheme `Oauth2c`
  - the security scope `https://www.googleapis.com/auth/dataplex.read-write` was removed from the endpoint's security scheme `Oauth2`
  - the security scope `https://www.googleapis.com/auth/dataplex.read-write` was removed from the endpoint's security scheme `Oauth2c`

[Operation history](https://skmtc.dev/google/apis/dataplex/changes/v1/projects/:projectsId/locations/:locationsId/lakes/:lakesId/tasks/post.md)

---

[API](https://skmtc.dev/google/apis/dataplex.md) - [All operations](https://skmtc.dev/google/apis/dataplex/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/dataplex/revisions/5d0894669d35?raw)
