DevelopersHow to connect an assistantKeys
Reference/Files/Create

Get a download address

POSThttps://api.getwerk.ai/api/v1/projects/{projectId}/cards/{cardId}/files/{fileId}/download-grants

Makes an address that downloads one file of a card, valid an hour.

The address carries its own grant, so it needs no key; it stops working after the hour, or sooner when the key that asked for it ends or expires.

Authorization

AuthorizationheaderRequired

Authorization: Bearer <key> Authentication

Path parameters

projectIdstring, uuidRequired

The project's id.

cardIdstring, uuidRequired

The card's id.

fileIdstring, uuidRequired

The photo's or the document's id.

Response

200 The download address.

pathstring

The download address under the API's base; it carries its own grant, so it needs no key.

At least 1 character
expiresAtstring, date-time

When the address stops working.

Errors

400invalid_queryThe 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).
401session_revokedThe request carries no session the server holds, or its session has ended.
401session_expiredThe session has expired.
404conversation_not_foundThe project the request names, or its chat, is not one the signed-in person is in.
404item_not_foundThe card the request names, or its list, is not one the signed-in person can see.
404asset_not_foundThe file the request names is not one the signed-in person can reach where the request names it, or is no longer available.
409session_changedThe session changed while the request was in flight.
rate_limitedMore requests of this kind were sent than Werk takes within the time it counts them over.
500server_errorThe server could not complete the request, and it is not known whether a write it holds was made.
curl
curl -X POST "https://api.getwerk.ai/api/v1/projects/2f6c9e41-7a3b-4d58-9c1e-0b8d4f2a6e73/cards/3c9e5b17-8d2f-4a64-b1e3-7f5a0c9d2b48/files/d7e1b5c3-9a4f-4e26-b8d0-2f6a4c8e1d59/download-grants" \
  -H "Authorization: Bearer wk_key_..."
TypeScript
const res = await fetch("https://api.getwerk.ai/api/v1/projects/2f6c9e41-7a3b-4d58-9c1e-0b8d4f2a6e73/cards/3c9e5b17-8d2f-4a64-b1e3-7f5a0c9d2b48/files/d7e1b5c3-9a4f-4e26-b8d0-2f6a4c8e1d59/download-grants", {
  method: "POST",
  headers: {
    Authorization: "Bearer wk_key_...",
  },
});
const answer = await res.json();
200JSON
{
  "path": "/files/d7e1b5c3-9a4f-4e26-b8d0-2f6a4c8e1d59/download/AQJ4c2VhbGVkLWdyYW50LWZvci10aGUtZmlsZQ",
  "expiresAt": "2026-11-21T15:05:00.000Z"
}