---
title: "Remove a trait's file"
method: DELETE
path: "/api/v2/trait/{id}/files/{file_id}"
tags: ["Trait"]
---

# Remove a trait's file

`DELETE /api/v2/trait/{id}/files/{file_id}`

## Request

- Base URL: `https://www.onlyworlds.com`
- URL: `https://www.onlyworlds.com/api/v2/trait/{id}/files/{file_id}`
- Auth: API key in header `API-Key` and API key in header `API-Pin`

The world's owner key, or the key of whoever added the file (an agent seat answers as its sponsor). The file is removed for real: it leaves the lists and the world's total at once, and its bytes are deleted from the store. Files on elements answer only where the server has them switched on; elsewhere every files route is a 404.

## Path parameters

- `id` string, uuid, required
- `file_id` string, uuid, required

## Response `204`

Removed.

## Other responses

- `401`: Missing, invalid or revoked credential, or a wrong PIN (authentication_error; code key_revoked for a revoked key, invalid_credentials otherwise).
- `403`: The credential is valid but lacks the scope: a read key on a write route (permission_error). Or the key is neither the world's owner's nor the file's uploader's (permission_error).
- `404`: Not found in this world (not_found).
- `422`: Invalid request: unknown or read-only field, bad value, unknown query parameter, over-long text, extensions over the size cap (invalid_request); `param` names the culprit.
- `429`: Too many failed PIN attempts; see the Retry-After header (rate_limited). Or too many requests: over the request budget (code too_many_requests, type rate_limited): 300 requests a minute per key or account token, 60 a minute per address for a request with neither. Retry after the Retry-After header's seconds.
- `503`: The server is busy: every request slot stayed full for 10 s (code server_busy, type api_error). Retry after the Retry-After header's seconds.

## Changes

- **2026-10-20** `78df39c4c62e`: 6 warning
  - added the new `known_of_not_writable` enum value to the `error/code` response property for the response status `401`
  - added the new `known_of_not_writable` enum value to the `error/code` response property for the response status `403`
  - added the new `known_of_not_writable` enum value to the `error/code` response property for the response status `404`
  - added the new `known_of_not_writable` enum value to the `error/code` response property for the response status `422`
  - …2 more
- **2026-10-20** `4dd5b1cd0687`: 12 warning
  - added the new `character_taken` enum value to the `error/code` response property for the response status `401`
  - added the new `character_taken` enum value to the `error/code` response property for the response status `403`
  - added the new `character_taken` enum value to the `error/code` response property for the response status `404`
  - added the new `character_taken` enum value to the `error/code` response property for the response status `422`
  - …8 more

[Operation history](https://skmtc.dev/onlyworlds/apis/onlyworlds-api/changes/api/v2/trait/:id/files/:file_id/delete.md)

---

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