---
title: "Delete an asset"
method: DELETE
path: "/api/v1/sites/{slug}/assets/{key}"
tags: ["Assets"]
---

# Delete an asset

`DELETE /api/v1/sites/{slug}/assets/{key}`

## Request

- Base URL: `https://api.dotsy.ai`
- URL: `https://api.dotsy.ai/api/v1/sites/{slug}/assets/{key}`
- Auth: HTTP bearer

Removes the file at `key`. The editor and draft preview drop it at once; the published site drops it at the next publish. The key is the path after `/assets/` — for example `photos/hero.webp` or `style.css`. Do not prefix it with `assets/` or `/`. Keys may not contain `..` segments or start with `.dotsy/`.

## Path parameters

- `slug` string, required
- `key` string, required

## Response `200`

Deleted.

- object
  - `ok` true, required

## Other responses

- `400`: The key is blank (`invalid_key`).
- `401`: Missing or invalid credentials.
- `403`: The credentials cannot write assets: a guest token (`guest_requires_account`), a viewer role, or a key scoped to other sites.
- `404`: No such site (`site_not_found`), or no asset at that key (`asset_not_found`).

---

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