Mint short-TTL signed URLs for referenced attachments
POST/api/attachments/sign
signAttachments
Each entry also carries the DERIVED renditions that exist right now (ADR 0108 §§4/6), established by an exact-key probe rather than assumed. **The whole async design rests on this telling the truth**: `<picture>` has no error fallback, so an advertised rendition whose bytes are absent is a broken image, not a slow one — and a rendition that exists but goes unadvertised is only a missed optimisation.
Requires authentication using a bearer token or a session cookie — see tokens and scopes.
curl
curl -X POST 'https://neosource.dev/api/attachments/sign' \
-H 'Authorization: Bearer $NEOSOURCE_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"ids":[]}'fetch
fetch("https://neosource.dev/api/attachments/sign", {
method: "POST",
headers: {
Authorization: "Bearer $NEOSOURCE_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({"ids":[]}),
});Request bodyrequired
application/json
Responses
200Signed URLs for the readable ids
application/json
403Forbidden — one of: forbidden, needs_scope
application/json
Standard errors
Bodies documented once for the whole API — see standard errors.
- 400Bad Request — one of: invalid_input
- 401Authentication required
- 404Not Found — one of: not_found
- 429Rate limited — retry after the `Retry-After` header
- 500Internal server error
- 503Service temporarily unavailable / at capacity — retry after the `Retry-After` header
- 504Gateway timeout — the request exceeded the server's handling budget
Schemas
Referenced above. Listed here rather than expanded inline, so the same definition is not repeated at every level.
AttachmentSource
One DERIVED rendition of an attachment that exists right now (ADR 0108 §3). A client emits a `<source>` from this list and from nowhere else: `<picture>` selects on `type`/`media` only and has NO error fallback, so a `<source>` pointing at bytes that are not there renders a broken image rather than falling back to the `<img>`.
mimerequiredThe rendition's media type — the `<source type=…>` selection hint.
urlrequiredAbsolute signed content-origin URL for this rendition.
widthrequiredThe rendition's LONG-EDGE bound in px (the key's `w{W}`), NOT the rendered image's true width: a portrait image is narrower than this. Informational in v1 — the client selects on `mime`, and there is no `srcset`/`sizes` (a `srcset` width descriptor here would mis-select).