Skip to content

uploadMedia

POST
/media/uploads
curl --request POST \
--url http://localhost:8080/api/v1/media/uploads \
--header 'Content-Type: multipart/form-data' \
--cookie hs_session=<hs_session> \
--form file=example \
--form kind=image

Upload bytes for ingest or avatars. Max 50 MB. Images: jpeg, png, webp, gif, heic. Video: mp4, webm. Returns an existing media ID when the SHA-256 matches.

Media typemultipart/form-data
object
file
required
string
kind
string
Allowed values: image video poster

Stored.

Media typeapplication/json
object
mediaId
required
string
/^[a-z]{2,3}_[0-9a-hjkmnp-tv-z]{26}$/
sha256
required
string

Examples

Exampleseed

Derived from fixtures/seed.json.

{
"mediaId": "med_01j9a1b2c3d4e5f6g7h8j9k01w",
"sha256": "0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef"
}

Too large.

Media typeapplication/problem+json
object
type
required
string format: uri
title
required
string
status
required
integer
code
required
string
i18nKey
string
detail
string
fields
Array<object>
object
path
required
string
code
required
string
i18nKey
string

Example generated

{
"type": "https://example.com",
"title": "example",
"status": 1,
"code": "example",
"i18nKey": "example",
"detail": "example",
"fields": [
{
"path": "example",
"code": "example",
"i18nKey": "example"
}
]
}