Media
List Media
Lists the workspace's media assets, newest first. Results are paginated.
GET
header
x-api-key<token>Workspace API key, sent in the x-api-key header. Keys start with op_ and are created in the dashboard.
limit?integerNumber of assets per page. Defaults to 20.
Range
1 <= value <= 100page?integerPage to return, starting at 1. Defaults to 1.
Range
1 <= valueMedia list
application/json- response
media*array<>total*integerTotal media assets across all pages.
page*integerPage number of this response, starting at 1.
hasMore*booleanTrue 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}