---
title: "POST /v1/{+parent}/customTargetTypes"
method: POST
path: "/v1/{+parent}/customTargetTypes"
tags: ["projects"]
---

# POST /v1/{+parent}/customTargetTypes

`POST /v1/{+parent}/customTargetTypes`

Creates a new CustomTargetType in a given project and location.

## Path parameters

- `parent` string, required

## Query parameters

- `customTargetTypeId` string
- `requestId` string
- `validateOnly` boolean

## Request body

- CustomTargetType — A `CustomTargetType` resource in the Cloud Deploy API. A `CustomTargetType` defines a type of custom target that can be referenced in a `Target` in order to facilitate deploying to other systems besides the supported runtimes.
  - `tasks` CustomTargetTasks — CustomTargetTasks represents the `CustomTargetType` configuration using tasks.
    - `deploy` Task — A Task represents a unit of work that is executed as part of a Job.
      - `container` ContainerTask — This task is represented by a container that is executed in the Cloud Build execution environment.
        - `image` string — Required. Image is the container image to use.
        - `args` string[] — Optional. Args is the container arguments to use. This overrides the default arguments defined in the container image.
        - `command` string[] — Optional. Command is the container entrypoint to use. This overrides the default entrypoint defined in the container image.
        - `env` object — Optional. Environment variables that are set in the container.
    - `render` Task — A Task represents a unit of work that is executed as part of a Job.
      - `container` ContainerTask — This task is represented by a container that is executed in the Cloud Build execution environment.
        - `image` string — Required. Image is the container image to use.
        - `args` string[] — Optional. Args is the container arguments to use. This overrides the default arguments defined in the container image.
        - `command` string[] — Optional. Command is the container entrypoint to use. This overrides the default entrypoint defined in the container image.
        - `env` object — Optional. Environment variables that are set in the container.
  - `etag` string — Optional. This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.
  - `uid` string — Output only. Unique identifier of the `CustomTargetType`.
  - `description` string — Optional. Description of the `CustomTargetType`. Max length is 255 characters.
  - `customActions` CustomTargetSkaffoldActions — CustomTargetSkaffoldActions represents the `CustomTargetType` configuration using Skaffold custom actions.
    - `renderAction` string — Optional. The Skaffold custom action responsible for render operations. If not provided then Cloud Deploy will perform the render operations via `skaffold render`.
    - `includeSkaffoldModules` SkaffoldModules[] — Optional. List of Skaffold modules Cloud Deploy will include in the Skaffold Config as required before performing diagnose.
      - `git` SkaffoldGitSource — Git repository containing Skaffold Config modules.
        - `repo` string — Required. Git repository the package should be cloned from.
        - `path` string — Optional. Relative path from the repository root to the Skaffold file.
        - `ref` string — Optional. Git branch or tag to use when cloning the repository.
      - `configs` string[] — Optional. The Skaffold Config modules to use from the specified source.
      - `googleCloudStorage` SkaffoldGCSSource — Cloud Storage bucket containing Skaffold Config modules.
        - `path` string — Optional. Relative path from the source to the Skaffold file.
        - `source` string — Required. Cloud Storage source paths to copy recursively. For example, providing "gs://my-bucket/dir/configs/*" will result in Skaffold copying all files within the "dir/configs" directory in the bucket "my-bucket".
      - `googleCloudBuildRepo` SkaffoldGCBRepoSource — Cloud Build V2 Repository containing Skaffold Configs.
        - `path` string — Optional. Relative path from the repository root to the Skaffold Config file.
        - `ref` string — Optional. Branch or tag to use when cloning the repository.
        - `repository` string — Required. Name of the Cloud Build V2 Repository. Format is projects/{project}/locations/{location}/connections/{connection}/repositories/{repository}.
    - `deployAction` string — Required. The Skaffold custom action responsible for deploy operations.
  - `labels` object — Optional. Labels are attributes that can be set and used by both the user and by Cloud Deploy. Labels must meet the following constraints: * Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. * All characters must use UTF-8 encoding, and international characters are allowed. * Keys must start with a lowercase letter or international character. * Each resource is limited to a maximum of 64 labels. Both keys and values are additionally constrained to be <= 128 bytes.
  - `name` string — Identifier. Name of the `CustomTargetType`. Format is `projects/{project}/locations/{location}/customTargetTypes/{customTargetType}`. The `customTargetType` component must match `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`
  - `annotations` object — Optional. User annotations. These attributes can only be set and used by the user, and not by Cloud Deploy. See https://google.aip.dev/128#annotations for more details such as format and size limitations.
  - `createTime` string, google-datetime — Output only. Time at which the `CustomTargetType` was created.
  - `customTargetTypeId` string — Output only. Resource id of the `CustomTargetType`.
  - `updateTime` string, google-datetime — Output only. Most recent time at which the `CustomTargetType` was updated.

## Response `200`

Successful response

---

[API](https://skmtc.dev/google/apis/clouddeploy.md) · [All operations](https://skmtc.dev/google/apis/clouddeploy/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/google/clouddeploy/revisions/a8819765974a/schema)
