{"items":[{"type":"link","label":"Ads API Reference","link":"/ads","routeSlug":"/ads","content":{"contentType":"overview","meta":{"name":"Ads API Reference"},"children":[{"nodeType":"container","panels":[{"title":"Download OpenAPI description","titleTranslationKey":"download.description.title","children":[{"kind":"download","label":"ads.json","url":"/_bundle/ads.json?download"},{"kind":"download","label":"ads.yaml","url":"/_bundle/ads.yaml?download"}]},{"title":"Overview","titleTranslationKey":"info.title","children":[]},{"title":"Languages","titleTranslationKey":"languages.title","children":[{"kind":"languages","options":[{"key":"python (bria-client)","title":"Python (bria-client)","lang":"Python"},{"key":"typescript (@bria-ai/client)","title":"TypeScript (@bria-ai/client)","lang":"JavaScript"},{"key":"curl","title":"cURL","lang":"curl"}]}]},{"title":"Servers","titleTranslationKey":"servers.title","children":[{"kind":"servers","servers":[{"url":"https://engine.prod.bria-api.com/v2"}],"mode":"default"}]}],"children":[{"nodeType":"overview-section-wrapper","children":[{"nodeType":"header","level":1,"label":"Ads API Reference","showPageActions":true},{"nodeType":"overview-section-wrapper","children":[{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Two endpoints for finished, flat ads. "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"POST /v2/ads/delayer"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" turns an ad into editable layers (background plate, image cutouts, live text with typography, vector shapes) returned as one JSON layer document. "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"POST /v2/ads/resize"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" produces the same ad at up to ten other sizes with the layout redone for each shape. Both are asynchronous: they return a "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"request_id"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" and "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"status_url"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", and the completed status body carries the result. The "},"children":[]},{"$$mdtype":"Node","type":"link","inline":true,"attributes":{"href":"/ads-overview"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Ads overview"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" introduces both; each endpoint below carries its full guide: the flow, the response contract, limits and retention."},"children":[]}]}]}]}],"sectionId":"/ads"},{"nodeType":"external-docs","url":"https://platform.bria.ai/organization-management/api-keys","description":"Register and get API Access"}],"sectionId":"/ads"}]}]}},{"type":"group","label":"Transformations","link":"/ads/transformations","routeSlug":"/ads/transformations","items":[{"label":"Decompose an ad into layers","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/ads/transformations/delayer-ad","routeSlug":"/ads/transformations/delayer-ad","metadata":{"seo":{"title":"Decompose an ad into layers","description":"Turn a flat ad image into editable layers, returned as one structured JSON document: a background plate, product and logo cutouts, live text with typography, and vector shapes. Trained exclusively on licensed data for safe commercial use. Latency is on average under 1 minute."}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"delayer-ad","name":"Decompose an ad into layers","isWebhook":false,"pointer":"/paths/~1ads~1delayer/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Decompose an ad into layers","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Turn a flat ad image into editable layers, returned as one structured JSON document: a background plate, product and logo cutouts, live text with typography, and vector shapes. Trained exclusively on licensed data for safe commercial use. Latency is on average under 1 minute."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"How it works"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"list","attributes":{"ordered":true,"marker":"."},"children":[{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Submit the ad. The response carries a "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"request_id"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" and a "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"status_url"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Poll the "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"status_url"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" ("},"children":[]},{"$$mdtype":"Node","type":"link","inline":true,"attributes":{"href":"/status"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"status endpoint"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":") or pass a "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"webhook_url"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" ("},"children":[]},{"$$mdtype":"Node","type":"link","inline":true,"attributes":{"href":"/getting-started/async-requests#webhooks"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"webhooks"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"). Both deliver the completion payload shown under "},"children":[]},{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Callbacks"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" below."},"children":[]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"On completion, "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"result.url"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" points to the hosted layer document; each image layer's "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"asset_path"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" is a hosted file. The document and its assets stay downloadable for 30 days."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Input assumptions"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"The input is assumed to be a flat ad. Ordinary photographs are out of scope and the result is not guaranteed. Unknown fields are currently ignored rather than rejected, so a misspelled parameter silently falls back to its default. Submissions are not idempotent: a retried POST is a new job. Failed jobs are never billed."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Reporting a problem"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"The "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"request_id"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" in an error body identifies that response, not your job. The durable handle is the id inside the "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"status_url"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" you received at submit; quote that."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"The layer document"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"The field-by-field contract (document, layer, image, vector and text fields), the two halves of every copy layer, a real example and a rendering guide are in the "},"children":[]},{"$$mdtype":"Node","type":"link","inline":true,"attributes":{"href":"/ads"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Ad Delayer guide"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"The Ad Delayer turns a finished, flat ad image into its editable parts: a background plate, product and logo cutouts, live text with full typography, and vector shapes. The result is one JSON layer document you can render, edit, resize or localize programmatically. Use it to recover a lost design file, make a shipped ad editable again, or feed an ad into your own templating pipeline."},"children":[]}]}]},{"$$mdtype":"Node","type":"table","attributes":{},"children":[{"$$mdtype":"Node","type":"thead","attributes":{},"children":[{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"th","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"You send"},"children":[]}]}]},{"$$mdtype":"Node","type":"th","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"You get back"},"children":[]}]}]}]}]},{"$$mdtype":"Node","type":"tbody","attributes":{},"children":[{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"One flat ad image (PNG, JPEG or WEBP)"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"A hosted layer document: canvas size, the web fonts it needs, and a z-ordered list of layers with bounding boxes and type-specific styling; image layers as hosted transparent PNGs"},"children":[]}]}]}]}]}]},{"$$mdtype":"Node","type":"heading","attributes":{"level":3,"id":"transformations/delayer-ad/request/how-a-job-runs","deepLinkHash":"/transformations/delayer-ad#transformations/delayer-ad/request/how-a-job-runs"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"How a job runs"},"children":[]}]}]},{"$$mdtype":"Node","type":"list","attributes":{"ordered":true,"marker":"."},"children":[{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Submit"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" the ad. The API returns a "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"request_id"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" and a "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"status_url"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" immediately."},"children":[]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Wait"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" for completion by polling the "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"status_url"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" (the shared "},"children":[]},{"$$mdtype":"Node","type":"link","inline":true,"attributes":{"href":"/status"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"status endpoint"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":") every few seconds, or pass a "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"webhook_url"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" and let Bria POST the result to you ("},"children":[]},{"$$mdtype":"Node","type":"link","inline":true,"attributes":{"href":"/getting-started/async-requests#webhooks"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"webhooks"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"). Both deliver the same body."},"children":[]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Fetch the layer document."},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" The completed status body carries a pointer, not the layers: "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"result.url"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" is the JSON document."},"children":[]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Fetch assets as needed."},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" Each image layer's "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"asset_path"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" is a hosted file; download the ones you render."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Python SDK"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"fence","attributes":{"content":"import httpx\nfrom bria_client import BriaSyncClient\n\nclient = BriaSyncClient()  # reads BRIA_API_TOKEN\n\njob = client.submit(\n    endpoint=\"ads/delayer\",\n    payload={\"attachments\": [\"https://example.com/ads/spring-sale.jpg\"]},\n)\nstatus = client.poll(job, interval=5, timeout=600)\n\ndoc = httpx.get(status.result.url, timeout=30).json()\n\nlayers = sorted((l for l in doc[\"layers\"] if l.get(\"hidden\") is not True), key=lambda l: l[\"z_order\"])\nfor layer in layers:\n    print(layer[\"z_order\"], layer[\"id\"], layer[\"type\"], layer[\"subtype\"], layer[\"bbox\"])\n","language":"python"},"children":[{"$$mdtype":"Node","type":"text","attributes":{"content":"import httpx\nfrom bria_client import BriaSyncClient\n\nclient = BriaSyncClient()  # reads BRIA_API_TOKEN\n\njob = client.submit(\n    endpoint=\"ads/delayer\",\n    payload={\"attachments\": [\"https://example.com/ads/spring-sale.jpg\"]},\n)\nstatus = client.poll(job, interval=5, timeout=600)\n\ndoc = httpx.get(status.result.url, timeout=30).json()\n\nlayers = sorted((l for l in doc[\"layers\"] if l.get(\"hidden\") is not True), key=lambda l: l[\"z_order\"])\nfor layer in layers:\n    print(layer[\"z_order\"], layer[\"id\"], layer[\"type\"], layer[\"subtype\"], layer[\"bbox\"])\n"},"children":[]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"TypeScript SDK"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"fence","attributes":{"content":"import { BriaClient } from \"@bria-ai/client\";\n\nconst client = new BriaClient(); // reads BRIA_API_TOKEN\n\n// 1 + 2. Submit and wait\nconst job = await client.submit(\"ads/delayer\", { attachments: [\"https://example.com/ads/spring-sale.jpg\"] });\nconst status = await client.poll(job, { interval: 5, timeout: 600 });\n\n// 3. Fetch the layer document\ntype Layer = { id: string; type: string; subtype: string; z_order: number; bbox: number[]; hidden?: boolean };\nconst doc: { layers: Layer[] } = await (await fetch(String(status.result?.url))).json();\n\n// 4. Work with the visible layers in paint order\nconst layers = doc.layers.filter((l) => l.hidden !== true).sort((a, b) => a.z_order - b.z_order);\nfor (const layer of layers) console.log(layer.z_order, layer.id, layer.type, layer.subtype, layer.bbox);\n","language":"typescript"},"children":[{"$$mdtype":"Node","type":"text","attributes":{"content":"import { BriaClient } from \"@bria-ai/client\";\n\nconst client = new BriaClient(); // reads BRIA_API_TOKEN\n\n// 1 + 2. Submit and wait\nconst job = await client.submit(\"ads/delayer\", { attachments: [\"https://example.com/ads/spring-sale.jpg\"] });\nconst status = await client.poll(job, { interval: 5, timeout: 600 });\n\n// 3. Fetch the layer document\ntype Layer = { id: string; type: string; subtype: string; z_order: number; bbox: number[]; hidden?: boolean };\nconst doc: { layers: Layer[] } = await (await fetch(String(status.result?.url))).json();\n\n// 4. Work with the visible layers in paint order\nconst layers = doc.layers.filter((l) => l.hidden !== true).sort((a, b) => a.z_order - b.z_order);\nfor (const layer of layers) console.log(layer.z_order, layer.id, layer.type, layer.subtype, layer.bbox);\n"},"children":[]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"cURL"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"fence","attributes":{"content":"curl -s -X POST https://engine.prod.bria-api.com/v2/ads/delayer \\\n  -H \"api_token: $BRIA_API_TOKEN\" -H \"Content-Type: application/json\" \\\n  -d '{\"attachments\": [\"https://example.com/ads/spring-sale.jpg\"]}'\n\ncurl -s \"https://engine.prod.bria-api.com/v2/status/<request_id>\" -H \"api_token: $BRIA_API_TOKEN\"\n\ncurl -s \"<result.url>\" | jq '.layers | map(select(.hidden != true)) | sort_by(.z_order) | .[] | {z_order, id, type, subtype}'\n","language":"bash"},"children":[{"$$mdtype":"Node","type":"text","attributes":{"content":"curl -s -X POST https://engine.prod.bria-api.com/v2/ads/delayer \\\n  -H \"api_token: $BRIA_API_TOKEN\" -H \"Content-Type: application/json\" \\\n  -d '{\"attachments\": [\"https://example.com/ads/spring-sale.jpg\"]}'\n\ncurl -s \"https://engine.prod.bria-api.com/v2/status/<request_id>\" -H \"api_token: $BRIA_API_TOKEN\"\n\ncurl -s \"<result.url>\" | jq '.layers | map(select(.hidden != true)) | sort_by(.z_order) | .[] | {z_order, id, type, subtype}'\n"},"children":[]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"The completed status body looks like this:"},"children":[]}]}]},{"$$mdtype":"Node","type":"fence","attributes":{"content":"{\n  \"request_id\": \"860f1a2b73f847e59f284d6f860f2ddb\",\n  \"status\": \"COMPLETED\",\n  \"result\": {\n    \"status\": \"completed\",\n    \"text\": \"Constructed a layered ad.\",\n    \"url\": \"https://temp.bria.ai/results/860f1a2b73f847e59f284d6f860f2ddb/creation.json\"\n  }\n}\n","language":"json"},"children":[{"$$mdtype":"Node","type":"text","attributes":{"content":"{\n  \"request_id\": \"860f1a2b73f847e59f284d6f860f2ddb\",\n  \"status\": \"COMPLETED\",\n  \"result\": {\n    \"status\": \"completed\",\n    \"text\": \"Constructed a layered ad.\",\n    \"url\": \"https://temp.bria.ai/results/860f1a2b73f847e59f284d6f860f2ddb/creation.json\"\n  }\n}\n"},"children":[]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Two details specific to this endpoint:"},"children":[]}]}]},{"$$mdtype":"Node","type":"list","attributes":{"ordered":false,"marker":"-"},"children":[{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"An unrecognized or expired "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"request_id"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" is reported as "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"\"status\": \"UNKNOWN\""},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" with HTTP "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"200"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":". Treat it as not found and stop polling."},"children":[]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"The "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"request_id"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" inside an error body identifies that response, not your job. When reporting a problem, quote the id inside the "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"status_url"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" you received at submit."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"heading","attributes":{"level":3,"id":"transformations/delayer-ad/request/request-essentials","deepLinkHash":"/transformations/delayer-ad#transformations/delayer-ad/request/request-essentials"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Request essentials"},"children":[]}]}]},{"$$mdtype":"Node","type":"table","attributes":{},"children":[{"$$mdtype":"Node","type":"thead","attributes":{},"children":[{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"th","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Parameter"},"children":[]}]}]},{"$$mdtype":"Node","type":"th","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Description"},"children":[]}]}]}]}]},{"$$mdtype":"Node","type":"tbody","attributes":{},"children":[{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"attachments"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Exactly one image: a public URL or a "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"data:image/…;base64,…"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" URI. PNG, JPEG or WEBP, up to 10 MB and 2048 px per dimension (no dimension cap on Enterprise). Required."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"webhook_url"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Optional. Receive the completion body by POST instead of polling."},"children":[]}]}]}]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Inputs are assumed to be flat ads. Ordinary photographs are out of scope and results for them are not guaranteed. Unknown fields are currently ignored rather than rejected, so a misspelled parameter silently falls back to its default. Submissions are not idempotent: a retried POST is a new job. Failed jobs are never billed."},"children":[]}]}]},{"$$mdtype":"Node","type":"heading","attributes":{"level":3,"id":"transformations/delayer-ad/request/the-layer-document","deepLinkHash":"/transformations/delayer-ad#transformations/delayer-ad/request/the-layer-document"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"The layer document"},"children":[]}]}]},{"$$mdtype":"Node","type":"fence","attributes":{"content":"{\n  \"canvas\": { \"width\": 1000, \"height\": 1500 },\n  \"font_stylesheets\": [\"https://fonts.googleapis.com/css2?family=Inter…\"],\n  \"layers\": [ ... ]\n}\n","language":"json"},"children":[{"$$mdtype":"Node","type":"text","attributes":{"content":"{\n  \"canvas\": { \"width\": 1000, \"height\": 1500 },\n  \"font_stylesheets\": [\"https://fonts.googleapis.com/css2?family=Inter…\"],\n  \"layers\": [ ... ]\n}\n"},"children":[]}]},{"$$mdtype":"Node","type":"table","attributes":{},"children":[{"$$mdtype":"Node","type":"thead","attributes":{},"children":[{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"th","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Field"},"children":[]}]}]},{"$$mdtype":"Node","type":"th","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Type"},"children":[]}]}]},{"$$mdtype":"Node","type":"th","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Description"},"children":[]}]}]}]}]},{"$$mdtype":"Node","type":"tbody","attributes":{},"children":[{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"canvas"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"object"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"width"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" and "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"height"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", matching the input image."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"font_stylesheets"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"string[]"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Google Fonts stylesheet URLs covering every font referenced by text layers. Load them before rendering text. May be omitted when no web font is needed, so read it defensively."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"layers"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"array"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Every layer in the ad. Sort by "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"z_order"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" before rendering; array order is not guaranteed to match paint order."},"children":[]}]}]}]}]}]},{"$$mdtype":"Node","type":"heading","attributes":{"level":4,"id":"transformations/delayer-ad/request/fields-on-every-layer","deepLinkHash":"/transformations/delayer-ad#transformations/delayer-ad/request/fields-on-every-layer"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Fields on every layer"},"children":[]}]}]},{"$$mdtype":"Node","type":"table","attributes":{},"children":[{"$$mdtype":"Node","type":"thead","attributes":{},"children":[{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"th","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Field"},"children":[]}]}]},{"$$mdtype":"Node","type":"th","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Type"},"children":[]}]}]},{"$$mdtype":"Node","type":"th","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Description"},"children":[]}]}]}]}]},{"$$mdtype":"Node","type":"tbody","attributes":{},"children":[{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"id"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"string"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Result-scoped: "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"background_1"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"text_3"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"image_1"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"shape_1"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", plus the literal "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"canvas_background"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":". A copy layer arrives as a pair suffixed "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"_font"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" and "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"_svg"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"type"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"string"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"image"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"vector"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" or "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"text"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"subtype"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"string"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"background"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"logo"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"product"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"primary_copy"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"secondary_copy"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"cta"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"compliance"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"icon"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"decorative"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"bbox"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"object"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"x"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"y"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"width"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"height"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" in canvas pixels."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"z_order"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"integer"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Paint order from 0 upward with no gaps; lowest paints first. Each half of a copy pair takes its own number, so gaps appear once hidden layers are dropped."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"hidden"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"boolean"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Present and "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"true"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" only on the inactive half of a copy pair. Skip those layers. Absent means visible; it is never "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"false"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", so test for "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"hidden === true"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]}]}]}]},{"$$mdtype":"Node","type":"heading","attributes":{"level":4,"id":"transformations/delayer-ad/request/image-layers","deepLinkHash":"/transformations/delayer-ad#transformations/delayer-ad/request/image-layers"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Image layers"},"children":[]}]}]},{"$$mdtype":"Node","type":"table","attributes":{},"children":[{"$$mdtype":"Node","type":"thead","attributes":{},"children":[{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"th","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Field"},"children":[]}]}]},{"$$mdtype":"Node","type":"th","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Type"},"children":[]}]}]},{"$$mdtype":"Node","type":"th","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Description"},"children":[]}]}]}]}]},{"$$mdtype":"Node","type":"tbody","attributes":{},"children":[{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"asset_path"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"string"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Hosted image. Cutouts are transparent PNGs; the "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"_svg"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" half of a copy pair is an SVG of the traced letterforms."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"image_fit.object_fit"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"string"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"cover"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" or "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"contain"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", with CSS "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"object-fit"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" semantics."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"image_fit.object_position_x"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"image_fit.object_position_y"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"string"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Optional. Where the image sits when the fit leaves slack: "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"left"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"center"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"right"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" and "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"top"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"center"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"bottom"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":". Absent means centered."},"children":[]}]}]}]}]}]},{"$$mdtype":"Node","type":"heading","attributes":{"level":4,"id":"transformations/delayer-ad/request/vector-layers","deepLinkHash":"/transformations/delayer-ad#transformations/delayer-ad/request/vector-layers"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Vector layers"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Vector layers carry no shape enum; treat them as boxes with a fill."},"children":[]}]}]},{"$$mdtype":"Node","type":"table","attributes":{},"children":[{"$$mdtype":"Node","type":"thead","attributes":{},"children":[{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"th","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Field"},"children":[]}]}]},{"$$mdtype":"Node","type":"th","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Type"},"children":[]}]}]},{"$$mdtype":"Node","type":"th","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Description"},"children":[]}]}]}]}]},{"$$mdtype":"Node","type":"tbody","attributes":{},"children":[{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"style.background_color"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"string"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Solid fill, "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"#RRGGBB"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"style.background_gradient"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"object"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"stops[]"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" of "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"{offset, color}"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" plus "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"kind"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" and "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"angle_deg"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":". Stop colors may carry an 8-digit "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"#RRGGBBAA"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" alpha suffix."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"style.border_radius_px"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"number"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Corner radius, when present."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"style.box_shadow"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"object"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Optional. "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"offset_x_px"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"offset_y_px"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"blur_px"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"spread_px"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"color"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" and "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"inset"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", with CSS "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"box-shadow"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" semantics."},"children":[]}]}]}]}]}]},{"$$mdtype":"Node","type":"heading","attributes":{"level":4,"id":"transformations/delayer-ad/request/text-layers","deepLinkHash":"/transformations/delayer-ad#transformations/delayer-ad/request/text-layers"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Text layers"},"children":[]}]}]},{"$$mdtype":"Node","type":"fence","attributes":{"content":"{\n  \"text\": \"string — live, editable content. Explicit line breaks are \\\\n and are preserved when you re-render\",\n  \"text_style\": {\n    \"color\": \"string — #RRGGBB\",\n    \"font_family\": \"string — a CSS font stack, nearest match first, fallbacks inline\",\n    \"font_weight\": \"integer, 100-900\",\n    \"font_size_px\": \"number\",\n    \"letter_spacing_px\": \"number — pixels; omitted when zero\",\n    \"line_height\": \"number — unitless multiplier over the font size\",\n    \"text_align\": \"string, optional — \\\"left\\\" | \\\"center\\\" | \\\"right\\\"\",\n    \"align_x\": \"string — CSS flexbox value: \\\"flex-start\\\" | \\\"center\\\" | \\\"flex-end\\\"\",\n    \"align_y\": \"string — same values as align_x\",\n    \"no_wrap\": \"boolean — true forbids wrapping inside the box\",\n    \"uppercase\": \"boolean\",\n    \"underline\": \"boolean\",\n    \"italic\": \"boolean\"\n  }\n}\n","language":"jsonc"},"children":[{"$$mdtype":"Node","type":"text","attributes":{"content":"{\n  \"text\": \"string — live, editable content. Explicit line breaks are \\\\n and are preserved when you re-render\",\n  \"text_style\": {\n    \"color\": \"string — #RRGGBB\",\n    \"font_family\": \"string — a CSS font stack, nearest match first, fallbacks inline\",\n    \"font_weight\": \"integer, 100-900\",\n    \"font_size_px\": \"number\",\n    \"letter_spacing_px\": \"number — pixels; omitted when zero\",\n    \"line_height\": \"number — unitless multiplier over the font size\",\n    \"text_align\": \"string, optional — \\\"left\\\" | \\\"center\\\" | \\\"right\\\"\",\n    \"align_x\": \"string — CSS flexbox value: \\\"flex-start\\\" | \\\"center\\\" | \\\"flex-end\\\"\",\n    \"align_y\": \"string — same values as align_x\",\n    \"no_wrap\": \"boolean — true forbids wrapping inside the box\",\n    \"uppercase\": \"boolean\",\n    \"underline\": \"boolean\",\n    \"italic\": \"boolean\"\n  }\n}\n"},"children":[]}]},{"$$mdtype":"Node","type":"heading","attributes":{"level":3,"id":"transformations/delayer-ad/request/copy-layers:-two-halves","deepLinkHash":"/transformations/delayer-ad#transformations/delayer-ad/request/copy-layers:-two-halves"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Copy layers: two halves"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Copy comes back in both forms, so one result can be rendered either way and an editor can offer the choice without a second job. Each copy slot produces two layers with the same "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"subtype"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" and "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"bbox"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" and their own "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"z_order"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":":"},"children":[]}]}]},{"$$mdtype":"Node","type":"table","attributes":{},"children":[{"$$mdtype":"Node","type":"thead","attributes":{},"children":[{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"th","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Layer"},"children":[]}]}]},{"$$mdtype":"Node","type":"th","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Type"},"children":[]}]}]},{"$$mdtype":"Node","type":"th","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Carries"},"children":[]}]}]}]}]},{"$$mdtype":"Node","type":"tbody","attributes":{},"children":[{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"<slot>_svg"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"image"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"asset_path"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" to an SVG of the letterforms traced out of the original ad."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"<slot>_font"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"text"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"text"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" and "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"text_style"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":": live, editable, in the nearest matching font."},"children":[]}]}]}]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"The "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"hidden: true"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" flag marks which half is inactive; that layer must not be drawn — render both and the ad shows its copy twice."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"A wordmark logo (a brand written out in lettering rather than a pictorial mark) is paired the same way, except that both halves are "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"image"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" layers: "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"_svg"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" is the traced outline and "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"_font"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" is the raster crop. A logo is never typeset. Layers with nothing to pair, which is most of them, keep their plain id and never carry "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"hidden"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Skipping the hidden half saves an asset download per copy layer, and when no text layer is drawn nothing needs "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"font_stylesheets"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" at all."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"A real copy pair"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"fence","attributes":{"content":"[\n  {\n    \"id\": \"text_5_svg\",\n    \"type\": \"image\",\n    \"subtype\": \"primary_copy\",\n    \"bbox\": { \"x\": 150.0, \"y\": 409.05, \"width\": 764.0, \"height\": 139.95 },\n    \"z_order\": 8,\n    \"asset_path\": \"https://temp.bria.ai/results/860f1a2b73f847e59f284d6f860f2ddb/text_5.svg\",\n    \"image_fit\": { \"object_fit\": \"contain\" }\n  },\n  {\n    \"id\": \"text_5_font\",\n    \"type\": \"text\",\n    \"subtype\": \"primary_copy\",\n    \"bbox\": { \"x\": 150.0, \"y\": 409.05, \"width\": 764.0, \"height\": 139.95 },\n    \"z_order\": 9,\n    \"hidden\": true,\n    \"text\": \"40% OFF*\",\n    \"text_style\": {\n      \"color\": \"#FFFFFF\",\n      \"font_family\": \"'Montserrat', 'Inter', 'Helvetica Neue', Arial, sans-serif\",\n      \"font_weight\": 900,\n      \"font_size_px\": 149.58,\n      \"letter_spacing_px\": -1.93,\n      \"line_height\": 1.0,\n      \"align_x\": \"flex-start\",\n      \"align_y\": \"center\",\n      \"no_wrap\": true,\n      \"uppercase\": false,\n      \"underline\": false,\n      \"italic\": false\n    }\n  }\n]\n","language":"json"},"children":[{"$$mdtype":"Node","type":"text","attributes":{"content":"[\n  {\n    \"id\": \"text_5_svg\",\n    \"type\": \"image\",\n    \"subtype\": \"primary_copy\",\n    \"bbox\": { \"x\": 150.0, \"y\": 409.05, \"width\": 764.0, \"height\": 139.95 },\n    \"z_order\": 8,\n    \"asset_path\": \"https://temp.bria.ai/results/860f1a2b73f847e59f284d6f860f2ddb/text_5.svg\",\n    \"image_fit\": { \"object_fit\": \"contain\" }\n  },\n  {\n    \"id\": \"text_5_font\",\n    \"type\": \"text\",\n    \"subtype\": \"primary_copy\",\n    \"bbox\": { \"x\": 150.0, \"y\": 409.05, \"width\": 764.0, \"height\": 139.95 },\n    \"z_order\": 9,\n    \"hidden\": true,\n    \"text\": \"40% OFF*\",\n    \"text_style\": {\n      \"color\": \"#FFFFFF\",\n      \"font_family\": \"'Montserrat', 'Inter', 'Helvetica Neue', Arial, sans-serif\",\n      \"font_weight\": 900,\n      \"font_size_px\": 149.58,\n      \"letter_spacing_px\": -1.93,\n      \"line_height\": 1.0,\n      \"align_x\": \"flex-start\",\n      \"align_y\": \"center\",\n      \"no_wrap\": true,\n      \"uppercase\": false,\n      \"underline\": false,\n      \"italic\": false\n    }\n  }\n]\n"},"children":[]}]},{"$$mdtype":"Node","type":"heading","attributes":{"level":3,"id":"transformations/delayer-ad/request/rendering-the-ad-back","deepLinkHash":"/transformations/delayer-ad#transformations/delayer-ad/request/rendering-the-ad-back"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Rendering the ad back"},"children":[]}]}]},{"$$mdtype":"Node","type":"list","attributes":{"ordered":true,"marker":"."},"children":[{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Load every URL in "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"font_stylesheets"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", or text metrics will be wrong."},"children":[]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Drop every layer with "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"hidden: true"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", then sort the rest by "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"z_order"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Create a stage the size of "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"canvas"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" and absolutely position each layer at its "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"bbox"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Image layers become an "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"<img>"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" with the given "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"object-fit"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"; vector layers become a box with the fill; text layers become a flex box using "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"align_x"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" and "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"align_y"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"A minimal browser renderer that follows those rules:"},"children":[]}]}]},{"$$mdtype":"Node","type":"fence","attributes":{"content":"function renderAd(doc, stage) {\n  for (const href of doc.font_stylesheets ?? []) {\n    const link = document.createElement(\"link\");\n    link.rel = \"stylesheet\";\n    link.href = href;\n    document.head.appendChild(link);\n  }\n  Object.assign(stage.style, { position: \"relative\", width: `${doc.canvas.width}px`, height: `${doc.canvas.height}px` });\n\n  const layers = doc.layers.filter((l) => l.hidden !== true).sort((a, b) => a.z_order - b.z_order);\n  for (const layer of layers) {\n    let el;\n    if (layer.type === \"image\") {\n      el = document.createElement(\"img\");\n      el.src = layer.asset_path;\n      el.style.objectFit = layer.image_fit?.object_fit ?? \"contain\";\n      el.style.objectPosition = `${layer.image_fit?.object_position_x ?? \"center\"} ${layer.image_fit?.object_position_y ?? \"center\"}`;\n    } else if (layer.type === \"vector\") {\n      el = document.createElement(\"div\");\n      const s = layer.style ?? {};\n      if (s.background_color) el.style.background = s.background_color;\n      if (s.border_radius_px) el.style.borderRadius = `${s.border_radius_px}px`;\n      // background_gradient and box_shadow map onto CSS linear-gradient() and box-shadow\n    } else {\n      el = document.createElement(\"div\");\n      const t = layer.text_style;\n      el.textContent = layer.text;\n      Object.assign(el.style, {\n        display: \"flex\", justifyContent: t.align_x, alignItems: t.align_y,\n        color: t.color, fontFamily: t.font_family, fontWeight: t.font_weight,\n        fontSize: `${t.font_size_px}px`, lineHeight: t.line_height,\n        letterSpacing: `${t.letter_spacing_px ?? 0}px`, textAlign: t.text_align ?? \"left\",\n        whiteSpace: t.no_wrap ? \"nowrap\" : \"pre-wrap\",\n        textTransform: t.uppercase ? \"uppercase\" : \"none\",\n        textDecoration: t.underline ? \"underline\" : \"none\",\n        fontStyle: t.italic ? \"italic\" : \"normal\",\n      });\n    }\n    Object.assign(el.style, {\n      position: \"absolute\",\n      left: `${layer.bbox.x}px`, top: `${layer.bbox.y}px`,\n      width: `${layer.bbox.width}px`, height: `${layer.bbox.height}px`,\n    });\n    stage.appendChild(el);\n  }\n}\n","language":"javascript"},"children":[{"$$mdtype":"Node","type":"text","attributes":{"content":"function renderAd(doc, stage) {\n  for (const href of doc.font_stylesheets ?? []) {\n    const link = document.createElement(\"link\");\n    link.rel = \"stylesheet\";\n    link.href = href;\n    document.head.appendChild(link);\n  }\n  Object.assign(stage.style, { position: \"relative\", width: `${doc.canvas.width}px`, height: `${doc.canvas.height}px` });\n\n  const layers = doc.layers.filter((l) => l.hidden !== true).sort((a, b) => a.z_order - b.z_order);\n  for (const layer of layers) {\n    let el;\n    if (layer.type === \"image\") {\n      el = document.createElement(\"img\");\n      el.src = layer.asset_path;\n      el.style.objectFit = layer.image_fit?.object_fit ?? \"contain\";\n      el.style.objectPosition = `${layer.image_fit?.object_position_x ?? \"center\"} ${layer.image_fit?.object_position_y ?? \"center\"}`;\n    } else if (layer.type === \"vector\") {\n      el = document.createElement(\"div\");\n      const s = layer.style ?? {};\n      if (s.background_color) el.style.background = s.background_color;\n      if (s.border_radius_px) el.style.borderRadius = `${s.border_radius_px}px`;\n      // background_gradient and box_shadow map onto CSS linear-gradient() and box-shadow\n    } else {\n      el = document.createElement(\"div\");\n      const t = layer.text_style;\n      el.textContent = layer.text;\n      Object.assign(el.style, {\n        display: \"flex\", justifyContent: t.align_x, alignItems: t.align_y,\n        color: t.color, fontFamily: t.font_family, fontWeight: t.font_weight,\n        fontSize: `${t.font_size_px}px`, lineHeight: t.line_height,\n        letterSpacing: `${t.letter_spacing_px ?? 0}px`, textAlign: t.text_align ?? \"left\",\n        whiteSpace: t.no_wrap ? \"nowrap\" : \"pre-wrap\",\n        textTransform: t.uppercase ? \"uppercase\" : \"none\",\n        textDecoration: t.underline ? \"underline\" : \"none\",\n        fontStyle: t.italic ? \"italic\" : \"normal\",\n      });\n    }\n    Object.assign(el.style, {\n      position: \"absolute\",\n      left: `${layer.bbox.x}px`, top: `${layer.bbox.y}px`,\n      width: `${layer.bbox.width}px`, height: `${layer.bbox.height}px`,\n    });\n    stage.appendChild(el);\n  }\n}\n"},"children":[]}]},{"$$mdtype":"Node","type":"heading","attributes":{"level":3,"id":"transformations/delayer-ad/request/limits-and-retention","deepLinkHash":"/transformations/delayer-ad#transformations/delayer-ad/request/limits-and-retention"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Limits and retention"},"children":[]}]}]},{"$$mdtype":"Node","type":"table","attributes":{},"children":[{"$$mdtype":"Node","type":"thead","attributes":{},"children":[{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"th","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[]}]},{"$$mdtype":"Node","type":"th","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tbody","attributes":{},"children":[{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Input size"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Up to 10 MB, PNG, JPEG or WEBP"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Input dimensions"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Up to 2048 px per side. Enterprise accounts have no cap and receive full-resolution layers. "},"children":[]},{"$$mdtype":"Node","type":"link","inline":true,"attributes":{"href":"https://bria.ai/contact-us"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Contact us"},"children":[]}]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Retention"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"The layer document and every referenced asset stay downloadable for 30 days after the job reaches a terminal status"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Billing"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Failed jobs are not billed"},"children":[]}]}]}]}]}]},{"$$mdtype":"Node","type":"heading","attributes":{"level":3,"id":"transformations/delayer-ad/request/use-it-from-an-agent","deepLinkHash":"/transformations/delayer-ad#transformations/delayer-ad/request/use-it-from-an-agent"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Use it from an agent"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"The hosted and local "},"children":[]},{"$$mdtype":"Node","type":"link","inline":true,"attributes":{"href":"/mcp-authentication"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"MCP server"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" exposes this capability as the "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"ad_to_layers"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" tool; agents that write code can use the "},"children":[]},{"$$mdtype":"Node","type":"link","inline":true,"attributes":{"href":"/integration-methods/python-sdk"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Python SDK"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" as shown above."},"children":[]}]}]}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"api_token","scopes":[],"type":"apiKey","in":"header","paramName":"api_token","description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Your Bria API token, sent in the "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"api_token"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" request header on every call."},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Create and manage tokens in the "},"children":[]},{"$$mdtype":"Node","type":"link","inline":true,"attributes":{"href":"https://platform.bria.ai/organization-management/api-keys"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Bria Console"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_77","exampleIds":["paths/~1ads~1delayer/post/requestBody/content/application~1json/examples/basic","paths/~1ads~1delayer/post/requestBody/content/application~1json/examples/with_webhook"]}},"schemaId":"schema_77","exampleIds":["paths/~1ads~1delayer/post/requestBody/content/application~1json/examples/basic","paths/~1ads~1delayer/post/requestBody/content/application~1json/examples/with_webhook"],"pointer":"/paths/~1ads~1delayer/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/ads/delayer","servers":[{"url":"https://engine.prod.bria-api.com/v2"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"api_token","type":"apiKey","name":"api_token","in":"header"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_77","exampleIds":["paths/~1ads~1delayer/post/requestBody/content/application~1json/examples/basic","paths/~1ads~1delayer/post/requestBody/content/application~1json/examples/with_webhook"]}},"responseCodes":["200","400","401","413","422","429","5XX"],"pointer":"/ads/delayer","href":"transformations/delayer-ad","openApiOperationId":"delayer-ad","summary":"Decompose an ad into layers"},"definitionSamples":[{"lang":"Python","label":"Python (bria-client)","source":"from bria_client import BriaSyncClient\n\nclient = BriaSyncClient()  # reads BRIA_API_TOKEN\n\njob = client.submit(\n    endpoint=\"ads/delayer\",\n    payload={\n        \"attachments\": [\n            \"https://bria-image-repository.s3.amazonaws.com/images/c41b39ec1a69a5d3.jpg\",\n        ],\n    },\n)\nresult = client.poll(job, interval=2, timeout=120)\nprint(result.result.url)\n"},{"lang":"JavaScript","label":"TypeScript (@bria-ai/client)","source":"import { BriaClient } from \"@bria-ai/client\";\n\nconst client = new BriaClient(); // reads BRIA_API_TOKEN\n\nconst job = await client.submit(\"ads/delayer\", {\n  attachments: [\n    \"https://bria-image-repository.s3.amazonaws.com/images/c41b39ec1a69a5d3.jpg\",\n  ],\n});\nconst result = await client.poll(job, { interval: 2, timeout: 120 });\nconsole.log(result.result?.url);\n"}],"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://engine.prod.bria-api.com/v2"}],"schemaId":"schema_77","exampleIds":["paths/~1ads~1delayer/post/requestBody/content/application~1json/examples/basic","paths/~1ads~1delayer/post/requestBody/content/application~1json/examples/with_webhook"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_77","exampleIds":["paths/~1ads~1delayer/post/requestBody/content/application~1json/examples/basic","paths/~1ads~1delayer/post/requestBody/content/application~1json/examples/with_webhook"]}},"examples":[{},{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Accepted (asynchronous). Track progress with the "},"children":[]},{"$$mdtype":"Node","type":"link","inline":true,"attributes":{"href":"/status"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Status Service"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" or a webhook; the completion payload is shown under Callbacks."},"children":[]}]}]}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/AsyncInitialResponse","exampleIds":["paths/~1ads~1delayer/post/responses/200/content/application~1json/example"]}},"schemaId":"components/schemas/AsyncInitialResponse","exampleIds":["paths/~1ads~1delayer/post/responses/200/content/application~1json/example"]},{"code":"400","description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Bad request. No image supplied in "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"attachments"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/ErrorResponse"}},"schemaId":"components/schemas/ErrorResponse"},{"code":"401","description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Unauthorized. Missing or invalid "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"api_token"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/ErrorResponse"}},"schemaId":"components/schemas/ErrorResponse"},{"code":"413","description":"Request body over the platform cap.","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/ErrorResponse"}},"schemaId":"components/schemas/ErrorResponse"},{"code":"422","description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Unprocessable Entity. More than one entry in "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"attachments"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", an invalid value for a supported field, or an image over the 2048 px per-dimension cap. Cap rejections carry the message "},"children":[]},{"$$mdtype":"Node","type":"em","inline":true,"attributes":{"marker":"*"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"\"Image exceeds 2048 px per dimension on this endpoint. Resize the source image, or use full-resolution as an enterprise user at Bria.ai/contact-us.\""},"children":[]}]}]}]}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/ErrorResponse","exampleIds":["paths/~1ads~1delayer/post/responses/422/content/application~1json/example"]}},"schemaId":"components/schemas/ErrorResponse","exampleIds":["paths/~1ads~1delayer/post/responses/422/content/application~1json/example"]},{"code":"429","description":"Request limit exceeded.","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/ErrorResponse"}},"schemaId":"components/schemas/ErrorResponse"},{"code":"5XX","description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Internal Server Error. The image could not be fetched or decoded, or the pipeline failed. Submit again; if it persists, contact support and quote the "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"status_url"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" of the run."},"children":[]}]}]}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/ErrorResponse"}},"schemaId":"components/schemas/ErrorResponse"}],"pointer":"/paths/~1ads~1delayer/post/responses"}],"panels":[{"children":[{"kind":"response","headerTitle":"Response","responseCodes":[{"code":"200","schemaId":"components/schemas/AsyncInitialResponse","exampleIds":["paths/~1ads~1delayer/post/responses/200/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/AsyncInitialResponse","exampleIds":["paths/~1ads~1delayer/post/responses/200/content/application~1json/example"]}}},{"code":"400","schemaId":"components/schemas/ErrorResponse","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/ErrorResponse"}}},{"code":"401","schemaId":"components/schemas/ErrorResponse","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/ErrorResponse"}}},{"code":"413","schemaId":"components/schemas/ErrorResponse","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/ErrorResponse"}}},{"code":"422","schemaId":"components/schemas/ErrorResponse","exampleIds":["paths/~1ads~1delayer/post/responses/422/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/ErrorResponse","exampleIds":["paths/~1ads~1delayer/post/responses/422/content/application~1json/example"]}}},{"code":"429","schemaId":"components/schemas/ErrorResponse","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/ErrorResponse"}}},{"code":"5XX","schemaId":"components/schemas/ErrorResponse","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/ErrorResponse"}}}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Callbacks","labelTranslationKey":"callbacks","deepLinkSuffix":"callbacks"}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"item-content","variant":"callback","callback":{"httpVerb":"post","pathName":"{$request.body#/webhook_url}","summary":"Completion payload (webhook or status poll)","description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Delivered to "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"webhook_url"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" when the job reaches a terminal state, signed as described in "},"children":[]},{"$$mdtype":"Node","type":"link","inline":true,"attributes":{"href":"/getting-started/async-requests#webhooks"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"webhooks"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":". Polling the "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"status_url"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" returns the same body, so one parser handles both."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"status"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" runs "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"IN_PROGRESS"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" to "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"COMPLETED"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" or "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"ERROR"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" and never moves backwards. An unrecognized or expired id polls as "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"UNKNOWN"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" with HTTP 200; treat it as not found and stop polling. On completion "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"result.url"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" is the hosted layer document."},"children":[]}]}]}],"callbackName":"jobCompleted","callbackId":"jobCompleted/post","contentChildren":[{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"components/schemas/DelayerCompletionPayload","exampleIds":["paths/~1ads~1delayer/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/completed","paths/~1ads~1delayer/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/in_progress","paths/~1ads~1delayer/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/failed","paths/~1ads~1delayer/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/unknown_id"]}},"schemaId":"components/schemas/DelayerCompletionPayload","exampleIds":["paths/~1ads~1delayer/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/completed","paths/~1ads~1delayer/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/in_progress","paths/~1ads~1delayer/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/failed","paths/~1ads~1delayer/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/unknown_id"],"pointer":"/paths/~1ads~1delayer/post/callbacks/jobCompleted/post/requestBody"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Return any 2xx within 10 seconds to acknowledge the delivery. Non-2xx responses are retried with exponential backoff."}],"pointer":"/paths/~1ads~1delayer/post/callbacks/jobCompleted/post/responses"}]},"pointer":"/paths/~1ads~1delayer/post/callbacks"}],"panels":[{"children":[{"kind":"callback-payload","callbackName":"jobCompleted/post","path":"{$request.body#/webhook_url}","httpVerb":"post","mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_78","exampleIds":["paths/~1ads~1delayer/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/completed","paths/~1ads~1delayer/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/in_progress","paths/~1ads~1delayer/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/failed","paths/~1ads~1delayer/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/unknown_id"]}},"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/transformations/delayer-ad"}],"panels":[]}]},"httpPath":"/ads/delayer"},{"label":"Resize an ad into other sizes","deprecated":false,"httpVerb":"post","isAdditionalOperation":false,"isWebhook":false,"type":"link","link":"/ads/transformations/resize-ad","routeSlug":"/ads/transformations/resize-ad","metadata":{"seo":{"title":"Resize an ad into other sizes","description":"Send one finished, flat ad and up to ten target sizes; get back one finished image per size, with the layout redone for each shape rather than cropped or stretched. Trained exclusively on licensed data for safe commercial use."}},"content":{"contentType":"item","itemVariant":"httpItem","meta":{"sourceId":"resize-ad","name":"Resize an ad into other sizes","isWebhook":false,"pointer":"/paths/~1ads~1resize/post","hasSamples":true},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Resize an ad into other sizes","isWebhook":false,"showPageActions":true}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Request","labelTranslationKey":"request","deepLinkSuffix":"request"},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Send one finished, flat ad and up to ten target sizes; get back one finished image per size, with the layout redone for each shape rather than cropped or stretched. Trained exclusively on licensed data for safe commercial use."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Input assumptions"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"The input is assumed to be a flat ad. PSD and Figma files are not inputs. The job is asynchronous only; "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"\"sync\": true"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" is rejected with "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"400"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":". On plans other than Enterprise, a source over 2048 px on either side is downscaled to fit before resizing, the outputs still come back at the requested sizes, and "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"result.text"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" says so. Submissions are not idempotent: a retried POST is a new job. Failed jobs are never billed."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Reporting a problem"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"The "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"request_id"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" in an error body identifies that response, not your job. The durable handle is the id inside the "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"status_url"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" you received at submit; quote that."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Ad Resize takes one finished, flat ad and returns it at other sizes, with the layout redone for each shape rather than cropped or stretched. Send the image and a list of target sizes; get one finished image per size back. Use it to turn a single creative into every placement a campaign needs, from a square feed post to a leaderboard, without a design file."},"children":[]}]}]},{"$$mdtype":"Node","type":"table","attributes":{},"children":[{"$$mdtype":"Node","type":"thead","attributes":{},"children":[{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"th","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"You send"},"children":[]}]}]},{"$$mdtype":"Node","type":"th","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"You get back"},"children":[]}]}]}]}]},{"$$mdtype":"Node","type":"tbody","attributes":{},"children":[{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"One flat ad image (PNG or JPEG) and up to 10 target sizes, each with a name and a width and height in pixels"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"One hosted image per target size, at exactly the pixels requested, laid out again from the ad's layers"},"children":[]}]}]}]}]}]},{"$$mdtype":"Node","type":"heading","attributes":{"level":3,"id":"transformations/resize-ad/request/how-a-resize-job-runs","deepLinkHash":"/transformations/resize-ad#transformations/resize-ad/request/how-a-resize-job-runs"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"How a resize job runs"},"children":[]}]}]},{"$$mdtype":"Node","type":"list","attributes":{"ordered":true,"marker":"."},"children":[{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Submit"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" the ad and its target sizes. The API returns a "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"request_id"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" and a "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"status_url"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" immediately."},"children":[]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Wait"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" for completion by polling the "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"status_url"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" (the shared "},"children":[]},{"$$mdtype":"Node","type":"link","inline":true,"attributes":{"href":"/status"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"status endpoint"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":") every few seconds, or pass a "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"webhook_url"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" and let Bria POST the result to you ("},"children":[]},{"$$mdtype":"Node","type":"link","inline":true,"attributes":{"href":"/getting-started/async-requests#webhooks"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"webhooks"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"). Both deliver the same body."},"children":[]}]}]},{"$$mdtype":"Node","type":"item","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Download the images."},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" The completed status body carries "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"result.results"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", one entry per target size, each with a hosted "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"url"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Every size is laid out again from the ad's layers, so a call takes several minutes and finishes when its slowest size does. Set a poll timeout of at least 20 minutes."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Python SDK"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"fence","attributes":{"content":"from bria_client import BriaSyncClient\n\nclient = BriaSyncClient()  # reads BRIA_API_TOKEN\n\njob = client.submit(\n    endpoint=\"ads/resize\",\n    payload={\n        \"attachments\": [\"https://example.com/ads/spring-sale.jpg\"],\n        \"formats\": [\n            {\"name\": \"feed\", \"width\": 1080, \"height\": 1080},\n            {\"name\": \"story\", \"width\": 1080, \"height\": 1920},\n            {\"name\": \"leaderboard\", \"width\": 970, \"height\": 90},\n        ],\n    },\n)\nstatus = client.poll(job, interval=10, timeout=1200)\n\nfor target in status.result.results:\n    print(target[\"name\"], target[\"status\"], target[\"strategy\"], target[\"url\"])\n","language":"python"},"children":[{"$$mdtype":"Node","type":"text","attributes":{"content":"from bria_client import BriaSyncClient\n\nclient = BriaSyncClient()  # reads BRIA_API_TOKEN\n\njob = client.submit(\n    endpoint=\"ads/resize\",\n    payload={\n        \"attachments\": [\"https://example.com/ads/spring-sale.jpg\"],\n        \"formats\": [\n            {\"name\": \"feed\", \"width\": 1080, \"height\": 1080},\n            {\"name\": \"story\", \"width\": 1080, \"height\": 1920},\n            {\"name\": \"leaderboard\", \"width\": 970, \"height\": 90},\n        ],\n    },\n)\nstatus = client.poll(job, interval=10, timeout=1200)\n\nfor target in status.result.results:\n    print(target[\"name\"], target[\"status\"], target[\"strategy\"], target[\"url\"])\n"},"children":[]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"TypeScript SDK"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"fence","attributes":{"content":"import { BriaClient } from \"@bria-ai/client\";\n\nconst client = new BriaClient(); // reads BRIA_API_TOKEN\n\n// 1 + 2. Submit and wait\nconst job = await client.submit(\"ads/resize\", {\n  attachments: [\"https://example.com/ads/spring-sale.jpg\"],\n  formats: [\n    { name: \"feed\", width: 1080, height: 1080 },\n    { name: \"story\", width: 1080, height: 1920 },\n    { name: \"leaderboard\", width: 970, height: 90 },\n  ],\n});\nconst status = await client.poll(job, { interval: 10, timeout: 1200 });\n\n// 3. One entry per target size\ntype Target = { name: string; status: string; strategy: string | null; url: string | null; error: string | null };\nfor (const target of (status.result?.results ?? []) as Target[]) {\n  console.log(target.name, target.status, target.strategy, target.url);\n}\n","language":"typescript"},"children":[{"$$mdtype":"Node","type":"text","attributes":{"content":"import { BriaClient } from \"@bria-ai/client\";\n\nconst client = new BriaClient(); // reads BRIA_API_TOKEN\n\n// 1 + 2. Submit and wait\nconst job = await client.submit(\"ads/resize\", {\n  attachments: [\"https://example.com/ads/spring-sale.jpg\"],\n  formats: [\n    { name: \"feed\", width: 1080, height: 1080 },\n    { name: \"story\", width: 1080, height: 1920 },\n    { name: \"leaderboard\", width: 970, height: 90 },\n  ],\n});\nconst status = await client.poll(job, { interval: 10, timeout: 1200 });\n\n// 3. One entry per target size\ntype Target = { name: string; status: string; strategy: string | null; url: string | null; error: string | null };\nfor (const target of (status.result?.results ?? []) as Target[]) {\n  console.log(target.name, target.status, target.strategy, target.url);\n}\n"},"children":[]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"strong","inline":true,"attributes":{"marker":"**"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"cURL"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"fence","attributes":{"content":"curl -s -X POST https://engine.prod.bria-api.com/v2/ads/resize \\\n  -H \"api_token: $BRIA_API_TOKEN\" -H \"Content-Type: application/json\" \\\n  -d '{\n    \"attachments\": [\"https://example.com/ads/spring-sale.jpg\"],\n    \"formats\": [\n      {\"name\": \"feed\", \"width\": 1080, \"height\": 1080},\n      {\"name\": \"story\", \"width\": 1080, \"height\": 1920},\n      {\"name\": \"leaderboard\", \"width\": 970, \"height\": 90}\n    ]\n  }'\n\ncurl -s \"https://engine.prod.bria-api.com/v2/status/<request_id>\" -H \"api_token: $BRIA_API_TOKEN\"\n\ncurl -s \"https://engine.prod.bria-api.com/v2/status/<request_id>\" -H \"api_token: $BRIA_API_TOKEN\" \\\n  | jq '.result.results[] | {name, status, strategy, url}'\n","language":"bash"},"children":[{"$$mdtype":"Node","type":"text","attributes":{"content":"curl -s -X POST https://engine.prod.bria-api.com/v2/ads/resize \\\n  -H \"api_token: $BRIA_API_TOKEN\" -H \"Content-Type: application/json\" \\\n  -d '{\n    \"attachments\": [\"https://example.com/ads/spring-sale.jpg\"],\n    \"formats\": [\n      {\"name\": \"feed\", \"width\": 1080, \"height\": 1080},\n      {\"name\": \"story\", \"width\": 1080, \"height\": 1920},\n      {\"name\": \"leaderboard\", \"width\": 970, \"height\": 90}\n    ]\n  }'\n\ncurl -s \"https://engine.prod.bria-api.com/v2/status/<request_id>\" -H \"api_token: $BRIA_API_TOKEN\"\n\ncurl -s \"https://engine.prod.bria-api.com/v2/status/<request_id>\" -H \"api_token: $BRIA_API_TOKEN\" \\\n  | jq '.result.results[] | {name, status, strategy, url}'\n"},"children":[]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"The completed status body looks like this:"},"children":[]}]}]},{"$$mdtype":"Node","type":"fence","attributes":{"content":"{\n  \"request_id\": \"340780795e1b4530a5c7ee4563989f6f\",\n  \"status\": \"COMPLETED\",\n  \"result\": {\n    \"status\": \"completed\",\n    \"results\": [\n      {\n        \"name\": \"feed\",\n        \"width\": 1080,\n        \"height\": 1080,\n        \"status\": \"ok\",\n        \"strategy\": \"delayer_dispatch\",\n        \"url\": \"https://editor-media.bria.ai/inventory/.../assets/7b4549c24686472bac04bcfd023a1f0e.png\",\n        \"error\": null\n      },\n      {\n        \"name\": \"leaderboard\",\n        \"width\": 970,\n        \"height\": 90,\n        \"status\": \"ok\",\n        \"strategy\": \"delayer_dispatch\",\n        \"url\": \"https://editor-media.bria.ai/inventory/.../assets/860865425a3f4d349dc79d8826e0c2b4.png\",\n        \"error\": null\n      }\n    ]\n  }\n}\n","language":"json"},"children":[{"$$mdtype":"Node","type":"text","attributes":{"content":"{\n  \"request_id\": \"340780795e1b4530a5c7ee4563989f6f\",\n  \"status\": \"COMPLETED\",\n  \"result\": {\n    \"status\": \"completed\",\n    \"results\": [\n      {\n        \"name\": \"feed\",\n        \"width\": 1080,\n        \"height\": 1080,\n        \"status\": \"ok\",\n        \"strategy\": \"delayer_dispatch\",\n        \"url\": \"https://editor-media.bria.ai/inventory/.../assets/7b4549c24686472bac04bcfd023a1f0e.png\",\n        \"error\": null\n      },\n      {\n        \"name\": \"leaderboard\",\n        \"width\": 970,\n        \"height\": 90,\n        \"status\": \"ok\",\n        \"strategy\": \"delayer_dispatch\",\n        \"url\": \"https://editor-media.bria.ai/inventory/.../assets/860865425a3f4d349dc79d8826e0c2b4.png\",\n        \"error\": null\n      }\n    ]\n  }\n}\n"},"children":[]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Each target is independent: one can be "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"\"status\": \"failed\""},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" with an "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"error"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" while the others carry a "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"url"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":". Check every entry rather than the job as a whole."},"children":[]}]}]},{"$$mdtype":"Node","type":"heading","attributes":{"level":3,"id":"transformations/resize-ad/request/how-a-size-is-made","deepLinkHash":"/transformations/resize-ad#transformations/resize-ad/request/how-a-size-is-made"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"How a size is made"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Every size is produced the same way: the "},"children":[]},{"$$mdtype":"Node","type":"link","inline":true,"attributes":{"href":"/ads"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Ad Delayer"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" separates the ad into layers, Bria's layout engine composes them for the new shape, and the text stays text. The "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"strategy"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" field on each result names that route, "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"delayer_dispatch"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":". It takes several minutes per call, and every image is Bria-made."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"An optional "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"prompt"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" steers the layout, for example "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"\"keep the logo in the top-left corner\""},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]},{"$$mdtype":"Node","type":"heading","attributes":{"level":3,"id":"transformations/resize-ad/request/resize-request-essentials","deepLinkHash":"/transformations/resize-ad#transformations/resize-ad/request/resize-request-essentials"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Resize request essentials"},"children":[]}]}]},{"$$mdtype":"Node","type":"table","attributes":{},"children":[{"$$mdtype":"Node","type":"thead","attributes":{},"children":[{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"th","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Parameter"},"children":[]}]}]},{"$$mdtype":"Node","type":"th","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Description"},"children":[]}]}]}]}]},{"$$mdtype":"Node","type":"tbody","attributes":{},"children":[{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"attachments"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Exactly one image: a public URL or a "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"data:image/…;base64,…"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" URI. PNG or JPEG. Required."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"formats"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"One to ten target sizes. Each has a "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"name"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" (echoed back on its result), and a "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"width"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" and "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"height"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" in pixels, both greater than zero. Required."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"prompt"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Optional guidance for how the ad should adapt to each size."},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"webhook_url"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Optional. Receive the completion body by POST instead of polling."},"children":[]}]}]}]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"The job is asynchronous only. A request with "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"\"sync\": true"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" is rejected with "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"400"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", because a layered target can run for minutes. Inputs are assumed to be flat ads; PSD and Figma files are not inputs. Submissions are not idempotent: a retried POST is a new job. Failed jobs are never billed."},"children":[]}]}]},{"$$mdtype":"Node","type":"heading","attributes":{"level":3,"id":"transformations/resize-ad/request/source-resolution","deepLinkHash":"/transformations/resize-ad#transformations/resize-ad/request/source-resolution"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Source resolution"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"On plans other than Enterprise, a source over 2048 px on either side is downscaled to fit 2048 px before resizing. The outputs still come back at the exact sizes requested, and the completed body carries a "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"result.text"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" note saying the source was downscaled. Enterprise accounts resize at full source resolution and receive no note. "},"children":[]},{"$$mdtype":"Node","type":"link","inline":true,"attributes":{"href":"https://bria.ai/contact-us"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Contact us"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" about Enterprise."},"children":[]}]}]},{"$$mdtype":"Node","type":"heading","attributes":{"level":3,"id":"transformations/resize-ad/request/limits","deepLinkHash":"/transformations/resize-ad#transformations/resize-ad/request/limits"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Limits"},"children":[]}]}]},{"$$mdtype":"Node","type":"table","attributes":{},"children":[{"$$mdtype":"Node","type":"thead","attributes":{},"children":[{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"th","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[]}]},{"$$mdtype":"Node","type":"th","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tbody","attributes":{},"children":[{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Target sizes"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"1 to 10 per call, any width and height in pixels"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Input format"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"PNG or JPEG, one image per call"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Source resolution"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Full resolution on Enterprise; downscaled to 2048 px per side on other plans, with a note in the response"},"children":[]}]}]}]},{"$$mdtype":"Node","type":"tr","attributes":{},"children":[{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Billing"},"children":[]}]}]},{"$$mdtype":"Node","type":"td","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Failed jobs are not billed"},"children":[]}]}]}]}]}]},{"$$mdtype":"Node","type":"heading","attributes":{"level":3,"id":"transformations/resize-ad/request/use-resize-from-an-agent","deepLinkHash":"/transformations/resize-ad#transformations/resize-ad/request/use-resize-from-an-agent"},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Use resize from an agent"},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"The hosted and local "},"children":[]},{"$$mdtype":"Node","type":"link","inline":true,"attributes":{"href":"/mcp-authentication"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"MCP server"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" exposes this capability as the "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"ad_resize"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" tool; agents that write code can use the "},"children":[]},{"$$mdtype":"Node","type":"link","inline":true,"attributes":{"href":"/integration-methods/python-sdk"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Python SDK"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" as shown above. To make the ad editable first, or to change its copy before resizing, run the "},"children":[]},{"$$mdtype":"Node","type":"link","inline":true,"attributes":{"href":"/ads"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Ad Delayer"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]}]},{"nodeType":"security","requirements":[{"schemes":[{"name":"api_token","scopes":[],"type":"apiKey","in":"header","paramName":"api_token","description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Your Bria API token, sent in the "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"api_token"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" request header on every call."},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Create and manage tokens in the "},"children":[]},{"$$mdtype":"Node","type":"link","inline":true,"attributes":{"href":"https://platform.bria.ai/organization-management/api-keys"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Bria Console"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]}]}]}]},{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_79","exampleIds":["paths/~1ads~1resize/post/requestBody/content/application~1json/examples/placements","paths/~1ads~1resize/post/requestBody/content/application~1json/examples/with_prompt_and_webhook"]}},"schemaId":"schema_79","exampleIds":["paths/~1ads~1resize/post/requestBody/content/application~1json/examples/placements","paths/~1ads~1resize/post/requestBody/content/application~1json/examples/with_prompt_and_webhook"],"pointer":"/paths/~1ads~1resize/post/requestBody"}],"panels":[{"children":[{"kind":"code-sample","source":{"kind":"code-sample","operationType":"http","method":"POST","path":"/ads/resize","servers":[{"url":"https://engine.prod.bria-api.com/v2"}],"parameters":{"path":[],"query":[],"querystring":[],"header":[],"cookie":[]},"security":[{"schemes":[{"id":"api_token","type":"apiKey","name":"api_token","in":"header"}],"scopes":[]}],"requestBody":{"application/json":{"schemaId":"schema_79","exampleIds":["paths/~1ads~1resize/post/requestBody/content/application~1json/examples/placements","paths/~1ads~1resize/post/requestBody/content/application~1json/examples/with_prompt_and_webhook"]}},"responseCodes":["202","400","401","413","422","429","5XX"],"pointer":"/ads/resize","href":"transformations/resize-ad","openApiOperationId":"resize-ad","summary":"Resize an ad into other sizes"},"definitionSamples":[{"lang":"Python","label":"Python (bria-client)","source":"from bria_client import BriaSyncClient\n\nclient = BriaSyncClient()  # reads BRIA_API_TOKEN\n\njob = client.submit(\n    endpoint=\"ads/resize\",\n    payload={\n        \"attachments\": [\n            \"https://bria-image-repository.s3.amazonaws.com/images/c41b39ec1a69a5d3.jpg\",\n        ],\n        \"formats\": [\n            {\n                \"name\": \"feed\",\n                \"width\": 1080,\n                \"height\": 1080,\n            },\n            {\n                \"name\": \"story\",\n                \"width\": 1080,\n                \"height\": 1920,\n            },\n            {\n                \"name\": \"leaderboard\",\n                \"width\": 970,\n                \"height\": 90,\n            },\n        ],\n    },\n)\nresult = client.poll(job, interval=10, timeout=1200)\nprint(result.result.results)\n"},{"lang":"JavaScript","label":"TypeScript (@bria-ai/client)","source":"import { BriaClient } from \"@bria-ai/client\";\n\nconst client = new BriaClient(); // reads BRIA_API_TOKEN\n\nconst job = await client.submit(\"ads/resize\", {\n  attachments: [\n    \"https://bria-image-repository.s3.amazonaws.com/images/c41b39ec1a69a5d3.jpg\",\n  ],\n  formats: [\n    {\n      name: \"feed\",\n      width: 1080,\n      height: 1080,\n    },\n    {\n      name: \"story\",\n      width: 1080,\n      height: 1920,\n    },\n    {\n      name: \"leaderboard\",\n      width: 970,\n      height: 90,\n    },\n  ],\n});\nconst result = await client.poll(job, { interval: 10, timeout: 1200 });\nconsole.log(result.result?.results);\n"}],"isWebhook":false,"hideReplay":false,"servers":[{"url":"https://engine.prod.bria-api.com/v2"}],"schemaId":"schema_79","exampleIds":["paths/~1ads~1resize/post/requestBody/content/application~1json/examples/placements","paths/~1ads~1resize/post/requestBody/content/application~1json/examples/with_prompt_and_webhook"],"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_79","exampleIds":["paths/~1ads~1resize/post/requestBody/content/application~1json/examples/placements","paths/~1ads~1resize/post/requestBody/content/application~1json/examples/with_prompt_and_webhook"]}},"examples":[{},{}]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Responses","labelTranslationKey":"responses","deepLinkSuffix":"responses"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"202","description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Accepted (asynchronous). Track progress with the "},"children":[]},{"$$mdtype":"Node","type":"link","inline":true,"attributes":{"href":"/status"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Status Service"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" or a webhook; the completion payload is shown under Callbacks."},"children":[]}]}]}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/AsyncInitialResponse","exampleIds":["paths/~1ads~1resize/post/responses/202/content/application~1json/example"]}},"schemaId":"components/schemas/AsyncInitialResponse","exampleIds":["paths/~1ads~1resize/post/responses/202/content/application~1json/example"]},{"code":"400","description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Bad request. "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"sync"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" was "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"true"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", or no image was supplied in "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"attachments"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":". Ad Resize runs asynchronously only."},"children":[]}]}]}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/ErrorResponse","exampleIds":["paths/~1ads~1resize/post/responses/400/content/application~1json/example"]}},"schemaId":"components/schemas/ErrorResponse","exampleIds":["paths/~1ads~1resize/post/responses/400/content/application~1json/example"]},{"code":"401","description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Unauthorized. Missing or invalid "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"api_token"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/ErrorResponse"}},"schemaId":"components/schemas/ErrorResponse"},{"code":"413","description":"Request body over the platform cap.","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/ErrorResponse"}},"schemaId":"components/schemas/ErrorResponse"},{"code":"422","description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Unprocessable Entity. More than one entry in "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"attachments"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", an attachment that is neither a URL nor base64, no "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"formats"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", more than ten of them, or a "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"width"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" or "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"height"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" that is not greater than zero."},"children":[]}]}]}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/ErrorResponse","exampleIds":["paths/~1ads~1resize/post/responses/422/content/application~1json/example"]}},"schemaId":"components/schemas/ErrorResponse","exampleIds":["paths/~1ads~1resize/post/responses/422/content/application~1json/example"]},{"code":"429","description":"Request limit exceeded.","mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/ErrorResponse"}},"schemaId":"components/schemas/ErrorResponse"},{"code":"5XX","description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Internal Server Error. The pipeline failed. Submit again; if it persists, contact support and quote the "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"status_url"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" of the run."},"children":[]}]}]}],"mediaType":"application/json","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/ErrorResponse"}},"schemaId":"components/schemas/ErrorResponse"}],"pointer":"/paths/~1ads~1resize/post/responses"}],"panels":[{"children":[{"kind":"response","headerTitle":"Response","responseCodes":[{"code":"202","schemaId":"components/schemas/AsyncInitialResponse","exampleIds":["paths/~1ads~1resize/post/responses/202/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/AsyncInitialResponse","exampleIds":["paths/~1ads~1resize/post/responses/202/content/application~1json/example"]}}},{"code":"400","schemaId":"components/schemas/ErrorResponse","exampleIds":["paths/~1ads~1resize/post/responses/400/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/ErrorResponse","exampleIds":["paths/~1ads~1resize/post/responses/400/content/application~1json/example"]}}},{"code":"401","schemaId":"components/schemas/ErrorResponse","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/ErrorResponse"}}},{"code":"413","schemaId":"components/schemas/ErrorResponse","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/ErrorResponse"}}},{"code":"422","schemaId":"components/schemas/ErrorResponse","exampleIds":["paths/~1ads~1resize/post/responses/422/content/application~1json/example"],"mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/ErrorResponse","exampleIds":["paths/~1ads~1resize/post/responses/422/content/application~1json/example"]}}},{"code":"429","schemaId":"components/schemas/ErrorResponse","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/ErrorResponse"}}},{"code":"5XX","schemaId":"components/schemas/ErrorResponse","mediaTypes":["application/json"],"mediaTypeContent":{"application/json":{"schemaId":"components/schemas/ErrorResponse"}}}],"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"header","level":4,"label":"Callbacks","labelTranslationKey":"callbacks","deepLinkSuffix":"callbacks"}],"panels":[]},{"nodeType":"container","children":[{"nodeType":"item-content","variant":"callback","callback":{"httpVerb":"post","pathName":"{$request.body#/webhook_url}","summary":"Completion payload (webhook or status poll)","description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Delivered to "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"webhook_url"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" when the job reaches a terminal state, signed as described in "},"children":[]},{"$$mdtype":"Node","type":"link","inline":true,"attributes":{"href":"/getting-started/async-requests#webhooks"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"webhooks"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":". Polling the "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"status_url"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" returns the same body, so one parser handles both."},"children":[]}]}]},{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"status"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" runs "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"IN_PROGRESS"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" to "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"COMPLETED"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" or "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"ERROR"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" and never moves backwards. An unrecognized or expired id polls as "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"UNKNOWN"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" with HTTP 200; treat it as not found and stop polling. On completion "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"result.results"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" carries one entry per target size."},"children":[]}]}]}],"callbackName":"jobCompleted","callbackId":"jobCompleted/post","contentChildren":[{"nodeType":"item-content","variant":"body","label":"Request Body","labelTranslationKey":"body","required":true,"mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"components/schemas/ResizeCompletionPayload","exampleIds":["paths/~1ads~1resize/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/completed","paths/~1ads~1resize/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/downscaled","paths/~1ads~1resize/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/in_progress","paths/~1ads~1resize/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/failed","paths/~1ads~1resize/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/unknown_id"]}},"schemaId":"components/schemas/ResizeCompletionPayload","exampleIds":["paths/~1ads~1resize/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/completed","paths/~1ads~1resize/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/downscaled","paths/~1ads~1resize/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/in_progress","paths/~1ads~1resize/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/failed","paths/~1ads~1resize/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/unknown_id"],"pointer":"/paths/~1ads~1resize/post/callbacks/jobCompleted/post/requestBody"},{"nodeType":"item-content","variant":"responses","responses":[{"code":"200","description":"Return any 2xx within 10 seconds to acknowledge the delivery. Non-2xx responses are retried with exponential backoff."}],"pointer":"/paths/~1ads~1resize/post/callbacks/jobCompleted/post/responses"}]},"pointer":"/paths/~1ads~1resize/post/callbacks"}],"panels":[{"children":[{"kind":"callback-payload","callbackName":"jobCompleted/post","path":"{$request.body#/webhook_url}","httpVerb":"post","mediaTypes":["application/json"],"mediaTypeSchemas":{"application/json":{"schemaId":"schema_80","exampleIds":["paths/~1ads~1resize/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/completed","paths/~1ads~1resize/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/downscaled","paths/~1ads~1resize/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/in_progress","paths/~1ads~1resize/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/failed","paths/~1ads~1resize/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/unknown_id"]}},"examples":[]}]}]},{"nodeType":"container","children":[{"nodeType":"feedback","pageSlug":"/transformations/resize-ad"}],"panels":[]}]},"httpPath":"/ads/resize"}],"content":{"contentType":"group","meta":{"name":"Transformations"},"children":[{"nodeType":"container","children":[{"nodeType":"header","level":2,"label":"Transformations","showPageActions":true},{"nodeType":"markdoc","content":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"One call submits a job. Track it with the shared "},"children":[]},{"$$mdtype":"Node","type":"link","inline":true,"attributes":{"href":"/status"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"status endpoint"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" or a "},"children":[]},{"$$mdtype":"Node","type":"link","inline":true,"attributes":{"href":"/getting-started/async-requests#webhooks"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"webhook"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"; each completion payload is documented as a callback on its endpoint."},"children":[]}]}]}]}],"panels":[{"children":[{"kind":"group-items","title":"Operations","titleTranslationKey":"operations","items":[{"title":"/ads/delayer","summary":"Decompose an ad into layers","prefix":{"name":"post","color":"post"},"badges":[],"link":"/transformations/delayer-ad","deprecated":false},{"title":"/ads/resize","summary":"Resize an ad into other sizes","prefix":{"name":"post","color":"post"},"badges":[],"link":"/transformations/resize-ad","deprecated":false}]}]}]}]}}],"store":{"schemaStore":{"components/schemas/AsyncInitialResponse":{"id":"components/schemas/AsyncInitialResponse","kind":"json-schema","title":"AsyncInitialResponse","data":{"type":"object","properties":{"request_id":{"type":"string","example":"860f1a2b73f847e59f284d6f860f2ddb"},"status_url":{"type":"string","example":"https://engine.prod.bria-api.com/v2/status/860f1a2b73f847e59f284d6f860f2ddb"}},"required":["request_id","status_url"]}},"components/schemas/DelayerCompletionPayload":{"id":"components/schemas/DelayerCompletionPayload","kind":"json-schema","title":"DelayerCompletionPayload","data":{"type":"object","description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"The body delivered to "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"webhook_url"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" and returned by the status endpoint for this job."},"children":[]}]}]}],"properties":{"request_id":{"type":"string","example":"860f1a2b73f847e59f284d6f860f2ddb"},"status":{"type":"string","enum":["IN_PROGRESS","COMPLETED","ERROR","UNKNOWN"],"description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"IN_PROGRESS"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"COMPLETED"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"ERROR"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", or "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"UNKNOWN"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" for an unrecognized or expired id (returned with HTTP 200 on a poll). Never moves backwards."},"children":[]}]}]}]},"result":{"type":"object","description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Present when "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"status"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" is "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"COMPLETED"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":". A pointer to the hosted result: fetch "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"url"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" for the layer document, then each image layer's "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"asset_path"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" separately. Downloadable for 30 days."},"children":[]}]}]}],"properties":{"status":{"type":"string","example":"completed"},"text":{"type":"string","example":"Constructed a layered ad."},"url":{"type":"string","format":"uri","description":"The hosted layer document (JSON).","example":"https://temp.bria.ai/results/860f1a2b73f847e59f284d6f860f2ddb/creation.json"}},"required":["url"]},"error":{"$ref":"#/components/schemas/ErrorObject"}},"required":["request_id","status"]}},"components/schemas/ErrorObject":{"id":"components/schemas/ErrorObject","kind":"json-schema","title":"ErrorObject","data":{"type":"object","properties":{"code":{"type":"integer","example":422},"message":{"type":"string","example":"Unprocessable Entity"},"details":{"type":"string","example":"['Invalid Input -> only one image URL is supported per request']"}},"required":["code","message","details"]}},"components/schemas/ErrorResponse":{"id":"components/schemas/ErrorResponse","kind":"json-schema","title":"ErrorResponse","data":{"type":"object","properties":{"error":{"$ref":"#/components/schemas/ErrorObject"},"request_id":{"type":"string","example":"3a51f1c2f0de4b6c9a3e2b41a7c9d0e8","description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Identifies this response, not your job; the durable handle is the id inside the "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"status_url"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" you received at submit."},"children":[]}]}]}]}},"required":["error","request_id"]}},"components/schemas/TargetSize":{"id":"components/schemas/TargetSize","kind":"json-schema","title":"TargetSize","data":{"type":"object","properties":{"name":{"type":"string","minLength":1,"description":"Label for this target, echoed back on its result.","example":"feed"},"width":{"type":"integer","minimum":1,"description":"Target width in pixels.","example":1080},"height":{"type":"integer","minimum":1,"description":"Target height in pixels.","example":1080}},"required":["name","width","height"]}},"components/schemas/TargetResult":{"id":"components/schemas/TargetResult","kind":"json-schema","title":"TargetResult","data":{"type":"object","description":"The outcome for one requested target size.","properties":{"name":{"type":"string","description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"The "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"name"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" given on the request."},"children":[]}]}]}],"example":"feed"},"width":{"type":"integer","example":1080},"height":{"type":"integer","example":1080},"status":{"type":"string","enum":["ok","failed"]},"strategy":{"type":"string","nullable":true,"enum":["ai_image_models","delayer_dispatch"],"description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"The route that produced this target. The API produces every target with "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"delayer_dispatch"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", the layered route through the Ad Delayer. "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"ai_image_models"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" names a direct image-model pass that the API does not offer."},"children":[]}]}]}]},"url":{"type":"string","format":"uri","nullable":true,"description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"The hosted image at the requested size. Present when "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"status"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" is "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"ok"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]}]},"error":{"type":"string","nullable":true,"description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Why this target failed. Present when "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"status"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" is "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"failed"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]}]}},"required":["name","width","height","status"]}},"components/schemas/ResizeCompletionPayload":{"id":"components/schemas/ResizeCompletionPayload","kind":"json-schema","title":"ResizeCompletionPayload","data":{"type":"object","description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"The body delivered to "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"webhook_url"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" and returned by the status endpoint for this job."},"children":[]}]}]}],"properties":{"request_id":{"type":"string","example":"340780795e1b4530a5c7ee4563989f6f"},"status":{"type":"string","enum":["IN_PROGRESS","COMPLETED","ERROR","UNKNOWN"],"description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"IN_PROGRESS"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"COMPLETED"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"ERROR"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":", or "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"UNKNOWN"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" for an unrecognized or expired id (returned with HTTP 200 on a poll). Never moves backwards."},"children":[]}]}]}]},"result":{"type":"object","description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Present when "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"status"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" is "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"COMPLETED"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]}],"properties":{"status":{"type":"string","example":"completed"},"results":{"type":"array","description":"One entry per requested target size, in request order.","items":{"$ref":"#/components/schemas/TargetResult"}},"text":{"type":"string","description":"Present when the source was downscaled to 2048 px per side on a non-Enterprise plan, or when a font the ad uses was not available and a default was rendered instead."}},"required":["results"]},"error":{"$ref":"#/components/schemas/ErrorObject"}},"required":["request_id","status"]}},"schema_77":{"kind":"json-schema","data":{"type":"object","properties":{"attachments":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"string"},"description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Exactly one image: a publicly reachable URL, or a "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"data:image/…;base64,…"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" URI. PNG, JPEG or WEBP, up to 10 MB and 2048 px per dimension (Enterprise accounts have no dimension cap). More than one entry is rejected. This parameter is required."},"children":[]}]}]}]},"webhook_url":{"type":"string","format":"uri","description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Optional URL that receives the completion payload by POST when the job reaches a terminal state, with the same body as a status poll. See "},"children":[]},{"$$mdtype":"Node","type":"link","inline":true,"attributes":{"href":"/getting-started/async-requests#webhooks"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"webhooks"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]}]}},"required":["attachments"]},"id":"schema_77"},"schema_78":{"kind":"json-schema","data":{"$ref":"#/components/schemas/DelayerCompletionPayload"},"id":"schema_78"},"schema_79":{"kind":"json-schema","data":{"type":"object","properties":{"attachments":{"type":"array","minItems":1,"maxItems":1,"items":{"type":"string"},"description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Exactly one image: a publicly reachable URL, or a "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"data:image/…;base64,…"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" URI. PNG or JPEG. More than one entry, or a value that is neither a URL nor base64, is rejected with 422. This parameter is required."},"children":[]}]}]}]},"formats":{"type":"array","minItems":1,"maxItems":10,"items":{"$ref":"#/components/schemas/TargetSize"},"description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"One to ten target sizes. One result comes back per entry, carrying the same "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"name"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":". This parameter is required."},"children":[]}]}]}]},"prompt":{"type":"string","description":"Optional guidance for how the ad should adapt to each size, for example \"keep the logo in the top-left corner\"."},"webhook_url":{"type":"string","format":"uri","description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Optional URL that receives the completion payload by POST when the job reaches a terminal state, with the same body as a status poll. See "},"children":[]},{"$$mdtype":"Node","type":"link","inline":true,"attributes":{"href":"/getting-started/async-requests#webhooks"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"webhooks"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]}]}},"required":["attachments","formats"]},"id":"schema_79"},"schema_80":{"kind":"json-schema","data":{"$ref":"#/components/schemas/ResizeCompletionPayload"},"id":"schema_80"}},"exampleStore":{"paths/~1ads~1delayer/post/requestBody/content/application~1json/examples/basic":{"value":{"attachments":["https://bria-image-repository.s3.amazonaws.com/images/c41b39ec1a69a5d3.jpg"]},"key":"basic","summary":"Basic request","id":"paths/~1ads~1delayer/post/requestBody/content/application~1json/examples/basic"},"paths/~1ads~1delayer/post/requestBody/content/application~1json/examples/with_webhook":{"value":{"attachments":["https://bria-image-repository.s3.amazonaws.com/images/c41b39ec1a69a5d3.jpg"],"webhook_url":"https://your-app.example.com/api/bria/webhook"},"key":"with_webhook","summary":"With a webhook","id":"paths/~1ads~1delayer/post/requestBody/content/application~1json/examples/with_webhook"},"paths/~1ads~1delayer/post/responses/200/content/application~1json/example":{"value":{"request_id":"860f1a2b73f847e59f284d6f860f2ddb","status_url":"https://engine.prod.bria-api.com/v2/status/860f1a2b73f847e59f284d6f860f2ddb"},"id":"paths/~1ads~1delayer/post/responses/200/content/application~1json/example"},"paths/~1ads~1delayer/post/responses/422/content/application~1json/example":{"value":{"error":{"code":422,"message":"The request was well-formed but was unable to be followed due to semantic errors.","details":"['Invalid Input -> only one image URL is supported per request']"},"request_id":"3a51f1c2f0de4b6c9a3e2b41a7c9d0e8"},"id":"paths/~1ads~1delayer/post/responses/422/content/application~1json/example"},"paths/~1ads~1delayer/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/completed":{"value":{"request_id":"860f1a2b73f847e59f284d6f860f2ddb","status":"COMPLETED","result":{"status":"completed","text":"Constructed a layered ad.","url":"https://temp.bria.ai/results/860f1a2b73f847e59f284d6f860f2ddb/creation.json"}},"key":"completed","summary":"Completed","id":"paths/~1ads~1delayer/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/completed"},"paths/~1ads~1delayer/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/in_progress":{"value":{"request_id":"860f1a2b73f847e59f284d6f860f2ddb","status":"IN_PROGRESS"},"key":"in_progress","summary":"In progress (status poll only)","id":"paths/~1ads~1delayer/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/in_progress"},"paths/~1ads~1delayer/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/failed":{"value":{"request_id":"860f1a2b73f847e59f284d6f860f2ddb","status":"ERROR","error":{"code":500,"message":"Internal Server Error","details":"The image could not be fetched or decoded."}},"key":"failed","summary":"Failed","id":"paths/~1ads~1delayer/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/failed"},"paths/~1ads~1delayer/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/unknown_id":{"value":{"request_id":"860f1a2b73f847e59f284d6f860f2ddb","status":"UNKNOWN"},"key":"unknown_id","summary":"Unknown or expired id (status poll only)","id":"paths/~1ads~1delayer/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/unknown_id"},"paths/~1ads~1resize/post/requestBody/content/application~1json/examples/placements":{"value":{"attachments":["https://bria-image-repository.s3.amazonaws.com/images/c41b39ec1a69a5d3.jpg"],"formats":[{"name":"feed","width":1080,"height":1080},{"name":"story","width":1080,"height":1920},{"name":"leaderboard","width":970,"height":90}]},"key":"placements","summary":"Three placements from one ad","id":"paths/~1ads~1resize/post/requestBody/content/application~1json/examples/placements"},"paths/~1ads~1resize/post/requestBody/content/application~1json/examples/with_prompt_and_webhook":{"value":{"attachments":["https://bria-image-repository.s3.amazonaws.com/images/c41b39ec1a69a5d3.jpg"],"formats":[{"name":"banner","width":1500,"height":300}],"prompt":"keep the logo in the top-left corner","webhook_url":"https://your-app.example.com/api/bria/webhook"},"key":"with_prompt_and_webhook","summary":"With guidance and a webhook","id":"paths/~1ads~1resize/post/requestBody/content/application~1json/examples/with_prompt_and_webhook"},"paths/~1ads~1resize/post/responses/202/content/application~1json/example":{"value":{"request_id":"340780795e1b4530a5c7ee4563989f6f","status_url":"https://engine.prod.bria-api.com/v2/status/340780795e1b4530a5c7ee4563989f6f"},"id":"paths/~1ads~1resize/post/responses/202/content/application~1json/example"},"paths/~1ads~1resize/post/responses/400/content/application~1json/example":{"value":{"error":{"code":400,"message":"Ads resize can't run synchronously.","details":"400 Bad Request: Ads resize can't run synchronously."},"request_id":"2877311f392640d7b3aa7c9545ba0a74"},"id":"paths/~1ads~1resize/post/responses/400/content/application~1json/example"},"paths/~1ads~1resize/post/responses/422/content/application~1json/example":{"value":{"error":{"code":422,"message":"The request was well-formed but was unable to be followed due to semantic errors.","details":"['formats -> List should have at most 10 items after validation, not 11']"},"request_id":"2541701dba04413b82a42bb9472d2602"},"id":"paths/~1ads~1resize/post/responses/422/content/application~1json/example"},"paths/~1ads~1resize/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/completed":{"value":{"request_id":"340780795e1b4530a5c7ee4563989f6f","status":"COMPLETED","result":{"status":"completed","results":[{"name":"feed","width":1080,"height":1080,"status":"ok","strategy":"delayer_dispatch","url":"https://editor-media.bria.ai/inventory/b30df825-8ad9-4a4f-bb18-21e142c0ef24/assets/7b4549c24686472bac04bcfd023a1f0e.png","error":null},{"name":"leaderboard","width":970,"height":90,"status":"ok","strategy":"delayer_dispatch","url":"https://editor-media.bria.ai/inventory/b30df825-8ad9-4a4f-bb18-21e142c0ef24/assets/860865425a3f4d349dc79d8826e0c2b4.png","error":null}]}},"key":"completed","summary":"Completed, both routes in one call","id":"paths/~1ads~1resize/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/completed"},"paths/~1ads~1resize/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/downscaled":{"value":{"request_id":"9c63823484764404b0f7fb615eb7a796","status":"COMPLETED","result":{"status":"completed","results":[{"name":"feed","width":1080,"height":1080,"status":"ok","strategy":"delayer_dispatch","url":"https://editor-media.bria.ai/inventory/b30df825-8ad9-4a4f-bb18-21e142c0ef24/assets/ce890f13f36c42a2ab02be886022a1a1.png","error":null}],"text":"Your source image was downscaled to fit within 2048 px per dimension before resizing, because your plan caps resolution at that size. Full-resolution resizing requires a Bria enterprise plan."}},"key":"downscaled","summary":"Completed, source downscaled on a non-Enterprise plan","id":"paths/~1ads~1resize/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/downscaled"},"paths/~1ads~1resize/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/in_progress":{"value":{"request_id":"340780795e1b4530a5c7ee4563989f6f","status":"IN_PROGRESS"},"key":"in_progress","summary":"In progress (status poll only)","id":"paths/~1ads~1resize/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/in_progress"},"paths/~1ads~1resize/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/failed":{"value":{"request_id":"340780795e1b4530a5c7ee4563989f6f","status":"ERROR","error":{"code":422,"message":"The image URL returned HTTP 403.","details":"422 Unprocessable Entity: The image URL returned HTTP 403."}},"key":"failed","summary":"Failed, the image could not be fetched","id":"paths/~1ads~1resize/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/failed"},"paths/~1ads~1resize/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/unknown_id":{"value":{"request_id":"340780795e1b4530a5c7ee4563989f6f","status":"UNKNOWN"},"key":"unknown_id","summary":"Unknown or expired id (status poll only)","id":"paths/~1ads~1resize/post/callbacks/jobCompleted/post/requestBody/content/application~1json/examples/unknown_id"}},"securitySchemeStore":{"api_token":{"id":"api_token","type":"apiKey","description":[{"$$mdtype":"Node","type":"paragraph","attributes":{},"children":[{"$$mdtype":"Node","type":"inline","attributes":{},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Your Bria API token, sent in the "},"children":[]},{"$$mdtype":"Node","type":"code","inline":true,"attributes":{"content":"api_token"},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":" request header on every call."},"children":[]},{"$$mdtype":"Node","type":"softbreak","inline":true,"attributes":{},"children":[]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Create and manage tokens in the "},"children":[]},{"$$mdtype":"Node","type":"link","inline":true,"attributes":{"href":"https://platform.bria.ai/organization-management/api-keys"},"children":[{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"Bria Console"},"children":[]}]},{"$$mdtype":"Node","type":"text","inline":true,"attributes":{"content":"."},"children":[]}]}]}],"in":"header","paramName":"api_token"}},"servers":[{"url":"https://engine.prod.bria-api.com/v2"}]},"options":{"codeSamples":{"languages":[{"lang":"Python","label":"Python (bria-client)"},{"lang":"JavaScript","label":"TypeScript (@bria-ai/client)"},{"lang":"curl","label":"cURL"}]},"jsonSamplesExpandLevel":"all","schemasExpansionLevel":"all","feedback":{"type":"sentiment","settings":{"label":"Was this section helpful?"}},"hideSidebar":true,"mockServer":{"url":"/_mock/ads","position":"off","description":"Mock server"},"disableRouter":true,"downloadUrls":[{"url":"/_bundle/ads.json?download"},{"url":"/_bundle/ads.yaml?download"}],"excludeFromSearch":false,"specType":"openapi","markdocOptions":{"tags":{},"nodes":{},"components":{}},"metadata":{"title":"Ads API Reference","description":"Two endpoints for finished, flat ads. `POST /v2/ads/delayer` turns an ad into editable layers (background plate, image cutouts, live text with typography, vector shapes) returned as one JSON layer document. `POST /v2/ads/resize` produces the same ad at up to ten other sizes with the layout redone for each shape. Both are asynchronous: they return a `request_id` and `status_url`, and the completed status body carries the result. The [Ads overview](/ads-overview) introduces both; each endpoint below carries its full guide: the flow, the response contract, limits and retention.\n"}},"baseSlug":"/ads","routesMapping":{}}