wa-server API — Overview

Internal overview of the multi-tenant WhatsApp backend. This page summarizes what the platform does, who uses it, and how to start quickly.

Summary

  • Name: wa-server API
  • Description: Multi-tenant WhatsApp backend
  • Environment: Production
  • Base URL: https://wa.sagad.net
  • Content-Type: application/json
  • Auth: Authorization: Bearer <token> for all device and message actions

Quick Start

  1. Use your App Bearer token.
  2. Health check: GET /health.
  3. Create device: POST /devices (returns initial QR + expires_at).
  4. Scan QR from phone; regenerate via /devices/{device_id}/qr only after disconnect/expiry.
  5. Send messages: POST /devices/{device_id}/messages (text/media/contact/location).
  6. Enable webhooks (recommended) to receive message/receipt/presence/logout events.

Key Pages

Media Access

When you receive a webhook with media_path, download the media file using:

GET /media?path={media_path}
Authorization: Bearer <your_token>

See Media documentation for details and examples.

Integration Tips

  • Use Authorization: Bearer <token> for all device/message calls; base URL https://wa.sagad.net.
  • Flow: create device → generate/scan QR → send messages → listen to webhooks.
  • Webhook-first: subscribe to message, receipt, presence (typing), warning/logout for reliability.
  • Automation/MCP: REST-friendly; endpoints are flat under /devices so tools can call without extra path params.