Media

List Media

Lists the workspace's media assets, newest first. Results are paginated.

GET
/v1/media

Authorization

headerx-api-key<token>

Workspace API key, sent in the x-api-key header. Keys start with op_ and are created in the dashboard.

Query Parameters

limit?integer

Number of assets per page. Defaults to 20.

Range1 <= value <= 100
page?integer

Page to return, starting at 1. Defaults to 1.

Range1 <= value

Response Body

Media list

application/json
  1. response
media*array<>
total*integer

Total media assets across all pages.

page*integer

Page number of this response, starting at 1.

hasMore*boolean

True when more assets follow this page. Request the next page to get them.

Example Request
import { Configuration, MediaApi } from "@onepostly/sdk";const mediaApi = new MediaApi(  new Configuration({ apiKey: process.env.ONEPOSTLY_API_KEY }));const response = await mediaApi.listMedia({  limit: 20,  page: 2,});console.log(response);
Example Response
{  "media": [    {      "id": "e8f9a0b1-c2d3-4e5f-8a6b-c7d8e9f0a1b2",      "url": "https://cdn.onepostly.com/media/WORKSPACE_ID/MEDIA_ID.jpg",      "contentType": "image/jpeg",      "sizeBytes": 12345    }  ],  "total": 42,  "page": 1,  "hasMore": true}