curl --request GET \
--url https://api.wsapi.chat/session/passkey \
--header 'X-Api-Key: <api-key>' \
--header 'X-Instance-Id: <x-instance-id>'import requests
url = "https://api.wsapi.chat/session/passkey"
headers = {
"X-Instance-Id": "<x-instance-id>",
"X-Api-Key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Instance-Id': '<x-instance-id>', 'X-Api-Key': '<api-key>'}
};
fetch('https://api.wsapi.chat/session/passkey', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));using RestSharp;
var options = new RestClientOptions("https://api.wsapi.chat/session/passkey");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("X-Instance-Id", "<x-instance-id>");
request.AddHeader("X-Api-Key", "<api-key>");
var response = await client.GetAsync(request);
Console.WriteLine("{0}", response.Content);
{
"status": "none",
"source": "notification",
"challenge": {
"challenge": "<string>",
"timeout": 123,
"rpId": "<string>",
"allowCredentials": [
{
"id": "<string>",
"type": "public-key",
"transports": [
"<string>"
]
}
],
"userVerification": "required",
"extensions": {}
},
"origin": "https://web.whatsapp.com",
"confirmationCode": "<string>",
"confirmationSent": true,
"error": "<string>",
"requestedAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z"
}{
"status": 401,
"detail": "unauthorized"
}{
"status": 503,
"detail": "instance not available"
}Get passkey verification state
Returns the state of the passkey verification step, if any.
On some accounts WhatsApp does not finish linking after the QR scan or pair code is
accepted. Instead it asks the account owner to verify with their passkey, sending a
standard WebAuthn challenge. While status is required, this endpoint returns that
challenge in challenge (a PublicKeyCredentialRequestOptionsJSON object with
base64url-encoded binary fields).
The challenge must be signed with navigator.credentials.get() in a browser on the
https://web.whatsapp.com origin (WebAuthn binds the origin into clientDataJSON, so
a server cannot sign it on its own) — typically via a browser extension or a snippet
pasted into the DevTools console on web.whatsapp.com. Submit the resulting assertion
with POST /session/passkey.
The step expires 5 minutes after it is requested (expiresAt); after that the status
becomes error and a new QR or pair code must be generated. While the step is pending,
GET /session/qr, GET /session/qr/text and GET /session/pair-code/{phone} return
409 — stop polling them. GET /session/status also reports the state as passkeyStatus,
so a single poll is enough to notice the step.
Statuses:
none— no passkey step in progressrequired— WhatsApp is waiting for the passkey assertion;challengeandoriginare setsubmitted— the assertion was sent; waiting for WhatsApp to complete the linkconfirmation_required— showconfirmationCodeto the user so they can check it matches the code on their phone and approve there. wsapi-app sends the confirmation automatically (confirmationSentbecomestrue); the link then completes by itself (isLoggedInbecomestrue). No confirm call is needed.error— the step failed or expired; seeerror
curl --request GET \
--url https://api.wsapi.chat/session/passkey \
--header 'X-Api-Key: <api-key>' \
--header 'X-Instance-Id: <x-instance-id>'import requests
url = "https://api.wsapi.chat/session/passkey"
headers = {
"X-Instance-Id": "<x-instance-id>",
"X-Api-Key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'X-Instance-Id': '<x-instance-id>', 'X-Api-Key': '<api-key>'}
};
fetch('https://api.wsapi.chat/session/passkey', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));using RestSharp;
var options = new RestClientOptions("https://api.wsapi.chat/session/passkey");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddHeader("X-Instance-Id", "<x-instance-id>");
request.AddHeader("X-Api-Key", "<api-key>");
var response = await client.GetAsync(request);
Console.WriteLine("{0}", response.Content);
{
"status": "none",
"source": "notification",
"challenge": {
"challenge": "<string>",
"timeout": 123,
"rpId": "<string>",
"allowCredentials": [
{
"id": "<string>",
"type": "public-key",
"transports": [
"<string>"
]
}
],
"userVerification": "required",
"extensions": {}
},
"origin": "https://web.whatsapp.com",
"confirmationCode": "<string>",
"confirmationSent": true,
"error": "<string>",
"requestedAt": "2023-11-07T05:31:56Z",
"expiresAt": "2023-11-07T05:31:56Z"
}{
"status": 401,
"detail": "unauthorized"
}{
"status": 503,
"detail": "instance not available"
}Authorizations
Response
Passkey verification state