---
title: "Update Project API Key"
method: PUT
path: "/v1/projects/{projectId}/api-keys/{apiKeyId}"
tags: ["Project API Keys"]
---

# Update Project API Key

`PUT /v1/projects/{projectId}/api-keys/{apiKeyId}`

Activates or deactivates a project-scoped API key. A deactivated key is rejected on authentication.

## Path parameters

- `projectId` string, required
- `apiKeyId` integer, required

## Request body

- UpdateApiKey
  - `valid` boolean, required — Set to `false` to deactivate the key, or `true` to reactivate it

## Response `200`

- ApiKeyResponse
  - `success` boolean, required — Indicates if the request was successful
  - `data` object, required
    - `apiKey` ApiKey
      - `id` integer, required — Unique identifier for the API key
      - `name` string, nullable — Human-readable label for the API key
      - `valid` boolean, required — Whether the key is active. A deactivated key is rejected on authentication.
      - `value` string, required — The API key value. This is redacted (only the last 6 characters are shown, prefixed with asterisks) on every response **except** the create response, where the full value is returned exactly once.
      - `created_at` string, date-time, required — ISO 8601 timestamp of when the key was created
      - `lastUsed` string, date-time, nullable — ISO 8601 timestamp of when the key was last used to authenticate, or `null` if never used

## Changes

> 54 revisions in range; 3 not diffed.

- **2026-05-31** `173563ada468` — 2 info
  - api tag `Project API Keys` added
  - api tag `API Keys` removed
- **2026-05-31** `78a7dd1b6b48` — 1 info
  - endpoint added
- **2026-05-31** `d493eef38a58` — 1 breaking
  - api path removed without deprecation
- **2026-05-31** `78a7dd1b6b48` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/confident-ai/apis/confident-ai-metrics-api/changes/v1/projects/:projectId/api-keys/:apiKeyId/put.md)

---

[API](https://skmtc.dev/confident-ai/apis/confident-ai-metrics-api.md) · [All operations](https://skmtc.dev/confident-ai/apis/confident-ai-metrics-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/confident-ai/confident-ai-metrics-api/revisions/95cdde71b65e/schema)
