Download a file
GEThttps://api.getwerk.ai/api/v1/files/{fileId}/download/{grant}
The file's bytes, at an address made by its download grant.
It needs no key: the grant names who may read it. A document comes as an attachment; the file is read again for the person as it is now.
Headers
If-None-Matchstring
The ETag of a copy already held. When it is current, the answer is 304.
Path parameters
fileIdstring, uuidRequired
The file's id, as the address names it.
grantstringRequired
The grant, as the address names it.
At least 1 character
Response
200 The file's bytes.
image/jpegapplication/pdfapplication/vnd.openxmlformats-officedocument.wordprocessingml.documentapplication/vnd.openxmlformats-officedocument.spreadsheetml.sheettext/csvtext/plaintext/markdown
304 The copy held is current.
Errors
400
invalid_query The query is not in the form the route takes; the limit is in the unit of the input details.field names (characters for a text, entries for a list, the value for a number).401
session_revoked The request carries no session the server holds, or its session has ended.401
session_expired The session has expired.404
download_grant_invalid This download address is not one Werk gave, or it was changed.404
item_not_found The card the request names, or its list, is not one the signed-in person can see.404
asset_not_found The file the request names is not one the signed-in person can reach where the request names it, or is no longer available.404
conversation_not_found The project the request names, or its chat, is not one the signed-in person is in.409
session_changed The session changed while the request was in flight.409
download_grant_expired This download address has expired and gives no file.429
rate_limited More requests of this kind were sent than Werk takes within the time it counts them over.500
server_error The server could not complete the request, and it is not known whether a write it holds was made.curl
curl "https://api.getwerk.ai/api/v1/files/d7e1b5c3-9a4f-4e26-b8d0-2f6a4c8e1d59/download/AQJ4c2VhbGVkLWdyYW50LWZvci10aGUtZmlsZQ"TypeScript
const res = await fetch("https://api.getwerk.ai/api/v1/files/d7e1b5c3-9a4f-4e26-b8d0-2f6a4c8e1d59/download/AQJ4c2VhbGVkLWdyYW50LWZvci10aGUtZmlsZQ");200
Send a requestGET
It is sent with the key you give, as you. A change made here is real.
JSON
The request could not be sent, or its response could not be read.