POST
/
client
/
{environmentId}
/
storage
Upload Private File
curl --request POST \
  --url https://app.formbricks.com/api/v2/client/{environmentId}/storage \
  --header 'Content-Type: application/json' \
  --data '{
  "surveyId": "cm7pr0x2y004o192zmit8cjvb",
  "fileName": "example.jpg",
  "fileType": "image/jpeg"
}'
{
  "data": {
    "signedUrl": "https://s3.example.com/bucket",
    "presignedFields": {
      "key": "uploads/env-id/private/file--fid--uuid.jpg",
      "policy": "<base64-policy>",
      "x-amz-algorithm": "AWS4-HMAC-SHA256"
    },
    "updatedFileName": "file--fid--b153ba3e-6602-4bb3-bed9-211b5b1ae463.jpg",
    "fileUrl": "https://app.formbricks.com/storage/cm1ubebtj000614kqe4hs3c67/private/file--fid--b153ba3e-6602-4bb3-bed9-211b5b1ae463.jpg"
  }
}

Path Parameters

environmentId
string
required

The ID of the environment.

Body

application/json
surveyId
string
required

The ID of the survey associated with the file.

fileName
string
required

The name of the file to be uploaded.

fileType
string
required

The MIME type of the file.

Response

OK - Returns the signed URL, presigned fields, updated file name, and file URL.

data
object