Skip to content

Upload a file

POST
/media/upload
curl --request POST \
--url https://postflow.biz.id/api/v1/media/upload \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/octet-stream' \
--data binary

The 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.

name
string

File name shown in the library.

width
integer

Videos: width in pixels.

height
integer
durationMs
integer

The file bytes.

Media typeapplication/octet-stream
string format: binary

OK

Media typeapplication/json
object
id
required

Use in mediaIds.

string
kind
required
string
Allowed values: image video
mime
required
string
Allowed values: image/jpeg image/png image/webp image/gif video/mp4 video/quicktime video/webm
sizeBytes
required
integer
width
required
Any of:
integer
height
required
Any of:
integer
durationMs
required
Any of:
integer
originalName
required
string
parentId
required
Any of:

Set on edited copies (e.g. a crop) of another file.

string
url
required

App path of the file. With the API, download it from /media/{id}/file.

string
thumbUrl
required
Any of:
string
createdAt
required
string format: date-time

Example

{
"kind": "image",
"mime": "image/jpeg"
}

Validation failed. details lists what to fix.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: UNAUTHENTICATED FORBIDDEN NOT_FOUND VALIDATION CONFLICT SUBSCRIPTION_GRACE SUBSCRIPTION_EXPIRED PLAN_LIMIT RATE_LIMITED INTERNAL
message
required

A sentence you can show to a person.

string
details

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.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: UNAUTHENTICATED FORBIDDEN NOT_FOUND VALIDATION CONFLICT SUBSCRIPTION_GRACE SUBSCRIPTION_EXPIRED PLAN_LIMIT RATE_LIMITED INTERNAL
message
required

A sentence you can show to a person.

string
details

Field errors ({ field: [messages] }), or preflight: per-account rule violations with an issue code.

Example

{
"error": {
"code": "UNAUTHENTICATED"
}
}

Subscription inactive or plan limit reached.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: UNAUTHENTICATED FORBIDDEN NOT_FOUND VALIDATION CONFLICT SUBSCRIPTION_GRACE SUBSCRIPTION_EXPIRED PLAN_LIMIT RATE_LIMITED INTERNAL
message
required

A sentence you can show to a person.

string
details

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.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: UNAUTHENTICATED FORBIDDEN NOT_FOUND VALIDATION CONFLICT SUBSCRIPTION_GRACE SUBSCRIPTION_EXPIRED PLAN_LIMIT RATE_LIMITED INTERNAL
message
required

A sentence you can show to a person.

string
details

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.

Media typeapplication/json
object
error
required
object
code
required
string
Allowed values: UNAUTHENTICATED FORBIDDEN NOT_FOUND VALIDATION CONFLICT SUBSCRIPTION_GRACE SUBSCRIPTION_EXPIRED PLAN_LIMIT RATE_LIMITED INTERNAL
message
required

A sentence you can show to a person.

string
details

Field errors ({ field: [messages] }), or preflight: per-account rule violations with an issue code.

Example

{
"error": {
"code": "UNAUTHENTICATED"
}
}