POST
api
/
files
/
aws-presigned
curl --request POST \
  --url https://api.prd.realitydefender.xyz/api/files/aws-presigned \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "fileName": "<string>"
}'
fileName
string

The file name of the file you would like to upload, including the file extension.

Before uploading a file directly to our storage, you’ll need to request a pre-signed URL. This URL provides secure, temporary access to upload your file.

Authorization

To request a pre-signed URL, you must include the x-api-key in your request headers. This key is essential for authenticating your request and ensuring secure access to the API.

Supported File Types

  • Documents: .pdf, .doc, .docx, .txt
  • Images: .jpg, .jpeg, .png, .gif, .webp
  • Audio: .mp3, .wav, .m4a, .aac, .ogg, .flac, .alac
  • Video: .mp4, .mov
  • Text: .txt

Size Limits

  • Documents: up to 5MB
  • Images: up to 10MB
  • Audio: up to 20MB
  • Video: up to 100MB

Filename Restrictions

  • Maximum length: 200 characters
  • Special characters will be converted to underscores
  • Case insensitive

Sample Code Snippet

Here’s an example of how you can request a pre-signed URL and upload a file.

# First request to get the presigned URL
curl -X POST \
  'https://api.prd.realitydefender.xyz/api/files/aws-presigned' \
  -H 'X-API-KEY: your-api-key-here' \
  -H 'Content-Type: application/json' \
  -d '{"fileName": "your-file-path-here"}'

# Second request to upload the file using the presigned URL
curl -X PUT \
  'presigned-url-from-previous-response' \
  --data-binary 'your-file-path-here'