---
title: "Validate Kubernetes manifests without applying them"
method: POST
path: "/kubernetes/{id}/manifests/dry_run"
tags: ["kubernetes"]
---

# Validate Kubernetes manifests without applying them

`POST /kubernetes/{id}/manifests/dry_run`

Validate Kubernetes manifests against the cluster with a server-side dry-run apply, without persisting anything.
Each resource is reported on its own, so a rejected resource does not hide the outcome of the others.
The dry-run runs with the permissions of the requesting user, so it also surfaces missing permissions.
A resource living in a namespace created by another manifest of the same request is reported as failed, because the dry-run never persists that namespace.
**Access policy**: authenticated

## Path parameters

- `id` integer, required

## Request body

- KubernetesManifestDryRunPayload
  - `manifests` string[] — The manifests to validate. Each entry may hold several YAML documents separated by "---".
  - `namespace` string — The namespace applied to namespaced resources that do not declare one. A resource declaring a different namespace is rejected.

## Response `200`

Success

- KubernetesManifestDryRunResponse
  - `results` KubernetesManifestDryRunResult[]
    - `documentIndex` integer — The zero-based position of the document among the non-empty documents of all manifests. It identifies a document rejected before its resource could be named, such as malformed YAML.
    - `kind` string
    - `message` string — The reason the resource was rejected. Empty when the resource passed.
    - `name` string
    - `namespace` string
    - `status` string — Either "pass" or "fail".

## Other responses

- `400` — Invalid request payload, such as missing required fields or fields not meeting validation criteria.
- `401` — Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions.
- `403` — Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions.
- `404` — Unable to find an environment with the specified identifier.
- `500` — Server error occurred while attempting to validate the manifests.

---

[API](https://skmtc.net/portainer/apis/portainerce-api.md) · [All operations](https://skmtc.net/portainer/apis/portainerce-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/portainer/portainerce-api/revisions/d7d5dff08b4c/schema)
