Skip to main content
POST
/
api
/
{session}
/
auth
/
request-code
Request authentication code.
curl --request POST \
  --url https://{host}/api/{session}/auth/request-code \
  --header 'Content-Type: application/json' \
  --header 'apikey: <api-key>' \
  --data '{
  "phoneNumber": "12132132130",
  "method": null
}'
{
  "code": "ABCD-1234"
}

Description

This endpoint allows requesting a pairing code as alternative method of authentication, without the need to scan the QR Code. The received code must be entered in the WhatsApp app to establish the connection.

URL Parameters

session
string
required
Unique ID of the session to be authenticated

Body

{
  "phone": "5511999999999"
}

Body Parameters

PropertyTypeRequiredDescription
phonestring✅ YesPhone number for which the pairing code will be requested

Response

code
string
required
Pairing code generated. This code must be entered in the WhatsApp app to complete authentication.
{
  "code": "ABCD-1234"
}

Status Codes

  • 200 - Code generated successfully
  • 400 - Invalid parameters (ex: invalid phone number)
  • 401 - Unauthorized

Usage Example

curl -X POST https://api.wappfy.com.br/api/my-session/auth/request-code \
  -H "Content-Type: application/json" \
  -d '{
    "phone": "5511999999999"
  }'

Authorizations

apikey
string
header
required

Your Wappfy API key (get it at dash.wappfy.com.br)

Path Parameters

session
string
required

The session name (instanceName) you want to authenticate

Body

application/json
phoneNumber
string
required

Mobile phone number in international format

Example:

"12132132130"

method
string

How would you like to receive the one time code for registration? |sms|voice. Leave empty for Web pairing.

Example:

null

I