Upload Media
Upload an image or video file to your SchedPilot media library. The returned media_id can then be passed to the Create Post endpoint via the image_ids or video_ids arrays.
Endpoint
POST https://api.schedpilot.com/developers/v1/media/upload
Authentication
Include either your API key or OAuth token on every request.
| Header | Value |
|---|---|
X-API-KEY | smm_your_key_here |
Authorization | Bearer sp_tok_your_token |
Request
Send the file as multipart/form-data. The form field name must be file.
| Field | Type | Required | Description |
|---|---|---|---|
file | binary | Yes | The media file to upload. |
File size limit
5 GB maximum per file.
Supported file types
| Category | Formats |
|---|---|
| Images | JPG, PNG, GIF, WebP |
| Videos | MP4, MOV, AVI, MKV, WEBM, MPEG |
Example Request
curl -X POST "https://api.schedpilot.com/developers/v1/media/upload" \
-H "X-API-KEY: smm_your_key_here" \
-F "file=@photo.jpg"
Uploading a video:
curl -X POST "https://api.schedpilot.com/developers/v1/media/upload" \
-H "X-API-KEY: smm_your_key_here" \
-F "file=@promo.mp4"
Response
HTTP 201 Created
{
"media_id": "image-42",
"type": "image",
"mime_type": "image/jpeg"
}
For a video upload:
{
"media_id": "video-7",
"type": "video",
"mime_type": "video/mp4"
}
Response fields
| Field | Type | Description |
|---|---|---|
media_id | string | Unique identifier for the uploaded file. Use this in Create Post. |
type | string | Either "image" or "video". |
mime_type | string | The detected MIME type of the uploaded file. |
Using the media_id in a Post
Pass the returned media_id to the Create Post endpoint:
- For images: include the value in the
image_idsarray. - For videos: include the value in the
video_idsarray.
Images and videos cannot be mixed
A single post may contain either images or a video — not both. Passing values in both image_ids and video_ids at the same time will return a 400 Bad Request error.
Error Responses
| Status | Meaning |
|---|---|
413 Payload Too Large | The file exceeds the 5 GB limit. |
415 Unsupported Media Type | The file format is not supported. |
422 Unprocessable Entity | The file field is missing or the multipart body is malformed. |
401 Unauthorized | No API key or token was provided. |
403 Forbidden | The API key or token is invalid or has been revoked. |