Skip to content
WorkRoad home
REST API

Restore a file from the trash

POST
/files/{fileId}/restore

Brings a trashed file back to its note's files and returns it. Needs files:delete, the scope that trashed it. The note must be out of the trash. An image file removed from the note's content stays out of it. The file never stopped counting toward the file and storage limits, so a restore always succeeds.

Required scopes: files:delete

Authorization

headerAuthorizationBearer <token>

Path Parameters

fileId*string

Note file id, scoped to the key's user.

Match^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
Formatuuid

Header Parameters

Idempotency-Key?string

A client-generated key (1 to 255 visible ASCII characters) that makes this POST safe to retry. A retry with the same key and body replays the original response; the same key with a different body returns 409 idempotency_conflict. Stored for 24 hours.

Match^[\x21-\x7E]{1,255}$
Length1 <= length <= 255

Response Body

OK

application/json
  1. response
data*
Example Request
curl -X POST 'https://workroad.app/api/v1/files/497f6eca-6276-4993-bfeb-53cbbbba6f08/restore' \  -H 'Authorization: Bearer $WORKROAD_API_KEY'
Example Response
{  "data": {    "id": "3c2b1a09-8f7e-4d6c-9b5a-4e3d2c1b0a9f",    "noteId": "3c2b1a09-8f7e-4d6c-9b5a-4f3e2d1c0b9a",    "kind": "document",    "name": "Cell biology lecture.pdf",    "mimeType": "application/pdf",    "sizeBytes": 482113,    "url": "https://storage.example.com/workroad/note/3c2b1a09-8f7e-4d6c-9b5a-4f3e2d1c0b9a/3c2b1a09-8f7e-4d6c-9b5a-4e3d2c1b0a9f-cell-biology-lecture.pdf",    "status": "ready",    "failure": null,    "chars": 18240,    "imageCount": 3,    "jobId": "7a6b5c4d-3e2f-4a1b-8c9d-0e1f2a3b4c5d",    "createdAt": "2026-01-15T09:30:00.000Z"  }}