← Blog

·

Two-step verification PIN on the WhatsApp API: how to set and reset it

Updated on November 24, 2026

To set or change the two-step verification PIN on the WhatsApp Business API, send POST /{PHONE_NUMBER_ID} with the body {"pin": "123456"}; if nobody remembers the current PIN, reset it in WhatsApp Manager under the number’s Two-step verification tab. There is no endpoint to disable the PIN. Since September 2026, Meta has been deprecating the PIN for eligible Cloud API numbers: on those numbers the tab disappears from WhatsApp Manager and the PIN is no longer checked at registration.

This guide shows how to set, change and reset the PIN, how to tell whether your number is already part of the deprecation and how to handle PIN-related errors.

What the two-step verification PIN is for

The PIN is a 6-digit number tied to the phone number on the platform. According to Meta’s business phone numbers page, you must set a PIN when registering the number, and it is required to change the PIN or delete the number.

It is not the 6-digit code sent by SMS or voice call. The difference:

Verification code (OTP)Two-step verification PIN
Who creates itMeta, on each requestYou
How you get itSMS or call to the numberYou don’t: you store it
What it provesThat you have access to the lineThat you control the number’s registration
Where it is usedverify_coderegister and PIN changes

The PIN stops someone who obtained an SMS code from registering your number somewhere else. How it fits into registration is covered in how to register a phone number on the WhatsApp Cloud API.

How to set or change the PIN through the API

From the two-step verification documentation:

curl -X POST "https://graph.facebook.com/v27.0/PHONE_NUMBER_ID" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "pin": "583920" }'

Successful response:

{ "success": true }

pin is required and has 6 digits. Use a token with the whatsapp_business_management permission, ideally from a system user, not the personal token of whoever is setting things up.

You can also set the PIN during registration. According to the registration documentation, if the number does not have two-step verification yet, the pin you send to POST /{PHONE_NUMBER_ID}/register becomes its PIN. If it already has one, you must send the current PIN.

Generate and store the PIN without exposing it

A weak PIN (123456, the founding year, the last digits of the company tax ID) defeats the purpose. Generate the value in code and write it straight to your secrets vault, never through a spreadsheet or chat:

import os
import secrets
import requests

GRAPH = "https://graph.facebook.com/v27.0"
TOKEN = os.environ["WHATSAPP_TOKEN"]
PHONE_NUMBER_ID = os.environ["PHONE_NUMBER_ID"]


def generate_pin() -> str:
    while True:
        pin = f"{secrets.randbelow(10**6):06d}"
        if len(set(pin)) > 2 and pin not in "0123456789" and pin not in "9876543210":
            return pin


def rotate_pin(save_to_vault) -> None:
    pin = generate_pin()
    r = requests.post(
        f"{GRAPH}/{PHONE_NUMBER_ID}",
        headers={"Authorization": f"Bearer {TOKEN}"},
        json={"pin": pin},
        timeout=30,
    )
    r.raise_for_status()
    save_to_vault(f"whatsapp/{PHONE_NUMBER_ID}/pin", pin)

save_to_vault is your secrets manager’s function (AWS Secrets Manager, Vault, 1Password or similar). Only save the PIN after the success response, so the vault never holds a value Meta did not accept.

Want to try it while you read? Create a Vectalk account and send your first message through the official API. Create free account →

How to reset a forgotten PIN

Forgot the PIN, or your previous provider never handed it over? Meta’s documentation points to WhatsApp Manager:

  1. Open your business portfolio Settings and select the business.
  2. Go to Messaging accounts (WhatsApp accounts in the older model) and pick the account.
  3. In the account panel, click Settings and open WhatsApp Manager.
  4. Find the phone number and open its settings.
  5. On the Two-step verification tab, click Change PIN, enter the new PIN and confirm.

You need access to the account in the portfolio. If the actual problem is that you cannot get into the portfolio, start with how to recover access to Business Manager.

After changing it, use the new PIN on the next register call. Remember that registration and deregistration are limited to 10 calls per number in 72 hours; beyond that you get error 133016.

The 2026 PIN deprecation

