---
title: "POST /v1/reasoningEngines/{reasoningEnginesId}/sandboxEnvironmentTemplates"
method: POST
path: "/v1/reasoningEngines/{reasoningEnginesId}/sandboxEnvironmentTemplates"
tags: ["reasoningEngines"]
---

# POST /v1/reasoningEngines/{reasoningEnginesId}/sandboxEnvironmentTemplates

`POST /v1/reasoningEngines/{reasoningEnginesId}/sandboxEnvironmentTemplates`

## Request

- Base URL: `https://aiplatform.googleapis.com`
- URL: `https://aiplatform.googleapis.com/v1/reasoningEngines/{reasoningEnginesId}/sandboxEnvironmentTemplates`
- 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 SandboxEnvironmentTemplate in a given reasoning engine.

## Path parameters

- `reasoningEnginesId` string, required

## Request body

- GoogleCloudAiplatformV1SandboxEnvironmentTemplate: The specification of a SandboxEnvironmentTemplate. A SandboxEnvironmentTemplate defines a template for creating SandboxEnvironments.
  - `createTime` string, google-datetime: Output only. The timestamp when this SandboxEnvironmentTemplate was created.
  - `customContainerEnvironment` GoogleCloudAiplatformV1SandboxEnvironmentTemplateCustomContainerEnvironment: The customized sandbox runtime environment for BYOC.
    - `customContainerSpec` GoogleCloudAiplatformV1SandboxEnvironmentTemplateCustomContainerSpec: Specification for deploying from a custom container image.
      - `imageUri` string: Required. The Artifact Registry Docker image URI (e.g., us-central1-docker.pkg.dev/my-project/my-repo/my-image:tag) of the container image that is to be run on each worker replica.
    - `ports` GoogleCloudAiplatformV1SandboxEnvironmentTemplateNetworkPort[]: Ports to expose from the container.
      - `port` integer: Optional. Port number to expose. This must be a valid port number, between 1 and 65535.
      - `protocol` 'PROTOCOL_UNSPECIFIED' | 'TCP' | 'UDP': Optional. Protocol for port. Defaults to TCP if not specified.
    - `resources` GoogleCloudAiplatformV1SandboxEnvironmentTemplateResourceRequirements: Message to define resource requests and limits (mirroring Kubernetes) for each sandbox instance created from this template.
      - `limits` object: Optional. The maximum amounts of compute resources allowed. Keys are resource names (e.g., "cpu", "memory"). Values are quantities (e.g., "500m", "1Gi").
      - `requests` object: Optional. The requested amounts of compute resources. Keys are resource names (e.g., "cpu", "memory"). Values are quantities (e.g., "250m", "512Mi").
  - `defaultContainerEnvironment` GoogleCloudAiplatformV1SandboxEnvironmentTemplateDefaultContainerEnvironment: The default sandbox runtime environment for default container workloads.
    - `defaultContainerCategory` 'DEFAULT_CONTAINER_CATEGORY_UNSPECIFIED' | 'DEFAULT_CONTAINER_CATEGORY_COMPUTER_USE' | 'DEFAULT_CONTAINER_CATEGORY_SHELL_SANDBOX': Required. The category of the default container image.
    - `resources` GoogleCloudAiplatformV1SandboxEnvironmentTemplateResourceRequirements: Message to define resource requests and limits (mirroring Kubernetes) for each sandbox instance created from this template.
      - `limits` object: Optional. The maximum amounts of compute resources allowed. Keys are resource names (e.g., "cpu", "memory"). Values are quantities (e.g., "500m", "1Gi").
      - `requests` object: Optional. The requested amounts of compute resources. Keys are resource names (e.g., "cpu", "memory"). Values are quantities (e.g., "250m", "512Mi").
  - `displayName` string: Required. The display name of the SandboxEnvironmentTemplate.
  - `egressControlConfig` GoogleCloudAiplatformV1SandboxEnvironmentTemplateEgressControlConfig: Configuration for egress control of sandbox instances.
    - `dnsPeeringConfigs` GoogleCloudAiplatformV1SandboxEnvironmentTemplateEgressControlConfigDnsPeeringConfig[]: Optional. DNS peering configurations that allow sandbox egress to resolve customer-internal domains via the customer VPC.
      - `domain` string: Required. The DNS name suffix of the zone being peered to, e.g., "my-internal-domain.corp.". Must end with a dot.
      - `targetNetwork` string: Required. The VPC network name in the target_project where the DNS zone specified by `domain` is visible.
      - `targetProject` string: Required. The project ID hosting the Cloud DNS managed zone that contains the `domain`. The Vertex AI Service Agent requires the dns.peer role on this project.
    - `internetAccess` boolean: Optional. Whether to allow internet access.
    - `networkAttachment` string: Optional. The name of the customer VPC `NetworkAttachment` used to draw a PSC interface IP into the customer VPC for sandbox egress.
  - `ingressControlConfig` GoogleCloudAiplatformV1PrivateServiceConnectConfig: Represents configuration for private service connect.
    - `enablePrivateServiceConnect` boolean: Required. If true, expose the IndexEndpoint via private service connect.
    - `projectAllowlist` string[]: A list of Projects from which the forwarding rule will target the service attachment.
    - `pscAutomationConfigs` GoogleCloudAiplatformV1PSCAutomationConfig[]: Optional. List of projects and networks where the PSC endpoints will be created. This field is used by Online Inference(Prediction) only.
      - `errorMessage` string: Output only. Error message if the PSC service automation failed.
      - `forwardingRule` string: Output only. Forwarding rule created by the PSC service automation.
      - `ipAddress` string: Output only. IP address rule created by the PSC service automation.
      - `network` string: Required. The full name of the Google Compute Engine [network](https://cloud.google.com/compute/docs/networks-and-firewalls#networks). [Format](https://cloud.google.com/compute/docs/reference/rest/v1/networks/get): `projects/{project}/global/networks/{network}`.
      - `projectId` string: Required. Project id used to create forwarding rule.
      - `state` 'PSC_AUTOMATION_STATE_UNSPECIFIED' | 'PSC_AUTOMATION_STATE_SUCCESSFUL' | 'PSC_AUTOMATION_STATE_FAILED': Output only. The state of the PSC service automation.
    - `serviceAttachment` string: Output only. The name of the generated service attachment resource. This is only populated if the endpoint is deployed with PrivateServiceConnect.
  - `name` string: Identifier. The resource name of the SandboxEnvironmentTemplate. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sandboxEnvironmentTemplates/{sandbox_environment_template}`
  - `state` 'UNSPECIFIED' | 'PROVISIONING' | 'ACTIVE' | 'DEPROVISIONING' | 'DELETED' | 'FAILED': Output only. The state of the sandbox environment template.
  - `updateTime` string, google-datetime: Output only. The timestamp when this SandboxEnvironmentTemplate was most recently 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`.

---

[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)
