1. Home
  2. Developer API
  3. API docs

API reference

WhatsApp API documentation for the HeyVarta REST API: every endpoint, with permissions, request bodies, responses and copy-ready examples.

Version v1Base URL https://api.heyvarta.com/api/v1Auth Authorization: Bearer hv_live_…
Quick start

Three steps to your first API call.

Anyone can read this reference. API keys are created only by the workspace owner inside HeyVarta — never shared by email or on this site.

  1. 1

    Create a key in HeyVarta

    Sign in, open Developer → API keys, name the key, tick only the permissions it needs and choose an expiry (30, 90, 180 days or 1 year). The full key is shown once — store it safely.

  2. 2

    Send it as a Bearer token

    Every request uses HTTPS and the header Authorization: Bearer hv_live_…. Keys belong to one workspace and can be revoked any time.

  3. 3

    Make your first call

    GET https://api.heyvarta.com/api/v1/developer/account shows the workspace, permissions, WhatsApp numbers and Telegram bots the key can reach.

Base URLhttps://api.heyvarta.com/api/v1

Permissions (scopes)

Give each key only what it needs.

messages:readRead conversations and message status
messages:writeReply in chats (and start chats on QR-linked numbers)
messages:templateSend approved WhatsApp templates
templates:readRead approved templates
contacts:readRead contacts
contacts:writeCreate and update contacts
campaigns:readRead campaign results
account:readRead workspace, numbers and bots

Limits & safe use

  • 120 requests per minute per keyWrites cost more: a contact write counts as 2, a message as 4, a template as 6. Over the limit you get 429 with Retry-After.
  • Idempotency-Key on every sendReuse the same key when retrying and a message is never sent twice.
  • Daily safety caps1,000 template messages and 250 new QR-number chats per workspace in 24 hours.
  • Opt-outs respectedUnsubscribed contacts are refused automatically.
  • Clear errors401 missing or invalid key · 403 missing permission · 404 not found · 409 conflict or duplicate · 429 too many requests.
API reference

Every endpoint, with examples.

Requests and responses are JSON. Replace IDs with values from your own workspace.

Messaging

Read conversations, reply and send WhatsApp templates.

GET/developer/conversations?channel=whatsappmessages:read

List WhatsApp conversations

WhatsApp conversations, newest first, 50 per page. Leave out ?channel= to get WhatsApp and Telegram together. Pass next_before exactly as returned as ?before= for the next page (null on the last page). Use the id as conversation_id to reply.

Example request
curl -X GET 'https://api.heyvarta.com/api/v1/developer/conversations?channel=whatsapp' \
  -H 'Authorization: Bearer hv_live_…'
Response · 200
{
  "items": [
    {
      "id": "11111111-2222-4333-8444-555555555555",
      "channel": "whatsapp",
      "number_id": "NUMBER_ID",
      "name": "Riya",
      "phone": "+919876543210",
      "updated_at": "2026-11-15T09:30:00.000Z"
    }
  ],
  "next_before": null
}
POST/developer/messagesmessages:write

Reply to a customer

Sends a text message. Use "to" (the customer’s number) or "conversation_id". Official numbers: only in an existing chat, within 24 hours of the customer’s last message (start chats with Send a template). QR-linked numbers can also start a new chat with "to" when the key has the start-new-conversations permission — up to 250 new chats per workspace in 24 hours. Always send an Idempotency-Key.

Headers
  • Idempotency-Key: order-1042-confirmation
Example request
curl -X POST 'https://api.heyvarta.com/api/v1/developer/messages' \
  -H 'Authorization: Bearer hv_live_…' \
  -H 'Idempotency-Key: order-1042-confirmation' \
  -H 'Content-Type: application/json' \
  -d '{"to": "+919876543210", "text": "Your order #1042 is confirmed. Thank you!"}'
Request body
{
  "to": "+919876543210",
  "text": "Your order #1042 is confirmed. Thank you!"
}
Response · 200
{
  "id": "MESSAGE_ID",
  "conversation_id": "11111111-2222-4333-8444-555555555555",
  "channel": "whatsapp",
  "status": "sent"
}
POST/developer/messages/templatemessages:template