Meta’s WhatsApp Business account updates page describes the change:

  • Meta is deprecating the 6-digit PIN for eligible Cloud API numbers.
  • The rollout is gradual, by business cohort, starting with general availability on September 23, 2026 and reaching all businesses by mid-October 2026. Later phases are planned for the first half of 2027 and the first half of 2028.
  • On eligible numbers, Meta no longer uses the PIN you send to validate registration, clears any leftover PIN state and does not create a new PIN.
  • Re-registering an already registered number succeeds without resetting the PIN, and the register response indicates when the PIN was not reset.

What does not change: ownership verification by code (OTP), token and permission checks, registration rate limits, and two-step verification inside the WhatsApp and WhatsApp Business apps.

What to do in your code

Meta’s guidance is to keep sending a valid 6-digit pin in POST /{PHONE_NUMBER_ID}/register until a separate API contract change is announced. In other words, do not drop the field from the payload, even if your number is already eligible.

How to tell if your number is eligible

Open the number in WhatsApp Manager. If the Two-step verification tab no longer appears, the number is eligible and there is no PIN to change there. If the tab is still there, the number is not part of the deprecation yet and the PIN still applies, so keep protecting it as before.

PIN-related errors

From Meta’s error codes table:

CodeMeaningWhat to do
133005Two-step verification PIN incorrectCheck the PIN in your vault. If nobody knows it, change it in WhatsApp Manager and register with the new one
133008Too many PIN guesses for this numberWait for the time given in the details field before retrying
133009PIN entered too quicklyRead details and space out attempts
133006Number must be verified before registeringRun request_code and verify_code first
133016Too many registration or deregistration attemptsWait for the 72-hour block to end
131031Account restricted for policy reasons, or request data that does not match, such as a wrong PINIf the account is not restricted, check the PIN

Two details:

  • The table’s fix for 133005 mentions disabling two-step verification and setting a new PIN. Since there is no endpoint to disable it, in practice the path is Change PIN in WhatsApp Manager.
  • Never put register inside an automatic retry loop. Each PIN failure uses up attempts and can lead to 133008 or 133016. More about these blocks in WhatsApp errors 133010 and 133016 and WhatsApp error 131031.

PIN best practices

  • One owner per PIN. Decide who in the company is responsible for it and where it is stored.
  • Rotate when someone leaves. If a person or vendor who knew the PIN is no longer involved, change it.
  • Be suspicious of PIN requests. The PIN is only used for registration. A request outside a migration you started is a scam signal. See WhatsApp Business account security.
  • Switching providers. In the current model, switching providers means sharing your WhatsApp account with the new partner, without migrating the number. Still, keep the PIN documented. Details in how to switch WhatsApp API providers.
  • Virtual or landline numbers. The PIN works the same on any type of line. Their specific caveats are in virtual numbers on the WhatsApp API.

How to do it with Vectalk

With Vectalk, registration uses the instance token, which already identifies the number: POST https://apis.vectalk.com.br/api/phone-numbers/register with the pin in the body, as described in the Vectalk registration docs. Follow Meta’s guidance and keep sending a valid 6-digit PIN, even on numbers already eligible for the deprecation.

Setting and changing the PIN are done in WhatsApp Manager or directly on the Graph API, as shown above. Vectalk is a proxy for the official WhatsApp API, and the number stays in your company’s own WhatsApp account. Create an account at apps.vectalk.com.br/register.

Frequently asked questions

Can I disable the two-step verification PIN through the API?

No. Meta states there is no endpoint to disable two-step verification. You can change the PIN through the API or in WhatsApp Manager.

I forgot the PIN. Will I lose the number?

No. With access to the portfolio, change the PIN on the number’s Two-step verification tab in WhatsApp Manager and register with the new value.

Is the PIN still required in the register call?

The field stays in the payload. On numbers eligible for the deprecation, Meta no longer uses it to validate registration, but asks you to keep sending a valid 6-digit PIN until it announces an API contract change.

How do I know my number no longer uses a PIN?

If the Two-step verification tab is gone from the number in WhatsApp Manager, it is eligible. If the tab is there, the PIN still applies.

What does error 133008 mean?

There were too many PIN attempts for the number. Wait for the time shown in the response’s details field before trying again.


Official sources checked on November 24, 2026: Two-step verification (Meta), WhatsApp Business account updates: 2FA PIN (Meta), Registration (Meta), Business phone numbers (Meta), Error codes (Meta), Vectalk docs: register number.

Put your business on the official WhatsApp

Create your account, connect your number to the official API (you can keep the app with coexistence) and start serving customers and sending messages.