---
title: "Delete a file"
description: "Delete a file and its bytes before its 24 hours are up. `DELETE /api/v1/files/{id}`"
url: https://www.unitpost.com/docs/platform/delete-files-id
section: "Platform API reference"
updated: 2026-11-11
---
# Delete a file

`DELETE /api/v1/files/{id}`

Delete a file and its bytes before its 24 hours are up. What already used it keeps its copy. Requires the `sms:manage` or `templates:write` or `branding:write` capability.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `id` | path | string | yes | — |

## Responses

| Status | Description |
| --- | --- |
| 204 | Deleted. |
| 401 | Missing or invalid API key. |
| 403 | Insufficient scope. |
| 404 | File not found, or of a purpose this credential can't use. |
| 422 | A query key (this operation takes none). |

## Example request

```bash
curl -X DELETE 'https://www.unitpost.com/api/v1/files/123' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'User-Agent: my-app/1.0'
```

## Links

- HTML reference (with Node.js, Python, Ruby, PHP, Laravel, Go, Java, Rust, .NET and CLI examples): https://www.unitpost.com/docs/platform/delete-files-id
- OpenAPI 3.1 (full schemas): https://www.unitpost.com/api/v1/openapi.json
