Media

Get a file from the media library

One file with its versions, alt text and the sites that use it.

get/media/{id}

Request

  • Base URL: https://api.hypamoon.com/api/v1
  • URL: https://api.hypamoon.com/api/v1/media/{id}
  • Auth: one of:
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL https://app.hypamoon.com/oauth/authorize, token URL https://api.hypamoon.com/oauth/token, scopes: sites:read)

Path parameters

idstring uuid required

The id of the file.

Response

The file.

idstring uuid required

The id of the file in the library.

pathstring required

Where the file goes on a site when you add it with deploy_site media, like /media/portfolio/project-12/03.webp.

folderstring required

The folder under /media/, empty for /media/ itself.

namestring required

The file name in the library.

original_namestring nullable required

The name on the user's computer, when it differs.

content_typestring required
bytesinteger required
widthinteger nullable required
heightinteger nullable required
altstring nullable required

The alt text, set with update_media.

urlstring nullable required

Where the file is served, on the first site that has it at this path. null: it is on no site yet; it is private until you add it with deploy_site media.

variantsobject required

For photos: 640, the small version for srcset and thumbnails.

srcsetstring nullable required

A ready srcset for an img tag once the file is on a site: small webp versions at 160, 320, 640 and 1280 wide (from /_hypamoon/img on that site) plus the file itself. Always add sizes with the width it is shown at, like sizes="52px" for a thumbnail.

thumbnail_urlstring nullable required

A small webp, 160 wide, for thumbnails up to about 80 px (search suggestions, lists, a cart). null while the file is on no site, or for a file that is not a photo.

original_keptboolean required

The full-size original is kept privately. It never goes on a site; the user downloads it in the portal.

source'upload' | 'portaal' | 'site' | 'import' required

upload: an upload link; portaal: the portal; site: it was already on a site; import: an import.

access'team' | 'public' | 'paid' required

Who can open the file. team: only the project's members and this chat (the default for every file).

titlestring nullable required

A display name, set with update_media.

descriptionstring nullable required

A free description, set with update_media.

tagsstring[] required

Tags to filter on, set with update_media.

kind'image' | 'video' | 'audio' | 'pdf' | 'font' | 'archive' | 'document' | 'data' | 'other' required

image, video, audio, pdf, font, archive, document, data or other, from the file type.

deleted_atstring nullable required

When it went to the trash; null when it is not in the trash. A file stays in the trash for 30 days.

purge_atstring nullable required

When the trash deletes it for good. Restore it before then with update_media restore: true.

deleted_fromstring nullable required

The path it had before it went to the trash; restore puts it back there.

created_atstring required
updated_atstring required

Changes

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