# Troubleshooting

> Common issues and solutions for Sendable API integration.

Source: https://wav1.recrav.com/docs/troubleshooting

## Session Disconnections [#session-disconnections]

**Symptom:** Messages fail with "Session not connected" error.

**Solutions:**

1. **Check session status in dashboard**
   * Navigate to your session page
   * Verify connection indicator is green

2. **Reconnect the session**
   * Go to session settings
   * Click "Reconnect"
   * Scan QR code with WhatsApp

3. **Check phone connectivity**
   * Ensure your phone has internet access
   * WhatsApp mobile app must remain active

## Messages Not Delivering [#messages-not-delivering]

**Symptom:** API returns success but message never arrives.

**Checklist:**

* [ ] Recipient phone number is correct and includes country code
* [ ] Recipient has WhatsApp installed
* [ ] Recipient hasn't blocked your number
* [ ] Your session is connected and healthy
* [ ] You're not rate limited

**Debug with webhook events:**

```typescript
// Listen for delivery status
app.post('/webhook', (req, res) => {
  const { event, messageId, status } = req.body
  
  if (event === 'message.failed') {
    console.log(`Message ${messageId} failed:`, status)
    // Handle failure - retry or notify
  }
  
  res.sendStatus(200)
})
```

## API Key Issues [#api-key-issues]

**Symptom:** 401 Unauthorized errors.

**Solutions:**

1. Verify API key is active in dashboard
2. Ensure correct header format: `x-api-key: YOUR_KEY`
3. Check API key is scoped to the correct session

## Webhook Not Receiving Events [#webhook-not-receiving-events]

**Checklist:**

* [ ] Webhook URL is publicly accessible
* [ ] SSL certificate is valid
* [ ] Endpoint responds with 2xx status
* [ ] Webhook is subscribed to correct events

**Test your webhook:**

```bash
curl -X POST https://your-app.com/webhook \
  -H "Content-Type: application/json" \
  -d '{"event":"test","timestamp":"2026-03-02T10:00:00Z"}'
```

## Debug Mode [#debug-mode]

Enable debug logging to see detailed request/response information:

```typescript
const client = new SendableClient({
  apiKey: process.env.SENDABLE_API_KEY,
  debug: true // Enables detailed logging
})
```

## Getting Help [#getting-help]

If you're still stuck:

1. Check [Status Page](https://status.sendable.dev) for outages
2. Review API logs in your dashboard
3. Contact support with:
   * Session ID
   * Message ID (if applicable)
   * Timestamp of issue
   * Error code/message
