> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wsapi.chat/llms.txt
> Use this file to discover all available pages before exploring further.

# 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 progress
- `required` — WhatsApp is waiting for the passkey assertion; `challenge` and `origin` are set
- `submitted` — the assertion was sent; waiting for WhatsApp to complete the link
- `confirmation_required` — show `confirmationCode` to the user so they can check it
  matches the code on their phone and approve there. wsapi-app sends the confirmation
  automatically (`confirmationSent` becomes `true`); the link then completes by itself
  (`isLoggedIn` becomes `true`). No confirm call is needed.
- `error` — the step failed or expired; see `error`




## OpenAPI

````yaml /openapi/wsapi-api.yaml get /session/passkey
openapi: 3.0.3
info:
  title: WSAPI - WhatsApp API
  description: >-
    RESTful HTTP API for WhatsApp via whatsmeow. Supports multi-instance
    connections, connections, webhook event delivery, and HMAC-SHA256 signing.
    Includes self-service instance management endpoints served by the API
    Gateway.
  version: 2.0.0
servers:
  - url: https://api.wsapi.chat
    description: WSAPI API
security:
  - ApiKeyAuth: []
tags:
  - name: Account
    description: >-
      Customer account management — instances, subscriptions, and default
      settings (CustomerApiKey auth)
  - name: Session
    description: WhatsApp session management (login, logout, status)
  - name: Messages
    description: Send and manage WhatsApp messages
  - name: Groups
    description: Group management
  - name: Communities
    description: Community management
  - name: Contacts
    description: Contact lookup and management
  - name: Users
    description: Own account management, user lookup, and profile information
  - name: Media
    description: Media download
  - name: Chats
    description: Chat listing, info, settings, and management
  - name: Calls
    description: Call management
  - name: Newsletters
    description: Newsletter/channel management
  - name: Status
    description: Status/stories posting
paths:
  /session/passkey:
    get:
      tags:
        - Session
      summary: Get passkey verification state
      description: >
        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 progress

        - `required` — WhatsApp is waiting for the passkey assertion;
        `challenge` and `origin` are set

        - `submitted` — the assertion was sent; waiting for WhatsApp to complete
        the link

        - `confirmation_required` — show `confirmationCode` to the user so they
        can check it
          matches the code on their phone and approve there. wsapi-app sends the confirmation
          automatically (`confirmationSent` becomes `true`); the link then completes by itself
          (`isLoggedIn` becomes `true`). No confirm call is needed.
        - `error` — the step failed or expired; see `error`
      operationId: getPasskeyState
      parameters:
        - $ref: '#/components/parameters/XInstanceId'
      responses:
        '200':
          description: Passkey verification state
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PasskeyState'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  parameters:
    XInstanceId:
      name: X-Instance-Id
      in: header
      required: true
      description: The ID of the WhatsApp instance to use
      schema:
        type: string
        default: '{{instanceId}}'
  schemas:
    PasskeyState:
      type: object
      properties:
        status:
          type: string
          enum:
            - none
            - required
            - submitted
            - confirmation_required
            - error
          description: Current passkey verification state
        source:
          type: string
          enum:
            - notification
            - requested
          description: >
            Where the challenge came from: `notification` (WhatsApp pushed it
            after the QR scan

            or pair code) or `requested` (fetched via `POST
            /session/passkey/request`, which

            usually leads to `confirmation_required`). Omitted when no step is
            in progress.
        challenge:
          type: object
          description: >
            WebAuthn `PublicKeyCredentialRequestOptionsJSON` sent by WhatsApp,
            with binary fields

            base64url-encoded (accepted by
            `PublicKeyCredential.parseRequestOptionsFromJSON`).

            Pass it to `navigator.credentials.get()` on `origin`. Only set while
            `status` is `required`.
          properties:
            challenge:
              type: string
              description: Challenge bytes (base64url, unpadded)
            timeout:
              type: integer
              description: Timeout in milliseconds
            rpId:
              type: string
              description: Relying party ID
            allowCredentials:
              type: array
              items:
                type: object
                properties:
                  id:
                    type: string
                    description: Credential ID (base64url, unpadded)
                  type:
                    type: string
                    example: public-key
                  transports:
                    type: array
                    items:
                      type: string
            userVerification:
              type: string
              example: required
            extensions:
              type: object
              additionalProperties: true
        origin:
          type: string
          description: >-
            Origin the challenge must be signed on. Only set while `status` is
            `required`.
          example: https://web.whatsapp.com
        confirmationCode:
          type: string
          description: >
            Code to show the user while `status` is `confirmation_required`.
            They must check it

            matches the code on their phone and approve the link there.
        confirmationSent:
          type: boolean
          description: >
            `true` once the confirmation has been sent to WhatsApp (sent
            automatically when

            `status` becomes `confirmation_required`). Omitted until then.
        error:
          type: string
          description: Failure reason when `status` is `error`
        requestedAt:
          type: string
          format: date-time
          description: When WhatsApp requested the passkey verification
        expiresAt:
          type: string
          format: date-time
          description: When the step expires (5 minutes after `requestedAt`)
      required:
        - status
    Error:
      type: object
      description: Standard error response returned by all API endpoints
      required:
        - detail
        - status
      properties:
        detail:
          type: string
          description: Human-readable error message
          example: invalid request body
        status:
          type: integer
          description: HTTP status code
          example: 400
  responses:
    Unauthorized:
      description: Authentication failed
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            status: 401
            detail: unauthorized
    ServiceUnavailable:
      description: Instance not available (not connected or service is nil)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            status: 503
            detail: instance not available
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-Api-Key
      description: >-
        Instance or customer-level API key. Either the instance's own API key or
        the customer's API key is accepted. Must be paired with the
        X-Instance-Id header to identify the target instance.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.