API v2.0

API Documentation

Everything you need to integrate WhatsApp Business API into your application

Getting Started

Welcome to the Text-World WhatsApp Business API documentation. This guide will help you integrate WhatsApp messaging into your application quickly and efficiently.

Get API Key

Sign up and get your API credentials from the dashboard

Make First Call

Send your first message in under 5 minutes

Go Live

Deploy to production with confidence

Base URL

URL
https://api.text-world.com/v2

Quick Example

Here's a simple example to send your first WhatsApp message:

cURL
curl -X POST https://api.text-world.com/v2/messages/send \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+919876543210",
    "type": "text",
    "text": {
      "body": "Hello from Text-World!"
    }
  }'

Authentication

All API requests require authentication using an API key. Include your API key in the Authorization header of every request.

API Key Authentication

Header
Authorization: Bearer YOUR_API_KEY

You can find your API key in your dashboard under Settings → API Keys.

Send Messages

Send text, media, and template messages to your customers via WhatsApp.

POST /v2/messages/send

Request Parameters

Parameter Type Required Description
to string Required Recipient's phone number with country code
type string Required Message type: text, image, video, document, template
text object Optional Text message content (required if type is "text")

Example Request

JavaScript
const response = await fetch('https://api.text-world.com/v2/messages/send', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    to: '+919876543210',
    type: 'text',
    text: {
      body: 'Hello from Text-World API!'
    }
  })
});

const data = await response.json();
console.log(data);

Example Response

JSON
{
  "success": true,
  "message_id": "wamid.HBgNOTE5ODc2NTQzMjEwFQIAERgSQzg5QjBGRjdBOEQ0RTQ5OTAA",
  "status": "sent",
  "timestamp": "2026-01-18T16:00:00Z"
}

Message Templates

Use pre-approved message templates for sending notifications and promotional messages.

GET /v2/templates

Retrieve all your approved message templates.

Python
import requests

headers = {
    'Authorization': 'Bearer YOUR_API_KEY'
}

response = requests.get(
    'https://api.text-world.com/v2/templates',
    headers=headers
)

templates = response.json()
print(templates)

Webhooks

Receive real-time notifications about message status updates, incoming messages, and more.

Webhook Events

  • message.sent - Message successfully sent
  • message.delivered - Message delivered to recipient
  • message.read - Message read by recipient
  • message.failed - Message delivery failed
  • message.received - Incoming message from customer

Webhook Payload Example

JSON
{
  "event": "message.delivered",
  "message_id": "wamid.HBgNOTE5ODc2NTQzMjEwFQIAERgSQzg5QjBGRjdBOEQ0RTQ5OTAA",
  "to": "+919876543210",
  "timestamp": "2026-01-18T16:05:30Z",
  "status": "delivered"
}

Manage Contacts

Create, update, and manage your contact database programmatically.

POST /v2/contacts

Add a new contact to your database.

PHP
$ch = curl_init('https://api.text-world.com/v2/contacts');

curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer YOUR_API_KEY',
    'Content-Type: application/json'
]);

curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
    'phone' => '+919876543210',
    'name' => 'John Doe',
    'email' => 'john@example.com',
    'tags' => ['customer', 'premium']
]));

$response = curl_exec($ch);
curl_close($ch);

Media Upload

Upload images, videos, and documents to send via WhatsApp.

POST /v2/media/upload

Supported formats: JPG, PNG, MP4, PDF, DOCX (Max size: 16MB)

Error Handling

The API uses standard HTTP status codes to indicate success or failure.

Status Code Meaning
200 Success
400 Bad Request - Invalid parameters
401 Unauthorized - Invalid API key
429 Too Many Requests - Rate limit exceeded
500 Internal Server Error

Rate Limits

To ensure fair usage and system stability, we enforce the following rate limits:

  • Starter Plan: 1,000 messages/day
  • Growth Plan: 10,000 messages/day
  • Scale Plan: 100,000 messages/day
  • Enterprise: Custom limits

SDKs & Libraries

We provide official SDKs for popular programming languages:

Node.js

npm install @text-world/api

Python

pip install textworld-api

PHP

composer require textworld/api

Need help? Contact our support team at hello@text-world.com or call +91 72570 73570