---
title: "Revoke Write Token"
method: DELETE
path: "/v1/projects/{project_id}/write-tokens/{token_id}/"
tags: ["Projects"]
---

# Revoke Write Token

`DELETE /v1/projects/{project_id}/write-tokens/{token_id}/`

## Request

- Base URL: `https://logfire-api.pydantic.dev/api`
- URL: `https://logfire-api.pydantic.dev/api/v1/projects/{project_id}/write-tokens/{token_id}/`
- Auth: OAuth 2
  - Authorization code: `api/oauth/authorize`
  - Token URL: `/api/oauth/token` scopes: `project:write_token`
- TypeScript: <https://skmtc.dev/pydantic/apis/pydantic-logfire-api/docs/v1/projects/:project_id/write-tokens/:token_id/delete.ts> (a function with typed inputs; its response is checked against the schema)

Revoke a write token. Refused for a token belonging to a frontend application.

That application would be left alive and unable to receive data, and nothing else can attach a
token to an existing application. Rotate the token instead, or delete the application.

## Path parameters

- `token_id` string, uuid, required
- `project_id` string, uuid, required

## Response `204`

Successful Response

## Other responses

- `400`: Cannot delete a token belonging to a frontend application
- `404`: Project token not found
- `422`: Validation Error
- `429`: Rate limit exceeded

---

[API](https://skmtc.dev/pydantic/apis/pydantic-logfire-api.md) - [All operations](https://skmtc.dev/pydantic/apis/pydantic-logfire-api/llms.txt) - [OpenAPI document](https://skmtc.dev/pydantic/apis/pydantic-logfire-api/revisions/7996e45256f4?raw)
