Text of a text, code, markdown, CSV or JSON file
For the in-app viewer (fazer-ai/projects#294): checks that the caller sees the task now and answers the file's text from the app's own origin as text/plain; charset=utf-8 with nosniff and no-store, never a redirect. At most the first 1 MiB, cut on a character boundary: X-Attachment-Size is the whole file's size in bytes, X-Attachment-Shown the bytes returned and X-Attachment-Truncated is 1 when the text stops before the file does. A file that is not UTF-8 text is a 422, as is any type without a text preview (previewKind text, markdown, csv, tsv or json has one); a file the caller cannot see is the same 404 as the content route. Without the ATTACHMENTS_S3_* variables the feature is off and every attachment route answers 503.
bearerTokenAuthorizationBearer <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".
id*string^[0-9]{1,40}$Unauthorized: missing or invalid credentials.
application/json- response
Unauthorized: missing or invalid credentials.
error*stringcurl -X GET 'http://localhost:3000/api/v1/attachments/string/text'{ "error": "string"}Preview link of a PDF, an audio or a video GET
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.
Whether attachments are on, and their limits GET
`configured` is false without the `ATTACHMENTS_S3_*` variables. `maxBytes` bounds the presigned upload, `inlineMaxBytes` the MCP tool that carries the bytes in the call, and `urlTtlSeconds` how long a presigned URL lives. Never 503 for the feature being off, so a client can say so before anything else.