PUT
/
v1
/
put
curl --request PUT \
  --url https://blob.squarecloud.app/v1/put \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '{}'
{
    "status": "success",
    "response": {
        "url": "https://public-blob.squarecloud.dev/ID/PREFIX/NAME_ltq7jshx-763f-ex1.jpeg"
    }
}
Authorization
string
required

The API key for your account. You can find this in your account settings.

file
file
required

Use FormData or NodeJS Buffer (single file or compress [zip])

name
string
required

A string representing the name of the file.
Must adhere to the a to z, A to Z, 0 to 9, and _ pattern. (3 to 32 characters)

prefix
string

A string representing the prefix for the file.
Must adhere to the a to z, A to Z, 0 to 9, and _ pattern. (3 to 32 characters)

expire
number

A number indicating the expiration period of the file, ranging from 1 to 365 days.

security_hash
boolean

Set to true if a security hash is required.

auto_download
boolean

Set to true if the file should be set for automatic download.

Response

status
string

Indicates whether the call was successful. “success” if successful, “error” if not.

response
object

Troubleshooting

Object-Related

// The provided object name is invalid. 
// Must adhere to the a to z, A to Z, 0 to 9, and _ pattern.
{
    "status": "error",
    "code": "INVALID_OBJECT_NAME"
}

File-Related

Actually, the maximum file size is 100mb. In the future, we plan to increase to 10GB. But for now, it’s 100mb because of the CDN.
// The provided file is invalid.
{
    "status": "error",
    "code": "INVALID_FILE"
}