MixMedia API
API keys Sign inTry it
MixMedia Sign in
Open as Markdown

POST /api/v1/jobs/confirm

Answer to the «trim or not» question for HeyGen Lipsync: 1 — trim and start, 0 — do not start.

When the question comes

Only for HeyGen Lipsync Speed and HeyGen Lipsync Precision. HeyGen accepts audio and video only if their lengths differ by at most 15% (with enable_dynamic_duration = true, the default). We check this ourselves, before the start and before any charge.

  • Lengths are close (up to 15%) — no question, the task runs as usual.
  • Lengths differ too much — the task is created in state confirm, nothing is charged. We ask whether to trim the longer file (from the start) to the length of the shorter one.
  • The video has no sound — no question: createTask answers 422 right away, no task is created, nothing is charged. HeyGen needs the original speech inside the video to find who speaks; pass the new speech in audio_urls.

Sync Lipsync 2 does not ask: it handles different lengths itself (sync_mode).

What the question looks like

The createTask response (the same confirm field comes in the task.confirm_required callback and in recordInfo):

{
  "code": 200,
  "msg": "confirm_required",
  "data": {
    "taskId": "task_heygen-lipsync-speed_1796400682122ec5137",
    "status": "awaiting_confirmation",
    "state": "confirm",
    "confirm": {
      "type": "trim_to_match",
      "question": "Audio is 2.96 s, video is 5.04 s. HeyGen Lipsync accepts at most a 15% difference. Trim the video to 2.96 s and continue? Answer 1 = yes, 0 = no.",
      "question_ru": "Звук 2.96 с, видео 5.04 с. HeyGen Lipsync допускает разницу не больше 15%. Обрезать видео до 2.96 с и продолжить?",
      "video_seconds": 5.04,
      "audio_seconds": 2.96,
      "max_difference_percent": 15,
      "trim": "video",
      "trim_to_seconds": 2.96,
      "price_if_yes_usd": "0.0550",
      "answers": {
        "0": "do not trim, the task fails, nothing is charged",
        "1": "trim the video and start (charged on start)"
      },
      "answer_url": "https://mixmedia.tech/api/v1/jobs/confirm",
      "expires_at": 1796486400000
    }
  }
}
FieldMeaning
trimWhat we trim: video or audio — always the longer file
trim_to_secondsTarget length (the shorter file)
price_if_yes_usdPrice if you answer 1. Trimming the audio lowers it: the price follows audio seconds
expires_atAnswer deadline (unix ms), 24 hours

Without a callBackUrl the question is in recordInfo: state = confirm, status = awaiting_confirmation. All of them: GET /api/v1/jobs/list?state=confirm.

Request

POST https://mixmedia.tech/api/v1/jobs/confirm
Authorization: Bearer <API_KEY>
Content-Type: application/json

{"taskId": "task_heygen-lipsync-speed_1796400682122ec5137", "answer": 1}
FieldRequiredDescription
taskIdyesID of a task in state confirm
answeryes1 — yes, trim and start; 0 — no

What happens

answerResult
1We trim the longer file, charge the price and start the task. Then as usual: recordInfo or a result callback. Not enough balance — 402, the task keeps waiting; top up and send 1 again
0Nothing is trimmed or started. The task becomes fail with code 422, nothing is charged. Your callBackUrl gets task.fail
no answer in 24 hoursSame as 0: fail, 422, nothing charged
{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "task_heygen-lipsync-speed_1796400682122ec5137",
    "status": "submitted",
    "answer": 1,
    "trimmed": {
      "what": "video",
      "to_seconds": 2.96
    }
  }
}

Errors

codeerrorWhen
401authentication_errorMissing or invalid key
400invalid_request_errortaskId missing or answer is not 1 or 0
404task_not_foundNo such task in your account
409not_awaiting_confirmationThe task no longer waits for an answer (already started or closed)
402payment_requiredNot enough balance for answer 1, the task keeps waiting

Try the same models on the website or see prices.

© 2026 MixMedia