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

# Create device

> Creates a WhatsApp device for the authenticated workspace and starts the pairing process. The response includes the initial device information and QR data when available; scan it with WhatsApp to finish connecting the sender.



## OpenAPI

````yaml /openapi.json post /devices/create
openapi: 3.1.0
info:
  title: Wachat API
  version: v1
  description: >-
    Wachat REST API. Authenticate with a workspace API key: send it as
    `Authorization: Bearer <key>`. Generate keys in the dashboard under
    Developers / API.
servers:
  - url: https://crm.wachat.net/api/v1
security:
  - http: []
tags:
  - name: Message
    description: >-
      Send a single WhatsApp message — text, media (image / video / document /
      audio) or a location pin — to one number, then read its delivery status or
      your message history. A file can be attached directly as a multipart
      `media` field or referenced by a public URL.
  - name: Template
    description: >-
      Create, list and manage your approved WhatsApp templates, and send a
      template to one number with your own header, body variables and button
      values. Use this for utility / marketing sends that need a pre-approved
      template — including one with a PDF / document header (pass the file's
      public URL as the header, e.g. from the Media endpoint).
  - name: Media
    description: >-
      Upload a file once (multipart / form-data, field name `file`, up to 16 MB)
      and get back a hosted public URL you can reuse across sends — for example
      a PDF to use as a document-header on a template, or an image on a message.
  - name: Contact
    description: >-
      Full create / read / update / delete over your contacts and leads,
      including search by number, tags and custom attributes.
  - name: ContactGroup
    description: >-
      Organise contacts into groups: create groups, list them, and add or remove
      members — handy for targeting broadcasts and campaigns.
  - name: Broadcast
    description: >-
      Send the same message to many contacts at once and track each broadcast's
      progress and per-recipient delivery.
  - name: Campaign
    description: >-
      Create, start, pause and monitor drip / marketing campaigns and their
      recipients.
  - name: Scheduled
    description: >-
      Schedule a WhatsApp send for a future time, list upcoming scheduled
      messages, and cancel one before it goes out.
  - name: AutoReply
    description: >-
      Manage keyword auto-replies — the automatic responses that fire when an
      inbound message matches a rule.
  - name: Flow
    description: >-
      Enroll a contact into an automation flow (chatbot) and manage your flows
      through the API.
  - name: Device
    description: >-
      List the WhatsApp numbers / devices connected to your workspace and check
      each one's connection status.
  - name: Webhook
    description: >-
      Register and manage webhook endpoints so Wachat POSTs real-time events
      (message received / sent / delivered / read / failed, plus campaign and
      contact events) to your server. When you set a signing secret each
      delivery carries an HMAC-SHA256 signature header you can verify.
  - name: Deal
    description: >-
      Manage sales-pipeline deals — create, list, update and move deals between
      stages.
  - name: Conversation
    description: >-
      Read your workspace inbox: list chat threads (conversations) and fetch the
      messages inside a thread.
  - name: Account
    description: Read your account details, plan, limits and message-credit usage.
paths:
  /devices/create:
    post:
      tags:
        - Device
      summary: Create device
      description: >-
        Creates a WhatsApp device for the authenticated workspace and starts the
        pairing process. The response includes the initial device information
        and QR data when available; scan it with WhatsApp to finish connecting
        the sender.
      operationId: v1.devices.create
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                device_name:
                  type: string
                  minLength: 2
                  maxLength: 191
                phone_number:
                  type: string
                  minLength: 5
                  maxLength: 32
                country_code:
                  type:
                    - string
                    - 'null'
                  maxLength: 8
                region:
                  type:
                    - string
                    - 'null'
                  maxLength: 16
                activate_after_pairing:
                  type: boolean
              required:
                - device_name
                - phone_number
      responses:
        '201':
          description: Resource created successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      device:
                        type: array
                        items: {}
                      qr:
                        type:
                          - string
                          - 'null'
                      status:
                        type: string
                      phone:
                        anyOf:
                          - type: 'null'
                          - type: array
                            items: {}
                          - type: string
                          - type: object
                      qr_url:
                        type: string
                    required:
                      - device
                      - qr
                      - status
                      - phone
                      - qr_url
                  meta:
                    type: object
                    properties:
                      message:
                        type: string
                        const: Device created. Scan the QR code to finish pairing.
                    required:
                      - message
                required:
                  - data
                  - meta
        '402':
          description: Request failed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        const: plan_limit
                      message:
                        type: string
                      details:
                        type: object
                        properties:
                          limit_key:
                            type: string
                          used:
                            type: string
                          limit:
                            type: string
                        required:
                          - limit_key
                          - used
                          - limit
                    required:
                      - code
                      - message
                      - details
                required:
                  - error
        '403':
          description: Request failed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        const: insufficient_scope
                      message:
                        type: string
                        const: This API key needs the devices.write scope.
                      details:
                        type: string
                    required:
                      - code
                      - message
                      - details
                required:
                  - error
        '409':
          description: Request failed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        const: device_conflict
                      message:
                        type: string
                        const: >-
                          This phone number is already connected to the
                          workspace.
                      details:
                        type: string
                    required:
                      - code
                      - message
                      - details
                required:
                  - error
        '422':
          $ref: '#/components/responses/ValidationException'
          description: Request failed.
        '500':
          description: Request failed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        const: device_create_failed
                      message:
                        type: string
                        const: The device could not be created.
                      details:
                        type: string
                    required:
                      - code
                      - message
                      - details
                required:
                  - error
        '502':
          description: Request failed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        const: pairing_failed
                      message:
                        type: string
                        const: >-
                          The device was not created because pairing could not
                          be started. Please retry.
                      details:
                        type: string
                    required:
                      - code
                      - message
                      - details
                required:
                  - error
        '503':
          description: Request failed.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        const: pairing_unavailable
                      message:
                        type: string
                        const: The device pairing service is not configured.
                      details:
                        type: string
                    required:
                      - code
                      - message
                      - details
                required:
                  - error
components:
  responses:
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    http:
      type: http
      scheme: bearer

````