app2email API מחירים

תיעוד

Verify a phone number on WhatsApp: by an inbound message, or with a code

Two ways to prove a person owns a phone number: they send you a prefilled WhatsApp message (no paid message, no code to type), or you send a code with an authentication template and check it.

By an inbound message (/verify/inbound)With a code (/verify)
The persontaps a link (or scans a QR code) and sends the prefilled messagetypes the code they got on WhatsApp
You neednothing elsean approved AUTHENTICATION template
Costnone: they write to youone authentication message per code
Done whenthey send it (and tap Yes, it was me)POST /verify/{id}/check says approved

Both send verify.completed or verify.failed to your webhooks, and GET /v1/{number}/verify/{id} shows the status. AI agents use the MCP tools start_inbound_verification, send_verification_code, check_verification_code and get_verification.

By an inbound message

curl -X POST "https://api.app2email.com/v1/YOUR_NUMBER/verify/inbound" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"reference": "signup-4711", "label": "MyShop"}'

The answer has link (a wa.me link with Please verify my number. Code: K7Q3MX9P prefilled), qr_svg (the same as a QR code, for a desktop page) and id. When the person sends the message, we ask them "You are confirming your number for <your business> (MyShop). Was that you?". If they tap Yes, it was me, the verification completes with their phone. The message itself is not forwarded by e-mail, and gets no auto reply and no agent answer.

Protect against relay attacks. Someone could start a verification on your site, then trick another person into sending the code, so their own session gets confirmed with the victim's number. Against that:

  • keep confirm: "button" (the default): the victim is asked, and can say No;
  • pass expected_phone when the person typed their number on your site: a message from any other phone fails;
  • bind id to the browser session that started it, and never accept an id from a URL.

A code is 8 characters (no 0, O, 1, I or L), works once and only for your number, and expires after ttl_seconds (10 minutes unless you set it, at most an hour).

With a code

curl -X POST "https://api.app2email.com/v1/YOUR_NUMBER/verify" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"to": "61412345678", "reference": "signup-4711"}'

Then check what the person types:

curl -X POST "https://api.app2email.com/v1/YOUR_NUMBER/verify/vf_3k9m2Lw8Rt5Yp1ZsQa7Xbw/check" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"code": "482913"}'
statusMeaning
approvedThe right code. Only once: a later check answers used.
wrong_codeNot it; attempts_left says how many tries remain.
too_many_attempts5 wrong tries: this code is finished. Send a new one.
expiredPast ttl_seconds (5 minutes unless you set it, at most an hour).

app2email keeps only a fingerprint of the code: it never appears in the message list, the Inbox, the Activity Log, the forwarded e-mail or a webhook. They show "verification code ••••••". The number needs an approved AUTHENTICATION template with a copy-code button (409 no_auth_template says how to create one). A sandbox key sends nothing, and the code is 000000.

OTP pumping: rate-limit your own form

Every code is a paid message. A known fraud drives a site's sign-up form so that it sends thousands of codes to numbers the attacker picks. Rate-limit your own form (per visitor, per number, a CAPTCHA). The link settings have three extra brakes, all off unless you set them:

SettingWhat it does
verify_resend_cooldown_secondsNo new code to the same number within this many seconds.
verify_hourly_per_recipientAt most this many codes to one number an hour.
verify_allowed_calling_codesCodes only to numbers with these calling codes, for example ["61", "44"].

Errors

CodeStatusMeaning
invalid_verify_request400A field is missing or not allowed (the message names it).
verify_not_found404No verification with that id on the number.
no_auth_template409No approved AUTHENTICATION template.
verify_country_not_allowed403Not in verify_allowed_calling_codes.
verify_resend_too_soon / verify_recipient_limit429One of the two limits above.
verify_too_many_active4295,000 verifications are waiting on the number.

The complete list is on the errors page.