{ "code": "UNSUPPORTED_IMAGE_TYPE", "message": "Unsupported image format: accepted formats are JPEG, PNG, WebP, and HEIC.", "status": 400}
Uploads a customer photo and returns an imageId. Pass it to Create Try-On as person.image.source.id, as many times as you want until it expires.JPEG, PNG, WebP or HEIC. 10 MB max. Send as multipart/form-data.
Body
file
required
The customer photo.
boolean
default:"true"
Crop to 4:5 around the person. Set false to keep the original framing.
boolean
default:"false"
Refuses the upload with NO_PERSON_DETECTED (400) when no person is found in the photo. Leave it off for pet photos and for close-ups of feet or hands.
{ "code": "UNSUPPORTED_IMAGE_TYPE", "message": "Unsupported image format: accepted formats are JPEG, PNG, WebP, and HEIC.", "status": 400}
Deprecated but still accepted: customerId and retentionDays form fields.
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Genlook Documentation","colors":{"primary":"#16A34A","light":"#07C983","dark":"#15803D"},"logo":{"light":"https://mintcdn.com/genloook/E-Zz0RUPElap0z-g/logo/light.png?fit=max\u0026auto=format\u0026n=E-Zz0RUPElap0z-g\u0026q=85\u0026s=b5850569f68556b7bcb48ae2d787deb2","dark":"https://mintcdn.com/genloook/E-Zz0RUPElap0z-g/logo/dark.png?fit=max\u0026auto=format\u0026n=E-Zz0RUPElap0z-g\u0026q=85\u0026s=22e6b558c8da304bc089c41f8dc6b33e"},"favicon":"https://mintcdn.com/genloook/7t2z58UuD_DLkyk0/favicon.svg?fit=max\u0026auto=format\u0026n=7t2z58UuD_DLkyk0\u0026q=85\u0026s=cd91e0c41ca457854f75a26a8db797ed","appearance":{"default":"light"},"navbar":{"links":[{"href":"https://discord.gg/gP9HsRUcvH","label":"Discord"},{"href":"mailto:support@genlook.app","label":"Support"}],"primary":{"type":"button","label":"Get Started","href":"https://genlook.app/get-started?utm_source=docs\u0026utm_medium=website"}},"footer":{"socials":{"x":"https://x.com/genlook_app","github":"https://github.com/genlookLabs","linkedin":"https://linkedin.com/company/genlook-virtual-try-on","youtube":"https://www.youtube.com/@genlookai","instagram":"https://www.instagram.com/genlook.app"},"links":[{"header":"Legal","items":[{"label":"Terms of Service","href":"https://genlook.app/terms"},{"label":"Privacy Policy","href":"https://genlook.app/privacy"},{"label":"Legal notice","href":"https://genlook.app/legal-notice"}]}]},"seo":{"metatags":{"canonical":"https://genlook.app/docs"}},"integrations":{"ga4":{"measurementId":"G-B46804SDQ5"}},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":true},"navigation":{"global":{"anchors":[{"anchor":"Website","icon":"globe","href":"https://genlook.app?utm_source=docs\u0026utm_medium=website"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"genloook","hasAudioNarration":false,"actualSubdomain":"genloook","customDomains":["docs.genlook.app"],"gitSource":{"type":"github","owner":"thibaultmthh","repo":"genlook","deployBranch":"main","contentDirectory":"apps/docs-v2","isPrivate":true,"mountPath":"","label":""},"feedback":{"thumbs":true},"entitlements":{},"buildId":"6afc7802530cbf293f9d7521","clientVersion":"0.0.4177","searchFilterCounts":[{"language":"default","tag":"Virtual Try-On API","count":29},{"language":"default","tag":"Virtual Try-On App","count":29},{"language":"default","tag":"Developers","count":11},{"language":"default","tag":"Get Started","count":10},{"language":"default","tag":"Guides","count":9},{"language":"default","tag":"Storefront API reference","count":8},{"language":"default","tag":"Grow","count":7},{"language":"default","tag":"Try-On","count":4},{"language":"default","tag":"Configure","count":4},{"language":"default","tag":"Batches","count":3}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"/docs","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-rbac-roles","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-metadata","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"starter-pricing","enabled":true,"variant":{"name":"treatment","enabled":true,"payload":{"type":"string","value":"treatment"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"tryon-api/endpoints/upload-image","slug":"/tryon-api/endpoints/upload-image","pageMetadata":{"title":"Upload Customer Image","description":"Upload a customer photo once, reuse the imageId for every try-on.","api":"POST /tryon/v1/images/upload","href":"/tryon-api/endpoints/upload-image"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Upload a customer photo once, reuse the imageId for every try-on.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,..._provideComponents(),...props.components},{Heading,Note,ParamField,ResponseField}=_components;if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Uploads a customer photo and returns an `,_jsx(_components.code,{children:`imageId`}),`. Pass it to `,_jsx(_components.a,{href:`/tryon-api/endpoints/create-try-on`,children:`Create Try-On`}),` as `,_jsx(_components.code,{children:`person.image.source.id`}),`, as many times as you want until it expires.`]}),`\n`,_jsxs(_components.p,{children:[`JPEG, PNG, WebP or HEIC. 10 MB max. Send as `,_jsx(_components.code,{children:`multipart/form-data`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`body`,children:`Body`}),`\n`,_jsx(ParamField,{body:`file`,type:`file`,required:true,id:`param-file`,children:_jsx(_components.p,{children:`The customer photo.`})}),`\n`,_jsx(ParamField,{body:`crop`,type:`boolean`,default:`true`,id:`param-crop`,children:_jsxs(_components.p,{children:[`Crop to 4:5 around the person. Set `,_jsx(_components.code,{children:`false`}),` to keep the original framing.`]})}),`\n`,_jsx(ParamField,{body:`requirePerson`,type:`boolean`,default:`false`,id:`param-require-person`,children:_jsxs(_components.p,{children:[`Refuses the upload with `,_jsx(_components.a,{href:`/tryon-api/errors#person-photo-checks`,children:_jsx(_components.code,{children:`NO_PERSON_DETECTED`})}),` (400) when no person is found in the photo. Leave it off for pet photos and for close-ups of feet or hands.`]})}),`\n`,_jsx(ParamField,{body:`externalUserId`,type:`string`,id:`param-external-user-id`,children:_jsxs(_components.p,{children:[`Your own user ID, for `,_jsx(_components.a,{href:`/tryon-api/endpoints/delete-customer`,children:`GDPR deletion`}),`. No PII.`]})}),`\n`,_jsx(ParamField,{body:`keepForDays`,type:`integer`,id:`param-keep-for-days`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`1`}),`, `,_jsx(_components.code,{children:`3`}),` or `,_jsx(_components.code,{children:`7`}),`. The image is deleted after that. Defaults to your account setting (7 days).`]})}),`\n`,`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsx(ResponseField,{name:`imageId`,type:`string`,required:true,id:`param-image-id`,children:_jsx(_components.p,{children:`Opaque token. Pass it back exactly as received.`})}),`\n`,_jsx(ResponseField,{name:`imageUrl`,type:`string`,required:true,id:`param-image-url`,children:_jsx(_components.p,{children:`Short-lived preview URL of the processed image.`})}),`\n`,`\n`,_jsxs(Note,{children:[`Deprecated but still accepted: `,_jsx(_components.code,{children:`customerId`}),` and `,_jsx(_components.code,{children:`retentionDays`}),` form fields.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Upload Customer Image","description":"Upload a customer photo once, reuse the imageId for every try-on.","api":"POST /tryon/v1/images/upload","href":"/tryon-api/endpoints/upload-image"}}},"mdxSourceWithNoJs":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note,ParamField,RequestExample,ResponseExample,ResponseField}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!RequestExample)_missingMdxReference(`RequestExample`,true);if(!ResponseExample)_missingMdxReference(`ResponseExample`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Uploads a customer photo and returns an `,_jsx(_components.code,{children:`imageId`}),`. Pass it to `,_jsx(_components.a,{href:`/tryon-api/endpoints/create-try-on`,children:`Create Try-On`}),` as `,_jsx(_components.code,{children:`person.image.source.id`}),`, as many times as you want until it expires.`]}),`\n`,_jsxs(_components.p,{children:[`JPEG, PNG, WebP or HEIC. 10 MB max. Send as `,_jsx(_components.code,{children:`multipart/form-data`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`body`,children:`Body`}),`\n`,_jsx(ParamField,{body:`file`,type:`file`,required:true,id:`param-file`,children:_jsx(_components.p,{children:`The customer photo.`})}),`\n`,_jsx(ParamField,{body:`crop`,type:`boolean`,default:`true`,id:`param-crop`,children:_jsxs(_components.p,{children:[`Crop to 4:5 around the person. Set `,_jsx(_components.code,{children:`false`}),` to keep the original framing.`]})}),`\n`,_jsx(ParamField,{body:`requirePerson`,type:`boolean`,default:`false`,id:`param-require-person`,children:_jsxs(_components.p,{children:[`Refuses the upload with `,_jsx(_components.a,{href:`/tryon-api/errors#person-photo-checks`,children:_jsx(_components.code,{children:`NO_PERSON_DETECTED`})}),` (400) when no person is found in the photo. Leave it off for pet photos and for close-ups of feet or hands.`]})}),`\n`,_jsx(ParamField,{body:`externalUserId`,type:`string`,id:`param-external-user-id`,children:_jsxs(_components.p,{children:[`Your own user ID, for `,_jsx(_components.a,{href:`/tryon-api/endpoints/delete-customer`,children:`GDPR deletion`}),`. No PII.`]})}),`\n`,_jsx(ParamField,{body:`keepForDays`,type:`integer`,id:`param-keep-for-days`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`1`}),`, `,_jsx(_components.code,{children:`3`}),` or `,_jsx(_components.code,{children:`7`}),`. The image is deleted after that. Defaults to your account setting (7 days).`]})}),`\n`,_jsxs(RequestExample,{children:[_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`3`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.genlook.app/tryon/v1/images/upload\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"x-api-key: gk_your_api_key\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -F`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"file=@customer.jpg\"`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`No crop`,numberOfLines:`4`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`4`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.genlook.app/tryon/v1/images/upload\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"x-api-key: gk_your_api_key\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -F`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"file=@customer.jpg\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -F`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"crop=false\"`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Python`,numberOfLines:`7`,language:`python`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`7`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`with`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:` open`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"customer.jpg\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"rb\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`) `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`as`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` f:`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` r `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests.post(`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.genlook.app/tryon/v1/images/upload\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"x-api-key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#D4D4D4`},children:`API_KEY`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`},`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:` files`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"file\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: (`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"customer.jpg\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, f, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"image/jpeg\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)},`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` )`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`image_id `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` r.json()[`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"imageId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`]`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`Node SDK`,numberOfLines:`6`,language:`typescript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`typescript`,children:_jsxs(_components.code,{language:`typescript`,numberOfLines:`6`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` { `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:`imageId`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` } `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` client`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`images`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`upload`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` readFile`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"./customer.jpg\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`), {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` mimeType:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"image/jpeg\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // crop: false,`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // customerId: \"user-123\",`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // API field externalUserId`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // retentionDays: 7,`}),_jsx(_components.span,{style:{color:`#6E7781`,\"--shiki-dark\":`#6A9955`},children:` // API field keepForDays`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`]})})})]}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsx(ResponseField,{name:`imageId`,type:`string`,required:true,id:`param-image-id`,children:_jsx(_components.p,{children:`Opaque token. Pass it back exactly as received.`})}),`\n`,_jsx(ResponseField,{name:`imageUrl`,type:`string`,required:true,id:`param-image-url`,children:_jsx(_components.p,{children:`Short-lived preview URL of the processed image.`})}),`\n`,_jsxs(ResponseExample,{children:[_jsx(CodeBlock,{filename:`201`,numberOfLines:`4`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"imageId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"ephemeral/customer/ttl-7d/acc_1a2b3c/20260708-9f86d081.jpeg\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"imageUrl\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://storage.googleapis.com/...\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),_jsx(CodeBlock,{filename:`400`,numberOfLines:`5`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"UNSUPPORTED_IMAGE_TYPE\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"message\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Unsupported image format: accepted formats are JPEG, PNG, WebP, and HEIC.\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`400`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})]}),`\n`,_jsxs(Note,{children:[`Deprecated but still accepted: `,_jsx(_components.code,{children:`customerId`}),` and `,_jsx(_components.code,{children:`retentionDays`}),` form fields.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Upload Customer Image","description":"Upload a customer photo once, reuse the imageId for every try-on.","api":"POST /tryon/v1/images/upload","href":"/tryon-api/endpoints/upload-image"}}}},"mdxExtracts":{"tableOfContents":[{"title":"Body","slug":"body","depth":2,"children":[]},{"title":"Response","slug":"response","depth":2,"children":[]}],"codeExamples":{"request":{"type":"RequestExample","children":[{"filename":"cURL","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"shellscript\">\u003ccode language=\"shellscript\" numberOfLines=\"3\">\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\">curl\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -X\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> POST\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"https://api.genlook.app/tryon/v1/images/upload\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"x-api-key: gk_your_api_key\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -F\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"file=@customer.jpg\"\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"No crop","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"shellscript\">\u003ccode language=\"shellscript\" numberOfLines=\"4\">\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\">curl\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -X\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> POST\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"https://api.genlook.app/tryon/v1/images/upload\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -H\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"x-api-key: gk_your_api_key\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -F\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"file=@customer.jpg\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> -F\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"crop=false\"\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"Python","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"python\">\u003ccode language=\"python\" numberOfLines=\"7\">\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">with\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#DCDCAA\"> open\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"customer.jpg\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"rb\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">) \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">as\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> f:\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> r \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> requests.post(\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"https://api.genlook.app/tryon/v1/images/upload\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\"> headers\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"x-api-key\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#D4D4D4\">API_KEY\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">},\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\"> files\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"file\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: (\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"customer.jpg\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, f, \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"image/jpeg\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">)},\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> )\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">image_id \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> r.json()[\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"imageId\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">]\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"Node SDK","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"typescript\">\u003ccode language=\"typescript\" numberOfLines=\"6\">\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">const\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> { \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\">imageId\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> } \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\"> await\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> client\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">images\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">upload\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">await\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\"> readFile\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"./customer.jpg\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">), {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> mimeType:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"image/jpeg\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#6E7781;--shiki-dark:#6A9955\"> // crop: false,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#6E7781;--shiki-dark:#6A9955\"> // customerId: \"user-123\",\u003c/span>\u003cspan style=\"color:#6E7781;--shiki-dark:#6A9955\"> // API field externalUserId\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#6E7781;--shiki-dark:#6A9955\"> // retentionDays: 7,\u003c/span>\u003cspan style=\"color:#6E7781;--shiki-dark:#6A9955\"> // API field keepForDays\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">});\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]},"response":{"type":"ResponseExample","children":[{"filename":"201","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"4\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"imageId\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"ephemeral/customer/ttl-7d/acc_1a2b3c/20260708-9f86d081.jpeg\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"imageUrl\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"https://storage.googleapis.com/...\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"400","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"5\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"code\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"UNSUPPORTED_IMAGE_TYPE\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"message\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Unsupported image format: accepted formats are JPEG, PNG, WebP, and HEIC.\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"status\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#B5CEA8\">400\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]}},"endpoint":{"title":"Upload Customer Image","path":"/tryon/v1/images/upload","method":"post","request":{"security":[],"parameters":{"query":{},"header":{},"cookie":{},"path":{}},"body":{"application/json":{"schemaArray":[{"type":"object","properties":{"file":[{"type":"file","description":"The customer photo.","required":true}],"crop":[{"type":"boolean","description":"Crop to 4:5 around the person. Set `false` to keep the original framing."}],"requirePerson":[{"type":"boolean","description":"Refuses the upload with `NO_PERSON_DETECTED` (400) when no person is found in the photo. Leave it off for pet photos and for close-ups of feet or hands."}],"externalUserId":[{"type":"string","description":"Your own user ID, for GDPR deletion . No PII."}],"keepForDays":[{"type":"integer","description":"`1` , `3` or `7` . The image is deleted after that. Defaults to your account setting (7 days)."}]}}],"examples":{"example":{"value":{"crop":true,"requirePerson":true,"externalUserId":"\u003cstring>","keepForDays":123}}}}}},"response":{"200":{"application/json":{"schemaArray":[{"type":"object","properties":{"imageId":[{"type":"string","description":"Opaque token. Pass it back exactly as received.","required":true}],"imageUrl":[{"type":"string","description":"Short-lived preview URL of the processed image.","required":true}]}}],"examples":{"example":{"value":{"imageId":"\u003cstring>","imageUrl":"\u003cstring>"}}}}}},"deprecated":false}},"jsLinks":[],"subdomain":"genloook","siteName":"Genlook Documentation","title":"Upload Customer Image - Genlook Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-11-15T14:00:19.798Z","originalFileLocation":"tryon-api/endpoints/upload-image.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"light\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Upload a customer photo once, reuse the imageId for every try-on.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Genlook Documentation\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/genloook/hbC379oeNjFTJNjB/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/docs/mintlify-assets/_mintlify/favicons/genloook/hbC379oeNjFTJNjB/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/genloook/hbC379oeNjFTJNjB/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/genloook/hbC379oeNjFTJNjB/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/genloook/hbC379oeNjFTJNjB/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/docs/mintlify-assets/_mintlify/favicons/genloook/hbC379oeNjFTJNjB/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/docs/mintlify-assets/_mintlify/favicons/genloook/hbC379oeNjFTJNjB/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/docs/mintlify-assets/_mintlify/favicons/genloook/hbC379oeNjFTJNjB/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/docs/mintlify-assets/_mintlify/favicons/genloook/hbC379oeNjFTJNjB/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Upload Customer Image - Genlook Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Upload a customer photo once, reuse the imageId for every try-on.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Genlook Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://genlook.app/docs/tryon-api/endpoints/upload-image\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://genloook.mintlify.site/docs/_mintlify/api/og/v2?division=Try-On\u0026amp;title=Upload+Customer+Image\u0026amp;description=Upload+a+customer+photo+once%2C+reuse+the+imageId+for+every+try-on.\u0026amp;theme=f28d07354cc3228d02af9b71\u0026amp;signature=297d59c5bfad2e076c335081b3d3e46ba856ca372666d076d4239c25162c33ba\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Upload Customer Image - Genlook Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Upload a customer photo once, reuse the imageId for every try-on.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://genloook.mintlify.site/docs/_mintlify/api/og/v2?division=Try-On\u0026amp;title=Upload+Customer+Image\u0026amp;description=Upload+a+customer+photo+once%2C+reuse+the+imageId+for+every+try-on.\u0026amp;theme=f28d07354cc3228d02af9b71\u0026amp;signature=297d59c5bfad2e076c335081b3d3e46ba856ca372666d076d4239c25162c33ba\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/docs/mintlify-assets/_mintlify/favicons/genloook/hbC379oeNjFTJNjB/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Genlook Documentation\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#16A34A\">\u003clink data-mint-head rel=\"canonical\" href=\"https://genlook.app/docs/tryon-api/endpoints/upload-image\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/docs/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/docs/tryon-api/endpoints/upload-image.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://genlook.app/#organization\",\"name\":\"Genlook Documentation\",\"url\":\"https://genlook.app\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/genloook/E-Zz0RUPElap0z-g/logo/light.png?fit=max\u0026auto=format\u0026n=E-Zz0RUPElap0z-g\u0026q=85\u0026s=b5850569f68556b7bcb48ae2d787deb2\"}},{\"@type\":\"WebSite\",\"@id\":\"https://genlook.app/docs#website\",\"name\":\"Genlook Documentation\",\"url\":\"https://genlook.app/docs\",\"publisher\":{\"@id\":\"https://genlook.app/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://genlook.app/docs/tryon-api/endpoints/upload-image#webpage\",\"url\":\"https://genlook.app/docs/tryon-api/endpoints/upload-image\",\"name\":\"Upload Customer Image\",\"description\":\"Upload a customer photo once, reuse the imageId for every try-on.\",\"dateModified\":\"2026-11-15T14:00:19.798Z\",\"isPartOf\":{\"@id\":\"https://genlook.app/docs#website\"},\"breadcrumb\":{\"@id\":\"https://genlook.app/docs/tryon-api/endpoints/upload-image#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://genlook.app/docs/tryon-api/endpoints/upload-image#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Genlook Documentation\",\"item\":\"https://genlook.app/docs\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Upload Customer Image\",\"item\":\"https://genlook.app/docs/tryon-api/endpoints/upload-image\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://genlook.app/docs/tryon-api/endpoints/upload-image#apireference\",\"headline\":\"Upload Customer Image\",\"name\":\"Upload Customer Image\",\"description\":\"Upload a customer photo once, reuse the imageId for every try-on.\",\"url\":\"https://genlook.app/docs/tryon-api/endpoints/upload-image\",\"mainEntityOfPage\":{\"@id\":\"https://genlook.app/docs/tryon-api/endpoints/upload-image#webpage\"},\"dateModified\":\"2026-11-15T14:00:19.798Z\",\"publisher\":{\"@id\":\"https://genlook.app/#organization\"},\"isPartOf\":{\"@id\":\"https://genlook.app/docs#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Genlook Documentation\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Genlook Documentation\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/docs/tryon-api/endpoints/upload-image.md","siteName":"Genlook Documentation","nav":{"global":{"anchors":[{"anchor":"Website","icon":"globe","href":"https://genlook.app?utm_source=docs\u0026utm_medium=website"}]},"tabs":[{"tab":"Home","pages":[{"title":"Home","href":""}]},{"tab":"Virtual Try-On App","pages":[{"title":"Virtual Try-On App","href":"/virtual-tryon/introduction"}]},{"tab":"Virtual Try-On API","groups":[{"group":"Get Started","pages":[{"title":"Introduction","href":"/tryon-api/introduction"},{"title":"Quickstart","href":"/tryon-api/quickstart"},{"title":"TypeScript SDK","href":"/tryon-api/sdk"},{"title":"MCP Server","href":"/tryon-api/mcp"},{"title":"Full Example (Python)","href":"/tryon-api/full-example"}]},{"group":"Guides","pages":[{"title":"Products","href":"/tryon-api/products"},{"title":"Multiple products","href":"/tryon-api/multi-product"},{"title":"Batches","href":"/tryon-api/batches"},{"title":"Watermark","href":"/tryon-api/watermark"},{"title":"AI content label","href":"/tryon-api/ai-label"},{"title":"Errors","href":"/tryon-api/errors"},{"title":"Idempotency","href":"/tryon-api/idempotency"},{"title":"Rate limits","href":"/tryon-api/rate-limits"},{"title":"Startup Program","description":"Free credits and a free first month for new products integrating virtual try-on.","href":"/tryon-api/startup-program"}]},{"group":"Try-On","pages":[{"title":"Upload Customer Image","api":"POST /tryon/v1/images/upload","href":"/tryon-api/endpoints/upload-image"},{"title":"Create Try-On","description":"Start a try-on generation. Costs 1 credit, 2 with several products, plus 1 at 2K.","api":"POST /tryon/v1/try-on","href":"/tryon-api/endpoints/create-try-on"},{"title":"Create Try-On (sync)","api":"POST /tryon/v1/try-on/sync","href":"/tryon-api/endpoints/create-try-on-sync"},{"title":"Generation Status","api":"GET /tryon/v1/generations/{id}","href":"/tryon-api/endpoints/generation-status"}]},{"group":"Batches","pages":[{"title":"Create Batch","api":"POST /tryon/v1/batches","href":"/tryon-api/endpoints/create-batch"},{"title":"Get Batch","api":"GET /tryon/v1/batches/{batchId}","href":"/tryon-api/endpoints/get-batch"},{"title":"Cancel Batch","api":"POST /tryon/v1/batches/{batchId}/cancel","href":"/tryon-api/endpoints/cancel-batch"}]},{"group":"Products (optional)","pages":[{"title":"Upsert Product (optional)","api":"POST /tryon/v1/products","href":"/tryon-api/endpoints/create-product"},{"title":"List, Get \u0026 Delete Products","api":"GET /tryon/v1/products","href":"/tryon-api/endpoints/list-products"},{"title":"Product Stats","api":"GET /tryon/v1/products/{externalId}/stats","href":"/tryon-api/endpoints/product-stats"}]},{"group":"Account","pages":[{"title":"Check Credits","api":"GET /tryon/v1/account/credits","href":"/tryon-api/endpoints/check-credits"},{"title":"Usage","api":"GET /tryon/v1/usage","href":"/tryon-api/endpoints/usage"},{"title":"Delete Customer Data","api":"DELETE /tryon/v1/customers/:externalUserId","href":"/tryon-api/endpoints/delete-customer"}]},{"group":"Releases","pages":[{"title":"Changelog","href":"/tryon-api/changelog"},{"title":"Migrating from the alpha","href":"/tryon-api/breaking-changes"}]}]}]},"basePath":"","title":"Upload Customer Image - Genlook Documentation","deploymentId":"dpl_81ettUQ5G7NASN425B6JKU3FX1Rg","buildId":"dpl_81ettUQ5G7NASN425B6JKU3FX1Rg","dynamics":["c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["OpenApiReferenceProvider-GKHRyhW5.js","utils-CXMoydtj.js","cloneDeep-Cl7CR73B.js","_Uint8Array-7sQhd3aE.js","isObject-FP1Yky1u.js","utils-ABJ_F6Yn.js","addUniqueKeysToSchema-B7v39GOQ.js","snippetPresets-CgibLHmh.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-C2n3VqMC.js","isEqual-BKe3Q7nP.js","usePlaygroundInputsStore-Iji6acs6.js","shallow-Db9K5ulX.js","getApiPlaygroundDisplay-BGnJQBSj.js","CodeSnippet-DlQqWRja.js","CodeSnippets-JF3Bj6-U.js","Page-Ctn-BHcp.js","getPastedJson-B0pIrOza.js","icon-UPBYC1Wr.js","MethodPill-CoVRW5MG.js","DuplicateIcon-BuNnsqwg.js","createIcon-Cj9cJegl.js","DynamicMarkdown-C_R66tyH.js","SectionHeading-C6RB-y9f.js","axios-vUo_bRtp.js"]}