Skip to main content
GET
/
app
/
login-with-code
Login with Pairing Code
curl --request GET \
  --url https://api.example.com/app/login-with-code \
  --header 'Authorization: <authorization>'
{
  "500": {},
  "code": "<string>",
  "message": "<string>",
  "results": {
    "pair_code": "<string>"
  }
}
Initiate the login process by generating a pairing code that can be entered in your WhatsApp mobile app.

Authentication

Authorization
string
required
Basic authentication credentials (username:password in base64)

Headers

X-Device-Id
string
Device identifier for multi-device support. Required when multiple devices are registered. If only one device is registered, it will be used as the default.

Query Parameters

phone
string
required
Your phone number with country code (no + prefix)Example: 628912344551

Response

code
string
Response code indicating success or failureExample: SUCCESS
message
string
Human-readable response messageExample: Success
results
object
Login response data
pair_code
string
The pairing code to enter in WhatsAppExample: ABCD-1234

Example Request

curl -X GET 'http://localhost:3000/app/login-with-code?phone=628912344551' \
  -u 'username:password' \
  -H 'X-Device-Id: my-device-id'

Response Example

{
  "code": "SUCCESS",
  "message": "Success",
  "results": {
    "pair_code": "ABCD-1234"
  }
}

Error Responses

500
object
Internal Server Error
{
  "code": "INTERNAL_SERVER_ERROR",
  "message": "Failed to generate pairing code",
  "results": null
}

Usage Notes

  • Enter the pairing code in WhatsApp: Settings > Linked Devices > Link a Device > Link with Phone Number Instead
  • The pairing code is time-limited and expires after a short period
  • Make sure to use your phone number with country code but without the + prefix
  • Once paired successfully, your session will be established
  • The device will remain logged in until you explicitly logout

Build docs developers (and LLMs) love