For AI agents: this page is also available as Markdown at https://docs.refabric.com/task-api-reference/image.to_svg.md, and the index of every page is https://docs.refabric.com/llms.txt.
Production prep
Convert a drawing to SVG
Convert a technical drawing into a layered SVG vector file, ready for tech packs and cutting. Delivered as one SVG file.
Endpoint: POST https://api.refabric.com/v1/tasks/image.to_svgTask: image.to_svgScope: tasks:runCategory: Production prep
Quick start
import os
import time
import requests
headers = {"Authorization": f"Key {os.environ['REFABRIC_API_KEY']}"}
job = requests.post(
"https://api.refabric.com/v1/tasks/image.to_svg",
headers=headers,
json={
"image": "art:4b7e02",
},
).json()
print(job["job_id"])
while True:
status = requests.get(job["status_url"], headers=headers).json()
if status["lifecycle"] == "terminal":
break
time.sleep(5)
print(requests.get(job["result_url"], headers=headers).json())cURL waits for the result with Prefer: wait; when the job outlives the wait, it answers 202 with the job's URLs.
Input schema
- stringrequired
The technical drawing to convert into a layered SVG, as one string: a URL, a file from an earlier result (
art:…or its url — animage.to_sketchdrawing works best) or an upload (file:…).pattern: ^(https://|art:|file:).+$
Example:
art:4b7e02
Output schema
- array<object>optional
One
image/svg+xmlfile: the drawing as a layered vector document. - objectoptional
Sent only when some shapes need a look: its
warningsthen say which check to make before cutting.- array<object>optional
{code: "svg_needs_review"}when some shapes could not be assigned to a part: each is on a layer of its own whose name contains "Unassigned" — check those layers before cutting.
Required-fields example
{
"image": "art:4b7e02"
}Full example
{
"image": "art:4b7e02"
}Response example
{
"job_id": "7a1c2e3f00004000800000000000001d",
"lifecycle": "queued",
"status_url": "http://v3-api.refabric.com/v1/jobs/7a1c2e3f00004000800000000000001d",
"result_url": "http://v3-api.refabric.com/v1/jobs/7a1c2e3f00004000800000000000001d/result",
"cancel_url": "http://v3-api.refabric.com/v1/jobs/7a1c2e3f00004000800000000000001d/cancel"
}Result example
{
"job_id": "7a1c2e3f00004000800000000000001d",
"files": [
{
"file": "art:8e1b01",
"url": "https://files.example.com/image.to_svg/1.svg",
"media_type": "image/svg+xml",
"task": "image.to_svg",
"job_id": "7a1c2e3f00004000800000000000001d",
"created_at": "2026-10-01T09:42:55Z"
}
],
"has_more": false,
"summary": {
"warnings": [
{
"code": "svg_needs_review",
"field": null,
"message": "Some shapes of the SVG are on layers whose names contain `Unassigned`."
}
]
}
}The drawing comes from image.to_sketch. summary.warnings is empty when every shape found its layer; here some did not and are on the Unassigned layer.
Send a technical drawing of a garment and get it back as a layered SVG vector file, ready for a tech pack or for cutting. A shape that could not be assigned to a part keeps a layer of its own whose name contains `Unassigned`, and the result tells you to check those layers.
Built for
- Tech-pack flats
- Files for cutting
- Editable line art from a sketch
What you get
- One SVG file: the drawing as a layered vector document.
- A
summarywith ansvg_needs_reviewwarning when some shapes are on layers whose names containUnassigned.
Specs
| Input formats | Images, each one string: a URL, an upload (file:…) or a file from an earlier result (art:…). Upload types and sizes: GET /v1/meta limits.upload. |
|---|---|
| Input count | image: one |
| Output format | Files: each one line with its url and its media_type, in the job's result. |
| Outputs per job | One file per job. |
Errors
field_not_acceptedinvalid_requestnot_foundpermission_deniedinsufficient_creditsprocessing_failedinternal
Related
image.to_sketch· It runs before: its result is this input.
Good to know
Pricing: Estimate a request before you run it, or see the price of each option.
For agents and code generation
- https://api.refabric.com/v1/tasks/image.to_svg/llms.txt
- https://api.refabric.com/v1/tasks/image.to_svg/openapi.json
GET https://api.refabric.com/v1/tasks/image.to_svg