Inicia ou continua o lote sem executar o loop na requisição
Inicia DRAFT, PAUSED ou INTERRUPTED respeitando a agenda: QUEUED dentro da janela, SCHEDULED antes da primeira ou WAITING_FOR_WINDOW fora dela. É idempotente nos estados já ativos ou agendados.
Autenticação
JWT HS256 de usuario. Deve conter userId em formato UUID e exp; a expiracao sempre e validada.
- Header
Authorization- Exemplo
Bearer <INSTANCE_TOKEN>
Parâmetros
batchIdpathobrigatórioSem descrição adicional.
Respostas
application/jsonEstado persistido
response 200object
response 200objectidstringobrigatórioformat: uuidownerUserIdstringobrigatórioformat: uuidnamestringobrigatóriostatusenum<DRAFT | SCHEDULED | QUEUED | PROCESSING | PAUSE_REQUESTED | PAUSED | WAITING_FOR_INSTANCE | WAITING_FOR_WINDOW | STOP_REQUESTED | STOPPED | INTERRUPTED | COMPLETED | COMPLETED_WITH_ERRORS | FAILED>obrigatóriomessageobjectMensagem persistida do lote. O payload é direto: não envie number/chat/recipient/options nem wrappers como textMessage, mediaMessage, audioMessage, contactMessage, locationMessage ou buttonMessage. Tipos aceitos: text, link, media, audio, contact, location e interactive; ptt, whatsapp-audio e whatsapp_audio são aliases de audio.
messageobjecttypeenum<text | link | media | audio | ptt | whatsapp-audio | whatsapp_audio | contact | location | interactive>obrigatóriopayloadoneOfobrigatórioObjeto ou array persistente conforme message.type: text={text}; link={link,thumbnailUrl,title,description}; media={mediatype,media|mediaUploadId,fileName,caption}; audio={audio} ou {mediaUploadId,ptt:true}; contact=[{fullName,phoneNumber,wuid,organization,vcard}]; location={latitude,longitude,name,address,url}; interactive segue MessageBatchInteractivePayload.
payloadoneOfobrigatórioopção 1objectopção 2array
opção 2arrayitems[]objectoptionsobject
optionsobjectreplicablebooleanPreservado no contrato; não adiciona semântica própria no worker.
presenceenum<composing | recording | paused>delayobject
delayobjectminMsintegerobrigatórioformat: int64 · padrão: 0 · mín: 0maxMsintegerobrigatórioformat: int64 · padrão: 0 · mín: 0quotedMessageIdintegerformat: int64quotedMessageobjectexternalAttributesobjectmentionAllbooleanSomente false é aceito; true é rejeitado porque lotes não aceitam grupos.
externalAttributesobjectinstancesarrayobrigatório
instancesarrayobrigatórioitems[]object
items[]objectidintegerobrigatórionamestringobrigatórioconnectionStatusstringselectedCountintegerformat: int64successCountintegerformat: int64failedCountintegerformat: int64countsobjectobrigatório
countsobjectobrigatórioreceivedintegerformat: int64 · mín: 0totalintegerobrigatórioformat: int64 · mín: 0duplicatesIgnoredintegerformat: int64 · mín: 0processedintegerobrigatórioformat: int64 · mín: 0pendingintegerobrigatórioformat: int64 · mín: 0sendingintegerobrigatórioformat: int64 · mín: 0successintegerobrigatórioformat: int64 · mín: 0failedintegerobrigatórioformat: int64 · mín: 0skippedintegerobrigatórioformat: int64 · mín: 0unknownintegerobrigatórioformat: int64 · mín: 0progressintegerobrigatóriomín: 0 · máx: 100floor(processed * 100 / total).
autoResumebooleanobrigatórioscheduleoneOfobrigatório
scheduleoneOfobrigatórioopção 1objectJanela absoluta inicial. DAILY preserva os horários locais e aceita janelas que atravessam a meia-noite.
opção 1objectwindowStartAtstringobrigatórioformat: date-timewindowEndAtstringobrigatórioformat: date-timerecurrenceenum<NONE | DAILY>obrigatóriotimezonestringobrigatórioTimezone IANA usado no cálculo da recorrência.
opção 2nullnextRunAtstring | nullobrigatórioformat: date-timelastInterruptedAtstring | nullobrigatórioformat: date-timeinterruptionReasonenum<GRACEFUL_SHUTDOWN | LEASE_EXPIRED | PROCESS_CRASH | SEND_TIMEOUT_DURING_SHUTDOWN | null>obrigatóriolastRecoveredAtstring | nullobrigatórioformat: date-timecurrentItemobject
currentItemobjectidstringobrigatórioformat: uuidpositionintegerobrigatóriomín: 0recipientstringobrigatórioinstanceNamestring | nullobrigatóriolastErrorstringcreatedAtstringobrigatórioformat: date-timestartedAtstringformat: date-timepausedAtstringformat: date-timestoppedAtstringformat: date-timecompletedAtstringformat: date-timeinterruptedAtstringformat: date-timeupdatedAtstringobrigatórioformat: date-time{"id": "01900000-0000-7000-8000-000000000001","ownerUserId": "01900000-0000-7000-8000-000000000001","name": "CodeChat","status": "DRAFT","message": {"type": "text","payload": {}},"options": {"replicable": true,"presence": "composing","delay": {"minMs": 0,"maxMs": 0},"quotedMessageId": 1,"quotedMessage": {},"externalAttributes": {},"mentionAll": false},"externalAttributes": {},"instances": [{"id": 1,"name": "CodeChat","connectionStatus": "string","selectedCount": 1,"successCount": 1,"failedCount": 1}],"counts": {"received": 1,"total": 1,"duplicatesIgnored": 1,"processed": 1,"pending": 1,"sending": 1,"success": 1,"failed": 1,"skipped": 1,"unknown": 1},"progress": 1,"autoResume": true,"schedule": {"windowStartAt": "2026-07-13T15:10:00Z","windowEndAt": "2026-07-13T15:10:00Z","recurrence": "NONE","timezone": "string"},"nextRunAt": "2026-07-13T15:10:00Z","lastInterruptedAt": "2026-07-13T15:10:00Z","interruptionReason": "GRACEFUL_SHUTDOWN","lastRecoveredAt": "2026-07-13T15:10:00Z","currentItem": {"id": "01900000-0000-7000-8000-000000000001","position": 1,"recipient": "5511999999999","instanceName": "minha-instancia"},"lastError": "string","createdAt": "2026-07-13T15:10:00Z","startedAt": "2026-07-13T15:10:00Z","pausedAt": "2026-07-13T15:10:00Z","stoppedAt": "2026-07-13T15:10:00Z","completedAt": "2026-07-13T15:10:00Z","interruptedAt": "2026-07-13T15:10:00Z","updatedAt": "2026-07-13T15:10:00Z"}
