# API Overview

> Public REST API for WAFlow — send WhatsApp messages, manage templates and contacts, run campaigns, and receive webhooks.

Source: https://edesy.in/docs/waflow/api

The WAFlow Public API lets you send WhatsApp messages, manage templates and contacts, run campaigns, and receive real‑time delivery and inbound events — all from your own backend, CRM, or automation tool.

It is a versioned REST API authenticated with an **API key**. Everything you can do in the dashboard is available programmatically.

## Base URL

```
https://waflow.edesy.in/api/v1
```

All endpoints are under `/api/v1` and require an API key. See [Authentication](https://edesy.in/docs/waflow/api/authentication) to create one.

## Quick start

```bash
curl -X POST "https://waflow.edesy.in/api/v1/messages" \
  -H "X-API-Key: wc_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+919812345678",
    "type": "text",
    "text": "Hello from WAFlow 👋"
  }'
```

> **Note:** Free‑form text can only be sent inside an open 24‑hour customer service window. To start a conversation, send an approved [template](https://edesy.in/docs/waflow/api/templates) message.

## Interactive reference

An always‑up‑to‑date, machine‑readable reference is served directly by the API:

| Resource | URL |
|----------|-----|
| Interactive docs | [`https://waflow.edesy.in/api/v1/docs`](https://waflow.edesy.in/api/v1/docs) |
| OpenAPI spec (JSON) | `https://waflow.edesy.in/api/v1/openapi.json` |

Import the OpenAPI spec into Postman, Insomnia, or a code‑generator to get a typed client instantly.

## API sections

| Section | Description |
|---------|-------------|
| [Authentication](https://edesy.in/docs/waflow/api/authentication) | API keys, headers, and scopes |
| [Send Messages](https://edesy.in/docs/waflow/api/messages) | Send one message — text, template, media, buttons, or list |
| [Campaigns](https://edesy.in/docs/waflow/api/campaigns) | Template broadcasts to many recipients + delivery status |
| [Contacts](https://edesy.in/docs/waflow/api/contacts) | Manage contacts and contact lists |
| [Templates](https://edesy.in/docs/waflow/api/templates) | Create, submit, sync, and delete message templates |
| [Webhooks](https://edesy.in/docs/waflow/api/webhooks) | Receive inbound messages and delivery events |

## Response format

All responses are JSON. Successful responses include `success: true` plus the relevant data:

```json
{
  "success": true,
  "messageId": "wamid.HBgMOTE5...",
  "to": "+919812345678",
  "type": "text",
  "timestamp": "2026-07-21T09:00:00.000Z"
}
```

Errors include `success: false`, a machine‑readable `code`, and a human‑readable message:

```json
{
  "success": false,
  "error": "Insufficient API key permissions",
  "code": "INSUFFICIENT_SCOPE",
  "message": "This API key lacks the 'messages.send' permission.",
  "requiredScope": "messages.send"
}
```

## HTTP status codes

| Code | Meaning |
|------|---------|
| 200 | Success |
| 201 | Created |
| 400 | Bad request — validation error |
| 401 | Unauthorized — missing or invalid API key |
| 403 | Forbidden — the key lacks the required scope |
| 404 | Not found |
| 429 | Too many requests — rate limit exceeded |
| 502 | Provider error — the message could not be sent |

## Rate limits

| Limit | Value |
|-------|-------|
| Per API key | 100 requests / 15 minutes (configurable per key) |
| Per IP (unauthenticated guard) | 600 requests / 15 minutes |

Rate‑limit headers (`RateLimit-Limit`, `RateLimit-Remaining`, `RateLimit-Reset`) are returned on every response. See [Authentication → Rate limits](https://edesy.in/docs/waflow/api/authentication#rate-limits).

## SDKs & libraries

There is no official SDK yet — use any HTTP client, or generate one from the [OpenAPI spec](https://waflow.edesy.in/api/v1/openapi.json):

- **JavaScript/Node.js**: `fetch`, `axios`
- **Python**: `requests`, `httpx`
- **Go**: `net/http`
- **PHP**: `Guzzle`, cURL

## Need help?

- Browse the [full WAFlow documentation](https://edesy.in/docs/waflow/getting-started)
- Contact support at [support@edesy.in](mailto:support@edesy.in)
- Try WAFlow at [waflow.edesy.in](https://waflow.edesy.in)
