---
title: "POST /api-keys/{id}/deactivate"
method: POST
path: "/api-keys/{id}/deactivate"
tags: ["API Keys"]
---

# POST /api-keys/{id}/deactivate

`POST /api-keys/{id}/deactivate`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/api-keys/{id}/deactivate`
- Auth: HTTP bearer

## Path parameters

- `id` integer, required

## Response `200`

API key deactivated successfully

- ApiKeyResponse
  - `created_at` string, date-time, required
  - `environment_id` integer, nullable
  - `expires_at` string, date-time, nullable
  - `id` integer, required
  - `is_active` boolean, required
  - `key_prefix` string, required
  - `last_used_at` string, date-time, nullable
  - `name` string, required
  - `permissions` string[], nullable
  - `project_id` integer, nullable: Immutable optional deployment resource scope.
  - `role_type` string, required

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not found
- `500`: Internal server error

## Changes

- **2026-11-16** `eb31063c55e2`: 2 info
  - added the optional property `environment_id` to the response with the `200` status
  - added the optional property `project_id` to the response with the `200` status

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/api-keys/:id/deactivate/post.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
