> ## Documentation Index
> Fetch the complete documentation index at: https://docs.skayle.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# List Media

> List media resources built from published article/item images and author avatars.

## Endpoint

```bash theme={null}
GET /media
```

## Notes

Media API currently returns image resources from:

* Published article/item featured images (`source: post`)
* Author avatars (`source: author`)

## Query parameters

| Parameter  | Type    | Default | Description                            |
| ---------- | ------- | ------- | -------------------------------------- |
| `page`     | integer | `1`     | Page number                            |
| `per_page` | integer | `10`    | Items per page                         |
| `search`   | string  | -       | Search by title/description            |
| `orderby`  | string  | `date`  | `date`, `created_at`, or `title`       |
| `order`    | string  | `desc`  | `asc` or `desc`                        |
| `_fields`  | string  | -       | Comma-separated attribute field filter |

## Example request

```bash theme={null}
curl "https://api.skayle.ai/v1/ORG_ID/media?page=1&per_page=10&orderby=date&order=desc"
```

## Example response

```json theme={null}
{
  "data": [
    {
      "id": "post-post_01HZX2...",
      "type": "media",
      "attributes": {
        "source": "post",
        "source_id": "post_01HZX2...",
        "url": "https://cdn.example.com/images/hero-1.jpg",
        "type": "image",
        "title": "B2B SaaS Content Strategy for 2026",
        "description": "Editorial hero composition",
        "aspect_ratio": "16:9",
        "palette": {
          "base": "#2F4F4F"
        },
        "created_at": "2026-02-01T09:20:11.000Z"
      },
      "links": {
        "self": "/v1/ORG_ID/media/post-post_01HZX2..."
      }
    },
    {
      "id": "author-author_01HZ...",
      "type": "media",
      "attributes": {
        "source": "author",
        "source_id": "author_01HZ...",
        "url": "https://cdn.example.com/images/avatar-1.jpg",
        "type": "image",
        "title": "Alex Jordan's Avatar",
        "created_at": "2025-12-20T07:30:00.000Z"
      },
      "links": {
        "self": "/v1/ORG_ID/media/author-author_01HZ..."
      }
    }
  ],
  "meta": {
    "total": 27,
    "per_page": 10,
    "page": 1
  }
}
```

## Response field descriptions

| Field                            | Type           | Description                                       |
| -------------------------------- | -------------- | ------------------------------------------------- |
| `data[].id`                      | string         | Media ID (`post-{postId}` or `author-{authorId}`) |
| `data[].type`                    | string         | Resource type (`media`)                           |
| `data[].attributes.source`       | string         | Source entity type (`post` or `author`)           |
| `data[].attributes.source_id`    | string         | Source entity ID                                  |
| `data[].attributes.url`          | string         | Media URL                                         |
| `data[].attributes.type`         | string         | Media type (`image`)                              |
| `data[].attributes.title`        | string \| null | Media title                                       |
| `data[].attributes.description`  | string \| null | Media description                                 |
| `data[].attributes.aspect_ratio` | string \| null | Aspect ratio label                                |
| `data[].attributes.palette`      | object \| null | Palette metadata                                  |
| `data[].attributes.created_at`   | string         | ISO datetime                                      |
| `meta.total`                     | number         | Total media items                                 |
| `meta.per_page`                  | number         | Page size                                         |
| `meta.page`                      | number         | Current page                                      |

## Filtering and pagination

* `search` matches media title and description.
* `orderby` supports date/title-oriented sorting.
* `page` and `per_page` control pagination.

## Error responses

* `403` if organization is not in Skayle CMS mode.
* `500` for unexpected server errors.
