Files

File a derived copy of a photo

The copy’s bytes, as the body. The browser derives a small copy of a photo at upload time and files it here; the server mints the key from the original’s own, so a copy always sits beside what it was made from and is deleted, replaced, swept and erased with it. Only a photo that is already stored takes copies, a copy is WebP or JPEG, and sending the same copy again replaces it. Read one back from GET /documents/{id}/content?variant=…

put/api/v1/documents/{id}/variants/{variant}

Request

  • Base URL: http://localhost:5180
  • URL: http://localhost:5180/api/v1/documents/{id}/variants/{variant}
  • Auth: API key in cookie better-auth.session_token

Path parameters

idstring required

Document id, for example doc_014.

variant'thumb' | 'display' required

Which copy this is: thumb for a grid, display for one photo on screen.

Query parameters

widthinteger required

The copy’s own pixel width, measured by whatever drew it.

heightinteger required

The copy’s own pixel height.

Response

The copy is filed and will be served for its name from now on.

okunknown required

Changes

No recorded changes to this operation across all 1 revision of this API.