Skip to main content
POST
/
tryon
/
v1
/
images
/
upload
curl -X POST "https://api.genlook.app/tryon/v1/images/upload" \
  -H "x-api-key: gk_your_api_key" \
  -F "file=@customer-photo.jpg"
{
  "imageId": "img_9f86d081ab",
  "imageUrl": "https://storage.googleapis.com/..."
}
Upload a customer photo. The server validates the image, normalizes orientation and color, optionally applies a 4:5 person-aware crop, and stores the result. The returned imageId is an opaque token — pass it to POST /try-on as person.image.source.id to run as many generations as you want against the same image. This is the recommended path. The /try-on endpoint also accepts inline person.image.source.url and person.image.source.fileKey — convenient for one-shots, but they re-download/re-upload on every call. Pre-uploading is cheaper if you’ll run more than one generation against the same photo. Supported formats: JPEG, PNG, WebP, HEIC. Max file size: 10 MB.

Request

Send as multipart/form-data.
file
file
required
The customer photo.
crop
boolean
default:"true"
Apply the 4:5 person-aware crop. Set to false for studio shots, model previews, or any case where you want to preserve the original framing.
externalUserId
string
Optional opaque identifier for the end user this image belongs to. No PII. When set, the upload is tracked server-side so you can later wipe it with DELETE /customers/:customerId (GDPR / right-to-erasure — pass the same value as the path segment).
keepForDays
integer
Optional retention preset for this upload. One of 1, 3, 7. Defaults to your account’s configured customer-retention window. After this many days the underlying file is deleted automatically.
The previous form fields customerId and retentionDays are still accepted but deprecated (not a breaking change). Use externalUserId and keepForDays.
curl -X POST "https://api.genlook.app/tryon/v1/images/upload" \
  -H "x-api-key: gk_your_api_key" \
  -F "file=@customer-photo.jpg"

Response

imageId
string
required
Opaque token. Pass to POST /try-on as person.image.source.id.
imageUrl
string
required
Temporary URL pointing to the processed image. Use it for previews; the URL expires after a short window, so re-fetch the upload response if you need a fresh one.
{
  "imageId": "img_9f86d081ab",
  "imageUrl": "https://storage.googleapis.com/..."
}

Retention

Uploaded images are auto-deleted after keepForDays (or your account’s default window if you omit it; default 7 days). The imageId is valid for that window — after that, you’ll need to re-upload. If you set externalUserId, the image can also be wiped on demand via DELETE /customers/:customerId.