---
title: "Create Api Key"
method: POST
path: "/service-accounts/{service_account_id}/api-keys"
tags: ["service-accounts"]
---

# Create Api Key

`POST /service-accounts/{service_account_id}/api-keys`

## Request

- Base URL: `https://api.traversal.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.traversal.com/service-accounts/{service_account_id}/api-keys`
- Auth: none declared

## Path parameters

- `service_account_id` string, required

## Request body

- CreateServiceAccountApiKeyRequest
  - `name` string, required

## Response `200`

Successful Response

- CreateServiceAccountApiKeyResponse
  - `api_key` ServiceAccountApiKey, required
    - `id` string, required
    - `name` string, required
    - `prefix` string, required
    - `created_at` string, date-time, required
    - `created_by` ServiceAccountApiKeyCreator, required
      - `user_id` string, required
      - `name` string, required
      - `profile_photo_url` string, nullable, required
    - `last_used_at` string, date-time, nullable, required
    - `revoked_at` string, date-time, nullable, required
    - `status` 'active' | 'revoked', required: Lifecycle state of a stored API key. Revoked keys stay in the table.
  - `token` string, required

## Other responses

- `422`: Validation Error

## Changes

> 66 revisions in range; 9 not diffed.

- **2026-09-28** `ff08ffe40f1a`: 2 info
  - added the required property `api_key/created_by` to the response with the `200` status
  - added the required property `api_key/status` to the response with the `200` status
- **2026-09-09** `50f9ba1b135c`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/traversal/apis/traversal-api/changes/service-accounts/:service_account_id/api-keys/post.md)

---

[API](https://skmtc.dev/traversal/apis/traversal-api.md) - [All operations](https://skmtc.dev/traversal/apis/traversal-api/llms.txt) - [OpenAPI document](https://skmtc.dev/traversal/apis/traversal-api/revisions/31e1a8b7cf89?raw)
