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

# Criar Instância

> Cria uma nova instância WhatsApp



## OpenAPI

````yaml openapi-v2.json post /instances
openapi: 3.0.0
info:
  title: Wapizap API v2 - Native
  description: >-
    API v2 nativa Wapizap com arquitetura RESTful moderna. Inclui 60 endpoints
    para gerenciamento completo de integrações WhatsApp, incluindo instâncias,
    mensagens, chats, grupos, contatos, webhooks e downloads.
  version: 2.0.0
  contact:
    name: Wapizap Support
    url: https://wapizap.com/support
servers:
  - url: https://api.wapizap.com/api/v2
    description: Produção
  - url: http://localhost:3000/api/v2
    description: Desenvolvimento
security:
  - BearerAuth: []
tags:
  - name: Instances
    description: Gerenciamento de instâncias WhatsApp
  - name: Messages
    description: Envio e gerenciamento de mensagens
  - name: Chats
    description: Gerenciamento de chats e conversas
  - name: Contacts
    description: Gerenciamento de contatos
  - name: Groups
    description: Gerenciamento de grupos
  - name: Webhooks
    description: Configuração de webhooks
  - name: Downloads
    description: Download de mídias
paths:
  /instances:
    post:
      tags:
        - Instances
      summary: Criar Instância
      description: Cria uma nova instância WhatsApp
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - name
              properties:
                name:
                  type: string
                  example: minha-loja
                webhookUrl:
                  type: string
                  format: uri
                  example: https://meusite.com/webhook
                qrcode:
                  type: boolean
                  default: true
                  description: Gerar QR code imediatamente
                integration:
                  type: string
                  enum:
                    - baileys
                  default: baileys
      responses:
        '201':
          description: Instância criada
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Instance'
        '400':
          description: Erro de validação
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    Instance:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        status:
          type: string
          enum:
            - connected
            - disconnected
            - connecting
            - error
        phone:
          type: string
          description: Número WhatsApp conectado
        profilePicture:
          type: string
          format: uri
        createdAt:
          type: string
          format: date-time
        lastConnection:
          type: string
          format: date-time
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
        code:
          type: string
        details:
          type: object
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````