# Whiteboard media

- image: placed with documents.whiteboard_image_add, never with
  whiteboard_edit: pass source_url (a public http/https image that opens
  without login, max 10 MB) or image_document_id (an image in the
  whiteboard's Space; internal files such as admin uploads go this way). The
  file is stored as a Space document in "Whiteboard-Dateien/<whiteboard>"
  (documents.whiteboard_files_folder returns it for uploads). Also takes
  level, place and caption (≤200). PNG, JPEG, GIF, WebP, AVIF and HEIC
  work (HEIC becomes WebP). The element shows status loading, then ready or
  failed with an error code: http_401/http_403/unreachable (the source needs
  a login or blocks fetching: download, upload and pass image_document_id),
  http_404, image_too_large (10 MB), image_dimensions (40 MP),
  unsupported_format, not_an_image, image_damaged, url_not_allowed. Fetch a
  source_url image again with documents.whiteboard_image_refresh. Default
  size 320x240, free.
- video: url, a YouTube link (youtube.com/watch?v=, /shorts/, /embed/,
  /live/ or youtu.be/), and title. Set only w (default 480); the height
  follows 16:9 plus a title bar. It shows the thumbnail and plays in the
  browser when selected.
- instagram: layout post|feed, handle (≤30, without @), caption (≤2200),
  ratio 1:1|4:5 (post only, default 4:5), images (document ids; a post holds
  1, a feed up to 12, shown in 3 columns). Own images in Instagram style, no
  connection to Instagram. Set only w (default 360). Add the element first,
  then each image with documents.whiteboard_image_add and element_id: the
  image is ingested like any other and replaces a post's image or is
  appended to a feed (up to 12) instead of becoming its own element. A
  failed image leaves the element unchanged, which shows only when you read
  it again and count its images.

Example, a feed with two images:
{"document_id": "...", "ops": [
  {"op": "add", "type": "instagram", "layout": "feed", "handle": "studio.mara", "caption": "October drop"}
]}
then for each image:
{"document_id": "...", "element_id": "<id from the result>", "source_url": "https://example.com/look-1.jpg", "idempotency_key": "feed-look-1"}

A video next to it:
{"op": "add", "type": "video", "url": "https://www.youtube.com/watch?v=aBcDeFgHiJk", "title": "Lookbook", "place": {"right_of": "<instagram id>", "gap": 80}}
