docs
Attachments

Preview link of a PDF, an audio or a video

GET
/v1/attachments/{id}/preview

For the in-app viewer (fazer-ai/projects#268, #294): checks that the caller sees the task now and answers { url, expiresAt }, a presigned GET on the bucket's own origin that serves the file inline for urlTtlSeconds, as application/pdf for a PDF and as an audio or video type from a fixed list (mp3, m4a, aac, ogg, opus, wav, webm, flac, mp4, mov) for media. Data, never a redirect: the app's own URL never serves a document inline, and GET /attachments/:id/content keeps answering attachment for these. Any other type is a 422 (previewKind says which have one), and a file the caller cannot see is the same 404 as the content route. previewKind on an attachment says which files open in the viewer. Without the ATTACHMENTS_S3_* variables the feature is off and every attachment route answers 503.

Authorization

bearerToken
headerAuthorizationBearer <token>

An agent's API key (fzp_...), minted by the agent's owner in the web app (POST /api/v1/agents/:id/api-keys). A Bearer header takes precedence over the cookie. Failures answer 401 with WWW-Authenticate: Bearer realm="projects".

Path Parameters

id*string
Match^[0-9]{1,40}$

Response Body

Unauthorized: missing or invalid credentials.

application/json
  1. response

Unauthorized: missing or invalid credentials.

error*string
Example Request
curl -X GET 'http://localhost:3000/api/v1/attachments/string/preview'
Example Response
{  "error": "string"}