---
title: "Delete Token"
method: DELETE
path: "/api/v1/tokens/{token_id}"
tags: ["API Tokens"]
---

# Delete Token

`DELETE /api/v1/tokens/{token_id}`

## Request

- Base URL: `https://public-api.linearb.io`
- URL: `https://public-api.linearb.io/api/v1/tokens/{token_id}`
- Auth: API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/linearb/apis/linearb-api/docs/api/v1/tokens/:token_id/delete.ts> (a function with typed inputs; its response is checked against the schema)

Permanently delete a token. Revoke an active token first. A token that a detection setting uses cannot be deleted until that setting changes.

## Path parameters

- `token_id` integer, required: Token ID

## Response `200`

Successful Response

## Other responses

- `204`: Successful Response
- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden - only admins can manage tokens
- `404`: Token not found
- `405`: Method Not Allowed
- `409`: Conflict - the token is active, a detection setting uses it, or the token is an otel token
- `422`: Validation Error
- `500`: Internal Server Error
- `504`: Gateway Timeout

---

[API](https://skmtc.dev/linearb/apis/linearb-api.md) - [All operations](https://skmtc.dev/linearb/apis/linearb-api/llms.txt) - [OpenAPI document](https://skmtc.dev/linearb/apis/linearb-api/revisions/3aea06710db6?raw)
