Skip to content

Upload media

POST
/public/v1/media
curl --request POST \
--url https://api.loomta.com/public/v1/media \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form file=@file \
--form fileName=example \
--form mimeType=example \
--form mediaType=image \
--form folderId=example

Upload an image or video via multipart/form-data. TikTok only ingests media that Loomta hosts, so uploading is a prerequisite for posting. The returned object is immediately READY; pass its id to POST /posts.

Media typemultipart/form-data
object
file
required

The image or video file.

string format: binary
fileName

Overrides the uploaded file’s name.

string
mimeType

One of image/jpeg, image/webp, video/mp4, video/webm, video/quicktime. Inferred from the file when omitted.

string
mediaType

Inferred from the MIME type when omitted.

string
Allowed values: image video
folderId

Target folder UUID, or the string null for the root.

string

The uploaded media object.

Media typeapplication/json

A media object in the workspace library.

object
id
string format: uuid
storageKey
string
publicUrl
string format: uri
previewUrl
string format: uri
mimeType
string
size
integer | null
mediaType
string
Allowed values: image video audio file
originalFileName
string
status
string
Allowed values: PENDING READY
thumbnailMetadata
object | null
finalizedAt
string | null format: date-time
folderId
string | null format: uuid
createdAt
string format: date-time
Example
{
"mimeType": "image/jpeg",
"mediaType": "image",
"status": "PENDING"
}

The file field is missing or the type is unsupported.

Media typeapplication/json
object
code
required

A stable, machine-readable error code to branch on.

string
message
required

A human-readable description.

string
details

Optional structured detail (for example Zod validation issues).

Example
{
"code": "invalid_media_file",
"message": "The file field is required."
}

The API key is missing or invalid.

Media typeapplication/json
object
code
required

A stable, machine-readable error code to branch on.

string
message
required

A human-readable description.

string
details

Optional structured detail (for example Zod validation issues).

Examples
{
"code": "missing_api_key",
"message": "A Bearer API key is required."
}