Fetch file metadata by API identifier
Fetch one file record by identifier, interpret every returned metadata field and null value, and separate missing, hidden, locked, and denied responses.
Last reviewed
The single-file endpoint returns identity, storage, location, version, visibility, and collaboration counts in one record. Null fields are valid data, not necessarily a failed lookup.

Access requirements
Call GET https://api.dosya.dev/api/files/:id with a Read only or Full access key permitted on REST API. The key may be workspace-pinned, but a folder anchor makes REST unavailable. The current member role must include access_files.
Steps
- Obtain a known
file_…id from a trusted list, upload response, or webhook and keep its expected workspace alongside it. - Send
GET /api/files/:idwith the bearer header and require JSON rather than following a UI-formatted value. - Match
file.id,workspace_id,folder_id, andnameto the record the integration selected. - Compare
size_bytes,mime_type,extension,region,current_version,etag, andcontent_hashwith the operation being verified. - Interpret
created_atandupdated_atas Unix seconds, and allow nullable values such asuploader_nameorcontent_hash. - Record the metadata needed by the application, omit visibility or identity details from public logs, and handle 403/404 by their exact body.
Returned file fields
A successful body is {ok:true,file:{…}}. The file object includes id, name, size_bytes, mime_type, extension, region, uploaded_by, uploader_name, created_at, updated_at, deleted_at, lock_mode, is_hidden, hidden_mode, current_version, workspace_id, folder_id, content_hash, etag, share_count, and comment_count.
content_hash:null is expected for work that has not yet received a verified or lazy-computed hash. A missing uploader row can make uploader_name null while uploaded_by remains present.
Expected result
HTTP 200 returns the same file id and workspace expected by the caller, with byte size and version metadata suitable for an integrity or synchronization decision.
Troubleshooting
Missing file ID is a 400 route-input error. File not found may indicate absence or a privacy-preserving hidden/confinement decision. A 403 can name membership, files-page permission, member-folder confinement, full-folder lock, key scope, surface, or workspace pin. Do not convert these distinct conditions into a generic retry loop.

Related guides
Was this helpful?
Loading helpfulness results…
Voting saves a necessary ballot cookie for up to 180 days so you can change your answer.
Questions and replies
Ask about the steps in this guide. Questions are reviewed before publication.
Keep account details, credentials and private files out of public questions. Use private support for those.
Loading questions…
Sign in to your Dosya account to ask a question.