Kulcare Docs
General

Presigned URLs API

Generate presigned URLs for uploading files to S3.

Endpoint

POST /identity/presigned_urls

Payload

{
  "files": [
    {
      "bucket": "kulcare-stag-profile-images",
      "file_path": "users/123/avatar.jpg"
    }
  ]
}
FieldTypeRequiredDescription
filesArrayYesArray of file objects
files[].bucketStringYesS3 bucket name
files[].file_pathStringYesKey/path for the file in S3

Response

{
  "data": {
    "ps_urls": [
      "https://kulcare-stag-profile-images.s3.amazonaws.com/users/123/avatar.jpg?X-Amz-Algorithm=..."
    ],
    "type": "presigned_url",
    "message": "data fetched"
  },
  "meta": {
    "request_id": "uuid-here"
  }
}

Usage

After receiving the presigned URL, make a PUT request to the URL to upload the file:

curl -X PUT "<presigned_url>" \
  -H "Content-Type: image/jpeg" \
  --data-binary @file.jpg

On this page