Media Uploads
PostBoost supports three upload methods. Choose based on file size and source:
| Method | Best for | API calls |
|---|---|---|
| Simple upload | Files under 10 MB | 1 |
| Chunked upload | Files over 10 MB | 3+ |
| Remote URL | Files hosted on the web | 2+ |
Simple upload
Send the file directly as a multipart form upload:
curl -X POST https://postboost.co/app/api/{workspaceUuid}/media \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-F "file=@/path/to/image.jpg"
The response is a Media object containing the uuid to use when attaching media to a post.
Chunked upload
Use for large files (video, high-res images). The server tells you the chunk size — you split the file and upload each piece in order.
Step 1 — Initiate
curl -X POST https://postboost.co/app/api/{workspaceUuid}/media/chunked/initiate \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"filename": "video.mp4",
"mime_type": "video/mp4",
"total_size": 52428800
}'
{
"upload_uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"chunk_size": 5242880,
"total_chunks": 10
}
Save upload_uuid, chunk_size, and total_chunks — you'll need all three.
Step 2 — Upload each chunk
Split your file into chunk_size-byte pieces and upload them in order. chunk_index is zero-based:
curl -X POST https://postboost.co/app/api/{workspaceUuid}/media/chunked/{uploadUuid}/upload \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-F "chunk=@chunk_0.bin" \
-F "chunk_index=0"
Repeat for each chunk (chunk_index=1, chunk_index=2, …, up to total_chunks - 1). Each successful chunk returns 201.
Step 3 — Complete
Once all chunks are uploaded, signal completion:
curl -X POST https://postboost.co/app/api/{workspaceUuid}/media/chunked/{uploadUuid}/complete \
-H "Authorization: Bearer YOUR_API_TOKEN"
Returns the final Media object. Use its uuid when attaching the file to a post.
Aborting
If an error occurs mid-upload, clean up the session to free server storage:
curl -X DELETE https://postboost.co/app/api/{workspaceUuid}/media/chunked/{uploadUuid} \
-H "Authorization: Bearer YOUR_API_TOKEN"
Remote URL upload
Import media directly from a public URL — no local download required.
Step 1 — Initiate
curl -X POST https://postboost.co/app/api/{workspaceUuid}/media/remote/initiate \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com/photo.jpg"}'
For small files the Media object is returned immediately (no polling needed). For larger files you receive a job ID instead:
{ "download_id": "abc123xyz" }
Step 2 — Poll for status
curl https://postboost.co/app/api/{workspaceUuid}/media/remote/{downloadId}/status \
-H "Authorization: Bearer YOUR_API_TOKEN"
Poll every 2–3 seconds. Possible values for status: pending, downloading, complete, failed.
{
"status": "complete",
"media": {
"uuid": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"name": "photo.jpg"
}
}
When status is complete, use media.uuid when attaching to a post. If status is failed, retry the initiate call.
Next steps
- Authentication — manage API tokens
- Webhooks — get notified when posts publish
- API Reference — full media endpoint reference