Skip to content

Run a template

POST /v1/orgs/:orgId/template/:templateId/run
Content-Type: application/json
x-license-key: <server-secret>

Example:

Terminal window
curl -X POST "$AABHAS_CORE_BASE_URL/v1/orgs/$AABHAS_ORG_ID/template/$AABHAS_TEMPLATE_ID/run" \
-H "content-type: application/json" \
-H "x-license-key: $AABHAS_LICENSE_KEY" \
--data-raw '{
"entityId": "customer-or-product-reference",
"traceId": "client-generated-trace-id",
"aspectRatioKey": "2:3",
"variables": {},
"options": {},
"inputs": {
"<PERSON_INPUT_KEY>": "https://example.com/person.jpg",
"<GARMENT_INPUT_KEY>": "https://example.com/garment.jpg"
}
}'

Input keys and aspect ratios come from the assigned template. Do not copy keys from another organization or template.

  • traceId connects the client request to outputs and diagnostics. Generate a unique, non-secret value.
  • entityId groups outputs for an application entity such as a customer session or catalog item. Do not place email addresses or sensitive personal data in it.

Use the same idempotency or request identity only for the same logical execution. A deliberate new generation should receive a new identity.

Templates configured for prepared-image caching can reuse eligible intermediate images automatically. Send the original inputs as usual; customer or garment identifiers are not required for cache matching. Read Prepared-image caching for prerequisites, response statuses, a verification sequence, and optional caller-provided prepared inputs.