---
title: "POST /update-k8s-target"
method: POST
path: "/update-k8s-target"
tags: ["v2"]
---

# POST /update-k8s-target

`POST /update-k8s-target`

## Request body

- UpdateNativeK8STarget — updateNativeK8STarget is a command that updates an existing target. [Deprecated: Use target-update-k8s command]
  - `comment` string — Deprecated - use description
  - `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
  - `keep-prev-version` string — Whether to keep previous version [true/false]. If not set, use default according to account settings
  - `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)
  - `max-versions` string — Set the maximum number of versions, limited by the account settings defaults.
  - `name` string, required — Target name
  - `new-name` string — New target name
  - `token` string — Authentication token (see `/auth` and `/configure`)
  - `uid-token` string — The universal identity token, Required only for universal_identity authentication
  - `update-version` boolean — Deprecated
  - `use-gw-service-account` boolean — Use the GW's service account

## Response `200`

updateNativeK8STargetResponse wraps response body.

- UpdateNativeK8STargetOutput
  - `target_id` integer

## Other responses

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

---

[API](https://skmtc.net/akeyless/apis/akeyless-api.md) · [All operations](https://skmtc.net/akeyless/apis/akeyless-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/akeyless/akeyless-api/versions/0ceb25634501/schema)
