POST
/
api
/
v1
/
management
/
storage
curl --request POST \
  --url http:///%7B{baseurl}%7D/api/v1/management/storage \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <x-api-key>' \
  --data '{
  "allowedFileExtensions": [
    "png",
    "jpg",
    "jpeg"
  ],
  "environmentId": "env123",
  "fileName": "profile.png",
  "fileType": "image/png"
}'
{
  "data": {
    "fileUrl": "http://localhost:3000/storage/cm1ubebtj000614kqe4hs3c67/public/profile--fid--abc123.png",
    "localUrl": "http://localhost:3000/storage/cm1ubebtj000614kqe4hs3c67/public/profile.png",
    "signedUrl": "http://localhost:3000/api/v1/client/cm1ubebtj000614kqe4hs3c67/storage/public",
    "updatedFileName": "profile--fid--abc123.png"
  }
}

Headers

x-api-key
string
required

Body

application/json
environmentId
string
required

The ID of the environment.

fileName
string
required

The name of the file to be uploaded.

fileType
string
required

The MIME type of the file.

allowedFileExtensions
string[]

Optional. List of allowed file extensions.

Response

200
application/json
OK - Returns the signed URL, updated file name, and file URL.
data
object

Was this page helpful?