{"openapi":"3.1.0","info":{"title":"Herofab API","version":"1.0.0","description":"Product-photo generation API. Authenticate with `Authorization: Bearer hf_sk_live_…`. Errors are `{error:{code,detail,request_id}}`; `code` is stable, `detail` is informational. Every response carries `X-Request-Id` and `RateLimit-*` headers. Breaking changes ship as /api/v2; v1 is supported for 12 months after that (Deprecation / Sunset headers)."},"servers":[{"url":"https://app.herofab.app"}],"security":[{"bearer":[]}],"paths":{"/api/v1/me":{"get":{"summary":"The calling API key","operationId":"getMe","responses":{"200":{"description":"ApiKey","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKey"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/tools":{"get":{"summary":"Tool catalog with credit costs, inputs and parameter choices","operationId":"getTools","responses":{"200":{"description":"ToolList","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ToolList"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/credits":{"get":{"summary":"Available and reserved credits, current period usage","operationId":"getCredits","x-required-scope":"billing:read","responses":{"200":{"description":"Credits","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Credits"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/assets":{"post":{"summary":"Add an image: multipart upload (≤25 MB), upload intent ({content_type,size}) or import ({url})","operationId":"postAssets","x-required-scope":"jobs:write","requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/AssetUpload"}},"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/AssetIntent"},{"$ref":"#/components/schemas/AssetImport"}]}}}},"responses":{"201":{"description":"Asset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Asset"}}}},"422":{"description":"Asset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Asset"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/assets/{id}":{"get":{"summary":"Read an asset","operationId":"getAssetsId","x-required-scope":"jobs:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Asset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Asset"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete an asset's bytes permanently (the record stays with state=deleted); the key's creator must currently be a workspace owner or admin","operationId":"deleteAssetsId","x-required-scope":"jobs:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Asset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Asset"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/assets/{id}/complete":{"post":{"summary":"Measure the uploaded bytes; the asset becomes stored or rejected","operationId":"postAssetsIdComplete","x-required-scope":"jobs:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Asset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Asset"}}}},"422":{"description":"Asset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Asset"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/assets/{id}/content":{"get":{"summary":"Download the bytes (302 to a short-lived link, or the bytes)","operationId":"getAssetsIdContent","x-required-scope":"jobs:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Bytes","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"302":{"description":"Short-lived download link in Location"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"summary":"Upload the bytes of an upload intent (local storage mode only)","operationId":"putAssetsIdContent","x-required-scope":"jobs:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Upload","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Upload"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/jobs":{"post":{"summary":"Create a job; credits are reserved in the same transaction","operationId":"postJobs","x-required-scope":"jobs:write","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Required. Same key + same body returns the original (200, Idempotent-Replayed: true); same key + different body is 409 idempotency_key_reused.","schema":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,128}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobCreate"}}}},"responses":{"200":{"description":"Job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"201":{"description":"Job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List jobs, newest first","operationId":"getJobs","x-required-scope":"jobs:read","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"description":"Page size"},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"next_cursor of the previous page"},{"name":"state","in":"query","required":false,"schema":{"enum":["queued","running","succeeded","failed","canceled"]},"description":"Filter by state"},{"name":"batch_id","in":"query","required":false,"schema":{"type":"string","format":"uuid"},"description":"Filter by batch or chain"}],"responses":{"200":{"description":"JobList","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobList"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/jobs/{id}":{"get":{"summary":"Read a job (Retry-After: 2 while it runs)","operationId":"getJobsId","x-required-scope":"jobs:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/jobs/{id}/cancel":{"post":{"summary":"Cancel a queued or running job; reserved credits are released","operationId":"postJobsIdCancel","x-required-scope":"jobs:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Job","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Job"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/batches":{"post":{"summary":"Create up to 100 jobs at once — all or nothing","operationId":"postBatches","x-required-scope":"jobs:write","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Required. Same key + same body returns the original (200, Idempotent-Replayed: true); same key + different body is 409 idempotency_key_reused.","schema":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,128}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchCreate"}}}},"responses":{"200":{"description":"Batch","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Batch"}}}},"201":{"description":"Batch","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Batch"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/batches/{id}":{"get":{"summary":"Batch (or chain) status with its jobs","operationId":"getBatchesId","x-required-scope":"jobs:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Batch","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Batch"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/batches/{id}/outputs":{"get":{"summary":"Stored outputs of a batch","operationId":"getBatchesIdOutputs","x-required-scope":"jobs:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OutputList","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutputList"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/batches/{id}/outputs.zip":{"get":{"summary":"All stored outputs as a streamed ZIP","operationId":"getBatchesIdOutputsZip","x-required-scope":"jobs:read","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"format","in":"query","required":false,"schema":{"enum":["jpg"]},"description":"Convert every image to JPEG"},{"name":"platform","in":"query","required":false,"schema":{"type":"string"},"description":"Resize for a marketplace (see /tools limits)"}],"responses":{"200":{"description":"Bytes","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/batches/{id}/cancel":{"post":{"summary":"Cancel unfinished jobs of a batch; finished ones are kept","operationId":"postBatchesIdCancel","x-required-scope":"jobs:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"BatchCancellation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchCancellation"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/chains":{"post":{"summary":"Create a linear chain: each step's output feeds the next step","operationId":"postChains","x-required-scope":"jobs:write","parameters":[{"name":"Idempotency-Key","in":"header","required":true,"description":"Required. Same key + same body returns the original (200, Idempotent-Replayed: true); same key + different body is 409 idempotency_key_reused.","schema":{"type":"string","pattern":"^[A-Za-z0-9._:-]{1,128}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChainCreate"}}}},"responses":{"200":{"description":"Chain","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Chain"}}}},"201":{"description":"Chain","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Chain"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/webhooks":{"get":{"summary":"Webhook endpoints of the workspace","operationId":"getWebhooks","x-required-scope":"webhooks:write","responses":{"200":{"description":"WebhookEndpointList","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointList"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Create a webhook endpoint; the signing secret (whsec_…) is returned only in this response","operationId":"postWebhooks","x-required-scope":"webhooks:write","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointCreate"}}}},"responses":{"201":{"description":"WebhookEndpointWithSecret","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointWithSecret"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/webhooks/{id}":{"get":{"summary":"Read a webhook endpoint","operationId":"getWebhooksId","x-required-scope":"webhooks:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"WebhookEndpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Change url, events or description; enable or disable (enabling resets the failure clock)","operationId":"patchWebhooksId","x-required-scope":"webhooks:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointUpdate"}}}},"responses":{"200":{"description":"WebhookEndpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete the endpoint (final); queued deliveries are dropped","operationId":"deleteWebhooksId","x-required-scope":"webhooks:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"WebhookEndpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpoint"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/webhooks/{id}/test":{"post":{"summary":"Queue a signed webhook.test event to the endpoint","operationId":"postWebhooksIdTest","x-required-scope":"webhooks:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"202":{"description":"WebhookDelivery","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/webhooks/{id}/rotate":{"post":{"summary":"New signing secret (returned once); the previous secret keeps signing for 24 hours","operationId":"postWebhooksIdRotate","x-required-scope":"webhooks:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"WebhookEndpointWithSecret","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointWithSecret"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/webhooks/{id}/deliveries":{"get":{"summary":"Deliveries to the endpoint, newest first, with status, attempts and the next retry time","operationId":"getWebhooksIdDeliveries","x-required-scope":"webhooks:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100,"default":20},"description":"Page size"},{"name":"cursor","in":"query","required":false,"schema":{"type":"string"},"description":"next_cursor of the previous page"},{"name":"state","in":"query","required":false,"schema":{"enum":["pending","succeeded","failed"]},"description":"Filter by state"}],"responses":{"200":{"description":"WebhookDeliveryList","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryList"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/webhooks/{id}/deliveries/{deliveryId}/redeliver":{"post":{"summary":"Send the same event (same webhook-id) again; the retry schedule starts over","operationId":"postWebhooksIdDeliveriesDeliveryIdRedeliver","x-required-scope":"webhooks:write","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"deliveryId","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"202":{"description":"WebhookDelivery","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDelivery"}}}},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/openapi.json":{"get":{"summary":"This document","operationId":"getOpenapiJson","security":[],"responses":{"200":{"description":"Document"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/llms.txt":{"get":{"summary":"Plain-text summary for LLM agents","operationId":"getLlmsTxt","security":[],"responses":{"200":{"description":"Document"},"default":{"description":"Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{"job.succeeded":{"post":{"summary":"job.succeeded — answer 2xx within 10 s; otherwise retried after 30s, 2m, 10m, 30m, 1h, 3h, 6h, 12h, 24h","parameters":[{"name":"webhook-id","in":"header","required":true,"schema":{"type":"string"},"description":"Event id (evt_…); the same on every retry — deduplicate with it"},{"name":"webhook-timestamp","in":"header","required":true,"schema":{"type":"string"},"description":"Unix seconds; reject if more than 5 minutes off"},{"name":"webhook-signature","in":"header","required":true,"schema":{"type":"string"},"description":"Space-separated `v1,<base64 HMAC-SHA256>` over `{webhook-id}.{webhook-timestamp}.{raw body}`, keyed with the base64-decoded part of the secret after `whsec_`. Two signatures for 24 h after a rotation."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx acknowledges the event"}}}},"job.failed":{"post":{"summary":"job.failed — answer 2xx within 10 s; otherwise retried after 30s, 2m, 10m, 30m, 1h, 3h, 6h, 12h, 24h","parameters":[{"name":"webhook-id","in":"header","required":true,"schema":{"type":"string"},"description":"Event id (evt_…); the same on every retry — deduplicate with it"},{"name":"webhook-timestamp","in":"header","required":true,"schema":{"type":"string"},"description":"Unix seconds; reject if more than 5 minutes off"},{"name":"webhook-signature","in":"header","required":true,"schema":{"type":"string"},"description":"Space-separated `v1,<base64 HMAC-SHA256>` over `{webhook-id}.{webhook-timestamp}.{raw body}`, keyed with the base64-decoded part of the secret after `whsec_`. Two signatures for 24 h after a rotation."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx acknowledges the event"}}}},"job.canceled":{"post":{"summary":"job.canceled — answer 2xx within 10 s; otherwise retried after 30s, 2m, 10m, 30m, 1h, 3h, 6h, 12h, 24h","parameters":[{"name":"webhook-id","in":"header","required":true,"schema":{"type":"string"},"description":"Event id (evt_…); the same on every retry — deduplicate with it"},{"name":"webhook-timestamp","in":"header","required":true,"schema":{"type":"string"},"description":"Unix seconds; reject if more than 5 minutes off"},{"name":"webhook-signature","in":"header","required":true,"schema":{"type":"string"},"description":"Space-separated `v1,<base64 HMAC-SHA256>` over `{webhook-id}.{webhook-timestamp}.{raw body}`, keyed with the base64-decoded part of the secret after `whsec_`. Two signatures for 24 h after a rotation."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx acknowledges the event"}}}},"batch.completed":{"post":{"summary":"batch.completed — answer 2xx within 10 s; otherwise retried after 30s, 2m, 10m, 30m, 1h, 3h, 6h, 12h, 24h","parameters":[{"name":"webhook-id","in":"header","required":true,"schema":{"type":"string"},"description":"Event id (evt_…); the same on every retry — deduplicate with it"},{"name":"webhook-timestamp","in":"header","required":true,"schema":{"type":"string"},"description":"Unix seconds; reject if more than 5 minutes off"},{"name":"webhook-signature","in":"header","required":true,"schema":{"type":"string"},"description":"Space-separated `v1,<base64 HMAC-SHA256>` over `{webhook-id}.{webhook-timestamp}.{raw body}`, keyed with the base64-decoded part of the secret after `whsec_`. Two signatures for 24 h after a rotation."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx acknowledges the event"}}}},"webhook.test":{"post":{"summary":"webhook.test — answer 2xx within 10 s; otherwise retried after 30s, 2m, 10m, 30m, 1h, 3h, 6h, 12h, 24h","parameters":[{"name":"webhook-id","in":"header","required":true,"schema":{"type":"string"},"description":"Event id (evt_…); the same on every retry — deduplicate with it"},{"name":"webhook-timestamp","in":"header","required":true,"schema":{"type":"string"},"description":"Unix seconds; reject if more than 5 minutes off"},{"name":"webhook-signature","in":"header","required":true,"schema":{"type":"string"},"description":"Space-separated `v1,<base64 HMAC-SHA256>` over `{webhook-id}.{webhook-timestamp}.{raw body}`, keyed with the base64-decoded part of the secret after `whsec_`. Two signatures for 24 h after a rotation."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPayload"}}}},"responses":{"200":{"description":"Any 2xx acknowledges the event"}}}}},"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"Secret API key (hf_sk_live_…), created by the workspace owner."}},"schemas":{"Tool":{"enum":["ad_creative","apparel_tryon","background_remove","canvas","colorway","detail_shot","fabric_studio","ghost_mannequin","model_maker","pose_change","product_studio","reframe","upscale"]},"JobCreate.ad_creative":{"type":"object","additionalProperties":false,"required":["tool","inputs"],"description":"Turns a product photo into a ready-to-post ad: the scene is generated, and your headline and button text are set exactly as written — 5 credits; outputs carry typeset text and cannot be retouched","properties":{"tool":{"const":"ad_creative"},"inputs":{"type":"object","additionalProperties":false,"required":["product"],"properties":{"product":{"type":"string","format":"uuid","description":"Stored asset id"},"product_detail":{"type":"string","format":"uuid","description":"Stored asset id"}}},"params":{"type":"object","additionalProperties":false,"required":[],"properties":{"cta":{"type":"string","maxLength":24,"default":"","description":"Text Herofab typesets onto the image (never sent to the image model). Latin-script languages incl. Vietnamese; CJK, right-to-left scripts and emoji are refused."},"format":{"enum":["square_1_1","portrait_4_5","story_9_16","banner_16_9"],"default":"square_1_1"},"headline":{"type":"string","maxLength":40,"default":"","description":"Text Herofab typesets onto the image (never sent to the image model). Latin-script languages incl. Vietnamese; CJK, right-to-left scripts and emoji are refused."},"style":{"enum":["minimal","bold","lifestyle","seasonal"],"default":"minimal"},"subline":{"type":"string","maxLength":80,"default":"","description":"Text Herofab typesets onto the image (never sent to the image model). Latin-script languages incl. Vietnamese; CJK, right-to-left scripts and emoji are refused."}}},"instructions":{"type":"string","maxLength":500},"product_id":{"type":"string","format":"uuid"}}},"JobCreate.apparel_tryon":{"type":"object","additionalProperties":false,"required":["tool","inputs","params"],"description":"Shows your garment, bag, hat, shoes, glasses or jewelry on a model — 5 credits; a real person in the model role needs params.model_consent=\"true\"; params.view=\"back\" needs inputs.garment_back","properties":{"tool":{"const":"apparel_tryon"},"inputs":{"type":"object","additionalProperties":false,"required":["garment"],"properties":{"background_image":{"type":"string","format":"uuid","description":"Stored asset id"},"garment":{"type":"string","format":"uuid","description":"Stored asset id"},"garment_back":{"type":"string","format":"uuid","description":"Stored asset id"},"garment_detail":{"type":"string","format":"uuid","description":"Stored asset id"},"model":{"type":"string","format":"uuid","description":"Stored asset id"},"outfit_bottom":{"type":"string","format":"uuid","description":"Stored asset id"},"outfit_shoes":{"type":"string","format":"uuid","description":"Stored asset id"},"outfit_top":{"type":"string","format":"uuid","description":"Stored asset id"}}},"params":{"type":"object","additionalProperties":false,"required":["garment_type"],"properties":{"aspect_ratio":{"enum":["1:1","3:4","4:5","2:3","9:16","4:3","16:9"],"default":"3:4"},"background":{"enum":["studio_white","studio_grey","outdoor","lifestyle","seaside_rocks","wooden_pier","city_street","whitewashed_village","cafe_terrace","garden","keep","custom"],"default":"studio_white"},"bottom_style":{"enum":["auto","cargo","jeans","skirt","shorts","tailored"],"default":"auto"},"expression":{"enum":["neutral","smile"],"default":"neutral"},"garment_category":{"enum":["unspecified","abaya","backpack","beanie","blazer","blouse","boots","bra","bracelet","brimmed_hat","bucket_hat","cap","cardigan","clutch","coat","crossbody_bag","dress","earrings","eyeglasses","flats","handbag","heels","hoodie","jacket","jeans","jewelry_set","jumpsuit","knitwear","leggings","loafers","necklace","ring","sandals","shirt","shorts","shoulder_bag","skirt","sneakers","sportswear","suit","sunglasses","sweatshirt","swimwear","t_shirt","tote_bag","tracksuit_bottoms","trousers","tunic","underwear","vest"],"default":"unspecified"},"garment_type":{"enum":["top","bottom","one_piece","two_piece_set","bag","headwear","jewelry","footwear","eyewear"]},"gender":{"enum":["unspecified","female","male"],"default":"unspecified"},"light":{"enum":["scene_default","morning","golden_hour","overcast"],"default":"scene_default"},"marketplace":{"enum":["none","amazon","ebay","etsy","hepsiburada","shopify","trendyol"],"default":"none"},"model_consent":{"enum":["true","false"],"default":"false"},"pose":{"enum":["standing_front","standing_three_quarter","walking","hands_on_hips","hands_in_pockets","arms_crossed","leaning","sitting","looking_away","close_up"],"default":"standing_front"},"resolution":{"enum":["2k","4k"],"default":"2k"},"size":{"enum":["XS","S","M","L","XL","XXL"],"default":"M"},"styling":{"enum":["plain","accessorized"],"default":"plain"},"view":{"enum":["front","front_back","back"],"default":"front"}}},"instructions":{"type":"string","maxLength":500},"mannequin_id":{"type":"string","format":"uuid","description":"Saved model instead of inputs.model"},"product_id":{"type":"string","format":"uuid"}}},"JobCreate.background_remove":{"type":"object","additionalProperties":false,"required":["tool","inputs"],"description":"Removes the background — 2 credits","properties":{"tool":{"const":"background_remove"},"inputs":{"type":"object","additionalProperties":false,"required":["source"],"properties":{"source":{"type":"string","format":"uuid","description":"Stored asset id"}}},"params":{"type":"object","additionalProperties":false,"required":[],"properties":{"marketplace":{"enum":["none","amazon","ebay","etsy","hepsiburada","shopify","trendyol"],"default":"none"},"output":{"enum":["transparent","white","grey"],"default":"transparent"}}},"instructions":{"type":"string","maxLength":500},"product_id":{"type":"string","format":"uuid"}}},"JobCreate.canvas":{"type":"object","additionalProperties":false,"required":["tool","inputs","instructions"],"description":"Places your product in the scene you describe; up to two reference images set the setting and mood — 5 credits; instructions (a scene description of at least 10 characters) are required; up to 4 variants in one call: POST /api/v1/batches with vary {\"variant\": [...]}","properties":{"tool":{"const":"canvas"},"inputs":{"type":"object","additionalProperties":false,"required":["product"],"properties":{"product":{"type":"string","format":"uuid","description":"Stored asset id"},"product_detail":{"type":"string","format":"uuid","description":"Stored asset id"},"reference_1":{"type":"string","format":"uuid","description":"Stored asset id"},"reference_2":{"type":"string","format":"uuid","description":"Stored asset id"}}},"params":{"type":"object","additionalProperties":false,"required":[],"properties":{"aspect_ratio":{"enum":["1:1","3:4","4:5","2:3","9:16","4:3","16:9"],"default":"1:1"},"people":{"enum":["product_only","with_people"],"default":"product_only"},"resolution":{"enum":["2k","4k"],"default":"2k"},"variant":{"enum":["v1","v2","v3","v4"],"default":"v1"},"view":{"enum":["front","back"],"default":"front"}}},"instructions":{"type":"string","maxLength":500,"minLength":10,"description":"Scene description (required)"},"product_id":{"type":"string","format":"uuid"}}},"JobCreate.colorway":{"type":"object","additionalProperties":false,"required":["tool","inputs","params"],"description":"Shows the same product in another colour — 4 credits","properties":{"tool":{"const":"colorway"},"inputs":{"type":"object","additionalProperties":false,"required":["source"],"properties":{"color_reference":{"type":"string","format":"uuid","description":"Stored asset id"},"source":{"type":"string","format":"uuid","description":"Stored asset id"}}},"params":{"type":"object","additionalProperties":false,"required":["color"],"properties":{"color":{"enum":["black","white","off_white","light_grey","charcoal","navy","royal_blue","light_blue","teal","green","olive","sage","red","burgundy","pink","blush","purple","lavender","yellow","mustard","orange","beige","camel","brown","match_reference"]},"marketplace":{"enum":["none","amazon","ebay","etsy","hepsiburada","shopify","trendyol"],"default":"none"},"prints":{"enum":["keep","recolour"],"default":"keep"},"resolution":{"enum":["2k","4k"],"default":"2k"},"target":{"enum":["main_product","whole_outfit"],"default":"main_product"}}},"instructions":{"type":"string","maxLength":500},"product_id":{"type":"string","format":"uuid"}}},"JobCreate.detail_shot":{"type":"object","additionalProperties":false,"required":["tool","inputs"],"description":"A faithful close-up of one area of the product: collar, print, stitching, hardware, sole or clasp — 4 credits","properties":{"tool":{"const":"detail_shot"},"inputs":{"type":"object","additionalProperties":false,"required":["source"],"properties":{"product_detail":{"type":"string","format":"uuid","description":"Stored asset id"},"source":{"type":"string","format":"uuid","description":"Stored asset id"}}},"params":{"type":"object","additionalProperties":false,"required":[],"properties":{"aspect_ratio":{"enum":["1:1","4:5","3:4"],"default":"1:1"},"focus":{"enum":["auto","collar_neckline","fabric_texture","print_logo","cuff_sleeve","hem","closure_hardware","stitching","sole_heel","stone_setting","clasp"],"default":"auto"},"resolution":{"enum":["2k","4k"],"default":"2k"}}},"instructions":{"type":"string","maxLength":500},"product_id":{"type":"string","format":"uuid"}}},"JobCreate.fabric_studio":{"type":"object","additionalProperties":false,"required":["tool","inputs"],"description":"Shows the same garment in the fabric from your swatch — cut, fit and pose stay the same. Keep the original background or switch to a plain studio background — 5 credits","properties":{"tool":{"const":"fabric_studio"},"inputs":{"type":"object","additionalProperties":false,"required":["fabric","garment"],"properties":{"fabric":{"type":"string","format":"uuid","description":"Stored asset id"},"garment":{"type":"string","format":"uuid","description":"Stored asset id"}}},"params":{"type":"object","additionalProperties":false,"required":[],"properties":{"aspect_ratio":{"enum":["keep","1:1","3:4","4:5","2:3","9:16","4:3","16:9"],"default":"keep"},"background":{"enum":["keep","studio_white","studio_grey"],"default":"keep"},"garment_category":{"enum":["unspecified","abaya","blazer","blouse","bra","cardigan","coat","dress","hoodie","jacket","jeans","jumpsuit","knitwear","leggings","shirt","shorts","skirt","sportswear","suit","sweatshirt","swimwear","t_shirt","tracksuit_bottoms","trousers","tunic","underwear","vest"],"default":"unspecified"},"pattern_scale":{"enum":["as_swatch","smaller","larger"],"default":"as_swatch"},"resolution":{"enum":["2k","4k"],"default":"2k"}}},"instructions":{"type":"string","maxLength":500},"product_id":{"type":"string","format":"uuid"}}},"JobCreate.ghost_mannequin":{"type":"object","additionalProperties":false,"required":["tool","inputs"],"description":"Ghost mannequin effect: the garment keeps its shape with no model visible — 4 credits","properties":{"tool":{"const":"ghost_mannequin"},"inputs":{"type":"object","additionalProperties":false,"required":["garment"],"properties":{"garment":{"type":"string","format":"uuid","description":"Stored asset id"},"garment_back":{"type":"string","format":"uuid","description":"Stored asset id"},"garment_detail":{"type":"string","format":"uuid","description":"Stored asset id"}}},"params":{"type":"object","additionalProperties":false,"required":[],"properties":{"aspect_ratio":{"enum":["1:1","3:4","4:5","2:3","9:16","4:3","16:9"],"default":"1:1"},"backdrop":{"enum":["white","grey","black","beige"],"default":"white"},"garment_category":{"enum":["unspecified","abaya","blazer","blouse","bra","cardigan","coat","dress","hoodie","jacket","jeans","jumpsuit","knitwear","leggings","shirt","shorts","skirt","sportswear","suit","sweatshirt","swimwear","t_shirt","tracksuit_bottoms","trousers","tunic","underwear","vest"],"default":"unspecified"},"marketplace":{"enum":["none","amazon","ebay","etsy","hepsiburada","shopify","trendyol"],"default":"none"},"resolution":{"enum":["2k","4k"],"default":"2k"},"style":{"enum":["3d","flat_lay"],"default":"3d"},"view":{"enum":["front","back"],"default":"front"}}},"instructions":{"type":"string","maxLength":500},"product_id":{"type":"string","format":"uuid"}}},"JobCreate.model_maker":{"type":"object","additionalProperties":false,"required":["tool","params"],"description":"Generates a synthetic model for your library — 4 credits","properties":{"tool":{"const":"model_maker"},"inputs":{"type":"object","additionalProperties":false,"required":[],"properties":{}},"params":{"type":"object","additionalProperties":false,"required":["gender"],"properties":{"age_range":{"enum":["18_25","26_35","36_50","51_plus"],"default":"26_35"},"aspect_ratio":{"enum":["1:1","3:4","4:5","2:3","9:16","4:3","16:9"],"default":"3:4"},"body_type":{"enum":["slim","average","curvy","plus"],"default":"average"},"ethnicity":{"enum":["unspecified","european","middle_eastern","east_asian","south_asian","african","latin"],"default":"unspecified"},"gender":{"enum":["female","male","unspecified"]},"hair":{"enum":["short","medium","long","tied"],"default":"medium"},"marketplace":{"enum":["none","amazon","ebay","etsy","hepsiburada","shopify","trendyol"],"default":"none"},"resolution":{"enum":["2k","4k"],"default":"2k"}}},"instructions":{"type":"string","maxLength":500},"product_id":{"type":"string","format":"uuid"}}},"JobCreate.pose_change":{"type":"object","additionalProperties":false,"required":["tool","inputs","params"],"description":"Changes the pose in an existing image — 4 credits","properties":{"tool":{"const":"pose_change"},"inputs":{"type":"object","additionalProperties":false,"required":["source"],"properties":{"source":{"type":"string","format":"uuid","description":"Stored asset id"}}},"params":{"type":"object","additionalProperties":false,"required":["pose"],"properties":{"aspect_ratio":{"enum":["1:1","3:4","4:5","2:3","9:16","4:3","16:9"],"default":"3:4"},"marketplace":{"enum":["none","amazon","ebay","etsy","hepsiburada","shopify","trendyol"],"default":"none"},"pose":{"enum":["standing_front","standing_three_quarter","walking","hands_on_hips","hands_in_pockets","arms_crossed","leaning","sitting","looking_away","close_up"]},"resolution":{"enum":["2k","4k"],"default":"2k"}}},"instructions":{"type":"string","maxLength":500},"product_id":{"type":"string","format":"uuid"}}},"JobCreate.product_studio":{"type":"object","additionalProperties":false,"required":["tool","inputs"],"description":"Studio or lifestyle product shots without a model: shoes, glasses, bags, jewelry and more — 4 credits","properties":{"tool":{"const":"product_studio"},"inputs":{"type":"object","additionalProperties":false,"required":["product"],"properties":{"background_image":{"type":"string","format":"uuid","description":"Stored asset id"},"product":{"type":"string","format":"uuid","description":"Stored asset id"},"product_detail":{"type":"string","format":"uuid","description":"Stored asset id"}}},"params":{"type":"object","additionalProperties":false,"required":[],"properties":{"aspect_ratio":{"enum":["1:1","3:4","4:5","2:3","9:16","4:3","16:9"],"default":"3:4"},"hand":{"enum":["no_hand","hand_woman","hand_man"],"default":"no_hand"},"lighting":{"enum":["light_soft","light_dramatic","light_natural","light_rim"],"default":"light_soft"},"marketplace":{"enum":["none","amazon","ebay","etsy","hepsiburada","shopify","trendyol"],"default":"none"},"product_kind":{"enum":["unspecified","apparel","footwear","eyewear","bag","jewelry","headwear","watch","cosmetics","home","other","food"],"default":"unspecified"},"resolution":{"enum":["2k","4k"],"default":"2k"},"scene":{"enum":["studio_white","studio_grey","studio_beige","marble","wood","linen","podium","outdoor","lifestyle_home","custom","studio_dark","studio_gradient","concrete","pedestal_acrylic","pedestal_stone","kitchen","office"],"default":"studio_white"},"shadow":{"enum":["soft","no_shadow","reflection"],"default":"soft"},"shot":{"enum":["front","three_quarter","side","top_down"],"default":"three_quarter"},"view":{"enum":["front","back"],"default":"front"}}},"instructions":{"type":"string","maxLength":500},"product_id":{"type":"string","format":"uuid"}}},"JobCreate.reframe":{"type":"object","additionalProperties":false,"required":["tool","inputs","params"],"description":"Changes the aspect ratio without cropping — the scene is extended, the product stays untouched — 4 credits","properties":{"tool":{"const":"reframe"},"inputs":{"type":"object","additionalProperties":false,"required":["source"],"properties":{"source":{"type":"string","format":"uuid","description":"Stored asset id"}}},"params":{"type":"object","additionalProperties":false,"required":["aspect_ratio"],"properties":{"aspect_ratio":{"enum":["1:1","3:4","4:5","2:3","9:16","4:3","16:9"]},"resolution":{"enum":["2k","4k"],"default":"2k"}}},"instructions":{"type":"string","maxLength":500},"product_id":{"type":"string","format":"uuid"}}},"JobCreate.upscale":{"type":"object","additionalProperties":false,"required":["tool","inputs"],"description":"Increases the resolution — 2 credits","properties":{"tool":{"const":"upscale"},"inputs":{"type":"object","additionalProperties":false,"required":["source"],"properties":{"source":{"type":"string","format":"uuid","description":"Stored asset id"}}},"params":{"type":"object","additionalProperties":false,"required":[],"properties":{"factor":{"enum":["2","4"],"default":"2"}}},"instructions":{"type":"string","maxLength":500},"product_id":{"type":"string","format":"uuid"}}},"JobCreate":{"oneOf":[{"$ref":"#/components/schemas/JobCreate.ad_creative"},{"$ref":"#/components/schemas/JobCreate.apparel_tryon"},{"$ref":"#/components/schemas/JobCreate.background_remove"},{"$ref":"#/components/schemas/JobCreate.canvas"},{"$ref":"#/components/schemas/JobCreate.colorway"},{"$ref":"#/components/schemas/JobCreate.detail_shot"},{"$ref":"#/components/schemas/JobCreate.fabric_studio"},{"$ref":"#/components/schemas/JobCreate.ghost_mannequin"},{"$ref":"#/components/schemas/JobCreate.model_maker"},{"$ref":"#/components/schemas/JobCreate.pose_change"},{"$ref":"#/components/schemas/JobCreate.product_studio"},{"$ref":"#/components/schemas/JobCreate.reframe"},{"$ref":"#/components/schemas/JobCreate.upscale"}],"discriminator":{"propertyName":"tool"}},"BatchCreate":{"type":"object","required":["tool"],"properties":{"tool":{"$ref":"#/components/schemas/Tool"},"items":{"type":"array","maxItems":100,"items":{"type":"object","additionalProperties":false,"properties":{"inputs":{"type":"object"},"params":{"type":"object"},"instructions":{"type":"string"},"mannequin_id":{"type":"string"}}}},"inputs":{"type":"object"},"params":{"type":"object"},"vary":{"type":"object","description":"{param: [values]} — one job per value"},"product_id":{"type":"string"}}},"ChainCreate":{"type":"object","required":["steps"],"properties":{"steps":{"type":"array","minItems":2,"maxItems":5,"items":{"type":"object","additionalProperties":false,"properties":{"inputs":{"type":"object"},"params":{"type":"object"},"instructions":{"type":"string"},"mannequin_id":{"type":"string"},"tool":{"$ref":"#/components/schemas/Tool"},"input_role":{"type":"string","description":"Role that receives the previous step's output (all steps but the first)"}},"required":["tool"]}},"product_id":{"type":"string"}}},"AssetUpload":{"type":"object","required":["file"],"properties":{"file":{"type":"string","format":"binary"},"product_id":{"type":"string"}}},"AssetIntent":{"type":"object","required":["content_type","size"],"properties":{"content_type":{"enum":["image/jpeg","image/png","image/webp"]},"size":{"type":"integer","maximum":26214400},"product_id":{"type":"string"}}},"AssetImport":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri"},"product_id":{"type":"string"}}},"Asset":{"type":"object","properties":{"object":{"const":"asset"},"id":{"type":"string"},"kind":{"enum":["upload","output"]},"state":{"enum":["pending","stored","rejected","deleted"]},"content_type":{"type":["string","null"]},"byte_size":{"type":["integer","null"]},"sha256":{"type":["string","null"]},"product_id":{"type":["string","null"]},"job_id":{"type":["string","null"]},"rejection":{"type":["object","null"]},"expires_at":{"type":["string","null"]},"created_at":{"type":"string"},"upload":{"type":"object","description":"Only on upload intents: where to PUT the bytes"}}},"Upload":{"type":"object","properties":{"object":{"const":"upload"},"asset_id":{"type":"string"},"bytes":{"type":"integer"},"next":{"type":"string"}}},"Job":{"type":"object","properties":{"object":{"const":"job"},"id":{"type":"string"},"tool":{"$ref":"#/components/schemas/Tool"},"state":{"enum":["queued","running","succeeded","failed","canceled"]},"credit_cost":{"type":"integer"},"batch_id":{"type":["string","null"]},"product_id":{"type":["string","null"]},"depends_on":{"type":["string","null"]},"inputs":{"type":"object"},"params":{"type":"object"},"instructions":{"type":["string","null"]},"outputs":{"type":"array","items":{"type":"object","properties":{"asset_id":{"type":"string"},"content_type":{"type":"string"},"byte_size":{"type":"integer"},"sha256":{"type":"string"}}}},"watermarked":{"type":"boolean"},"failure":{"type":["object","null"],"properties":{"code":{"type":"string"}}},"source":{"enum":["web","api"]},"created_at":{"type":"string"},"started_at":{"type":["string","null"]},"finished_at":{"type":["string","null"]}}},"JobList":{"type":"object","required":["object","data","has_more","next_cursor"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Job"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}},"Batch":{"type":"object","properties":{"object":{"const":"batch"},"id":{"type":"string"},"total":{"type":"integer"},"counts":{"type":"object"},"done":{"type":"boolean"},"remaining":{"type":"integer"},"credits_reserved":{"type":"integer"},"jobs":{"type":"array","items":{"$ref":"#/components/schemas/Job"}}}},"Chain":{"type":"object","properties":{"object":{"const":"chain"},"id":{"type":"string"},"batch_id":{"type":"string"},"total":{"type":"integer"},"credits_reserved":{"type":"integer"},"jobs":{"type":"array","items":{"$ref":"#/components/schemas/Job"}}}},"BatchCancellation":{"type":"object","properties":{"object":{"const":"batch_cancellation"},"id":{"type":"string"},"canceled":{"type":"array","items":{"type":"string"}},"count":{"type":"integer"}}},"OutputList":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"type":"object"}},"pending":{"type":"integer"}}},"ToolList":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"type":"object"}}}},"Credits":{"type":"object","properties":{"object":{"const":"credits"},"available":{"type":"integer"},"reserved":{"type":"integer"},"period":{"type":"object"}}},"WebhookEvent":{"enum":["job.succeeded","job.failed","job.canceled","batch.completed"]},"WebhookEndpointCreate":{"type":"object","additionalProperties":false,"required":["url"],"properties":{"url":{"type":"string","format":"uri","maxLength":2048,"description":"https URL on a public address, port 80 or 443; redirects are not followed"},"events":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/WebhookEvent"},"description":"Default: all events"},"description":{"type":"string","maxLength":200}}},"WebhookEndpointUpdate":{"type":"object","additionalProperties":false,"properties":{"url":{"type":"string","format":"uri","maxLength":2048},"events":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/WebhookEvent"}},"description":{"type":"string","maxLength":200},"enabled":{"type":"boolean"}}},"WebhookEndpoint":{"type":"object","properties":{"object":{"const":"webhook_endpoint"},"id":{"type":"string"},"url":{"type":"string"},"description":{"type":"string"},"events":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEvent"}},"enabled":{"type":"boolean"},"disabled_reason":{"enum":["failing","user",null],"description":"failing: no successful delivery for 3 days; the owner is emailed"},"failing_since":{"type":["string","null"]},"last_success_at":{"type":["string","null"]},"secret_rotated_at":{"type":["string","null"]},"created_at":{"type":"string"}}},"WebhookEndpointWithSecret":{"allOf":[{"$ref":"#/components/schemas/WebhookEndpoint"},{"type":"object","required":["secret"],"properties":{"secret":{"type":"string","pattern":"^whsec_","description":"Shown once. Verify `webhook-signature` with it (Standard Webhooks)."}}}]},"WebhookEndpointList":{"type":"object","required":["object","data","has_more","next_cursor"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}},"WebhookDelivery":{"type":"object","properties":{"object":{"const":"webhook_delivery"},"id":{"type":"string"},"endpoint_id":{"type":"string"},"event_id":{"type":"string","description":"= webhook-id header and payload id"},"event_type":{"type":"string"},"state":{"enum":["pending","succeeded","failed"]},"attempts":{"type":"integer"},"next_attempt_at":{"type":["string","null"]},"last_attempt_at":{"type":["string","null"]},"last_status":{"type":["integer","null"]},"last_error":{"type":["string","null"],"description":"http_status, timeout, connection_failed, blocked:<reason>, endpoint_disabled, endpoint_deleted"},"duration_ms":{"type":["integer","null"]},"delivered_at":{"type":["string","null"]},"redeliveries":{"type":"integer"},"created_at":{"type":"string"},"payload":{"$ref":"#/components/schemas/WebhookPayload"}}},"WebhookDeliveryList":{"type":"object","required":["object","data","has_more","next_cursor"],"properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDelivery"}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}}},"WebhookPayload":{"type":"object","required":["id","type","created_at","data"],"description":"Thin event: ids and states only (no URLs, no bytes). Fetch details with your API key.","properties":{"id":{"type":"string","pattern":"^evt_[0-9a-f]{32}$"},"type":{"enum":["job.succeeded","job.failed","job.canceled","batch.completed","webhook.test"]},"created_at":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{"job":{"type":"object","properties":{"id":{"type":"string"},"tool":{"type":"string"},"state":{"enum":["succeeded","failed","canceled"]},"batch_id":{"type":["string","null"]},"failure_code":{"type":["string","null"]},"outputs":{"type":"array","items":{"type":"object","properties":{"asset_id":{"type":"string"}}}}}},"batch":{"type":"object","properties":{"id":{"type":"string"},"total":{"type":"integer"},"counts":{"type":"object","properties":{"succeeded":{"type":"integer"},"failed":{"type":"integer"},"canceled":{"type":"integer"}}}}},"endpoint_id":{"type":"string","description":"webhook.test only"}}}}},"ApiKey":{"type":"object","properties":{"object":{"const":"api_key"},"id":{"type":"string"},"name":{"type":"string"},"prefix":{"type":"string"},"scopes":{"type":"array","items":{"enum":["jobs:read","jobs:write","billing:read","webhooks:write"]}},"rate_per_minute":{"type":"integer"},"expires_at":{"type":["string","null"]},"workspace_id":{"type":"string"}}},"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"object","required":["code","request_id"],"properties":{"code":{"type":"string"},"detail":{"type":"string"},"request_id":{"type":"string"}}}}}}}}