# Delete a project

`DELETE /v1/delete`

Remove a project and its hosted files by hostname.

**Effect.** Deletes the project and its files. Confirm the exact hostname with the user. Use [Fetch profile](../fetch-profile/) to resolve any ambiguity.

## Authentication

Send `x-api-key: <key>`. The target must belong to the authenticated account.

## Request

`Content-Type: multipart/form-data`. Send a single required text part named `domain` with the hostname from `data.links[].subdomain`. Supply just the hostname.

## Example

```bash
curl --fail-with-body -X DELETE https://ext.tiiny.host/v1/delete \
  -H "x-api-key: $TIINY_API_KEY" -F 'domain=example.tiiny.site'
```

## Success response

`200 OK` returns the remaining [profile](../fetch-profile/#success-response) and the post-delete quota in bytes.

```json
{"success":true,"data":{"id":"account-id","email":"owner@example.com","customDomains":["tiiny.site"],"links":[],"maxLinks":5,"maxFileSize":75,"quotaUsed":0,"quotaLimit":10737418240}}
```

## Errors

| HTTP | Code or condition |
| --- | --- |
| 400 | `DOMAIN_REQUIRED` or `INVALID_DOMAIN` |
| 401 | Missing API key |
| 403 | Key without API access or `NOT_LINK_OWNER` |
| 404 | `LINK_NOT_FOUND` |
| 429 | `RATE_LIMIT_EXCEEDED` |

If the response is lost, fetch the profile to verify whether the project was deleted before retrying.
