---
title: "Create sub-account API key"
method: POST
path: "/v1/sub-accounts/{id}/api-keys"
tags: ["Sub-Accounts"]
---

# Create sub-account API key

`POST /v1/sub-accounts/{id}/api-keys`

## Request

- Base URL: `https://api.zavu.dev`
- URL: `https://api.zavu.dev/v1/sub-accounts/{id}/api-keys`
- Auth: HTTP bearer

Create sub-account API key. Requires a parent project API key; sub-account API keys receive HTTP 403.

## Path parameters

- `id` string, required

## Request body

- SubAccountApiKeyCreateRequest
  - `name` string, required
  - `environment` 'live' | 'test'
  - `permissions` string[]

## Response `201`

API key created. The full key is only returned once.

- object
  - `apiKey` object, required
    - `id` string, required
    - `key` string, required
    - `name` string, required
    - `environment` 'live' | 'test', required

## Other responses

- `400`: Invalid request.
- `401`: Unauthorized.
- `403`: Forbidden. Sub-account API keys cannot manage sub-accounts.
- `404`: Not a sub-account of this team. The parent project's own id is not a sub-account and answers 404.

## Changes

> 80 revisions in range; 1 not diffed.

- **2026-05-15** `3e45958691da`: 1 info
  - added the non-success response with the status `403`
- **2026-03-17** `dca8af164271`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/zavudev/apis/zavu-unified-messaging-layer-api/changes/v1/sub-accounts/:id/api-keys/post.md)

---

[API](https://skmtc.dev/zavudev/apis/zavu-unified-messaging-layer-api.md) - [All operations](https://skmtc.dev/zavudev/apis/zavu-unified-messaging-layer-api/llms.txt) - [OpenAPI document](https://skmtc.dev/zavudev/apis/zavu-unified-messaging-layer-api/revisions/75bc777b0ffb?raw)
