Upload a file
const url = 'https://postflow.biz.id/api/v1/media/upload';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/octet-stream'}, body: 'binary'};
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/upload \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/octet-stream' \ --data binaryThe request body is the file. Content-Type is its type, Content-Length its size. Up to 30 MB for images and 1 GB for videos; for bigger or resumable uploads use the multipart flow.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”File name shown in the library.
Videos: width in pixels.
Request Bodyrequired
Section titled “Request Bodyrequired”The file bytes.
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" }}