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

# POST /v1/projects/{projectsId}/locations/{locationsId}/notebookExecutionJobs

`POST /v1/projects/{projectsId}/locations/{locationsId}/notebookExecutionJobs`

## Request

- Base URL: `https://aiplatform.googleapis.com`
- URL: `https://aiplatform.googleapis.com/v1/projects/{projectsId}/locations/{locationsId}/notebookExecutionJobs`
- Auth: 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`

Creates a NotebookExecutionJob.

## Path parameters

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

## Query parameters

- `notebookExecutionJobId` string

## Request body

- GoogleCloudAiplatformV1NotebookExecutionJob: NotebookExecutionJob represents an instance of a notebook execution.
  - `createTime` string, google-datetime: Output only. Timestamp when this NotebookExecutionJob was created.
  - `customEnvironmentSpec` GoogleCloudAiplatformV1NotebookExecutionJobCustomEnvironmentSpec: Compute configuration to use for an execution job.
    - `machineSpec` GoogleCloudAiplatformV1MachineSpec: Specification of a single machine.
      - `acceleratorCount` integer: The number of accelerators to attach to the machine. For [accelerator optimized machine types](https://cloud.google.com/compute/docs/accelerator-optimized-machines), One may set the accelerator_count from 1 to N for machine with N GPUs. If accelerator_count is less than or equal to N / 2, Agent Platform co-schedules the replicas of the model into the same VM to save cost. For example, if the machine type is a3-highgpu-8g, which has 8 H100 GPUs, one can set accelerator_count to 1 to 8. If accelerator_count is 1, 2, 3, or 4, Agent Platform co-schedules 8, 4, 2, or 2 replicas of the model into the same VM to save cost. When co-scheduling, CPU, memory and storage on the VM will be distributed to replicas on the VM. For example, one can expect a co-scheduled replica requesting 2 GPUs out of a 8-GPU VM will receive 25% of the CPU, memory and storage of the VM. Note that the feature is not compatible with multihost_gpu_node_count. When multihost_gpu_node_count is set, the co-scheduling will not be enabled.
      - `acceleratorType` 'ACCELERATOR_TYPE_UNSPECIFIED' | 'NVIDIA_TESLA_K80' | 'NVIDIA_TESLA_P100' | 'NVIDIA_TESLA_V100' | 'NVIDIA_TESLA_P4' | 'NVIDIA_TESLA_T4' | 'NVIDIA_TESLA_A100' | 'NVIDIA_A100_80GB' | 'NVIDIA_L4' | 'NVIDIA_H100_80GB' | 'NVIDIA_H100_MEGA_80GB' | 'NVIDIA_H200_141GB' | 'NVIDIA_B200' | 'NVIDIA_GB200' | 'NVIDIA_RTX_PRO_6000' | 'TPU_V2' | 'TPU_V3' | 'TPU_V4_POD' | 'TPU_V5_LITEPOD': Immutable. The type of accelerator(s) that may be attached to the machine as per accelerator_count.
      - `gpuPartitionSize` string: Optional. Immutable. The Nvidia GPU partition size. When specified, the requested accelerators will be partitioned into smaller GPU partitions. For example, if the request is for 8 units of NVIDIA A100 GPUs, and gpu_partition_size="1g.10gb", the service will create 8 * 7 = 56 partitioned MIG instances. The partition size must be a value supported by the requested accelerator. Refer to [Nvidia GPU Partitioning](https://cloud.google.com/kubernetes-engine/docs/how-to/gpus-multi#multi-instance_gpu_partitions) for the available partition sizes. If set, the accelerator_count should be set to 1.
      - `machineType` string: Immutable. The type of the machine. See the [list of machine types supported for prediction](https://cloud.google.com/gemini-enterprise-agent-platform/machine-learning/predictions/configure-compute#machine-types) See the [list of machine types supported for custom training](https://cloud.google.com/gemini-enterprise-agent-platform/machine-learning/training/configure-compute#machine-types). For DeployedModel this field is optional, and the default value is `n1-standard-2`. For BatchPredictionJob or as part of WorkerPoolSpec this field is required.
      - `reservationAffinity` GoogleCloudAiplatformV1ReservationAffinity: A ReservationAffinity can be used to configure a Vertex AI resource (e.g., a DeployedModel) to draw its Compute Engine resources from a Shared Reservation, or exclusively from on-demand capacity.
        - `key` string: Optional. Corresponds to the label key of a reservation resource. To target a SPECIFIC_RESERVATION by name, use `compute.googleapis.com/reservation-name` as the key and specify the name of your reservation as its value.
        - `reservationAffinityType` 'TYPE_UNSPECIFIED' | 'NO_RESERVATION' | 'ANY_RESERVATION' | 'SPECIFIC_RESERVATION': Required. Specifies the reservation affinity type.
        - `values` string[]: Optional. Corresponds to the label values of a reservation resource. This must be the resource name of the reservation, reservation block, or reservation sub- block.
      - `tpuTopology` string: Immutable. The topology of the TPUs. Corresponds to the TPU topologies available from GKE. (Example: tpu_topology: "2x2x1").
    - `networkSpec` GoogleCloudAiplatformV1NetworkSpec: Network spec.
      - `enableInternetAccess` boolean: Whether to enable public internet access. Default false.
      - `network` string: The full name of the Google Compute Engine [network](https://cloud.google.com//compute/docs/networks-and-firewalls#networks)
      - `subnetwork` string: The name of the subnet that this instance is in. Format: `projects/{project_id_or_number}/regions/{region}/subnetworks/{subnetwork_id}`
    - `persistentDiskSpec` GoogleCloudAiplatformV1PersistentDiskSpec: Represents the spec of persistent disk and hyperdisk options.
      - `diskSizeGb` string, int64: Size in GB of the disk (default is 100GB).
      - `diskType` string: Type of the disk (default is "pd-standard"). Valid values: "pd-ssd" (Persistent Disk Solid State Drive) "pd-standard" (Persistent Disk Hard Disk Drive) "pd-balanced" (Balanced Persistent Disk) "pd-extreme" (Extreme Persistent Disk) "hyperdisk-balanced" (Hyperdisk Balanced) "hyperdisk-extreme" (Hyperdisk Extreme) "hyperdisk-balanced-high-availability" (Hyperdisk Balanced High Availability) "hyperdisk-ml" (Hyperdisk ML) "hyperdisk-throughput" (Hyperdisk Throughput)
    - `shieldedInstanceConfig` GoogleCloudAiplatformV1NotebookExecutionJobCustomEnvironmentSpecShieldedInstanceConfig: A set of Shielded VM options for the execution VM. Mirrors `google.cloud.notebooks.v2.ShieldedInstanceConfig`. See https://cloud.google.com/compute/docs/instances/modifying-shielded-vm.
      - `enableIntegrityMonitoring` boolean: Optional. Whether the VM instance has integrity monitoring enabled.
      - `enableSecureBoot` boolean: Optional. Whether the VM instance has Secure Boot enabled. Disabled by default.
      - `enableVtpm` boolean: Optional. Whether the VM instance has vTPM enabled.
  - `dataformRepositorySource` GoogleCloudAiplatformV1NotebookExecutionJobDataformRepositorySource: The Dataform Repository containing the input notebook.
    - `commitSha` string: The commit SHA to read repository with. If unset, the file will be read at HEAD.
    - `dataformRepositoryResourceName` string: The resource name of the Dataform Repository. Format: `projects/{project_id}/locations/{location}/repositories/{repository_id}`
  - `directNotebookSource` GoogleCloudAiplatformV1NotebookExecutionJobDirectNotebookSource: The content of the input notebook in ipynb format.
    - `content` string, byte: The base64-encoded contents of the input notebook file.
  - `displayName` string: The display name of the NotebookExecutionJob. The name can be up to 128 characters long and can consist of any UTF-8 characters.
  - `encryptionSpec` GoogleCloudAiplatformV1EncryptionSpec: Represents a customer-managed encryption key specification that can be applied to a Vertex AI resource.
    - `kmsKeyName` string: Required. Resource name of the Cloud KMS key used to protect the resource. The Cloud KMS key must be in the same region as the resource. It must have the format `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
  - `executionTimeout` string, google-duration: Max running time of the execution job in seconds (default 86400s / 24 hrs).
  - `executionUser` string: The user email to run the execution as. Only supported by Colab runtimes.
  - `gcsNotebookSource` GoogleCloudAiplatformV1NotebookExecutionJobGcsNotebookSource: The Cloud Storage uri for the input notebook.
    - `generation` string: The version of the Cloud Storage object to read. If unset, the current version of the object is read. See https://cloud.google.com/storage/docs/metadata#generation-number.
    - `uri` string: The Cloud Storage uri pointing to the ipynb file. Format: `gs://bucket/notebook_file.ipynb`
  - `gcsOutputUri` string: The Cloud Storage location to upload the result to. Format: `gs://bucket-name`
  - `jobState` 'JOB_STATE_UNSPECIFIED' | 'JOB_STATE_QUEUED' | 'JOB_STATE_PENDING' | 'JOB_STATE_RUNNING' | 'JOB_STATE_SUCCEEDED' | 'JOB_STATE_FAILED' | 'JOB_STATE_CANCELLING' | 'JOB_STATE_CANCELLED' | 'JOB_STATE_PAUSED' | 'JOB_STATE_EXPIRED' | 'JOB_STATE_UPDATING' | 'JOB_STATE_PARTIALLY_SUCCEEDED': Output only. The state of the NotebookExecutionJob.
  - `kernelName` string: The name of the kernel to use during notebook execution. If unset, the default kernel is used.
  - `labels` object: The labels with user-defined metadata to organize NotebookExecutionJobs. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels. System reserved label keys are prefixed with "aiplatform.googleapis.com/" and are immutable.
  - `name` string: Output only. The resource name of this NotebookExecutionJob. Format: `projects/{project_id}/locations/{location}/notebookExecutionJobs/{job_id}`
  - `notebookRuntimeTemplateResourceName` string: The NotebookRuntimeTemplate to source compute configuration from.
  - `scheduleResourceName` string: The Schedule resource name if this job is triggered by one. Format: `projects/{project_id}/locations/{location}/schedules/{schedule_id}`
  - `serviceAccount` string: The service account to run the execution as.
  - `status` 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.
  - `updateTime` string, google-datetime: Output only. Timestamp when this NotebookExecutionJob was most recently updated.
  - `workbenchRuntime` GoogleCloudAiplatformV1NotebookExecutionJobWorkbenchRuntime: Configuration for a Workbench Instances-based environment.
    - `customContainerImage` GoogleCloudAiplatformV1NotebookExecutionJobWorkbenchRuntimeContainerImage: The definition of a user-provided container image to run the notebook execution in. Mirrors `google.cloud.notebooks.v2.ContainerImage`.
      - `repository` string: Required. The path to the container image repository. For example: `gcr.io/{project_id}/{image_name}`.
      - `tag` string: Optional. The tag of the container image. If unset, defaults to `latest`.
    - `vmImage` GoogleCloudAiplatformV1NotebookExecutionJobWorkbenchRuntimeVmImage: The definition of a Compute Engine VM image to run the notebook execution on. Mirrors `google.cloud.notebooks.v2.VmImage`.
      - `family` string: Use this VM image family to find the image; the newest image in this family is used.
      - `name` string: Use this VM image name to find the image.
      - `project` string: Required. The name of the Google Cloud project that this VM image belongs to. Format: `{project_id}`.

## 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`.

---

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