Skip to main content
GET
/
media
List Media
curl --request GET \
  --url https://api.example.com/media

Endpoint

GET /media

Query Parameters

ParameterTypeDefaultDescription
pageinteger1Page number
perPageinteger20Items per page (max 100)
sortstring-createdAtSort field
filter[type]string-Filter by type (image, video, document)
filter[mimeType]string-Filter by MIME type

Example Request

curl -X GET "https://api.skayle.ai/v1/media?filter[type]=image&perPage=20" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example Response

{
  "data": [
    {
      "id": "media_abc123",
      "type": "media",
      "attributes": {
        "filename": "hero-image.jpg",
        "url": "https://cdn.skayle.io/media/hero-image.jpg",
        "mimeType": "image/jpeg",
        "size": 245678,
        "width": 1920,
        "height": 1080,
        "alt": "Hero image for blog post",
        "createdAt": "2024-01-15T10:00:00Z"
      }
    },
    {
      "id": "media_def456",
      "type": "media",
      "attributes": {
        "filename": "thumbnail.png",
        "url": "https://cdn.skayle.io/media/thumbnail.png",
        "mimeType": "image/png",
        "size": 45678,
        "width": 400,
        "height": 300,
        "alt": "Post thumbnail",
        "createdAt": "2024-01-14T15:30:00Z"
      }
    }
  ],
  "meta": {
    "total": 156,
    "page": 1,
    "perPage": 20,
    "totalPages": 8
  }
}

Supported Media Types

TypeMIME Types
imageimage/jpeg, image/png, image/gif, image/webp, image/svg+xml
videovideo/mp4, video/webm
documentapplication/pdf