Look Preview Endpoints¶
Look Preview API endpoints.
Overview¶
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/production-requests/{production_request_id}/look-preview |
Read Look Previews |
| POST | /api/v1/production-requests/{production_request_id}/look-preview |
Create Look Preview |
| DELETE | /api/v1/production-requests/{production_request_id}/look-preview/{preview_id} |
Delete Look Preview |
API Reference¶
Sartiq Backend Server - Look Preview 0.1.0¶
look-preview¶
GET /api/v1/production-requests/{production_request_id}/look-preview¶
Read Look Previews
Description
List every preview queued for the production request, newest first.
Lets the canvas recover state after a refresh or in a second browser tab:
each preview carries its lifecycle (PENDING/EXECUTING/COMPLETED/FAILED) and,
once completed, its result image_url. Scoped to the production request in
the path — the caller must be able to read its shooting.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
production_request_id |
path | string | No |
Responses
{
"data": [
{
"id": "e963b541-da42-4cc2-95a0-c69abd313f85",
"production_request_id": "e55b4d8e-a015-4aa5-9879-79573f644f44",
"subject_id": "78fd425b-c76c-42d9-a627-c5aa88d53fa6",
"outfit_id": null,
"product_ids": [
"c86ffd16-cad9-4a07-8d39-dd32996fee6d"
],
"status": "PENDING",
"image_url": null,
"error_message": null
}
],
"count": 0
}
Schema of the response body
{
"properties": {
"data": {
"items": {
"$ref": "#/components/schemas/LookPreviewPublic"
},
"type": "array",
"title": "Data"
},
"count": {
"type": "integer",
"title": "Count"
}
},
"type": "object",
"required": [
"data",
"count"
],
"title": "LookPreviewsPublic",
"description": "Collection envelope for ``GET /production-requests/{id}/look-preview``.\n\nThe canvas re-reads every preview for a production request on open so the\ncards recover state after a refresh or in a second tab — newest first, the\nsame ordering the ``ix_look_preview_production_request`` index serves."
}
POST /api/v1/production-requests/{production_request_id}/look-preview¶
Create Look Preview
Description
Queue a preview of the model wearing the on-canvas garments.
Scoped to the production request in the path: the caller must be able to read its shooting and the subject must be the one assigned to it.
Returns 202 with a PENDING preview — the image is generated
asynchronously on the compute server's realtime queue. The client learns the
outcome from the generation WebSocket (LOOK_PREVIEW_COMPLETED /
LOOK_PREVIEW_FAILED); the result is ingested as a MediaResource and
exposed via image_url.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
production_request_id |
path | string | No |
Request body
{
"subject_id": "a6cb19ea-6a0e-41e9-a249-b0a0e69ff742",
"product_ids": [
"0e5720c2-6781-4a88-9a80-3372b030c31d"
],
"outfit_id": null,
"outfit_instruction": null,
"shot_type_id": null
}
Schema of the request body
{
"properties": {
"subject_id": {
"type": "string",
"format": "uuid",
"title": "Subject Id"
},
"product_ids": {
"items": {
"type": "string",
"format": "uuid"
},
"type": "array",
"maxItems": 12,
"minItems": 1,
"title": "Product Ids",
"description": "Product ids in layering order (main first, then the rest); 1-12 (mirrors the compute-side garment cap)."
},
"outfit_id": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Outfit Id",
"description": "Outfit proposal card this preview is rendered for. Must belong to the production request in the path. Bound previews are purged together with their proposal; unbound previews live until finalize."
},
"outfit_instruction": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Outfit Instruction",
"description": "Free-text directive folded into the composed prompt. When omitted, falls back to the production request's saved outfit_instruction; pass an empty string to clear it."
},
"shot_type_id": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Shot Type Id",
"description": "Which of the subject's base images to preview against, selected by shot type (as exposed by SubjectPublic.base_images[].shot_type_id). When omitted, defaults to the subject's front_full_body base image for backward compatibility."
}
},
"type": "object",
"required": [
"subject_id",
"product_ids"
],
"title": "LookPreviewCreate",
"description": "Request body for ``POST /production-requests/{production_request_id}/look-preview``.\n\nThe production request is the path parameter; the body carries only the\nlook being previewed — the canvas subject and garments, plus optional\ndirectives that drive the prompt and base-image selection."
}
Responses
{
"id": "d792573f-ae1a-42b4-8f98-2ce6b099f4a0",
"production_request_id": "894a408c-f114-45ed-a8a2-47b3fe25ddeb",
"subject_id": "c4d49686-c6eb-4909-a061-fdb99eafaee0",
"outfit_id": null,
"product_ids": [
"2aa14e4a-e04d-4137-9b83-6e0c8137bdec"
],
"status": "PENDING",
"image_url": null,
"error_message": null
}
Schema of the response body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"production_request_id": {
"type": "string",
"format": "uuid",
"title": "Production Request Id"
},
"subject_id": {
"type": "string",
"format": "uuid",
"title": "Subject Id"
},
"outfit_id": {
"anyOf": [
{
"type": "string",
"format": "uuid"
},
{
"type": "null"
}
],
"title": "Outfit Id"
},
"product_ids": {
"items": {
"type": "string",
"format": "uuid"
},
"type": "array",
"title": "Product Ids"
},
"status": {
"$ref": "#/components/schemas/LookPreviewStatus"
},
"image_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Image Url"
},
"error_message": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Error Message"
}
},
"type": "object",
"required": [
"id",
"production_request_id",
"subject_id",
"product_ids",
"status"
],
"title": "LookPreviewPublic",
"description": "A preview's current state.\n\n``image_url`` is populated only once the compute task has completed and its\nresult has been ingested as a MediaResource; it is ``None`` while PENDING or\nEXECUTING, and on FAILED (where ``error_message`` carries the reason the\ncard should show)."
}
DELETE /api/v1/production-requests/{production_request_id}/look-preview/{preview_id}¶
Delete Look Preview
Description
Delete a preview dismissed from the canvas.
Removes the preview row and detaches its result image (the file is deleted after the commit). Scoped to the production request in the path — the caller must be able to read its shooting, and the preview must belong to it.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
preview_id |
path | string | No | ||
production_request_id |
path | string | No |
Responses
Schemas¶
HTTPValidationError¶
| Name | Type | Description |
|---|---|---|
detail |
Array<ValidationError> |
LookPreviewCreate¶
| Name | Type | Description |
|---|---|---|
outfit_id |
Outfit proposal card this preview is rendered for. Must belong to the production request in the path. Bound previews are purged together with their proposal; unbound previews live until finalize. | |
outfit_instruction |
Free-text directive folded into the composed prompt. When omitted, falls back to the production request's saved outfit_instruction; pass an empty string to clear it. | |
product_ids |
Array<string(uuid)> | Product ids in layering order (main first, then the rest); 1-12 (mirrors the compute-side garment cap). |
shot_type_id |
Which of the subject's base images to preview against, selected by shot type (as exposed by SubjectPublic.base_images[].shot_type_id). When omitted, defaults to the subject's front_full_body base image for backward compatibility. | |
subject_id |
string(uuid) |
LookPreviewPublic¶
| Name | Type | Description |
|---|---|---|
error_message |
||
id |
string(uuid) | |
image_url |
||
outfit_id |
||
product_ids |
Array<string(uuid)> | |
production_request_id |
string(uuid) | |
status |
LookPreviewStatus | |
subject_id |
string(uuid) |
LookPreviewsPublic¶
| Name | Type | Description |
|---|---|---|
count |
integer | |
data |
Array<LookPreviewPublic> |
LookPreviewStatus¶
Type: string
ValidationError¶
| Name | Type | Description |
|---|---|---|
ctx |
||
input |
||
loc |
Array<> | |
msg |
string | |
type |
string |
Security schemes¶
| Name | Type | Scheme | Description |
|---|---|---|---|
| OAuth2PasswordBearer | oauth2 |