GUIDES

Wait for a result

Most images convert in seconds, a few take minutes. Pick the way to wait that fits your program.

WayHowBest for
In the callPOST /v1/vectorize with wait (0 to 60 s, 30 by default): 200 with the files, else 202Scripts, the CLI, most apps
The SDKsvectorize() waits through a 202 for youNode.js and Python
PollingGET /v1/conversions/{id} every few seconds until status endsJobs and queues
EventsGET /v1/conversions/{id}/events: Server-Sent Events, one per changeA page showing progress
WebhooksWe POST to your server when it endsServers; nothing to keep open

The statuses

waiting (in line behind your other conversions), queued, processing, then one of completed, failed, expired or canceled. The last four never change again.

A 202, by hand

curl
# 202: the conversion finishes by itself. Read it until it ends.
curl https://api.vecsnap.com/v1/conversions/$ID -H "Authorization: Bearer $VECSNAP_API_KEY"
# then its file
curl "https://api.vecsnap.com/v1/conversions/$ID/download?format=web" -H "Authorization: Bearer $VECSNAP_API_KEY"
Retry with the same key.Send an Idempotency-Key on every POST. A request sent again with the same key and the same image is the same conversion, never a second charge.