---
title: "Revoke previous API key secret"
method: POST
path: "/api-keys/{id}/revoke-previous"
tags: ["Team Management"]
---

# Revoke previous API key secret

`POST /api-keys/{id}/revoke-previous`

## Request

- Base URL: `https://admin-api.exa.ai/team-management`
- URL: `https://admin-api.exa.ai/team-management/api-keys/{id}/revoke-previous`
- Auth: API key in header `x-api-key`

Ends a rotation's grace period early. The secret replaced by the last rotation stops working now; the current secret is unaffected. Responds with `revoked` set to false when there is no previous secret in its grace period.

## Path parameters

- `id` string, required

## Response `200`

Previous secret revoked, or there was none to revoke

- object
  - `apiKey` object
    - `publicId` string
    - `previousSecretExpiresAt` unknown
  - `revoked` boolean: Whether a previous secret was revoked by this request.

## Other responses

- `401`: Unauthorized - Invalid or missing service key
- `403`: Forbidden - the key is managed by an integration
- `404`: Not Found - API key does not exist

## Changes

- **2026-11-03** `271bf8d70dff`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/exa/apis/team-management-api/changes/api-keys/:id/revoke-previous/post.md)

---

[API](https://skmtc.dev/exa/apis/team-management-api.md) - [All operations](https://skmtc.dev/exa/apis/team-management-api/llms.txt) - [OpenAPI document](https://skmtc.dev/exa/apis/team-management-api/revisions/271bf8d70dff?raw)
