---
title: "Revoke the API key used for this request"
method: DELETE
path: "/api/v1/api-keys/self"
tags: ["API Key Management"]
---

# Revoke the API key used for this request

`DELETE /api/v1/api-keys/self`

## Request

- Base URL: `https://api.imagestep.dev`
- URL: `https://api.imagestep.dev/api/v1/api-keys/self`
- Auth: API key in header `Authorization`

Revokes the key this request authenticated with and answers `204` with no body. Takes no id, so it cannot revoke any other key. Called by `imagestep logout`.

- The key stops working at once on the instance that answered; another instance that has validated it recently may accept it for up to 30 seconds more. Stop using the key after this call rather than racing that window.
- Not repeatable: a second call cannot authenticate and answers `401` — after your own revoke, that means it worked.
- A signed-in session (`Bearer`) has no key behind it and gets `400 invalid_state`; it revokes a key by id instead (`DELETE /api/v1/api-keys/{keyId}`, session only).

## Headers

- `Idempotency-Key` string

## Response `204`

The calling key is revoked; from now on it answers `401`

## Other responses

- `400`: `invalid_state` — this request did not authenticate with an API key
- `409`: Conflict — `error.code` is `idempotency_key_reuse` (the key already means a different request) or `request_in_progress` (the first request under this key has not settled yet; retryable).
- `429`: Rate limited — `error.code` is `rate_limited` and `retryable` is true. `Retry-After` says how many seconds to wait.

---

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