---
title: "Create a user-owned API token valid until revoked"
method: POST
path: "/v1/organizations/{organization_id}/user-api-keys"
---

# Create a user-owned API token valid until revoked

`POST /v1/organizations/{organization_id}/user-api-keys`

## Request

- Base URL: `https://app.ohmyho.st`
- URL: `https://app.ohmyho.st/v1/organizations/{organization_id}/user-api-keys`
- Auth: HTTP bearer

Requires a current interactive user session. Organization membership and product permissions are revalidated. Only the first creation returns the full value; exact replay returns metadata and a null value. Save the first response locally without putting it in logs or agent prompts. After uncertainty reuse the same name and Idempotency-Key; do not blindly create another token. Available at zero credits.

## Path parameters

- `organization_id` string, required

## Headers

- `X-Request-Id` string
- `Idempotency-Key` string, required

## Request body

- object
  - `name` string, required

## Response `200`

Original token observed; the full value cannot be retrieved again.

- UserApiKeyCreation
  - `request_id` string, required
  - `replayed` false, required
  - `key` UserApiKey, required
    - `id` string, required
    - `organization_id` string, required
    - `name` string, required
    - `obfuscated_value` string, required
    - `permissions` string[], required
    - `expires_at` string, date-time, nullable, required
    - `created_at` string, date-time, required
    - `last_used_at` string, date-time, nullable, required
  - `value` string, nullable, required

## Other responses

- `201`: Token created; the full value is returned once.
- `400`: The request failed.
- `401`: The request failed.
- `403`: The request failed.
- `404`: The resource does not exist or is not visible to the authenticated principal.
- `409`: The request failed.
- `429`: The request failed.
- `503`: The request failed.

---

[API](https://skmtc.dev/ohmyho/apis/ohmyho-st-api.md) · [All operations](https://skmtc.dev/ohmyho/apis/ohmyho-st-api/llms.txt) · [OpenAPI document](https://skmtc.dev/ohmyho/apis/ohmyho-st-api/revisions/d069888c0017?raw)
