Skip to content

A file an agent handed over, from the artifact store​

GET
/api/threads/{threadId}/artifacts/{sha256}

The content of a file of the thread (ADR 0032): the file of an artifact event, href of the projected artifact on the owner's streams and pages (a reader of a share link is given getSharedArtifact's or getPublicSharedArtifact's route as the href, ADR 0040). sha256 is the content's hash in 64 lowercase hexadecimal digits, and the file belongs to the thread in the path: no thread reaches another's by hash. Authorised by the permission artifact.read (ADR 0033) over the thread: the thread's owner, and nobody else (ADR 0039). Another person's thread, a thread that does not exist, a hash the thread holds no file for, a hash that is not 64 lowercase hex digits and a deployment with no artifact store are all the same 404; a caller whose roles hold no artifact.read gets a 403 (code: forbidden), whatever they ask for.

The body is streamed from the store. Content-Type is the type the worker kept (it sniffed it: an image whose bytes disagree with its declared type is application/octet-stream) for a preview type, and application/octet-stream for every other type (a kept text/javascript or text/css is never sent as one: the web allows scripts and styles of its own origin). A request whose Sec-Fetch-Dest is script, worker, sharedworker, serviceworker, style or object is a 403 (code: forbidden) before the file is opened; the shared routes do the same.

  • Inline (no download, or download=0): only for the preview types, image/png, image/jpeg, image/gif, image/webp, image/svg+xml, text/plain and application/json (the last two with ; charset=utf-8), with Content-Disposition: inline; filename="…". An SVG is sanitized first (orch-svg-clean: no script, no foreignObject, no external reference, no event handler); one that is larger than 2 MiB or cannot be sanitized is sent as an attachment instead. Every other type is an attachment only.
  • Download (download=1): Content-Disposition: attachment; filename="…", the original bytes. The file name is the agent's, cleaned: one name with no path, no control or direction character, a printable ASCII fallback in filename and the real name as filename*=UTF-8''… (RFC 6266, RFC 5987); a file without a usable name is artifact-<8 hex digits of the hash>.

Every response, inline or not, carries X-Content-Type-Options: nosniff, Content-Security-Policy: default-src 'none'; img-src 'self' data:; style-src 'unsafe-inline'; sandbox, Cache-Control: private, max-age=31536000, immutable (the URL is the content's hash) and ETag: "<sha256>".

A redirect (ADR 0058, A1, amendment of 2026-10-14). When the deployment sets artifacts.s3.downloads: redirect (off by default: the web fetches a file with fetch, whose connect-src does not list the files host) and the artifact store can presign, the answer is 302 with Location set to a presigned GET on artifacts.s3.publicEndpoint, valid for artifacts.s3.presignTtlSecs (300 by default), and Cache-Control: private, no-store. It comes after every check above, which are unchanged and run first: a refusal is never a redirect, and a file the store does not hold is the same 404. The file is not read to be redirected. The URL carries three signed query members, so the holder cannot change them: response-content-disposition (inline for a preview type without download, else attachment, both with the cleaned name as above), response-content-type (the kept type for a preview type, application/octet-stream for every other) and response-cache-control (private, max-age=<lifetime>). The bytes, and X-Content-Type-Options, Content-Security-Policy and the CORS headers, are the files host's: none of them is on the 302. An SVG without download is never redirected: it is sanitized and streamed as above; with download=1 it is redirected like any download. A store that cannot presign, and artifacts.s3.downloads: stream (the default), stream as above. If the URL cannot be signed the answer is a 5xx problem (503 for a store that is unavailable, 500 for a fault of the deployment), never the bytes.

Authorizations​

bearerToken

A JWT signed by the configured issuer (RS256, RS384, ES256 or EdDSA), with the configured audience. Read when auth.mode is jwt or jwt_or_proxy_header. A missing or refused token gets 401 with WWW-Authenticate: Bearer; an issuer whose keys cannot be fetched gets 503.

Type
HTTP (bearer)
or
dpopToken

A JWT as bearerToken, bound to the key of the client (cnf.jkt, RFC 7638), sent as Authorization: DPoP <token> with one DPoP header holding a proof signed by that key (RFC 9449, ADR 0054). Read only when auth.dpop is configured. A bad proof gets 401 with WWW-Authenticate: DPoP error="invalid_dpop_proof", algs="ES256 EdDSA", a bad or unbound token error="invalid_token".

Type
HTTP (DPoP)
or
proxyIdentity

Set by oauth2-proxy after OIDC login; requests without it get 401. Read when auth.mode is proxy_header (the default) or jwt_or_proxy_header without a bearer token.

Type
API Key (header: X-Auth-Request-Email)

Parameters​

Query Parameters

download

1 (or true) sends the file as an attachment; 0, false or absent shows a preview type inline. Any other value is a 400.

Type
string
Valid values
"0""1""false""true"

Responses​

The file

application/octet-stream

Samples​

Powered by VitePress OpenAPI