---
title: "Toggle API Key Active Status"
method: PATCH
path: "/api/me/api-keys/{key_id}/active"
tags: ["API Keys"]
---

# Toggle API Key Active Status

`PATCH /api/me/api-keys/{key_id}/active`

Enable or disable an API key. Disabled keys will be rejected for authentication.

## Path parameters

- `key_id` string, required

## Request body

- UserApiKeyToggleRequest
  - `is_active` boolean, required

## Response `200`

Key status updated

- UserApiKeyInfo
  - `id` string
  - `name` string
  - `key_prefix` string — First 8 characters of the key (fim_****)
  - `scopes` string, nullable — Comma-separated scopes (chat, agents, kb, connectors, admin)
  - `is_active` boolean
  - `expires_at` string, date-time, nullable
  - `last_used_at` string, date-time, nullable
  - `total_requests` integer
  - `created_at` string, date-time

## Other responses

- `401` — Unauthorized
- `404` — API key not found

---

[API](https://skmtc.dev/fim-ai/apis/fim-one-api.md) · [All operations](https://skmtc.dev/fim-ai/apis/fim-one-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/fim-ai/fim-one-api/revisions/6832c00d58dc/schema)
