Upload Media
Upload images or videos for use in content generation or publishing.
POST /api/v1/media/upload
Upload images or videos to use as input for caption generation, image generation, or publishing.
Request
Send a multipart/form-data request with the file and metadata.
Headers
| Header | Value |
|---|---|
x-api-key | Your API key |
X-Workspace-Id | Your workspace ID |
Content-Type | multipart/form-data |
Form Fields
| Field | Type | Required | Description |
|---|---|---|---|
file | file | Yes | The image or video file to upload |
type | string | Yes | image or video |
Supported Formats
| Type | Formats | Max Size |
|---|---|---|
| Image | JPEG, PNG, WebP | 10 MB |
| Video | MP4, MOV, WebM | 500 MB |
Example
Upload an Image
curl -X POST https://powerpost.ai/api/v1/media/upload \
-H "x-api-key: pp_live_sk_YOUR_KEY" \
-H "X-Workspace-Id: YOUR_WORKSPACE_ID" \
-F "file=@photo.jpg" \
-F "type=image"const formData = new FormData()
formData.append('file', fs.createReadStream('photo.jpg'))
formData.append('type', 'image')
const res = await fetch('https://powerpost.ai/api/v1/media/upload', {
method: 'POST',
headers: {
'x-api-key': 'pp_live_sk_YOUR_KEY',
'X-Workspace-Id': 'YOUR_WORKSPACE_ID',
},
body: formData,
})
const data = await res.json()import requests
res = requests.post(
"https://powerpost.ai/api/v1/media/upload",
headers={
"x-api-key": "pp_live_sk_YOUR_KEY",
"X-Workspace-Id": "YOUR_WORKSPACE_ID",
},
files={"file": open("photo.jpg", "rb")},
data={"type": "image"},
)
data = res.json()Upload a Video
curl -X POST https://powerpost.ai/api/v1/media/upload \
-H "x-api-key: pp_live_sk_YOUR_KEY" \
-H "X-Workspace-Id: YOUR_WORKSPACE_ID" \
-F "file=@video.mp4" \
-F "type=video"const formData = new FormData()
formData.append('file', fs.createReadStream('video.mp4'))
formData.append('type', 'video')
const res = await fetch('https://powerpost.ai/api/v1/media/upload', {
method: 'POST',
headers: {
'x-api-key': 'pp_live_sk_YOUR_KEY',
'X-Workspace-Id': 'YOUR_WORKSPACE_ID',
},
body: formData,
})
const data = await res.json()import requests
res = requests.post(
"https://powerpost.ai/api/v1/media/upload",
headers={
"x-api-key": "pp_live_sk_YOUR_KEY",
"X-Workspace-Id": "YOUR_WORKSPACE_ID",
},
files={"file": open("video.mp4", "rb")},
data={"type": "video"},
)
data = res.json()Response
{
"media_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"type": "image",
"file_name": "photo.jpg",
"file_size": 245000,
"mime_type": "image/jpeg",
"created_at": "2026-01-10T18:30:00Z"
}Response Fields
| Field | Type | Description |
|---|---|---|
media_id | string | Unique ID to reference in other requests |
type | string | image or video |
file_name | string | Original file name |
file_size | number | File size in bytes |
mime_type | string | MIME type of the uploaded file |
created_at | string | ISO 8601 timestamp |
Using Uploaded Media
Once uploaded, use the media_id in other endpoints:
Caption generation — Pass media_ids to the Generate Content endpoint:
{
"media_ids": ["a1b2c3d4-..."],
"post_types": ["instagram-feed"],
"research_mode": "regular"
}Image generation — Pass as style_images to the Generate Images endpoint:
{
"prompt": "Product photo in the same style",
"style_images": ["a1b2c3d4-..."],
"size": "square"
}Publishing — Attach to posts via the Create Post endpoint:
{
"items": [{ "post_type": "instagram-feed", "content": "...", "media_ids": ["a1b2c3d4-..."] }]
}Storage
All accounts have a 10 GB storage quota. Uploaded and generated media counts toward this quota. Media is retained until you delete it — there is no automatic expiration.
When your storage is full, uploads are rejected with a 413 error. Free up space by deleting unused media in your dashboard.
Errors
| Code | Description |
|---|---|
| 400 | Invalid file type or missing fields |
| 401 | Invalid API key |
| 413 | File too large (FILE_TOO_LARGE) or storage quota exceeded (STORAGE_QUOTA_EXCEEDED) |
| 429 | Rate limit exceeded |