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:
| Field | Meaning |
|---|---|
person_image_url | Shopper / model photograph |
garment_image_url | Garment 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):
POST /v1/uploads/presignedwith JSON body{ "content_type": "…" }.- Allowed
content_typevalues:image/png,image/jpeg,image/jpg,image/webp. - Response includes:
upload_url— perform an HTTP PUT of the raw file bytes herepublic_url— use this URL later asperson_image_urlorgarment_image_url
- The PUT must use the same
Content-Typeyou 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 submitWhen to use which source
| Situation | Approach |
|---|---|
| Shopper photo only on the device / your backend | Presign → PUT → use public_url as person_image_url |
| Garment already on your product CDN | Pass that HTTPS URL as garment_image_url directly |
| You want a platform-hosted URL for a garment | Same presign endpoint; use public_url as garment_image_url |
| Both images already public | Skip 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.