POST /devices/me/login-code

Generate pairing code for WhatsApp login (no QR scan needed). Enter the code in WhatsApp > Linked Devices > Link with phone number.

application/json

Body Required

  • phone string Required

    Phone number without + or spaces

Responses

  • 200 application/json

    Pairing code generated successfully

    Hide response attributes Show response attributes object
    • status boolean
    • code integer
    • message string
    • data object
      Hide data attributes Show data attributes object
      • pair_code string
      • timeout integer
  • 400 application/json

    Bad request

    Hide response attributes Show response attributes object
    • status boolean
    • code integer
    • message string
    • error string
  • 401 application/json

    Unauthorized

    Hide response attributes Show response attributes object
    • status boolean
    • code integer
    • message string
    • error string
  • 500 application/json

    Internal server error

    Hide response attributes Show response attributes object
    • status boolean
    • code integer
    • message string
    • error string
POST /devices/me/login-code
curl \
 --request POST 'http://localhost:7001/devices/me/login-code' \
 --header "Authorization: $API_KEY" \
 --header "Content-Type: application/json" \
 --data '{"phone":"6281234567890"}'
Request examples
{
  "phone": "6281234567890"
}
Response examples (200)
{
  "code": 200,
  "data": {
    "timeout": 120,
    "pair_code": "ABCD-1234"
  },
  "status": true,
  "message": "Pairing code generated successfully"
}
Response examples (200)
{
  "status": true,
  "code": 200,
  "message": "Pairing code generated successfully",
  "data": {
    "pair_code": "ABCD-1234",
    "timeout": 120
  }
}
Response examples (400)
{
  "code": 400,
  "error": "Phone number is required",
  "status": false,
  "message": "Bad request"
}
Response examples (400)
{
  "status": false,
  "code": 400,
  "message": "Bad request",
  "error": "Bad request"
}
Response examples (401)
{
  "code": 401,
  "error": "Invalid or expired JWT token",
  "status": false,
  "message": "Unauthorized"
}
Response examples (401)
{
  "status": false,
  "code": 401,
  "message": "Unauthorized",
  "error": "Invalid or missing authentication"
}
Response examples (500)
{
  "code": 500,
  "error": "Failed to generate pairing code",
  "status": false,
  "message": "Internal server error"
}
Response examples (500)
{
  "status": false,
  "code": 400,
  "message": "Bad request",
  "error": "Bad request"
}