create_media_upload
Use this when the user wants to Pin their own image or video file: a Canva export, a photo or video on disk, anything without a publicly accessible URL. Creates a single-use upload in Tailwind's media staging and returns its uploadId, a write-only uploadUrl, the contentType that uploadUrl accepts, and two expiry times: one for uploadUrl and a later one for uploadId. The tool has two modes. With file, an attachment object that the host application supplies for a file the user attached, the server downloads the attachment and stages its bytes during the call, so the returned uploadId already refers to the staged media. Hosts that do not supply attachment objects leave file out and use the extension mode. With only extension, nothing is staged yet: the bytes are staged when they are sent to uploadUrl in an HTTP PUT whose Content-Type equals contentType. create_post accepts the uploadId as its uploadId input, in place of mediaUrl. Each uploadId attaches to exactly one Pin. Creating an upload costs no credits. Not for media that already has a public URL, which create_post takes directly as mediaUrl.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | An attachment object for a file the user attached, filled in by the host application. Only the host can supply it: an object you construct yourself, or a file path, is not a valid value. If the host does not provide one, omit this and use `extension` with uploadUrl. When it is present the server downloads the file and stages its bytes during the call, so no PUT to uploadUrl is involved. | |
| extension | Yes | The file's extension, with or without a leading dot and in any case (jpg, .PNG, mp4). It determines both the upload's media type and the Content-Type the signed URL is issued for. Accepted: jpg, jpeg, png, svg, gif, webp, heic, mp4, mov, qt. When `file` is also present its mime_type/file_name take precedence, so a wrong guess here is not fatal. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| upload | Yes |