---
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`

## Request

- Base URL: `http://localhost:3025`
- URL: `http://localhost:3025/connections/{phoneNumber}/import-session`
- Auth: API key in header `x-api-key`

## 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 the explicit-takeover routes: POST /connections/{phoneNumber}, /import-session and /restart.
- `422`: Unprocessable Entity — the requested noise candidate index is out of range.

## Changes

- **2026-08-15** `533b3360e2e4`: 1 breaking, 2 info
  - removed the success response with the status `200`
  - removed the non-success response with the status `404`
  - removed the non-success response with the status `500`
- **2026-08-15** `80b5396ef493`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/fazer-ai/apis/fazer-ai-baileys-api/changes/connections/:phoneNumber/import-session/post.md)

---

[API](https://skmtc.dev/fazer-ai/apis/fazer-ai-baileys-api.md) - [All operations](https://skmtc.dev/fazer-ai/apis/fazer-ai-baileys-api/llms.txt) - [OpenAPI document](https://skmtc.dev/fazer-ai/apis/fazer-ai-baileys-api/revisions/322af11b310e?raw)
