---
title: "Create a service account API key"
method: POST
path: "/api/v0/service-accounts/{serviceAccountId}/api-keys"
tags: ["Service Accounts"]
---

# Create a service account API key

`POST /api/v0/service-accounts/{serviceAccountId}/api-keys`

Mints a new API key for a service account and returns the one-time key value. The value is shown only once and cannot be retrieved later.

## Path parameters

- `serviceAccountId` string, required — Service account ID

## Request body

- CreateServiceAccountApiKeyRequestBody
  - `name` string, required
  - `expiresAt` integer

## Response `201`

Response for status 201

- CreateServiceAccountApiKey201ResponseBody
  - `apiKey` object, required
    - `id` string, required — API key ID
    - `value` string, required — One-time presentation key value, returned only on creation
    - `fingerprint` string, required — Non-reversible suffix for display
    - `name` string, required — Human-readable name for the key
    - `expiresAt` number — Unix epoch milliseconds when the key expires, if set

## Other responses

- `400` — Response for status 400
- `401` — Response for status 401
- `402` — Response for status 402
- `403` — Response for status 403
- `404` — Response for status 404
- `409` — Response for status 409
- `500` — Response for status 500

---

[API](https://skmtc.net/factory/apis/factory-public-api.md) · [All operations](https://skmtc.net/factory/apis/factory-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/factory/factory-public-api/versions/684f94d47ca9/schema)
