Skip to content

Upload Media

POST
/platform/v1/media
curl --request POST \
--url https://example.com/platform/v1/media \
--header 'X-API-Key: example'

Upload a media binary to Meta and return its media_id.

Two content types are accepted on the same path:

  • multipart/form-data — form fields channel_id + file.
  • application/json{channel_id, url, mime_type} (url-source; SSRF-guarded BEFORE any fetch).
X-API-Key
required
X-Api-Key
string

Successful Response

Media type application/json
PlatformMediaUploadResponse

Response for POST /platform/v1/media (both variants).

object
channel_id
required
Channel Id
integer
media_id
required
Media Id
string
Example generated
{
"channel_id": 1,
"media_id": "example"
}

Validation Error

Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
ctx
Context
object
input
Input
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
Example generated
{
"detail": [
{
"ctx": {},
"input": "example",
"loc": [
"example"
],
"msg": "example",
"type": "example"
}
]
}