Send a template (start a conversation)

Sends an approved WhatsApp template to any number, even if they never messaged you — for order updates, reminders and notices. Needs an official Cloud API number. Choose the template with "template_id" or "template" + "language". "parameters" fill {{1}}, {{2}}… in order; add "media_url" (public https link) for a media header. Unsubscribed contacts are refused. Limit: 1,000 template messages per workspace in 24 hours.

Headers
  • Idempotency-Key: order-1042-shipped
Example request
curl -X POST 'https://api.heyvarta.com/api/v1/developer/messages/template' \
  -H 'Authorization: Bearer hv_live_…' \
  -H 'Idempotency-Key: order-1042-shipped' \
  -H 'Content-Type: application/json' \
  -d '{"to": "+919876543210", "template_id": "1234567890", "parameters": ["Riya", "#1042"]}'
Request body
{
  "to": "+919876543210",
  "template_id": "1234567890",
  "parameters": [
    "Riya",
    "#1042"
  ]
}
Response · 200
{
  "id": "MESSAGE_ID",
  "conversation_id": "11111111-2222-4333-8444-555555555555",
  "channel": "whatsapp",
  "status": "sent"
}
GET/developer/messages/{message_id}messages:read

Get message status

Latest recorded status: queued, sent, delivered, read, failed, or unknown (sent but not confirmed by WhatsApp).

Example request
curl -X GET 'https://api.heyvarta.com/api/v1/developer/messages/{message_id}' \
  -H 'Authorization: Bearer hv_live_…'
Response · 200
{
  "id": "MESSAGE_ID",
  "conversation_id": "11111111-2222-4333-8444-555555555555",
  "channel": "whatsapp",
  "direction": "out",
  "status": "delivered",
  "created_at": "2026-11-15T09:31:00.000Z"
}

Telegram bots

Read and reply in Telegram bot chats.

GET/developer/accountaccount:read

List your Telegram bots

The Telegram bots connected to the workspace (in telegram_bots). Only bots can be used with the API; personal Telegram accounts are never automated.

Example request
curl -X GET 'https://api.heyvarta.com/api/v1/developer/account' \
  -H 'Authorization: Bearer hv_live_…'
Response · 200
{
  "workspace": {
    "id": "WORKSPACE_ID",
    "name": "Your business"
  },
  "telegram_bots": [
    {
      "id": "BOT_ID",
      "name": "Support bot",
      "status": "Connected"
    }
  ]
}
GET/developer/conversations?channel=telegrammessages:read

List Telegram conversations

Chats with people who started your bot, newest first, 50 per page. Telegram does not share phone numbers, so phone is always null.

Example request
curl -X GET 'https://api.heyvarta.com/api/v1/developer/conversations?channel=telegram' \
  -H 'Authorization: Bearer hv_live_…'
Response · 200
{
  "items": [
    {
      "id": "TELEGRAM_CONVERSATION_ID",
      "channel": "telegram",
      "number_id": "BOT_ID",
      "name": "Arjun",
      "phone": null,
      "updated_at": "2026-11-15T09:20:00.000Z"
    }
  ],
  "next_before": null
}
POST/developer/messagesmessages:write

Reply in a Telegram chat

Sends a text reply from your bot. Use "conversation_id" (Telegram has no phone numbers). The person must have started your bot and not blocked it. Always send an Idempotency-Key.

Headers
  • Idempotency-Key: ticket-881-reply
Example request
curl -X POST 'https://api.heyvarta.com/api/v1/developer/messages' \
  -H 'Authorization: Bearer hv_live_…' \
  -H 'Idempotency-Key: ticket-881-reply' \
  -H 'Content-Type: application/json' \
  -d '{"conversation_id": "TELEGRAM_CONVERSATION_ID", "text": "Hi Arjun, your ticket #881 is resolved."}'
Request body
{
  "conversation_id": "TELEGRAM_CONVERSATION_ID",
  "text": "Hi Arjun, your ticket #881 is resolved."
}
Response · 200
{
  "id": "MESSAGE_ID",
  "conversation_id": "TELEGRAM_CONVERSATION_ID",
  "channel": "telegram",
  "status": "sent"
}

