---
title: "Restore a revoked API key [admin]"
method: POST
path: "/api_keys/{id}/restore"
tags: ["api_keys"]
---

# Restore a revoked API key \[admin\]

`POST /api_keys/{id}/restore`

## Request

- Base URL: `https://api.agentsky.dev/v1`
- URL: `https://api.agentsky.dev/v1/api_keys/{id}/restore`
- Auth: HTTP bearer

The same secret works again. An expired key cannot be restored (409 `expired`).

## Path parameters

- `id` string, required

## Response `200`

OK

- object
  - `api_key` ApiKey, required: One of the person's own API keys. Its secret is never part of it.
    - `id` string, required
    - `name` string, required
    - `token_prefix` string, required: The first characters of the secret, to tell keys apart.
    - `scopes` string[], required
    - `universe` string, nullable, required: The workspace the key is fixed to; null for a key that works in any of the person's workspaces.
    - `status` 'active' | 'revoked' | 'expired', required
    - `can_reveal` boolean, required: Whether `reveal` can read the secret back. Keys made before secrets were kept encrypted cannot.
    - `can_restore` boolean, required: Whether `restore` can make the key work again once revoked.
    - `current` boolean, required: True for the key this request was made with.
    - `last_used_at` string, date-time, nullable, required
    - `expires_at` string, date-time, nullable, required
    - `revoked_at` string, date-time, nullable, required
    - `created_at` string, date-time, required

## Other responses

- `default`: Error — { error: { code, message } }

## Changes

- **2026-11-02** `e5e8f0229a99`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/agentsky/apis/agentsky-developer-api/changes/api_keys/:id/restore/post.md)

---

[API](https://skmtc.dev/agentsky/apis/agentsky-developer-api.md) - [All operations](https://skmtc.dev/agentsky/apis/agentsky-developer-api/llms.txt) - [OpenAPI document](https://skmtc.dev/agentsky/apis/agentsky-developer-api/revisions/8280a065ef6a?raw)
