Media Library
List the media files you have previously uploaded to SchedPilot. Use this endpoint to browse available images and videos before attaching them to a new post.
Endpoint
GET https://api.schedpilot.com/developers/v1/media/list
Authentication
| Header | Value |
|---|---|
X-API-KEY | smm_your_key_here |
Authorization | Bearer sp_tok_your_token |
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
type | string | No | (all) | Filter by media type. Accepted values: image, video. Omit to return both. |
page | integer | No | 1 | Page number for pagination. |
per_page | integer | No | 20 | Number of items per page. Maximum 100. |
Example Requests
List all media (first page, default page size):
curl "https://api.schedpilot.com/developers/v1/media/list" \
-H "X-API-KEY: smm_your_key_here"
List only images, 50 per page:
curl "https://api.schedpilot.com/developers/v1/media/list?type=image&per_page=50" \
-H "X-API-KEY: smm_your_key_here"
List the second page of videos:
curl "https://api.schedpilot.com/developers/v1/media/list?type=video&page=2" \
-H "X-API-KEY: smm_your_key_here"
Response
HTTP 200 OK
[
{
"media_id": "image-42",
"url": "https://api.schedpilot.com/wp-content/uploads/smm/image-42.jpg",
"type": "image",
"mime_type": "image/jpeg",
"created_at": "2024-06-10T08:30:00Z"
},
{
"media_id": "image-38",
"url": "https://api.schedpilot.com/wp-content/uploads/smm/image-38.png",
"type": "image",
"mime_type": "image/png",
"created_at": "2024-06-08T14:15:22Z"
},
{
"media_id": "video-7",
"url": "https://api.schedpilot.com/wp-content/uploads/smm/video-7.mp4",
"type": "video",
"mime_type": "video/mp4",
"title": "Product demo Q2",
"status": "processed",
"created_at": "2024-06-05T11:00:00Z"
}
]
Response fields
| Field | Type | Present on | Description |
|---|---|---|---|
media_id | string | All items | Unique ID. Use this in image_ids or video_ids when creating a post. |
url | string | All items | Public URL of the file. |
type | string | All items | Either "image" or "video". |
mime_type | string | All items | MIME type detected at upload time. |
title | string | Videos only | The filename or title set at upload time. |
status | string | Videos only | "processed" — ready to attach to a post. "pending" — still being transcoded; cannot be used yet. |
created_at | string | All items | ISO 8601 UTC timestamp of when the file was uploaded. |
Video processing
Freshly uploaded videos may briefly show "status": "pending" while they are being transcoded. Poll this endpoint or wait a moment before attempting to use a video_id in a new post.
Error Responses
| Status | Meaning |
|---|---|
400 Bad Request | An invalid value was supplied for type, page, or per_page. |
401 Unauthorized | No API key or token was provided. |
403 Forbidden | The API key or token is invalid or has been revoked. |