Contacts

Sync your customer directory.

GET/developer/contactscontacts:read

List contacts

Up to 500 per page, oldest first. Pass next_cursor as ?cursor= for the next page; null on the last page.

Example request
curl -X GET 'https://api.heyvarta.com/api/v1/developer/contacts' \
  -H 'Authorization: Bearer hv_live_…'
Response · 200
{
  "items": [
    {
      "id": "11111111-2222-4333-8444-555555555555",
      "name": "Riya Sen",
      "phone": "+919876543210",
      "email": "riya@example.com",
      "company": "Sen Spaces",
      "status": "Lead",
      "tags": [
        "Website lead"
      ],
      "segments": [],
      "channels": [
        "WhatsApp"
      ],
      "notes": null,
      "language": null,
      "version": 1,
      "created_at": "2026-11-15T09:30:00.000Z"
    }
  ],
  "next_cursor": null
}
GET/developer/contacts/{contact_id}contacts:read

Get contact

One contact with its current version (send that version when you update it).

Example request
curl -X GET 'https://api.heyvarta.com/api/v1/developer/contacts/{contact_id}' \
  -H 'Authorization: Bearer hv_live_…'
Response · 200
{
  "id": "11111111-2222-4333-8444-555555555555",
  "name": "Riya Sen",
  "phone": "+919876543210",
  "email": "riya@example.com",
  "company": "Sen Spaces",
  "status": "Lead",
  "tags": [
    "Website lead"
  ],
  "segments": [],
  "channels": [
    "WhatsApp"
  ],
  "notes": null,
  "language": null,
  "version": 1,
  "created_at": "2026-11-15T09:30:00.000Z"
}
POST/developer/contactscontacts:write

Create contact

Adds a WhatsApp contact. Phone must be in international format. Counts towards your plan’s contact limit; unknown fields are rejected. An existing number returns 409.

Example request
curl -X POST 'https://api.heyvarta.com/api/v1/developer/contacts' \
  -H 'Authorization: Bearer hv_live_…' \
  -H 'Content-Type: application/json' \
  -d '{"name": "Riya Sen", "phone": "+919876543210", "email": "riya@example.com", "company": "Sen Spaces", "status": "Lead", "tags": ["Website lead"]}'
Request body
{
  "name": "Riya Sen",
  "phone": "+919876543210",
  "email": "riya@example.com",
  "company": "Sen Spaces",
  "status": "Lead",
  "tags": [
    "Website lead"
  ]
}
Response · 200
{
  "id": "11111111-2222-4333-8444-555555555555",
  "name": "Riya Sen",
  "phone": "+919876543210",
  "email": "riya@example.com",
  "company": "Sen Spaces",
  "status": "Lead",
  "tags": [
    "Website lead"
  ],
  "segments": [],
  "channels": [
    "WhatsApp"
  ],
  "notes": null,
  "language": null,
  "version": 1,
  "created_at": "2026-11-15T09:30:00.000Z"
}
PUT/developer/contacts/{contact_id}contacts:write

Update contact

Send only the fields you want to change, plus the version you last read. Everything else is kept. If someone changed the contact since you read it, you get 409 — read it again and retry. Status Unsubscribed stops all messages to them.

Example request
curl -X PUT 'https://api.heyvarta.com/api/v1/developer/contacts/{contact_id}' \
  -H 'Authorization: Bearer hv_live_…' \
  -H 'Content-Type: application/json' \
  -d '{"status": "Active", "tags": ["Website lead", "Paid"], "version": 1}'
Request body
{
  "status": "Active",
  "tags": [
    "Website lead",
    "Paid"
  ],
  "version": 1
}
Response · 200
{
  "id": "11111111-2222-4333-8444-555555555555",
  "name": "Riya Sen",
  "phone": "+919876543210",
  "email": "riya@example.com",
  "company": "Sen Spaces",
  "status": "Active",
  "tags": [
    "Website lead",
    "Paid"
  ],
  "segments": [],
  "channels": [
    "WhatsApp"
  ],
  "notes": null,
  "language": null,
  "version": 2,
  "created_at": "2026-11-15T09:30:00.000Z"
}

