Upload media
chirpie_upload_mediaUpload an image or a video and get back the id a post can attach. Give it either a public url for Chirpie to fetch, or data, the file's bytes as base64. The file type is read from the file's own first bytes, never from its name or a declared type, so a mislabelled file is refused rather than published. The id is valid for 7 days; attach it with media: [{ id, alt }] on chirpie_post, chirpie_thread or chirpie_update_post. A post keeps its own copy of the bytes, so it is unaffected when the id expires. Uploads are limited to 3 MB of file when sent as data, which bounds the request rather than the post; attach a larger file with media_urls instead, which has no such limit.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| url | No | A public image or video URL for Chirpie to fetch and store. | |
| data | No | The file's bytes, base64 encoded. Use this or url, not both. | |
| filename | No | A name to show in the dashboard. Never used to decide the file type. | |
| idempotency_key | No | A key of your own making that makes retrying this call safe. The same key with the same request replays the first answer for 24 hours instead of sending it again; the same key with a different request is refused with 422 idempotency_key_reused, and a retry that arrives while the first is still running is refused with 409 idempotency_in_progress; a retry after the first has finished collects the replay. |