---
title: "Delete File"
method: DELETE
path: "/v0/inboxes/{inbox_id}/files/{file_id}"
tags: ["inboxes > files"]
---

# Delete File

`DELETE /v0/inboxes/{inbox_id}/files/{file_id}`

## Request

- Base URL: `https://api.agentmail.to`
- URL: `https://api.agentmail.to/v0/inboxes/{inbox_id}/files/{file_id}`
- Auth: HTTP bearer

Deletes a file, pending or `ready`, and frees its path at once. Its bytes are deleted, and its space given
back to the organization's quota, within seconds. A download URL signed before the delete keeps working
until it expires, at most an hour. Deleting a file that is already gone returns `404`.

Requires the `file_delete` permission. Only a key with `file_read`, or the key that created the file, can
delete it; any other key gets `404`.

## Path parameters

- `inbox_id` string, required: The ID of the inbox.
- `file_id` string, required: ID of the file. A UUID.

## Response `200`

Successful response

## Other responses

- `400`: Error response with status 400
- `403`: `code` says why: `forbidden` when the organization hasn't joined AgentMail Labs; `missing_permission` when the credential lacks the file permission the endpoint needs, including `file_create` in an organization that hasn't completed agent verification, and every file permission for an organization- or pod-scoped key under a content-access policy; `account_suspended`, `pod_suspended` or `inbox_suspended` when the organization, pod or inbox is suspended; and, for Create File only, `limit_exceeded` when the file doesn't fit the organization's Drive quota.
- `404`: Error response with status 404

## Changes

- **2026-10-16** `3f5c7830c952`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/agentmail-to/apis/api/changes/v0/inboxes/:inbox_id/files/:file_id/delete.md)

---

[API](https://skmtc.dev/agentmail-to/apis/api.md) - [All operations](https://skmtc.dev/agentmail-to/apis/api/llms.txt) - [OpenAPI document](https://skmtc.dev/agentmail-to/apis/api/revisions/a9792efe7bdf?raw)