Templates

Read approved WhatsApp templates.

GET/developer/templatestemplates:read

List approved templates

All approved templates of the workspace’s WhatsApp Cloud API number. Use the id as template_id (or name + language) to send one. Add ?number_id= to choose a number.

Example request
curl -X GET 'https://api.heyvarta.com/api/v1/developer/templates' \
  -H 'Authorization: Bearer hv_live_…'
Response · 200
{
  "number_id": "NUMBER_ID",
  "items": [
    {
      "id": "1234567890",
      "name": "order_update",
      "language": "en_US",
      "category": "UTILITY",
      "components": [
        {
          "type": "BODY",
          "text": "Hi {{1}}, your order {{2}} has shipped."
        }
      ]
    }
  ]
}

Campaigns

Read broadcast results.

GET/developer/campaignscampaigns:read

List campaigns

WhatsApp broadcast campaigns with their delivery numbers.

Example request
curl -X GET 'https://api.heyvarta.com/api/v1/developer/campaigns' \
  -H 'Authorization: Bearer hv_live_…'
Response · 200
{
  "items": [
    {
      "id": "11111111-2222-4333-8444-555555555555",
      "name": "Diwali offer",
      "status": "Completed",
      "template": "diwali_offer",
      "stats": {
        "total": 1200,
        "sent": 1180,
        "failed": 20
      }
    }
  ]
}
GET/developer/campaigns/{campaign_id}campaigns:read

Get campaign

One campaign and its results.

Example request
curl -X GET 'https://api.heyvarta.com/api/v1/developer/campaigns/{campaign_id}' \
  -H 'Authorization: Bearer hv_live_…'
Response · 200
{
  "id": "11111111-2222-4333-8444-555555555555",
  "name": "Diwali offer",
  "status": "Completed",
  "template": "diwali_offer",
  "scheduled_at": null,
  "started_at": "2026-11-01T10:00:00.000Z",
  "completed_at": "2026-11-01T10:12:00.000Z",
  "stats": {
    "total": 1200,
    "sent": 1180,
    "failed": 20
  }
}

Workspace

Check what a key can reach.

GET/developer/accountaccount:read

Workspace, numbers and bots

The workspace this key belongs to, its permissions, connected WhatsApp numbers and Telegram bots. A good first call to check a key.

Example request
curl -X GET 'https://api.heyvarta.com/api/v1/developer/account' \
  -H 'Authorization: Bearer hv_live_…'
Response · 200
{
  "workspace": {
    "id": "WORKSPACE_ID",
    "name": "Your business"
  },
  "key": {
    "scopes": [
      "account:read"
    ]
  },
  "whatsapp_numbers": [
    {
      "id": "NUMBER_ID",
      "name": "Main line",
      "phone": "+91 98765 43210",
      "type": "Cloud API",
      "status": "Connected"
    }
  ],
  "telegram_bots": [
    {
      "id": "BOT_ID",
      "name": "Support bot",
      "status": "Connected"
    }
  ]
}
FAQ

Frequently asked questions

Do I need to log in to read the API docs?

No. This reference is public. You only sign in to HeyVarta to create an API key.

Where do I get an access token?

Only inside HeyVarta: Developer → API keys. The workspace owner chooses the permissions and expiry, and the full key is shown once.

Can I start WhatsApp conversations through the API?

Yes — with an approved template on an official Cloud API number (POST /developer/messages/template). QR-linked numbers can open new chats with POST /developer/messages, up to 250 per day.

Can I reply in Telegram?

Yes, from your connected Telegram bot using the conversation_id. Personal Telegram accounts are never automated.

What happens if my request is retried?

Send the same Idempotency-Key and HeyVarta returns the original result instead of sending again.

Can I revoke a key?

Yes, any time in Developer → API keys. Keys also expire automatically on the date you chose.

Ready to build?

Create a scoped API key inside HeyVarta and send your first request.