---
title: "Create Service Account Api Key"
method: POST
path: "/v1/service-accounts/{service_account_user_id}/api-keys"
tags: ["workspace"]
---

# Create Service Account Api Key

`POST /v1/service-accounts/{service_account_user_id}/api-keys`

Create a new API key for a service account

## Path parameters

- `service_account_user_id` string, required

## Headers

- `xi-api-key` string, nullable — Your API key. This is required by most endpoints to access our API programmatically. You can view your xi-api-key using the 'Profile' tab on the website.

## Request body

- BodyCreateServiceAccountApiKeyV1ServiceAccountsServiceAccountUserIdApiKeysPost
  - `name` string, required
  - `permissions` union, required — The permissions of the XI API.
    - PermissionType[]
    - 'all'
  - `character_limit` integer, nullable — The character limit of the XI API key. If provided this will limit the usage of this api key to n characters per month where n is the chosen value. Requests that incur charges will fail after reaching this monthly limit.
  - `allowed_ips` string[], nullable — List of IP addresses or CIDR ranges allowed to use this API key. Each entry may be a CIDR range (e.g. '10.0.0.0/24') or a bare IP address (normalized to /32 or /128). On create, omit or pass null to allow all IPs. On update, omit to leave the allowlist unchanged, or pass "clear" to remove it.
  - `third_party_disable_allowed` boolean, nullable — Whether the holder of this key may disable it via the self-disable endpoint. On create, omit or pass null to use the workspace's default (enabled for non-Enterprise plans, disabled for Enterprise plans). On update, omit to leave it unchanged, or pass "clear" to reset it to the workspace default. Only honored for workspaces with self-disable access enabled.

## Response `200`

Successful Response

- WorkspaceCreateApiKeyResponseModel
  - `xi-api-key` string, required
  - `key_id` string, required

## Other responses

- `422` — Validation Error

---

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