POST /uploads/presign

Get a presigned URL for direct upload to S3.

The client should:

  1. Call this endpoint to get a presigned URL
  2. PUT the file directly to the uploadUrl
  3. Use the resourceId in subsequent API calls
application/json

Body Required

  • contentType string Required

    MIME type of the file to upload (image/jpeg or image/png)

    Values are image/jpeg or image/png.

  • purpose string

    Purpose of upload - determines TTL and validation.

    Values are tryon_photo or general.

Responses

  • 200 application/json

    Successful Response

    Hide response attributes Show response attributes object
    • resourceId string Required

      Unique identifier for the uploaded resource

    • uploadUrl string Required

      URL to POST the form data to

    • fields object Required

      Form fields to include in POST request

      Hide fields attribute Show fields attribute object
      • * string Additional properties
    • maxSize integer Required

      Maximum file size in bytes

    • expiresAt string(date-time) Required

      When the presigned URL expires

  • 422 application/json

    Validation Error

    Hide response attribute Show response attribute object
    • detail array[object]
      Hide detail attributes Show detail attributes object
      • loc array[string | integer] Required
      • msg string Required
      • type string Required
POST /uploads/presign
curl \
 --request POST 'http://api.example.com/uploads/presign' \
 --header "Content-Type: application/json" \
 --data '{"contentType":"image/jpeg","purpose":"tryon_photo"}'
Request examples
{
  "contentType": "image/jpeg",
  "purpose": "tryon_photo"
}
Response examples (200)
{
  "resourceId": "string",
  "uploadUrl": "string",
  "fields": {
    "additionalProperty1": "string",
    "additionalProperty2": "string"
  },
  "maxSize": 42,
  "expiresAt": "2026-05-04T09:42:00Z"
}
Response examples (422)
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}