API Reference
The Zapy API provides RESTful endpoints for managing WhatsApp instances and sending messages programmatically.
Base URL
https://api.zapyapi.com
Authentication
All API requests require authentication using an API key. Include your API key in the x-api-key header:
curl -X GET "https://api.zapyapi.com/api/instances" \
-H "x-api-key: YOUR_API_KEY"
Getting Your API Key
Obtain your API key from the Zapy Dashboard.
Request Formats
Phone Numbers
The API accepts phone numbers in multiple formats:
| Format | Example | Description |
|---|---|---|
| International | 5511999999999 | Full international format with country code (recommended) |
| Brazilian | 11999999999 | Brazilian mobile (11 digits) - auto-adds +55 |
| Personal Chat ID | 5511999999999@c.us | Direct message to individual |
| Group Chat ID | 120363404090439360@g.us | Send to WhatsApp group |
| WhatsApp LID | 40076373446793@lid | WhatsApp LID identifier |
Media Files
Media can be sent as:
- Base64:
data:image/jpeg;base64,/9j/4AAQSkZJRg... - URL:
https://example.com/image.jpg
Response Format
Success Response
{
"data": { ... },
"isFirstPage": true,
"isLastPage": true,
"currentPage": 1,
"pageCount": 1,
"totalCount": 10
}
Error Response
{
"statusCode": 400,
"message": "Invalid request data",
"error": "VALIDATION_ERROR",
"timestamp": "2024-12-14T12:00:00.000Z",
"path": "/api/instances/123"
}
HTTP Status Codes
| Code | Description |
|---|---|
200 | Success |
201 | Created |
204 | No Content |
400 | Bad Request - Invalid request data |
401 | Unauthorized - Invalid or missing API key |
403 | Forbidden - No access to resource |
404 | Not Found - Resource doesn't exist |