---
title: "Recreate the socket, keeping the session"
method: POST
path: "/connections/{phoneNumber}/restart"
tags: ["Connections"]
---

# Recreate the socket, keeping the session

`POST /connections/{phoneNumber}/restart`

## Request

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

Tears down the live socket and spawns a replacement using the stored session, without clearing auth state — no QR, no re-pairing. Recovers a connection that is receiving and passing health checks but whose sends are wedged.

## Path parameters

- `phoneNumber` string, required

## Request body

- object
  - `reason` string: Free-text note recorded in the restart log line

## Response `202`

Restart accepted; reconnecting

## Other responses

- `403`: Forbidden — the API key does not own this connection. Returned when a connection is bound to a different API key.
- `404`: No stored session for this phone number
- `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.

## Changes

- **2026-08-23** `5299037901a9`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/fazer-ai/apis/fazer-ai-baileys-api/changes/connections/:phoneNumber/restart/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)
