Get a pre-signed URL

POST

Generate Pre-Signed URL for File Uploads

The POST /pre-signed-url endpoint provides a secure, pre-signed URL that you can use to upload files directly to a designated storage service. The URL is time-limited, remaining valid for 15 minutes, and authenticated to ensure that file uploads are secure. The maximum supported file size is 100000000 bytes (100MB).

Uploading Your File

Once you have obtained the pre-signed URL and the accompanying fields (key, name, x-amz-Algorithm, x-amz-credential, x-amz-date, x-amz-signature) from the API endpoint:

To upload your file to the designated storage location using the provided data, you need to make a request formatted as follows:

$ curl -X POST 'url' \
> --form 'key="key"' \
> --form 'name="name"' \
> --form 'X-Amz-Algorithm="x-amz-algorithm"' \
> --form 'X-Amz-Credential="x-amz-credential"' \
> --form 'X-Amz-Date="x-amz-date"' \
> --form 'X-Amz-Security-Token="x-amz-security-token"' \
> --form 'Policy="policy"' \
> --form 'X-Amz-Signature= "x-amz-signature"' \
> --form 'file=@"/path/to/file"'

Important Note: You must retain the returned key as it is essential for later referencing the file in the application, such as attaching it to a case or including it in a user comment.

Request

This endpoint expects an object.
filename
stringRequired
fileSize
doubleRequired
File size should be less than 100000000 bytes

Response

This endpoint returns an object
url
string
fields
object
Fields to be used in the form-data request

Errors

POST
1curl -X POST https://sandbox.api.flagright.com/management/pre-signed-url \
2 -H "x-api-key: <apiKey>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "filename": "filename",
6 "fileSize": 1.1
7}'
1{
2 "url": "url",
3 "fields": {
4 "key": "key",
5 "policy": "policy",
6 "x-amz-algorithm": "x-amz-algorithm",
7 "x-amz-credential": "x-amz-credential",
8 "x-amz-date": "x-amz-date",
9 "x-amz-signature": "x-amz-signature",
10 "name": "name"
11 }
12}