Skip to main content

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:

FormatExampleDescription
International5511999999999Full international format with country code (recommended)
Brazilian11999999999Brazilian mobile (11 digits) - auto-adds +55
Personal Chat ID[email protected]Direct message to individual
Group Chat ID[email protected]Send to WhatsApp group
WhatsApp LID40076373446793@lidWhatsApp 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

CodeDescription
200Success
201Created
204No Content
400Bad Request - Invalid request data
401Unauthorized - Invalid or missing API key
403Forbidden - No access to resource
404Not Found - Resource doesn't exist

API Sections