Skip to main content
POST
For uploading a file directly from your machine instead of fetching a URL, use POST /posts/{post}/media. MCP agents use the same contract via attach-media-from-url-tool.

Path parameters

string
required
The UUID of the post to attach media to.

Request

array
required
Media to download. Max 10 items per call. Each item is an object (not a bare string):Per-type size caps (from trypost.media.max_size_mb / env):URLs are downloaded server-side and stored as Media records on the workspace.

Behaviour

  • The post must belong to the caller’s current workspace; otherwise the response is 404.
  • Allowed media types are intersected with the platforms enabled on the post. If an enabled platform doesn’t support the file type (e.g. video on a platform that’s image-only), that file is rejected and listed in failed_urls.
  • Successful attachments are appended to the post’s media[] array (image alt becomes media[].meta.alt_text).

Response

Returns an object with three fields:
object
The updated post — same shape as GET /posts/{post}, with newly-attached items now in the media[] array.
integer
Number of URLs that were successfully downloaded and attached.
array
URLs that were rejected (unreachable, wrong MIME type, too large, or not allowed by any enabled platform). Each entry is the original URL string.