---
title: "Create service key"
method: POST
path: "/projects/{id}/service-keys"
tags: ["Service Keys"]
---

# Create service key

`POST /projects/{id}/service-keys`

## Request

- Base URL: `https://api.volcano.dev`
- URL: `https://api.volcano.dev/projects/{id}/service-keys`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Create a new service role key for admin operations.

**WARNING:** Service keys bypass all RLS policies!
Store securely and NEVER expose in frontend code.

## Path parameters

- `id` string, uuid, required

## Request body

- object
  - `name` string, required: Descriptive name for the key (e.g., "admin-dashboard", "background-jobs"). Can only contain letters, numbers, underscores, and hyphens.
  - `permissions` string[]: Optional least-privilege scope for the key. When omitted, empty, or containing only blank strings, the key is granted full access (["*"]) for backward compatibility. Provide an explicit list (e.g. ["functions.invoke", "locks.manage"]) to restrict the key; "*" grants everything. Scope enforcement applies to function invocation, storage object operations, project locks, and server-side auth proxy metadata (auth.signin, auth.signup, auth.refresh, auth.logout, auth.password_reset). A key scoped to a list without "*" reads and stops a durable execution only with the `client_token` its start returned.

## Response `201`

Service key created - save the key_value immediately!

- ServiceKey: Service role key for admin operations. **WARNING:** Bypasses all RLS - backend use only!
  - `id` string, uuid, required
  - `project_id` string, uuid
  - `name` string, required: Descriptive name for the key
  - `key_value` string: Full JWT token for Authorization header. Returned on create, get, and list (decrypted from storage). **Store securely - NEVER expose in frontend code!**
  - `key_prefix` string, required: First 12 characters of the key for display/identification
  - `permissions` string[], required: Operations this key may perform. ["*"] grants full admin access (default for keys created without an explicit scope). Scoped keys list specific permissions, e.g. ["functions.invoke", "locks.manage"].
  - `created_at` string, date-time
  - `updated_at` string, date-time

## Other responses

- `409`: Key with this name already exists

## Changes

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

[Operation history](https://skmtc.dev/kong/apis/volcano-api/changes/projects/:id/service-keys/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)
