Call it
curl https://api.peume.com/v1/call/connect-whatsapp-from-embedded-signup \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"code": "your code"
}
}'const res = await fetch("https://api.peume.com/v1/call/connect-whatsapp-from-embedded-signup", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"code": "your code"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/connect-whatsapp-from-embedded-signup",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"code": "your code"
}
},
)
print(res.json()["output"])Answer: {"id": "run_…", "status": "completed", "cost_usd": …, "output": {…}}. Long jobs answer 202 with a run id to read later. From an AI agent, connect the MCP server and ask for this by name: connect-whatsapp-from-embedded-signup.
Parameters
codeRequiredstringAuthorization code from the WA_EMBEDDED_SIGNUP postMessage
wabaIdstringWhatsApp Business Account id, when the SDK reported one
phoneNumberIdstringisCoexistencebooleanNumber is also live in the WhatsApp Business app
expectedPhoneNumberstringRejects the connect when Meta returns a different number (full international number). With a connect token minted with a pinned number, the pinned number applies instead.
redirect_urlstringHosted signup page only. When present, the response also carries `redirectUrl`, the URL the user should land on, with the outcome mapped exactly like the redirect flow (success params, or `error` and `platform` with the same values). Must be an absolute http(s) URL or a custom app scheme. The legacy spelling `redirectUrl` remains accepted as an alias.
echoConnectTokenbooleanHosted signup page only. Append the connect token to the success redirect, as the redirect flow does for API-key callers.
