---
title: "Revoke an API key"
method: POST
path: "/keys/{id}/revoke"
tags: ["keys"]
---

# Revoke an API key

`POST /keys/{id}/revoke`

## Request

- Base URL: `https://api.gogoscreen.com/api/v1`
- URL: `https://api.gogoscreen.com/api/v1/keys/{id}/revoke`
- Auth: HTTP bearer

Kill a key. It stops working everywhere within a second. Revoking an already-revoked key succeeds: making sure a credential is dead must always be possible.

## Path parameters

- `id` string, uuid, required

## Headers

- `Idempotency-Key` string, required

## Response `200`

Revoke an API key

- object
  - `apiKey` object, required
    - `createdAt` string, date-time, required
    - `expiresAt` string, date-time, nullable, required
    - `id` string, required
    - `last4` string, required: The last four characters, for telling two keys apart in a list.
    - `lastUsedAt` string, date-time, nullable, required: Written at most once a minute, so it is accurate to the minute and not to the request.
    - `name` string, required
    - `prefix` string, required: `gsk_live_` plus the first eight characters of the secret. Enough to recognise a key; not enough to use one.
    - `rateLimitPerDay` number, nullable, required: A per-key daily cap. Null means uncapped by the key itself.
    - `rateLimitPerMinute` number, nullable, required: A per-key ceiling. Null means the rate class's own limit applies; a number can only ever lower it.
    - `revokedAt` string, date-time, nullable, required
    - `scopes` string[], required
    - `status` 'active' | 'revoked' | 'expired', required

## Other responses

- `400`: `validation_failed` — That request is not valid. · `idempotency_key_required` — This operation needs an Idempotency-Key header: a string of up to 128 characters, unique to this request, so a retry cannot do the work twice.
- `401`: `unauthorized` — Authentication is required.
- `403`: `forbidden_scope` — This credential does not carry the scope this operation needs.
- `404`: `not_found` — No such resource.
- `409`: `idempotency_conflict` — That idempotency key was already used with a different request. · `idempotency_in_progress` — That idempotency key is still being processed. · `conflict` — That request conflicts with the current state.
- `429`: `rate_limited` — Too many requests. Try again shortly.
- `500`: `internal_error` — Something went wrong. Try again.

---

[API](https://skmtc.dev/gogoscreen/apis/gogoscreen-api.md) · [All operations](https://skmtc.dev/gogoscreen/apis/gogoscreen-api/llms.txt) · [OpenAPI document](https://skmtc.dev/gogoscreen/apis/gogoscreen-api/revisions/2fd812319d75?raw)
