Skip to main content

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

HeaderValue
X-API-KEYsmm_your_key_here
AuthorizationBearer sp_tok_your_token

Query Parameters

ParameterTypeRequiredDefaultDescription
typestringNo(all)Filter by media type. Accepted values: image, video. Omit to return both.
pageintegerNo1Page number for pagination.
per_pageintegerNo20Number 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

FieldTypePresent onDescription
media_idstringAll itemsUnique ID. Use this in image_ids or video_ids when creating a post.
urlstringAll itemsPublic URL of the file.
typestringAll itemsEither "image" or "video".
mime_typestringAll itemsMIME type detected at upload time.
titlestringVideos onlyThe filename or title set at upload time.
statusstringVideos only"processed" — ready to attach to a post. "pending" — still being transcoded; cannot be used yet.
created_atstringAll itemsISO 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

StatusMeaning
400 Bad RequestAn invalid value was supplied for type, page, or per_page.
401 UnauthorizedNo API key or token was provided.
403 ForbiddenThe API key or token is invalid or has been revoked.