Docs
Edit
POST /v1/edit changes a design with one instruction and saves the result as a new version. Older versions stay.
curl https://api.vectormojo.com/api/v1/edit \
-H "Authorization: Bearer $BRUSH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"design_id": "6745c0a1e4b0c2a9d1f3b7e3",
"instruction": "Make the third stage red.",
"target": "stage-3",
"sync": true
}' Fields
| Field | Type and limits | What it does |
|---|---|---|
design_id | string | The design to change. Send this or svg, not both. |
svg | string, 20 to 60,000 characters | An SVG of your own to change. Send this or design_id, not both. |
instruction | string, 1 to 4,000 characters | Required. One change in plain words: "make the third box red". |
target | element id, up to 200 characters | Optional. Aim the change at the element with this id. It must exist in the version you edit. |
version | whole number from 1 | With design_id: the version to start from. Default: the current one. |
title | string, up to 120 characters | With svg: the name of the new design. Default "Imported design". |
model | string | API name of a model. Default brush-1.0. |
sync | boolean | true waits for the result, as on generate. |
What comes back
The same shape as generate: 202 with the job, and with
"sync": true the design too, once the job ends (up to 170 seconds). The job's version is the
new version.
- The new version is always added at the end, as
current_version + 1, even when you start from an olderversion. - The edited design goes through the same checks as a new one. If it fails them, the job fails and is not charged, and the design is unchanged.
- One design holds up to 100 versions. After that, the call gets
400 too_many_versions: export the design and send it back assvgto keep going.
Aim at one element
VectorMojo draws each logical part of a design (a step, a card, a column) as a group with a readable id. Read
the ids from the SVG and send one as target to change only that part. If no element
in that version has the id, the call gets 400 target_not_found and no job is made.
Edit an SVG of your own
curl https://api.vectormojo.com/api/v1/edit \
-H "Authorization: Bearer $BRUSH_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"svg": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"800\" height=\"450\"><rect width=\"800\" height=\"450\" fill=\"#fff\"/><text x=\"40\" y=\"80\" font-size=\"32\">Pricing</text></svg>",
"title": "Old pricing chart",
"instruction": "Switch to a dark background."
}' - Up to 60,000 characters of SVG.
- VectorMojo cleans it first: scripts, embedded web content and outside links are removed.
- It needs a
widthandheight(or aviewBox) between 16 and 4,000, and it must render. If not, the call gets400 invalid_svg. - It becomes version 1 of a new design in your account; the edit is version 2. The new design is saved only once the credits for the edit are held.
Price
An edit costs the same as a new image on the same model: brush-1.0-lite 5 credits, brush-1.0 20 credits, brush-1.0-pro 40 credits. A failed edit is not charged.
Retries
Send an Idempotency-Key header to retry safely: the same key returns the first job and is never charged twice.
Designs are AI-generated. Outputs can contain factual mistakes, so review every design before you use it.