Skip to content

Media

5 endpoints: list media, retrieve media, start a media upload, sign video upload parts, complete a media upload.

List media

GET /v1/media

Lists uploaded videos, images and thumbnails, newest first.

Permission: media:read

Query parameters

FieldTypeRequiredDescription
limitintegerNoItems per page, 1 to 100. (1 to 100, default 25)
cursorstringNoThe next_cursor of the previous page. (up to 512 characters)
project_idstringNo(up to 128 characters)

Response

FieldTypeRequiredDescription
object"list"Yes
dataarray of objectYes
data[].object"media"Yes
data[].idstringYes(up to 128 characters)
data[].project_idstring or nullYes
data[].kindvideo, image, thumbnailYes
data[].statusstringYes
data[].content_typestringYes
data[].size_bytesinteger or nullYes
data[].created_atstringYesISO 8601 date and time, UTC.
has_morebooleanYes
next_cursorstring or nullYes
curl https://api.nowscale.com/v1/media \
  -H "Authorization: Bearer $NOWSCALE_API_KEY"

Retrieve media

GET /v1/media/{media_id}

Returns one uploaded file.

Permission: media:read

Path parameters

NameDescription
media_idThe media's id.

Response

FieldTypeRequiredDescription
object"media"Yes
idstringYes(up to 128 characters)
project_idstring or nullYes
kindvideo, image, thumbnailYes
statusstringYes
content_typestringYes
size_bytesinteger or nullYes
created_atstringYesISO 8601 date and time, UTC.
curl https://api.nowscale.com/v1/media/MEDIA_ID \
  -H "Authorization: Bearer $NOWSCALE_API_KEY"

Start a media upload

POST /v1/media

Reserves a media item in a Project and returns where to send the file. Images and thumbnails take one PUT to upload_url; videos upload in parts (sign them with the parts endpoint). Finish with the complete endpoint.

Permission: media:write · Accepts Idempotency-Key · Answers 201

Body

FieldTypeRequiredDescription
project_idstringYes(up to 128 characters)
kindvideo, image, thumbnailYes
content_typestringYes(up to 127 characters)
size_bytesintegerYes(at most 9007199254740991)

Response

FieldTypeRequiredDescription
object"media_upload"Yes
media_idstringYes(up to 128 characters)
methodsingle, multipartYes
upload_urlstring or nullYessingle: PUT the file here with its Content-Type.
part_sizeinteger or nullYesmultipart: bytes per part (the last part may be smaller).
part_countinteger or nullYes
content_typestringYes
curl -X POST https://api.nowscale.com/v1/media \
  -H "Authorization: Bearer $NOWSCALE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{ ... }'

Sign video upload parts

POST /v1/media/{media_id}/parts

Returns a short-lived PUT URL for each part number of a video upload. Keep the ETag header of each part's response for the complete endpoint.

Permission: media:write

Path parameters

NameDescription
media_idThe media's id.

Body

FieldTypeRequiredDescription
part_numbersarray of integerYes

Response

FieldTypeRequiredDescription
object"media_part_urls"Yes
media_idstringYes(up to 128 characters)
urlsobjectYes
curl -X POST https://api.nowscale.com/v1/media/MEDIA_ID/parts \
  -H "Authorization: Bearer $NOWSCALE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ ... }'

Complete a media upload

POST /v1/media/{media_id}/complete

Checks the uploaded file and makes it ready to attach to posts. Videos list every part with its ETag. Duration and size you report are checked again by each network at publish time.

Permission: media:write · Accepts Idempotency-Key

Path parameters

NameDescription
media_idThe media's id.

Body

FieldTypeRequiredDescription
partsarray of objectNo
parts[].part_numberintegerYes(1 to 10000)
parts[].etagstringYes(up to 256 characters)
duration_secondsnumberNo(at most 172800)
widthintegerNo(at most 16384)
heightintegerNo(at most 16384)

Response

FieldTypeRequiredDescription
object"media"Yes
idstringYes(up to 128 characters)
project_idstring or nullYes
kindvideo, image, thumbnailYes
statusstringYes
content_typestringYes
size_bytesinteger or nullYes
created_atstringYesISO 8601 date and time, UTC.
curl -X POST https://api.nowscale.com/v1/media/MEDIA_ID/complete \
  -H "Authorization: Bearer $NOWSCALE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{ ... }'