---
title: "Create a storage policy"
method: POST
path: "/projects/{id}/storage/buckets/{bucketName}/policies"
tags: ["Storage Policies"]
---

# Create a storage policy

`POST /projects/{id}/storage/buckets/{bucketName}/policies`

## Request

- Base URL: `https://api.volcano.dev`
- URL: `https://api.volcano.dev/projects/{id}/storage/buckets/{bucketName}/policies`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

## Path parameters

- `id` string, uuid, required
- `bucketName` string, required

## Request body

- CreateStoragePolicyRequest
  - `name` string, required: Policy name
  - `operation` 'SELECT' | 'INSERT' | 'UPDATE' | 'DELETE', required: Operation this policy applies to
  - `definition` string, required: Policy expression

## Response `201`

Policy created

- StoragePolicy
  - `id` string, uuid, required
  - `bucket_id` string, uuid, required
  - `name` string, required: Policy name (unique within bucket)
  - `operation` 'SELECT' | 'INSERT' | 'UPDATE' | 'DELETE', required: Operation this policy applies to
  - `definition` string, required: Policy expression evaluated at request time. Examples: - "true" - Allow all - "auth.uid() = owner_id" - Owner only - "auth.role() = 'authenticated'" - Authenticated users - "(storage.foldername(name))[1] = auth.uid()::text" - User's folder
  - `created_at` string, date-time
  - `updated_at` string, date-time

## Changes

- **2026-10-07** `23e7875e7c4c`: 1 info
  - the endpoint scheme security `ProjectAccessToken` was added to the API
- **2026-09-19** `3a6f365f3f35`: 7 breaking, 7 info
  - added the new path request parameter `bucketName`
  - added the new path request parameter `id`
  - added the new required request property `definition`
  - added the new required request property `name`
  - …10 more
- **2026-08-27** `bb44e98aba2e`: 7 breaking, 7 warning
  - the request's body type changed from `object` to no type
  - the response's body type changed from `object` to no type for status `201`
  - removed the required property `bucket_id` from the response with the `201` status
  - removed the required property `definition` from the response with the `201` status
  - …10 more

[Operation history](https://skmtc.dev/kong/apis/volcano-api/changes/projects/:id/storage/buckets/:bucketName/policies/post.md)

---

[API](https://skmtc.dev/kong/apis/volcano-api.md) - [All operations](https://skmtc.dev/kong/apis/volcano-api/llms.txt) - [OpenAPI document](https://skmtc.dev/kong/apis/volcano-api/revisions/84c4488f91e9?raw)
