---
title: "Create a PersistentVolumeClaim"
method: POST
path: "/kubernetes/{id}/namespaces/{namespace}/persistent_volume_claims"
tags: ["kubernetes"]
---

# Create a PersistentVolumeClaim

`POST /kubernetes/{id}/namespaces/{namespace}/persistent_volume_claims`

Create a PersistentVolumeClaim in the given namespace. The access mode
defaults to ReadWriteOnce and an omitted storage class leaves the choice to
the cluster default.
**Access policy**: Authenticated user.

## Path parameters

- `id` integer, required
- `namespace` string, required

## Request body

- KubernetesK8sPersistentVolumeClaimCreateRequest
  - `accessModes` V1PersistentVolumeAccessMode[]
  - `annotations` object
  - `labels` object
  - `name` string
  - `storage` string
  - `storageClass` string
  - `volumeMode` 'Block' | 'Filesystem'

## Response `200`

Success

- KubernetesK8sPersistentVolumeClaim
  - `accessModes` string[]
  - `allowVolumeExpansion` boolean
  - `creationDate` string
  - `humanReadableAccessModes` V1PersistentVolumeAccessMode[]
  - `id` string
  - `labels` object
  - `name` string
  - `namespace` string
  - `owningApplications` KubernetesK8sApplication[]
    - `Annotations` object
    - `ApplicationOwner` string
    - `ApplicationType` string
    - `Configurations` KubernetesConfiguration[]
      - `ConfigurationOwner` string
      - `Data` object
      - `Kind` string
    - `Containers` unknown[]
      - unknown
    - `CreationDate` string
    - `CustomResourceMetadata` KubernetesCustomResourceMetadata
      - `apiVersion` string
      - `kind` string
      - `name` string
      - `plural` string
      - `scope` string
    - `DeploymentType` string
    - `Id` string
    - `Image` string
    - `Kind` string
    - `Labels` object
    - `LoadBalancerIPAddress` string
    - `MatchLabels` object
    - `Metadata` KubernetesMetadata
      - `annotations` object
      - `labels` object
    - `Name` string
    - `Namespace` string
    - `Pods` KubernetesPod[]
      - `ContainerName` string
      - `CreationDate` string
      - `Image` string
      - `ImagePullPolicy` string
      - `Name` string
      - `NodeName` string
      - `PodIP` string
      - `Resource` KubernetesK8sApplicationResource
        - `CpuLimit` number
        - `CpuRequest` number
        - `MemoryLimit` integer
        - `MemoryRequest` integer
      - `Status` string
      - `Uid` string
    - `PublishedPorts` KubernetesPublishedPort[]
      - `IngressRules` KubernetesIngressRule[]
        - `Host` string
        - `IP` string
        - `Path` string
        - `TLS` KubernetesTLSInfo[]
          - `hosts` string[]
      - `Port` integer
    - `Resource` KubernetesK8sApplicationResource
      - `CpuLimit` number
      - `CpuRequest` number
      - `MemoryLimit` integer
      - `MemoryRequest` integer
    - `ResourcePool` string
    - `RunningPodsCount` integer
    - `ServiceId` string
    - `ServiceName` string
    - `ServiceType` string
    - `StackId` string
    - `StackKind` string
    - `StackName` string
    - `Status` string
    - `TotalPodsCount` integer
    - `Uid` string
  - `phase` 'Pending' | 'Bound' | 'Lost'
  - `resourcesRequests` V1ResourceList
  - `storage` integer
  - `storageClass` string
  - `storageRequest` string
  - `volumeMode` 'Block' | 'Filesystem'
  - `volumeName` string

## Other responses

- `400` — Invalid request payload, such as missing required fields or a storage size that is not a valid quantity.
- `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.
- `409` — A persistent volume claim with the same name already exists in the namespace.
- `500` — Server error occurred while attempting to create the persistent volume claim.

## Changes

- **2026-08-07** `ec51a8194ac0` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/portainer/apis/portainerce-api/changes/kubernetes/:id/namespaces/:namespace/persistent_volume_claims/post.md)

---

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