1. Criar a sessão
curl -X POST https://…/api/v1/auth/start \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"mode":"login"}'
user_id de antes.
Três chamadas e pronto.
curl -X POST https://…/api/v1/auth/start \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{"mode":"login"}'
{
"session_id": "ses_...",
"code": "4827",
"message": "LOGIN 4827",
"number": { "wa_link": "https://wa.me/55..." },
"expires_at": "..."
}
curl https://…/api/v1/auth/ses_.../wait \
-H "Authorization: Bearer sk_live_..."
{
"status": "authenticated",
"user": {
"id": "usr_8f92a1",
"phone": "+5521988887777",
"whatsapp": { "push_name": "João" }
}
}
Para confirmar um telefone que você já tem, troque o corpo por
{"mode":"verify","phone":"+5511999998888"}: a mensagem vira
AUTH 4827 e só aquele número fecha a sessão.
Ou receba um webhook assinado, sem polling. Ver docs →