API quickstart

1. Get your API key

  1. Step 1: Log in to your dashboard

    Sign in at wachatly.com/login. Any account works — API access is included on the 1-day free trial (100 campaign messages) and on paid monthly plans.
  2. Step 2: Open Settings

    From the dashboard, open the Settings page.
  3. Step 3: Switch to the API Keys tab

    In the Settings sidebar, select API Keys. This is where you manage keys for integrating external systems.
  4. Step 4: Generate a key

    Click Generate New Key. The new key appears in your list with a copy button next to it.
  5. Step 5: Store it securely

    Treat the key like a password: keep it in server-side configuration (environment variables, a secrets manager), never in client-side JavaScript, mobile apps, or a public repo. If a key leaks, use the revoke action next to it — revocation is immediate and cannot be undone — then generate a fresh one.

2. Authentication and error shapes

All endpoints live under the base URL https://api.wachatly.com/api/v1 and authenticate with a single header:

Required header
Authorization: Bearer YOUR_API_KEY

If the header is missing or the key is wrong, you get a 401 with a JSON body that tells you which problem you have. If the key is fine but the payload isn't, you get a 422 with a Laravel-style errors object naming each invalid field:

Error responses
# No Authorization header sent
HTTP/1.1 401 Unauthorized
{"success": false, "error": "API key is missing."}

# Wrong or revoked key
HTTP/1.1 401 Unauthorized
{"success": false, "error": "Invalid or suspended API key."}

# Valid key but bad payload (Laravel-style validation errors)
HTTP/1.1 422 Unprocessable Entity
{
  "message": "The phone field is required.",
  "errors": {
    "phone": ["The phone field is required."]
  }
}

3. Quickstart: send a template message

A template is a saved message with variables. It is ready the moment you save it, with no Meta review, and it goes out from your QR-linked number as a normal message. You need the template's exact name (as created in your Templates section) and its 2-letter language code:

POST /send-template
curl -X POST https://api.wachatly.com/api/v1/send-template \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "phone": "919876543210",
    "template": "order_update",
    "language": "en",
    "variables": ["Rahul", "ORD-1042"]
  }'

The variables array fills the template's placeholders in order. Templates with a media header also accept header_media_type (image, video, or document) with either header_media_url or header_media_id, plus an optional filename for documents.

On success the API returns a JSON success response and the message is queued for delivery. It shows up in your dashboard's Live Chat like any other outbound message, and its status usually moves through sent, delivered, and read within seconds as WhatsApp reports back. Delivery depends on your phone staying connected and on the recipient's device — no API can guarantee it.

What a send costs

There are no Meta per-message fees on a QR-linked number. API sends are covered by your monthly plan in INR, the same as dashboard sends. Details on pricing.

To send free-form text instead of a template, at any time:

POST /send-message
curl -X POST https://api.wachatly.com/api/v1/send-message \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "phone": "919876543210",
    "message": "Thanks for writing in! Your order shipped today."
  }'

Message people who know you

There is no 24-hour window, but WhatsApp can restrict or ban a number that messages people who never contacted it. Send API messages to customers and leads who know you, and use /campaigns/create-with-csv for lists so wachatly paces the sends. No tool can promise a number will not be banned.

4. All endpoints at a glance

POST/send-template

Send a saved template, with variables and an optional media header, to a phone number.

POST/send-message

Send a free-form text message to a phone number.

POST/send-campaign

Send an existing campaign (by campaign_id) to a single phone number — useful for event-triggered sends from your own system.

POST/campaigns/create-with-csv

Create a campaign from a CSV upload (form-data: name, template_id, file).

POST/create-contact

Add a contact with phone, name, and an optional custom_attributes object.

GET/conversations/{phone}

Fetch the conversation for a given phone number.

GET/messages/{conversationId}

List the messages inside a conversation.

5. Rate limits

Each API key is rate-limited to 1,000 requests per minute by default. That is per key, so a second key gets its own bucket. If you exceed the limit, back off and retry — for bulk sends to thousands of contacts, prefer /campaigns/create-with-csv over looping /send-template yourself: one request, and wachatly queues and paces the delivery for you.

API limit vs safe sending speed

This is wachatly's API rate limit, not a safe sending speed. A WhatsApp number that sends hundreds of messages a minute looks like spam, so for lists use campaigns, which add random gaps, typing and sending hours (9am-9pm IST).

Next: the full reference

This page covers the happy path. For every field, response shape, and worked example on all seven endpoints, head to the full API reference.

Stuck? Email info@wachatly.com or book a free 15-minute setup call on our booking page.