---
title: "Regenerate workspace API key"
method: POST
path: "/workspaces/{id}/api-key/regenerate"
tags: ["Workspaces"]
---

# Regenerate workspace API key

`POST /workspaces/{id}/api-key/regenerate`

Regenerates the API key for a workspace. Sets 24-hour expiration on existing active keys and creates a new key. Cannot be used on protected workspaces. Rate limited to 1 request per minute.

## Path parameters

- `id` string, uuid, required

## Request body

- object
  - `key_type` 'live' | 'test' — Which key type to regenerate ('live' or 'test'). Defaults to 'live'. Regenerating one type does not expire or affect the other.

## Response `201`

API key regenerated successfully

- ApiKeyRegenerateResponse — API key regeneration result
  - `new_key` object, required — The newly generated API key
    - `api_key` string — The new API key value
    - `created_at` string, date-time — When the key was created
  - `key_type` 'live' | 'test', required — The key type that was regenerated
  - `expiring_keys` object[] — List of keys that were set to expire in 24 hours
    - `id` string, uuid
    - `api_key` string — The expiring API key value
    - `expires_at` string, date-time
  - `workspace_id` string, uuid, required

## Other responses

- `400` — Cannot regenerate key for protected workspace
- `401` — Unauthorized - Invalid or missing API key
- `403` — Forbidden - Insufficient permissions
- `404` — Not Found - Resource does not exist
- `429` — Too Many Requests - Rate limit exceeded

---

[API](https://skmtc.dev/firma/apis/firma-partner-api.md) · [All operations](https://skmtc.dev/firma/apis/firma-partner-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/firma/firma-partner-api/revisions/5c03d6a9d080/schema)
