Media

Get Media

Returns one media asset. status turns ready once the upload has arrived.

GET
/v1/media/{id}

Authorization

Bearer
headerAuthorizationBearer <op_>

Workspace API key, sent as Authorization: Bearer op_... Keys are created in the dashboard.

Path Parameters

id*string
Length1 <= length

Response Body

Media asset

application/json
  1. response
id*string

Pass it in a post's media as { id }.

url*string

Public URL of the file. It never changes, and serves the file once status is ready.

Formaturi
contentType*string

MIME type of the file.

sizeBytes*|

File size in bytes. Null until status is ready.

filename*|

The filename sent to Create Media. Null for a file added without one.

status*|

pending until the file has been uploaded to uploadUrl and checked, usually within seconds. New values can be added, so handle a value you do not know.

createdAt*string
Formatdate-time
Example Request
import { Configuration, MediaApi } from "@onepostly/sdk";const mediaApi = new MediaApi(  new Configuration({ accessToken: process.env.ONEPOSTLY_API_KEY }));const response = await mediaApi.getMedia({  id: "med_7f3a9c2e1b4d4e8f9a6b5c4d3e2f1a0b",});console.log(response);
Example Response
{  "id": "med_7f3a9c2e1b4d4e8f9a6b5c4d3e2f1a0b",  "url": "https://cdn.onepostly.com/media/5b0e7c1a-2f4d-4c8e-9a3b-6d1f0e2c4a7b/7f3a9c2e-1b4d-4e8f-9a6b-5c4d3e2f1a0b.mp4",  "contentType": "video/mp4",  "sizeBytes": 48203776,  "filename": "launch.mp4",  "status": "ready",  "createdAt": "2027-03-15T09:00:00.000Z"}