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

# Início Rápido

> Envie sua primeira mensagem WhatsApp em menos de 5 minutos.

# Início Rápido

Este guia mostra como criar uma instância, conectá-la e enviar sua primeira mensagem.

## Pré-requisitos

* Uma conta Wappfy ([cadastre-se](https://app.wappfy.io/register))
* Um número WhatsApp para conectar
* Uma chave de API ou token JWT do Supabase

## Passo 1: Obtenha sua chave de API

```bash theme={null}
curl -X POST https://api.wappfy.io/api/api-keys \
  -H "Authorization: Bearer SEU_JWT_SUPABASE" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Minha Primeira Chave" }'
```

<Warning>
  Salve o valor retornado no campo `key` — ele só é exibido uma única vez.
</Warning>

## Passo 2: Crie uma instância

```bash theme={null}
curl -X POST https://api.wappfy.io/api/instances \
  -H "X-Api-Key: SUA_CHAVE_API" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "WhatsApp Produção",
    "instance_type": "waha"
  }'
```

Salve o `id` retornado — você o usará em todas as requisições seguintes.

## Passo 3: Conecte via QR code

```bash theme={null}
# Iniciar a conexão
curl -X POST https://api.wappfy.io/api/instances/ID_DA_INSTANCIA/connect \
  -H "X-Api-Key: SUA_CHAVE_API"

# Obter o QR code
curl https://api.wappfy.io/api/instances/ID_DA_INSTANCIA/qr \
  -H "X-Api-Key: SUA_CHAVE_API"
```

Abra o WhatsApp no seu celular, vá em **Aparelhos Conectados** e escaneie o QR code retornado no campo `qr` (imagem base64).

## Passo 4: Envie uma mensagem

Quando o status da instância estiver como `connected`, você pode enviar sua primeira mensagem:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.wappfy.io/api/instances/ID_DA_INSTANCIA/messages/send \
    -H "X-Api-Key: SUA_CHAVE_API" \
    -H "Content-Type: application/json" \
    -d '{
      "to": "5511999999999",
      "type": "text",
      "body": "Olá da Wappfy!"
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch(
    `https://api.wappfy.io/api/instances/${instanceId}/messages/send`,
    {
      method: 'POST',
      headers: {
        'X-Api-Key': 'SUA_CHAVE_API',
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        to: '5511999999999',
        type: 'text',
        body: 'Olá da Wappfy!',
      }),
    }
  );
  const data = await response.json();
  console.log(data.data.jobId);
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      f"https://api.wappfy.io/api/instances/{instance_id}/messages/send",
      headers={"X-Api-Key": "SUA_CHAVE_API"},
      json={
          "to": "5511999999999",
          "type": "text",
          "body": "Olá da Wappfy!",
      },
  )
  print(response.json()["data"]["jobId"])
  ```
</CodeGroup>

## Resposta

```json theme={null}
{
  "success": true,
  "data": {
    "message": "Message queued for delivery",
    "jobId": "12345"
  },
  "meta": {
    "requestId": "req_abc123",
    "timestamp": "2026-02-10T12:00:00.000Z"
  }
}
```

## Próximos passos

<CardGroup cols={2}>
  <Card title="Enviar todos os tipos de mensagem" icon="paper-plane" href="/pt-BR/guides/sending-messages">
    Imagens, vídeos, enquetes, contatos e mais
  </Card>

  <Card title="Configurar webhooks" icon="webhook" href="/pt-BR/guides/webhooks">
    Receba mensagens e status de entrega
  </Card>
</CardGroup>
