API Documentation

Everything you need to know about integrating CozyLatte's WhatsApp API into your applications.

Getting Started

To start using the CozyLatte API, you'll need to:

  1. Sign up for an account
  2. Generate your API keys
  3. Make your first API call
GET /api/v1/status

Check API status and connectivity

curl -X GET "https://api.cozylatte.com/v1/status" \
-H "Authorization: Bearer YOUR_API_KEY"

Response

{
    "status": "ok",
    "version": "1.0.0",
    "timestamp": "2024-01-20T12:00:00Z"
}

Authentication

All API requests must include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY
POST /api/v1/auth/token

Generate a new access token

Parameters

Parameter Type Description Required
client_id string Your client ID Required
client_secret string Your client secret Required

Messages

POST /api/v1/messages

Send a new message

{
    "to": "1234567890",
    "type": "text",
    "content": "Hello, World!"
}

Message Templates

GET /api/v1/templates

List all message templates

Webhooks

POST /api/v1/webhooks

Configure webhook endpoints

Error Handling

Error Codes

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