# Remove a brand item

> Removes a color, font or image from the editor's brand kit. A file templates still use needs force=true.

<Endpoint method="DELETE" path="/v1/brand/:id" />

<CodeTabs>

```bash tab="cURL"
curl -X DELETE https://api.muzekit.com/v1/brand/ast_dQC3Z8RgqAH \
  -H "Authorization: Bearer $MUZEKIT_SECRET_KEY"
```

```javascript tab="Node"
const res = await fetch("https://api.muzekit.com/v1/brand/ast_dQC3Z8RgqAH", {
  method: "DELETE",
  headers: { Authorization: `Bearer ${process.env.MUZEKIT_SECRET_KEY}` },
});
const deleted = await res.json();
```

```python tab="Python"
import os
import requests

deleted = requests.delete(
    "https://api.muzekit.com/v1/brand/ast_dQC3Z8RgqAH",
    headers={"Authorization": f"Bearer {os.environ['MUZEKIT_SECRET_KEY']}"},
).json()
```

</CodeTabs>

The id is an item's from [Get the brand kit](/docs/api-reference/brand-get). A font or image that templates still use is refused with `409 asset_in_use`, saying how many templates and naming the first few; add `force=true` to remove it anyway (those templates lose the file). An id that isn't in the brand kit answers `404 asset_not_found`.

## Examples

### Remove a color

Colors have no file, so removing one never answers `409`.

<CodeTabs>

```bash tab="cURL"
curl -X DELETE https://api.muzekit.com/v1/brand/ast_dQC3Z8RgqAH \
  -H "Authorization: Bearer $MUZEKIT_SECRET_KEY"
```

```javascript tab="Node"
await fetch("https://api.muzekit.com/v1/brand/ast_dQC3Z8RgqAH", {
  method: "DELETE",
  headers: { Authorization: `Bearer ${process.env.MUZEKIT_SECRET_KEY}` },
});
```

```python tab="Python"
import os
import requests

requests.delete(
    "https://api.muzekit.com/v1/brand/ast_dQC3Z8RgqAH",
    headers={"Authorization": f"Bearer {os.environ['MUZEKIT_SECRET_KEY']}"},
)
```

</CodeTabs>

### Remove a logo that templates use

Try without `force` first. On `409 asset_in_use`, the error carries `templates` (how many) and `names`; send `force=true` only once you accept that those templates lose the file.

<CodeTabs>

```bash tab="cURL"
# 1. Refused with 409 asset_in_use if templates use the file
curl -X DELETE https://api.muzekit.com/v1/brand/ast_dQC3Z8RgqAH \
  -H "Authorization: Bearer $MUZEKIT_SECRET_KEY"

# 2. Remove it anyway
curl -X DELETE "https://api.muzekit.com/v1/brand/ast_dQC3Z8RgqAH?force=true" \
  -H "Authorization: Bearer $MUZEKIT_SECRET_KEY"
```

```javascript tab="Node"
const url = "https://api.muzekit.com/v1/brand/ast_dQC3Z8RgqAH";
const headers = { Authorization: `Bearer ${process.env.MUZEKIT_SECRET_KEY}` };

let res = await fetch(url, { method: "DELETE", headers });
if (res.status === 409) {
  const { error } = await res.json();
  console.log(`Used in ${error.templates}: ${error.names.join(", ")}`);
  // Continue only if that's acceptable
  res = await fetch(`${url}?force=true`, { method: "DELETE", headers });
}
```

```python tab="Python"
import os
import requests

url = "https://api.muzekit.com/v1/brand/ast_dQC3Z8RgqAH"
headers = {"Authorization": f"Bearer {os.environ['MUZEKIT_SECRET_KEY']}"}

res = requests.delete(url, headers=headers)
if res.status_code == 409:
    error = res.json()["error"]
    print(f"Used in {error['templates']}: {', '.join(error['names'])}")
    # Continue only if that's acceptable
    res = requests.delete(url, params={"force": "true"}, headers=headers)
```

</CodeTabs>

### Remove every weight of a font

Each weight is its own item. Find them by `family` in [Get the brand kit](/docs/api-reference/brand-get) and remove each one.

<CodeTabs>

```bash tab="cURL"
for ID in $(curl -s https://api.muzekit.com/v1/brand \
  -H "Authorization: Bearer $MUZEKIT_SECRET_KEY" \
  | jq -r '.fonts[] | select(.family == "Acme") | .id'); do
  curl -s -X DELETE "https://api.muzekit.com/v1/brand/$ID" \
    -H "Authorization: Bearer $MUZEKIT_SECRET_KEY"
done
```

```javascript tab="Node"
const headers = { Authorization: `Bearer ${process.env.MUZEKIT_SECRET_KEY}` };
const brand = await (
  await fetch("https://api.muzekit.com/v1/brand", { headers })
).json();

for (const font of brand.fonts.filter((f) => f.family === "Acme")) {
  const res = await fetch(`https://api.muzekit.com/v1/brand/${font.id}`, {
    method: "DELETE",
    headers,
  });
  if (res.status === 409) console.log(`${font.name} is still in use`);
}
```

```python tab="Python"
import os
import requests

headers = {"Authorization": f"Bearer {os.environ['MUZEKIT_SECRET_KEY']}"}
brand = requests.get("https://api.muzekit.com/v1/brand", headers=headers).json()

for font in [f for f in brand["fonts"] if f["family"] == "Acme"]:
    res = requests.delete(
        f"https://api.muzekit.com/v1/brand/{font['id']}", headers=headers
    )
    if res.status_code == 409:
        print(f"{font['name']} is still in use")
```

</CodeTabs>

## Response

```json
{
  "object": "asset",
  "id": "ast_dQC3Z8RgqAH",
  "deleted": true
}
```
