v1.2 API Reference

Enterprise Messaging API

Our REST API allows you to programmatically manage your WhatsApp communications, build deep integrations with your CRM, and automate complex messaging workflows with ease.

Authentication

All API requests must include an Authorization header with a Bearer token. You can generate and revoke API keys from your dashboard settings.

bash
curl -X POST https://api.gpserp.com/v1/messages \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "to": "919876543210", "type": "template", "template": { "name": "welcome_message", "language": "en" } }'

Messaging

Send various types of messages to your customers using these core endpoints.

1. Send Template Message

Template messages are used for outbound notifications. They must be pre-approved by Meta.

POST/v1/messages/template

Broadcast an approved template with dynamic variables and buttons.

Required Parameters

  • to: Recipient phone number with country code.
  • templateName: The unique name of your approved template.
  • language: Template language code (e.g., "en").

2. Send Media Message

Send images, videos, documents, or audio files to any active conversation session.

POST/v1/messages/media

Upload media directly or provide a public URL to send rich content.

Webhooks

Configure your endpoint to receive real-time notifications for incoming messages, message status updates (sent, delivered, read), and customer-driven events from WhatsApp Flows.

Incoming Payload Example
{ "event": "message.received", "from": "919876543210", "name": "John Doe", "type": "text", "text": "How can I help you today?" }

Error Handling

CodeDescriptionSolution
401UnauthorizedCheck your API token in headers.
429Too Many RequestsSlow down requests temporarily.
400Bad RequestCheck your JSON payload structure.

Official SDKs Coming Soon

Our developer team is building official libraries for Node.js, Python, and PHP to make integration even faster. Join our developer community to stay updated!

Request Early Access