← API referenceOrganize · API access unavailable
API REFERENCE / ORGANIZE
POST /v1/items/{item_id}/trash
Move a visible file or folder to recoverable trash; this is not permanent deletion.
Request fields
| Location | Field | Type | Required | Description |
|---|---|---|---|---|
| Header | Authorization | string | Yes | Credential scoped to the authorized resource. |
| Header | Content-Type | string (media type) | Yes | application/json. |
| Path | item_id | string | Yes | Stable file or folder ID. |
| Header | Idempotency-Key | string | Yes | Stable retry identity. |
| Body | expected_revision | string | Yes | Revision observed before trashing. |
Request example
Example request
POST /v1/items/file_789/trash
Authorization: Bearer <scoped token>
Idempotency-Key: trash-8427
Content-Type: application/json
{
"expected_revision": "rev_008"
}HTTP status codes
| Status | Meaning |
|---|---|
202 Accepted | Success response shown below. |
401 Unauthorized | Missing, expired, or invalid credential. |
403 Forbidden | Credential is valid but lacks the required scope or role. |
404 Not Found | Item is not visible. |
409 Conflict | Expected revision changed or item cannot be trashed. |
429 Too Many Requests | Rate limit reached; honor Retry-After when provided. |
503 Service Unavailable | Service temporarily unavailable; retry safely. |
Response fields
| Field | Type | Example |
|---|---|---|
operation_id | string | op_459 |
item_id | string | file_789 |
status | string | accepted |
Response example
Example response
202 Accepted
Content-Type: application/json
{
"operation_id": "op_459",
"item_id": "file_789",
"status": "accepted"
}How it works
An owner or appropriate writer must authorize the action. Existing shared recipients cannot delete the owner’s underlying bytes merely because they can read them. Retention and provider-specific behavior remain design decisions.
