docs
Attachments

Text of a text, code, markdown, CSV or JSON file

GET
/v1/attachments/{id}/text

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.

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/text'
Example Response
{  "error": "string"}