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

# restart device

> Close any open socket (without logout) and start a new session. Optionally provide a phone number to receive a pairing code instead of QR.



## OpenAPI

````yaml api-reference/openapi.json post /devices/{id}/restart
openapi: 3.1.0
info:
  title: Chatlevel API
  description: >-
    Chatlevel is a WhatsApp web API to manage any WhatsApp account
    programmatically.
  version: v1.0.0
servers:
  - url: https://api.chatlevel.io/v1
security:
  - bearerAuth: []
tags:
  - name: devices
    description: Operations related to managing devices.
  - name: messages
    description: Operations related to sending messages.
paths:
  /devices/{id}/restart:
    post:
      tags:
        - devices
      summary: restart device
      description: >-
        Close any open socket (without logout) and start a new session.
        Optionally provide a phone number to receive a pairing code instead of
        QR.
      operationId: restart-device
      parameters:
        - name: id
          in: path
          description: Device ID
          required: true
          schema:
            type: integer
            description: Numeric device identifier
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                phoneNumber:
                  type: string
                  description: >-
                    Phone number for pairing code authentication (alternative to
                    QR code). Must be digits only, include country code.
                  example: '31612345678'
      responses:
        '200':
          description: Device restarted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/status'
              example:
                status:
                  code: 200
                  message: Device 12345 restarted successfully
        '400':
          $ref: '#/components/responses/400InvalidJSON'
        '401':
          $ref: '#/components/responses/401Unauthorized'
        '404':
          description: Device not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/status'
              example:
                status:
                  code: 404
                  message: Device not found
        '408':
          $ref: '#/components/responses/408Timeout'
        '413':
          $ref: '#/components/responses/413PayloadTooLarge'
        '429':
          $ref: '#/components/responses/429RateLimit'
        '500':
          description: Failed to restart device
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    $ref: '#/components/schemas/status'
              example:
                status:
                  code: 500
                  message: Failed to restart device 12345
components:
  schemas:
    status:
      type: object
      properties:
        code:
          type: integer
          description: Status code
          example: 200
        message:
          type: string
          description: Status message
          example: Success
  responses:
    400InvalidJSON:
      description: Invalid JSON format
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: object
                properties:
                  code:
                    type: integer
                    example: 400
                  message:
                    type: string
                    example: Invalid JSON format
    401Unauthorized:
      description: Missing or invalid authorization header
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: error
              error:
                type: object
                properties:
                  code:
                    type: integer
                    example: 401
                  message:
                    type: string
                    example: >-
                      Missing or invalid authorization header. Please provide a
                      Bearer token.
    408Timeout:
      description: Request timeout
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: object
                properties:
                  code:
                    type: integer
                    example: 408
                  message:
                    type: string
                    example: Request timeout
    413PayloadTooLarge:
      description: Request payload too large
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: object
                properties:
                  code:
                    type: integer
                    example: 413
                  message:
                    type: string
                    example: Request payload too large
    429RateLimit:
      description: Rate limit exceeded
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: object
                properties:
                  code:
                    type: integer
                    example: 429
                  message:
                    type: string
                    example: >-
                      Rate limit exceeded. Maximum 100 requests per minute per
                      user.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key authentication. Provide your API key as: Authorization: Bearer
        <api_key>

````