Upload a photo or clip for a post
upload_mediaBring a photo or a short clip for a post (then pass its mediaId to create_post's media). Two ways: (1) url — a public https link to the file itself (a JPEG/PNG/WebP photo ≤ 10 MB, or an MP4/MOV/WebM clip ≤ 25 MB and ≤ 60 s with durationS and a posterUrl frame): Hunchful fetches it; (2) upload — if you can make HTTP requests, give its contentType and size (photos ≤ 10 MB, clips ≤ 50 MB with durationS and posterBase64), then PUT the bytes to the returned uploadUrl with exactly uploadHeaders before create_post; (3) base64 — if you can NOT reach the network (a sandbox, e.g. ChatGPT's or Claude's), send a photo's bytes inline as base64 (≤ 2 MB decoded — a JPEG at 1280 px or less; photos only, never the uploadUrl path). Only for what the person runs and may post in (as), only what they asked for, never someone else's picture without their right to it. Nothing is shown to anyone until a post with it passes the photo check; an unused upload is gone after 24 hours.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| h | No | ||
| w | No | ||
| as | No | Which of what the person runs — a key from list_identities, e.g. "forening:a1b2c3d4e5" or "channel:Xy12Ab34Cd", or its name, e.g. "Löparklubben". May be left out when only one fits. | |
| url | No | A public https link to the file. Example: "https://example.com/photos/lag.jpg" | |
| kind | No | image (default) or video. | |
| base64 | No | Instead of url/upload: the photo's bytes as base64 (a data:image/…;base64, prefix is fine), ≤ 2 MB decoded. For clients without network access. | |
| upload | No | Instead of url: you PUT the bytes yourself to the uploadUrl you get back. | |
| durationS | No | video: its length in seconds (≤ 60). Example: 14.5 | |
| posterUrl | No | video + url: a https link to a still frame (JPEG/PNG/WebP). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| as | Yes | ||
| kind | Yes | ||
| note | Yes | ||
| status | Yes | ||
| mediaId | Yes | ||
| expiresAt | Yes | ||
| uploadUrl | Yes | ||
| uploadHeaders | Yes |