api reference/media
media
browse the workspace media library and attach images or videos to posts. visual platforms like instagram, tiktok, and pinterest require at least one media file.
list_media
list media files in the workspace media library. returns uploaded images and videos with urls that can be attached to posts.
> show me my uploaded images using antwork.list_media [done] 8 media files found [info] 6 images, 2 videos
parameters
workspace_idstringoptional
workspace id or name. optional if user has only one workspacemedia_typestringoptional
filter by type: "image", "video", "pdf", or null for alllimitnumberoptional
max items to return (default: 30, max: 50)attach_media
attach media (images or videos) to an existing post. replaces any existing media on the post. required for visual platforms like instagram, tiktok, and pinterest.
> attach our latest product image to that post using antwork.attach_media [done] media attached [info] 1 image added to post
parameters
post_idstringrequired
the post id to attach media tomedia_urlsstring[]required
list of media urls (from list_media or firebase storage)upload_media
upload an image to the workspace media library from a url or base64 data. the image is stored in firebase storage and added to the media library.
> upload this product screenshot to my media library using antwork.upload_media [done] image uploaded [info] url: https://storage.googleapis.com/...
parameters
image_urlstringoptional
public url of the image to upload. antwork will download and store itimage_base64stringoptional
base64-encoded image data (alternative to image_url)mime_typestringoptional
mime type for base64 uploads (default: "image/png")