Upload Media
Upload images or videos to the SchedPilot servers. Once uploaded, you will receive a unique media_id which you can then attach to your social media posts.
Endpoint
POST https://api.schedpilot.com/developers/v1/media/upload
Headers
| Header | Value | Description |
|---|---|---|
X-API-KEY | smm_your_secret_key | Your unique API key. |
Content-Type | multipart/form-data | Required. This endpoint requires multipart form-data for file transmission. |
Request Body (Multipart)
| Field | Type | Required | Description |
|---|---|---|---|
file | file | Yes | The binary file (Image or Video) to upload. |
Limits & Specs
- Max File Size: 5GB.
- Supported Images: JPG, PNG, WEBP, GIF.
- Supported Videos: MP4, MOV, WEBM, MPEG.
Response Fields
| Field | Type | Description |
|---|---|---|
code | number | Status code 201 for successful creation. |
media_id | string | The ID used for posting. It follows the format type-ID (e.g., image-50 or video-22). |
type | string | Either image or video. |
Example Request
curl -X POST [https://api.schedpilot.com/developers/v1/media/upload](https://api.schedpilot.com/developers/v1/media/upload) \
-H "X-API-KEY: smm_a1b2c3d4e5f6g7h8" \
-F "file=@/path/to/your/video.mp4"
Example Output
{
"code": 201,
"media_id": "video-1024",
"type": "video",
"mime_type": "video/mp4"
}