---
title: "Revoke a key"
method: DELETE
path: "/keys/{key_id}"
tags: ["keys"]
---

# Revoke a key

`DELETE /keys/{key_id}`

## Request

- Base URL: `https://api.tradingpal.io/api/v1`
- URL: `https://api.tradingpal.io/api/v1/keys/{key_id}`
- Auth: API key in cookie `tp_sessionid`

Revokes one of the signed-in user's keys; requests that carry it answer 401 invalid_api_key from then on. Cannot be undone. Answers 404 when the id is not one of the user's active keys. Session cookie auth, not an API key.

## Path parameters

- `key_id` integer, required

## Response `200`

Revoked

- KeyRevoked: Confirmation that a key was revoked.
  - `id` integer: The id of the revoked key.
  - `revoked_at` string, date-time: When it was revoked, ISO 8601 date-time.

## Other responses

- `403`: not signed in to the site
- `404`: no such key: not one of the user's active keys

---

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