Skip to content
Get your keyGet a key

Reference · Ads

POST/ugc-ads/{adId}/picture

Draw a new preview of a UGC ad, before its video is made

Draw a preview of a UGC ad made step by step again, before its video is made, as New preview does on the UGC Ads page: when the face, the product or the place came out wrong. It runs on the same picture model, or on another one named (pictureModel), which the ad then keeps. The new preview replaces the one before when it lands, and the job (kind "ugc") waits for a yes again. It works on a take whose preview is in and waiting, or whose preview could not be made; once its video has begun, its preview stays. GET /api/v1/jobs/{jobId} says each take’s id where an ad has several. It comes back as a job (kind "ugc") to follow with GET /api/v1/jobs/{jobId}.

Key needs
create · Make things and spend credits
Answers
A job to follow
Request
curl -X POST https://vessero.com/api/v1/ugc-ads/8f1c2d3e-4b5a-4789-8abc-def012345678/picture \
  -H "Authorization: Bearer $VESSERO_API_KEY" \
  -H "Idempotency-Key: 47f8f6f5-ea00-4fb1-925f-76aac956a0ec" \
  -H "Content-Type: application/json" \
  -d '{
    "confirmCredits": 5
  }'
Response202 Accepted
{
  "object": "job",
  "id": "ugc.8f1c2d3e-4b5a-4789-8abc-def012345678",
  "kind": "ugc",
  "status": "working",
  "stage": "Queued",
  "files": [],
  "credits": 58,
  "url": "/api/v1/jobs/ugc.8f1c2d3e-4b5a-4789-8abc-def012345678"
}
POST/ugc-ads/{adId}/picture/quoteFree

The same body without confirmCredits. It answers the price and your balance, and runs nothing.

Path

  • adIdstringrequiredThe UGC ad: its job’s id after ugc., so 8f1c… for the job ugc.8f1c….

Header

  • Idempotency-KeystringYour id for this request: 8–64 letters, digits, - or _. A repeat within 10 minutes gets the first answer back and never runs twice. Use the same one for the quote and the run.
  • Preferstringwait=N (up to 60): hold the answer up to N seconds while the job is made, within 80 seconds for the whole call.

Body

  • takeIdstringWhich take, by the takeId GET /api/v1/jobs/{jobId} gives for it, where the ad has several. Default: the first take.
  • pictureIdstringWhere the take drew several previews to pick from, which one to draw again: its pictureId from GET /api/v1/jobs/{jobId}. Default: the one its video starts from.
  • pictureModelstringAnother picture model to draw it with: an id from GET /api/v1/models (studio "ugc", pictureModels). Default: the one that drew it.
  • confirmCreditsintegerrequiredThe price you agree to, in credits: the credits its quote gave. It runs at that price, or at a lower one when that figure was quoted for this Idempotency-Key; above the price now, nothing runs (409 price_changed). Left out, nothing runs and the error carries the quote.
  • webhookUrlstring · httpsAn https address to POST the job to once it is done or has failed — or waits for a yes, as a UGC ad made step by step does once its previews are in — signed (see Webhooks).

Answers

  • 202jobStarted: follow the job, or wait for its webhook.
  • 200jobA job that ended at once: done, or failed (see error and charged).
  • 400confirm_credits_requiredA run that spends needs confirmCredits: the quote is in details.
  • 402insufficient_creditsThe account has too few credits for this.
  • 409price_changedThe price is above the confirmCredits sent: nothing ran; the new quote is in details.
  • 422content_refusedThe content check refused it.
  • 429daily_cap_reachedThe key’s daily credit cap would be passed: see Retry-After.
Next in AdsPOST/ugc-ads/{adId}/picture/quote