> ## 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.

# Guida rapida

> Invia il tuo primo messaggio WhatsApp in meno di 5 minuti.

# Guida rapida

Questa guida ti accompagna nella creazione di un'istanza, nella connessione e nell'invio del tuo primo messaggio.

## Prerequisiti

* Un account Wappfy ([registrati](https://app.wappfy.io/register))
* Un numero WhatsApp da collegare
* Una chiave API o un token JWT Supabase

## Passo 1: Ottieni la tua chiave API

```bash theme={null}
curl -X POST https://api.wappfy.io/api/api-keys \
  -H "Authorization: Bearer YOUR_SUPABASE_JWT" \
  -H "Content-Type: application/json" \
  -d '{ "name": "My First Key" }'
```

<Warning>
  Salva il valore `key` restituito — viene mostrato una sola volta.
</Warning>

## Passo 2: Crea un'istanza

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

Salva l'`id` restituito — lo utilizzerai in tutte le richieste successive.

## Passo 3: Connetti tramite codice QR

```bash theme={null}
# Avvia la connessione
curl -X POST https://api.wappfy.io/api/instances/INSTANCE_ID/connect \
  -H "X-Api-Key: YOUR_API_KEY"

# Ottieni il codice QR
curl https://api.wappfy.io/api/instances/INSTANCE_ID/qr \
  -H "X-Api-Key: YOUR_API_KEY"
```

Apri WhatsApp sul tuo telefono, vai su **Dispositivi collegati** e scansiona il codice QR restituito nel campo `qr` (immagine base64).

## Passo 4: Invia un messaggio

Una volta che lo stato dell'istanza e `connected`, puoi inviare il tuo primo messaggio:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.wappfy.io/api/instances/INSTANCE_ID/messages/send \
    -H "X-Api-Key: YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "to": "5511999999999",
      "type": "text",
      "body": "Hello from 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': 'YOUR_API_KEY',
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        to: '5511999999999',
        type: 'text',
        body: 'Hello from 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": "YOUR_API_KEY"},
      json={
          "to": "5511999999999",
          "type": "text",
          "body": "Hello from Wappfy!",
      },
  )
  print(response.json()["data"]["jobId"])
  ```
</CodeGroup>

## Risposta

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

## Prossimi passi

<CardGroup cols={2}>
  <Card title="Invia tutti i tipi di messaggio" icon="paper-plane" href="/it/guides/sending-messages">
    Immagini, video, sondaggi, contatti e altro
  </Card>

  <Card title="Configura i webhook" icon="webhook" href="/it/guides/webhooks">
    Ricevi messaggi in arrivo e stato di consegna
  </Card>
</CardGroup>
