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

# Get QR

> Returns the QR code of the phone as an HTML page with an inline PNG. Scan it with WhatsApp (Settings > Linked Devices) to connect.



## OpenAPI

````yaml api-reference/openapi-generated.json GET /v1/phones/qr
openapi: 3.0.3
info:
  title: Periskope API
  version: 1.0.0
  description: >-
    Periskope external API.


    Responses use a flat, unwrapped shape: most endpoints return the resource at
    the top level, and list endpoints return a wrapper object with pagination
    inline (e.g. `{ from, to, count, chats: [...] }`). The documented response
    schemas describe these shapes directly.
servers:
  - url: https://api.periskope.app
security:
  - bearerAuth: []
paths:
  /v1/phones/qr:
    get:
      tags:
        - Phones
      summary: Get the QR code of a phone
      description: >-
        Returns the QR code of the phone as an HTML page with an inline PNG.
        Scan it with WhatsApp (Settings > Linked Devices) to connect.
      operationId: getPhoneQr
      parameters:
        - schema:
            type: string
            minLength: 1
            example: '919876543210'
            description: >-
              Phone to act with: country code + number without symbols or spaces
              (e.g. 911111111111), or a phone_id (phone-xxxxxxxxxxxx). The phone
              must be connected to the org and accessible by the API token.
          required: true
          description: >-
            Phone to act with: country code + number without symbols or spaces
            (e.g. 911111111111), or a phone_id (phone-xxxxxxxxxxxx). The phone
            must be connected to the org and accessible by the API token.
          name: x-phone
          in: header
      responses:
        '200':
          description: HTML page with the QR code as an inline base64 PNG image
          content:
            text/html:
              schema:
                type: string
                description: >-
                  HTML snippet containing the QR code as an inline base64 PNG
                  image. Open it in a browser and scan it with WhatsApp
                  (Settings > Linked Devices) to connect.
                example: >-
                  <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
                  />
        '401':
          description: Invalid, expired or missing API token
          content:
            application/json:
              examples:
                error:
                  summary: Invalid, expired or missing API token
                  value:
                    code: UNAUTHORIZED_ERROR
                    message: Invalid bearer auth token
                    status: 401
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: UNAUTHORIZED_ERROR
                  message:
                    type: string
                    example: Invalid bearer auth token
                  status:
                    type: integer
                    example: 401
                example:
                  code: UNAUTHORIZED_ERROR
                  message: Invalid bearer auth token
                  status: 401
        '404':
          description: >-
            QR code not available — the phone is already connected or the QR has
            not been generated yet. Restart or reset the phone to generate one.
          content:
            application/json:
              examples:
                error:
                  summary: >-
                    QR code not available — the phone is already connected or
                    the QR has not been generated yet. Restart or reset the
                    phone to generate one.
                  value:
                    code: NOT_FOUND_ERROR
                    message: >-
                      QR code not available — the phone is already connected or
                      the QR has not been generated yet. Restart or reset the
                      phone to generate one.
                    status: 404
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: NOT_FOUND_ERROR
                  message:
                    type: string
                    example: >-
                      QR code not available — the phone is already connected or
                      the QR has not been generated yet. Restart or reset the
                      phone to generate one.
                  status:
                    type: integer
                    example: 404
                example:
                  code: NOT_FOUND_ERROR
                  message: >-
                    QR code not available — the phone is already connected or
                    the QR has not been generated yet. Restart or reset the
                    phone to generate one.
                  status: 404
        '422':
          description: Request validation failed
          content:
            application/json:
              examples:
                error:
                  summary: Request validation failed
                  value:
                    code: VALIDATION_ERROR
                    message: Request validation failed
                    status: 422
                    fields:
                      body.chat_id:
                        message: chat_id is required
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: VALIDATION_ERROR
                  message:
                    type: string
                    example: Request validation failed
                  status:
                    type: integer
                    example: 422
                  fields:
                    type: object
                    additionalProperties:
                      type: object
                      properties:
                        message:
                          type: string
                        value: {}
                    example:
                      body.chat_id:
                        message: chat_id is required
                example:
                  code: VALIDATION_ERROR
                  message: Request validation failed
                  status: 422
                  fields:
                    body.chat_id:
                      message: chat_id is required
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              examples:
                error:
                  summary: Rate limit exceeded
                  value:
                    code: RATE_LIMIT_ERROR
                    message: You can only make 100 requests per second
                    status: 429
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: RATE_LIMIT_ERROR
                  message:
                    type: string
                    example: You can only make 100 requests per second
                  status:
                    type: integer
                    example: 429
                example:
                  code: RATE_LIMIT_ERROR
                  message: You can only make 100 requests per second
                  status: 429
        '500':
          description: Internal server error
          content:
            application/json:
              examples:
                error:
                  summary: Internal server error
                  value:
                    code: UNKNOWN_ERROR
                    message: Internal server error
                    status: 500
              schema:
                type: object
                properties:
                  code:
                    type: string
                    example: UNKNOWN_ERROR
                  message:
                    type: string
                    example: Internal server error
                  status:
                    type: integer
                    example: 500
                example:
                  code: UNKNOWN_ERROR
                  message: Internal server error
                  status: 500
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: typescript
          label: TypeScript
          source: |-
            import { PeriskopeApi } from '@periskope/periskope-client';

            const client = new PeriskopeApi({
              authToken: 'YOUR_API_KEY',
              phone: '919876543210', // the phone to act with (x-phone)
            });

            async function main() {
              const response = await client.phones.getPhoneQr();
              console.log(response);
            }

            main();
        - lang: bash
          label: cURL
          source: |-
            curl -X GET 'https://api.periskope.app/v1/phones/qr' \
              -H 'Authorization: Bearer YOUR_API_KEY' \
              -H 'x-phone: 919876543210'
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your Periskope API token, sent as `Authorization: Bearer <token>`.
        Generate one from the Periskope dashboard under **Settings → API &
        Webhooks**. API access requires an active Pro or Enterprise plan.

````

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