Skip to content

Request the presigned URL to upload a new file or a new version directly to R2 (valid for 1 hour)

POST
/v1/brands/{brand}/drive/uploads
curl --request POST \
--url https://api.replifier.com/v1/brands/brd_01hx0000000000000000000000/drive/uploads \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "name": "example", "mime": "example", "bytes": 1, "sha256": "example", "folderId": "example", "fileId": "example", "forBrandKit": true }'

Upload with PUT to the returned URL sending EXACTLY the given headers (the type and the SHA-256 are signed), then call POST /v1/drive/uploads/{id}:complete. Per-file limits: image 25 MB and 40 megapixels, document 100 MB, font 5 MB.

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

Example

brd_01hx0000000000000000000000
Media typeapplication/json
object
name
required
string
>= 1 characters <= 200 characters /^[^\x00-\x1f\x7f]*$/
mime
required
string
<= 120 characters
bytes
required
integer
>= 1
sha256
required

Hex-encoded SHA-256 of the file. R2 verifies it when it receives the body.

string
/^[0-9a-f]{64}$/
folderId
string
nullable /^dfo_[a-z0-9]{26}$/
fileId

If sent, the upload creates a new version of that file.

string
/^dfl_[a-z0-9]{26}$/
forBrandKit

SVG is only accepted for the brand kit.

boolean

Example generated

{
"name": "example",
"mime": "example",
"bytes": 1,
"sha256": "example",
"folderId": "example",
"fileId": "example",
"forBrandKit": true
}

Upload

Media typeapplication/json
object
id
required
string
status
required
string
Allowed values: pending completed expired rejected
expiresAt
required
string
upload
required
object
method
required
string
Allowed values: PUT
url
required
string
headers
required
object
key
additional properties
string
expiresIn
required
number
duplicateOf
required

An active file with the same SHA-256 already exists in the brand: offered for reuse.

object
fileId
required
string
name
required
string

Example

{
"status": "pending",
"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"
}
}

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"
}
}

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"
}
}

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"
}
}

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"
}
}

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"
}
}