Start a media upload
Issues a presigned upload ticket: PUT the raw file bytes to `upload_url`, then call POST /v1/media/uploads/{id}/complete. Send `size_bytes` (strongly recommended, and it will be required in a future major version): it is checked against your plan's per-file limit and signed into the URL, so the PUT must send exactly that many bytes; without it the response carries a `Deprecation` header (an RFC 9745 date) and a `Link` with `rel="deprecation"`, the upload URL lives 5 minutes instead of 15, and the plan limit is enforced when the upload is completed, which measures the object. That path cannot stop a body PUT after you complete, or an upload you never complete, so send `size_bytes`. The PUT must also send the same `Content-Type` you declared here: the URL is signed for that value, and storage answers 403 to a PUT with a different one or none. Only image, video and audio types are accepted (SVG is refused), plus PDF, PPT, PPTX, DOC and DOCX documents (judged by the filename extension; other Office types such as XLSX are refused); the asset kind (image/video/audio/raw) is inferred from `content_type`. A type that is refused, or a size over your plan's per-file limit, answers 400 `validation_failed` with the offending field in `errors`. Call /complete within 24 hours: an upload that is not completed in that time is swept, and /complete then returns 404.
Issues a presigned upload ticket: PUT the raw file bytes to upload_url, then call POST /v1/media/uploads/{id}/complete. Send size_bytes (strongly recommended, and it will be required in a future major version): it is checked against your plan's per-file limit and signed into the URL, so the PUT must send exactly that many bytes; without it the response carries a Deprecation header (an RFC 9745 date) and a Link with rel="deprecation", the upload URL lives 5 minutes instead of 15, and the plan limit is enforced when the upload is completed, which measures the object. That path cannot stop a body PUT after you complete, or an upload you never complete, so send size_bytes. The PUT must also send the same Content-Type you declared here: the URL is signed for that value, and storage answers 403 to a PUT with a different one or none. Only image, video and audio types are accepted (SVG is refused), plus PDF, PPT, PPTX, DOC and DOCX documents (judged by the filename extension; other Office types such as XLSX are refused); the asset kind (image/video/audio/raw) is inferred from content_type. A type that is refused, or a size over your plan's per-file limit, answers 400 validation_failed with the offending field in errors. Call /complete within 24 hours: an upload that is not completed in that time is swept, and /complete then returns 404.
Organization API key as a Bearer token (postify_live_…).
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
curl -X POST "https://example.com/v1/media/uploads" \ -H "Content-Type: application/json" \ -d '{ "filename": "string", "content_type": "string" }'{ "asset_id": "string", "upload_url": "string", "method": "PUT", "expires_at": "2019-08-24T14:15:22Z"}List media assets GET
Lists the organization's media library, newest first, with cursor pagination. Use an asset's `url` as `media[].url` when creating posts.
Complete a media upload POST
Finalizes an uploaded asset after the PUT succeeds: checks the stored object's size and type against your plan and the type you declared, probes it, extracts a poster frame for videos, and marks it `ready`. An image is `ready` in the response. A video or audio file is probed after the response, which can take a few minutes: the response then carries the asset with `status` `pending`, and it turns `ready`, or `failed` with a `failure_reason`, on its own. Poll by calling this endpoint again (it is idempotent and returns the current asset) or with GET /v1/media, and attach the asset to a post only once it is `ready`: scheduling or publishing a post that holds a `failed` or still-processing file answers `validation_failed`, so completing a video and scheduling it at once can be refused until processing ends. A file over your plan's limit, or stored as a different type than you declared, is refused in the response itself (`validation_failed`) and the asset is `failed`. If the file is not in storage yet, answers 409 `resource_conflict` and leaves the asset `pending`: PUT it to `upload_url`, then complete again. Safe to retry — completing an asset that is already ready or failed returns it as it is, and one still processing returns it `pending` (a process restart during processing can restart the job, so do not rely on a retry to run it only once). A ready asset serves the bytes that were checked: a body PUT to `upload_url` after completion does not change it. Returns 404 if the upload was never completed within 24 hours and has been swept.