---
title: "POST /target-create-k8s"
method: POST
path: "/target-create-k8s"
tags: ["Targets"]
---

# POST /target-create-k8s

`POST /target-create-k8s`

## Request

- Base URL: `https://api.akeyless.io`
- URL: `https://api.akeyless.io/target-create-k8s`
- Auth: none declared

## Request body

- TargetCreateK8s: targetCreateK8s is a command that creates a new k8s target
  - `delete_protection` string: Protection from accidental deletion of this object [true/false]
  - `description` string: Description of the object
  - `json` boolean: Set output format to JSON
  - `k8s-auth-type` string: K8S auth type [token/certificate]
  - `k8s-client-certificate` string: Content of the k8 client certificate (PEM format) in a Base64 format
  - `k8s-client-key` string: Content of the k8 client private key (PEM format) in a Base64 format
  - `k8s-cluster-ca-cert` string: K8S cluster CA certificate
  - `k8s-cluster-endpoint` string: K8S cluster URL endpoint
  - `k8s-cluster-name` string: K8S cluster name
  - `k8s-cluster-token` string: K8S cluster Bearer token
  - `key` string: The name of a key that used to encrypt the target secret value (if empty, the account default protectionKey key will be used)
  - `lock-on-read` string: Lock this secret after each successful value read
  - `lock-ttl` string: Lock TTL in minutes
  - `max-versions` string: Set the maximum number of versions, limited by the account settings defaults.
  - `name` string, required: Target name
  - `rotate-on-unlock` string: Rotate this secret after it is unlocked
  - `token` string: Authentication token (see `/auth` and `/configure`)
  - `uid-token` string: The universal identity token, Required only for universal_identity authentication
  - `use-gw-service-account` boolean: Use the GW's service account

## Response `201`

targetCreateK8sResponse wraps response body.

- TargetCreateOutput
  - `target_id` integer

## Other responses

- `default`: errorResponse wraps any error to return it as a JSON object with one "error" field.

---

[API](https://skmtc.dev/akeyless/apis/infrastructure-connectivity.md) - [All operations](https://skmtc.dev/akeyless/apis/infrastructure-connectivity/llms.txt) - [OpenAPI document](https://skmtc.dev/akeyless/apis/infrastructure-connectivity/revisions/62dc62fea89d?raw)
