Skip to content

Register a video and return the R2 presigned URL to upload it directly

POST
/v1/brands/{brand}/videos
curl --request POST \
--url https://api.replifier.com/v1/brands/brd_01hx0000000000000000000000/videos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "title": "example", "fileName": "example", "contentType": "video/mp4", "sizeBytes": 1 }'

Up to 2 GB and 60 minutes (MP4, MOV, WebM or MKV). The file does NOT go through the API: PUT to upload.url (valid for 15 minutes, without Authorization) and then POST /v1/videos/{video}/complete.

brand
required
string
/^brd_[a-z0-9]{26}$/

Example

brd_01hx0000000000000000000000
Media typeapplication/json
object
title
string
>= 1 characters <= 200 characters /^[^\x00-\x1f\x7f]*$/
fileName
required
string
>= 1 characters <= 200 characters /^[^\x00-\x1f\x7f]*$/
contentType
required
string
Allowed values: video/mp4 video/quicktime video/webm video/x-matroska video/x-m4v
sizeBytes
required
integer
>= 1 <= 2147483648

Video registered (status uploading)

Media typeapplication/json

Upload the file with a direct PUT to upload.url, with exactly the headers in upload.headers and WITHOUT Authorization. Then call complete.

object
video
required
object
id
required
string
brandId
required
string
status
required

uploading (waiting for the PUT to R2), queued, encoding, ready or failed

string
Allowed values: uploading queued encoding ready failed
title
required
string
fileName
required
string
nullable
contentType
required
string
sizeBytes
required

Actual size measured in R2 when the upload completed

integer
nullable
durationSeconds
required
number
nullable
width
required
integer
nullable
height
required
integer
nullable
renditions
required
Array<object>
object
name
required
string
width
required
integer
height
required
integer
videoKbps
required
integer
hasThumbnail
required
boolean
hasFallback
required
boolean
hasPreview
required

M12.4: a lightweight animated preview for email is available

boolean
previewBytes
required
integer
nullable
attempts
required
integer
failure
required

Only in failed: the cause in the language of the request. retryable: false = a retry will not fix it; another file must be uploaded.

object
code
required
string
cause
required
string
fix
required
string
detail
required
string
nullable
retryable
required
boolean
createdAt
required
string
readyAt
required
string
nullable
privateContactId
required

M12.3: if set, only that contact can watch the video with their link

string
nullable
upload
required
object
url
required
string
method
required
string
Allowed values: PUT
headers
required
object
key
additional properties
string
expiresInSeconds
required
integer

Example

{
"video": {
"status": "uploading"
},
"upload": {
"method": "PUT"
}
}

Invalid data

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}

No session, expired session, or invalid, expired or revoked API key

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}

Not allowed, API key missing the scope, IP not allowed, or request rejected (csrf_rejected)

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}

Does not exist or is not visible to you

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}

Internal error

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}

Service temporarily unavailable

Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
cause
required
string
fix
required
string
requestId
required
string

Example

{
"error": {
"code": "not_found"
}
}