curl --request POST \
--url https://app.hypersender.com/api/whatsapp/v1/{instance}/request-new-qr-code \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.hypersender.com/api/whatsapp/v1/{instance}/request-new-qr-code"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.hypersender.com/api/whatsapp/v1/{instance}/request-new-qr-code', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.hypersender.com/api/whatsapp/v1/{instance}/request-new-qr-code",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.hypersender.com/api/whatsapp/v1/{instance}/request-new-qr-code"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.hypersender.com/api/whatsapp/v1/{instance}/request-new-qr-code")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.hypersender.com/api/whatsapp/v1/{instance}/request-new-qr-code")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "c9a1dd76-5678-4f9d-9012-a5b78de100c3",
"name": "MyInstanceName",
"phone": "+201234567890",
"service_type": "whatsapp",
"status": "SCAN_QR_CODE",
"qr_code": "iVBORw0KGgoAAAANSUhEUgAAA...",
"access_token": "234|3uB2pBST2H6If8twXIeUaeNu23VJ8XassYoOVJuva48388e1",
"created_at": "2025-05-26T10:12:45"
}{
"message": "Resource not found."
}{
"message": "Too many requests. Please try again later."
}Request New QR Code
Generate a new QR code for instance authentication after an expired or failed scan.
curl --request POST \
--url https://app.hypersender.com/api/whatsapp/v1/{instance}/request-new-qr-code \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.hypersender.com/api/whatsapp/v1/{instance}/request-new-qr-code"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.hypersender.com/api/whatsapp/v1/{instance}/request-new-qr-code', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.hypersender.com/api/whatsapp/v1/{instance}/request-new-qr-code",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.hypersender.com/api/whatsapp/v1/{instance}/request-new-qr-code"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.hypersender.com/api/whatsapp/v1/{instance}/request-new-qr-code")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.hypersender.com/api/whatsapp/v1/{instance}/request-new-qr-code")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "c9a1dd76-5678-4f9d-9012-a5b78de100c3",
"name": "MyInstanceName",
"phone": "+201234567890",
"service_type": "whatsapp",
"status": "SCAN_QR_CODE",
"qr_code": "iVBORw0KGgoAAAANSUhEUgAAA...",
"access_token": "234|3uB2pBST2H6If8twXIeUaeNu23VJ8XassYoOVJuva48388e1",
"created_at": "2025-05-26T10:12:45"
}{
"message": "Resource not found."
}{
"message": "Too many requests. Please try again later."
}Rate Limit
This endpoint is limited to 1 request per minute to prevent abuse and protect against rapid QR code generation attempts.When to Use
Use this endpoint when:- The QR code has expired (typically after 60 seconds)
- The initial QR code scan failed
- The user closed the scanning interface without completing authentication
- You need to refresh the authentication flow
Response
The response includes:- Updated instance details
qr_code- New base64-encoded PNG QR code- Current instance status (should be
SCAN_QR_CODE) access_token- Your instance access token
QR Code Display
The QR code is returned as a base64-encoded PNG without the data URI prefix. To display it in HTML:<img src="data:image/png;base64,{qr_code}" alt="WhatsApp QR Code" />
Authentication Flow
- Request a new QR code
- Display it to the user
- User scans with WhatsApp mobile app (Settings > Linked Devices)
- Monitor instance status until it changes to
WORKING
Error Responses
- 404: Instance not found - Check if the instance UUID is correct
- 429: Rate limit exceeded - Wait at least 60 seconds before requesting again
Authorizations
Bearer token authentication. Example: Bearer 234|3uB2pBST2H6If8twXIeUaeNu23VJ8XassYoOVJuva48388e1
Headers
application/json
"application/json"
Path Parameters
Instance UUID copied from hypersender dashboard
"{{ instance_id }}"
Response
New QR code generated successfully
Instance UUID
"fa3d01c4-1234-4c0d-a12f-df319b612f8c"
Instance name
"MyInstanceName"
Phone number in E.164 format
"+201234567890"
Service type
"whatsapp"
Instance status
STOPPED, STARTING, WORKING, SCAN_QR_CODE, FAILED, PENDING "WORKING"
Access token for the instance
"234|3uB2pBST2H6If8twXIeUaeNu23VJ8XassYoOVJuva48388e1"
Creation timestamp
"2025-05-26T10:12:45"
Base64-encoded PNG QR code (without data:image/png;base64, prefix). You must prepend it manually when displaying: [Image blocked: No description]
"iVBORw0KGgoAAAANSUhEUgAAA..."