DrapeItOnDrapeItOn
Guides

Uploading images

How person and garment image URLs work with presigned upload and generation.

Uploading images

A generation requires two publicly reachable image URLs:

FieldMeaning
person_image_urlShopper / model photograph
garment_image_urlGarment product image

Both are required on POST /v1/generations and must be valid URLs. The API does not require either URL to come from DrapeItOn hosting.

Presigned upload (POST /v1/uploads/presigned)

Use this when you need the platform to host image bytes and give you a stable public_url.

Contract (enforced by the API):

  1. POST /v1/uploads/presigned with JSON body { "content_type": "…" }.
  2. Allowed content_type values: image/png, image/jpeg, image/jpg, image/webp.
  3. Response includes:
    • upload_url — perform an HTTP PUT of the raw file bytes here
    • public_url — use this URL later as person_image_url or garment_image_url
  4. The PUT must use the same Content-Type you requested.

There is no separate “person” vs “garment” upload endpoint. The same presign + PUT flow produces a public URL you may assign to either generation field.

Example

# 1) Request URLs
RESP=$(curl -sS -X POST "https://api.drapeiton.com/v1/uploads/presigned" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"content_type":"image/jpeg"}')

UPLOAD_URL=$(echo "$RESP" | jq -r .upload_url)
PUBLIC_URL=$(echo "$RESP" | jq -r .public_url)

# 2) Upload bytes
curl -sS -X PUT "$UPLOAD_URL" \
  -H "Content-Type: image/jpeg" \
  --data-binary @./person.jpg

# 3) Use $PUBLIC_URL as person_image_url (or garment_image_url) on submit

When to use which source

SituationApproach
Shopper photo only on the device / your backendPresign → PUT → use public_url as person_image_url
Garment already on your product CDNPass that HTTPS URL as garment_image_url directly
You want a platform-hosted URL for a garmentSame presign endpoint; use public_url as garment_image_url
Both images already publicSkip presign; pass both URLs on submit

Limits

Supported MIME types for presign are listed above. Keep images reasonably sized for e-commerce use; use formats the presign endpoint accepts.

On this page