Import media from a URL
const url = 'https://postflow.biz.id/api/v1/media';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"url":"example","name":"example","width":1,"height":1,"durationMs":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://postflow.biz.id/api/v1/media \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "url": "example", "name": "example", "width": 1, "height": 1, "durationMs": 1 }'Downloads a JPEG, PNG, WebP, GIF, MP4, MOV or WebM from a public https URL (images up to 30 MB, videos up to 1 GB with a Content-Length). Send a video’s size and length so pre-flight can check them.
MCP tool: import_media.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Example generated
{ "url": "example", "name": "example", "width": 1, "height": 1, "durationMs": 1}Responses
Section titled “Responses”OK
object
Use in mediaIds.
App path of the file. With the API, download it from /media/{id}/file.
Example
{ "kind": "image", "mime": "image/jpeg"}Validation failed. details lists what to fix.
object
object
A sentence you can show to a person.
Field errors ({ field: [messages] }), or preflight: per-account rule violations with an issue code.
Example
{ "error": { "code": "UNAUTHENTICATED" }}Missing, invalid, expired or deleted key or token.
object
object
A sentence you can show to a person.
Field errors ({ field: [messages] }), or preflight: per-account rule violations with an issue code.
Example
{ "error": { "code": "UNAUTHENTICATED" }}Subscription inactive or plan limit reached.
object
object
A sentence you can show to a person.
Field errors ({ field: [messages] }), or preflight: per-account rule violations with an issue code.
Example
{ "error": { "code": "UNAUTHENTICATED" }}Not allowed: a read-only key, the owner’s approval, or an owner-only action.
object
object
A sentence you can show to a person.
Field errors ({ field: [messages] }), or preflight: per-account rule violations with an issue code.
Example
{ "error": { "code": "UNAUTHENTICATED" }}More than 120 requests in a minute with this key.
object
object
A sentence you can show to a person.
Field errors ({ field: [messages] }), or preflight: per-account rule violations with an issue code.
Example
{ "error": { "code": "UNAUTHENTICATED" }}