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

# Add a new device

> Create a new device slot for multi-device management



## OpenAPI

````yaml /openapi.yml post /devices
openapi: 3.0.0
info:
  title: WhatsApp API MultiDevice
  version: 9.7.0
  description: |
    This API is used for sending whatsapp via API.

    The web dashboard is a separate project (gowa-ui); the server downloads its
    latest release asset and serves it at `/` (or returns a JSON banner when
    APP_UI_ENABLED=false).

    Device scoping:
    - Send `X-Device-Id` on all device-scoped REST calls.
    - WebSocket: connect to `/ws?device_id=<id>`.
    - WebSocket auth (when basic auth is enabled): browsers cannot set an
      Authorization header on WebSocket connections, so also pass
      `&authorization=<base64(user:pass)>` in the query string. Use TLS in
      production since the credential is visible in the URL.
servers:
  - url: http://localhost:3000
security:
  - basicAuth: []
tags:
  - name: app
    description: Initial Connection to Whatsapp server
  - name: device
    description: Device management for multi-device support
  - name: user
    description: Getting information
  - name: send
    description: Send Message (Text/Image/File/Video).
  - name: message
    description: Message manipulation (revoke/react/update).
  - name: call
    description: Call management (reject incoming calls)
  - name: chat
    description: Chat conversations and messaging
  - name: group
    description: Group setting
  - name: newsletter
    description: newsletter setting
  - name: chatwoot
    description: Chatwoot integration for customer support
paths:
  /devices:
    post:
      tags:
        - device
      summary: Add a new device
      description: Create a new device slot for multi-device management
      operationId: addDevice
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                device_id:
                  type: string
                  description: >-
                    Optional custom device ID. If not provided, one will be
                    generated.
                  example: my-custom-device-id
                webhook_url:
                  type: string
                  description: >-
                    Optional device-specific webhook URL. If set, events for
                    this device will be sent here instead of the global webhook.
                  example: https://device-webhook.example.com/handler
                webhook_secret:
                  type: string
                  description: >-
                    Optional secret used to sign device-specific webhook
                    payloads (HMAC).
                  example: super-secret-key
                webhook_events:
                  type: string
                  description: >-
                    Optional comma-separated list of event names to forward to
                    the device-specific webhook. Empty means all events.
                  example: message,message.ack
                webhook_insecure_skip_verify:
                  type: boolean
                  description: >-
                    Optional. Skip TLS certificate verification when delivering
                    to the device-specific webhook.
                  example: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeviceAddResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorBadRequest'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorInternalServer'
components:
  schemas:
    DeviceAddResponse:
      type: object
      properties:
        code:
          type: string
          example: SUCCESS
        message:
          type: string
          example: Device added
        status:
          type: integer
          example: 200
        results:
          type: object
          properties:
            id:
              type: string
              example: my-device-id
            display_name:
              type: string
              example: John Doe
            state:
              type: string
              enum:
                - disconnected
                - connecting
                - connected
                - logged_in
              example: disconnected
            jid:
              type: string
              example: 628123456789@s.whatsapp.net
            created_at:
              type: string
              format: date-time
              example: '2024-01-01T00:00:00Z'
            webhook_url:
              type: string
              description: Device-specific webhook URL echoed when provided on create
              example: https://device-webhook.example.com/handler
            webhook_secret:
              type: string
              description: Device-specific webhook secret echoed when provided on create
              example: super-secret-key
            webhook_events:
              type: string
              description: Device-specific event whitelist echoed when provided on create
              example: message,message.ack
            webhook_insecure_skip_verify:
              type: boolean
              description: >-
                Device-specific TLS verification setting echoed when provided on
                create
              example: false
    ErrorBadRequest:
      type: object
      properties:
        code:
          type: string
          example: 400
          description: HTTP Status Code
        message:
          type: string
          example: field cannot be blank
          description: Detail error message
        results:
          type: object
          example: null
          description: additional data
    ErrorInternalServer:
      type: object
      properties:
        code:
          type: string
          example: INTERNAL_SERVER_ERROR
          description: SYSTEM_CODE_ERROR
        message:
          type: string
          example: you are not loggin
          description: Detail error message
        results:
          type: object
          example: null
          description: additional data
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic

````

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