---
title: "Import an extracted WhatsApp Web session (no QR)"
method: POST
path: "/connections/{phoneNumber}/import-session"
tags: ["Connections"]
---

# Import an extracted WhatsApp Web session (no QR)

`POST /connections/{phoneNumber}/import-session`

## Path parameters

- `phoneNumber` string, required

## Request body

- object
  - `session` object, required — Impersonation credentials — never log this object. Transported over HTTPS only.
    - `noiseCandidates` object[], required — Noise keypair candidates (base64). Only one is the real pair; the server cycles them until the socket opens.
      - `private` string, required
      - `public` string, required
    - `identityKey` object, required
      - `private` string, required
      - `public` string, required
    - `registrationId` number, required
    - `advSecretKey` string, required — ADV secret key (base64)
    - `account` object, required
      - `details` string, required
      - `accountSignatureKey` string, required
      - `accountSignature` string, required
      - `deviceSignature` string, required
    - `id` string, required — Companion device JID
    - `lid` string
    - `platform` string
    - `signedPreKey` object
      - `keyId` number, required
      - `private` string, required
      - `public` string, required
      - `signature` string, required
    - `pushName` string
    - `routingInfo` string
  - `candidateIndex` number — Index into session.noiseCandidates to try first (only one candidate is the real pair).
  - `clientName` string — Name of the client to be used on WhatsApp connection
  - `webhookUrl` string, uri, required — URL for receiving updates
  - `webhookVerifyToken` string, required — Token for verifying webhook
  - `includeMedia` boolean — Include media in messages.upsert event payload as base64 string
  - `syncFullHistory` boolean — Sync full history of messages on connection.
  - `groupsEnabled` boolean — Enable full group message processing. When false, group messages are accumulated and sent as activity summaries.
  - `autoPresenceSubscribe` boolean — Automatically subscribe to presence updates when sending/receiving messages or typing status to/from a contact. Subscriptions are ephemeral and re-established automatically.

## Response `202`

Session import accepted; connecting

## Other responses

- `403` — Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key.
- `409` — Conflict — in cluster mode, the connection is owned by another live instance (id in the x-baileys-owner header).
- `421` — Misdirected Request — in cluster mode, this instance does not own the connection. The owning instance id is in the x-baileys-owner header; a proxy re-routes the request there. Not returned for POST /connections/{phoneNumber} (explicit takeover).
- `422` — Unprocessable Entity — the requested noise candidate index is out of range.

---

[API](https://skmtc.net/fazer-ai/apis/fazer-ai-baileys-api.md) · [All operations](https://skmtc.net/fazer-ai/apis/fazer-ai-baileys-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/fazer-ai/fazer-ai-baileys-api/revisions/533b3360e2e4/schema)
