Authentication
Public API requests authenticate with an API key using either Authorization: Bearer YOUR_API_KEY or X-AyuChat-API-Key: YOUR_API_KEY. The API key determines the active workspace and required scope.
Supported endpoints
| Method | Path | Scope | Purpose |
|---|---|---|---|
| GET | /api/public/contacts | contacts.read | List workspace contacts. |
| POST | /api/public/contacts | contacts.write | Create a contact. |
| GET | /api/public/campaigns | campaigns.read | List campaigns. |
| GET | /api/public/templates | templates.read | List templates. |
| POST | /api/public/messages/send-template | messages.send | Queue an approved template message. |
| GET | /api/public/zapier/triggers | contacts.read | Read Zapier trigger definitions. |
| GET | /api/public/zapier/actions | contacts.read | Read Zapier action definitions. |
Contact create fields
| Field | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Contact display name. |
| phone | string | Yes | Phone number, max 20 characters. |
| Yes | Contact email address. | ||
| source | string | No | Lead or integration source. |
Send template fields
| Field | Type | Required | Description |
|---|---|---|---|
| to | string | Yes | Recipient phone number. |
| template_id | integer | Yes | Approved template id in the same workspace. |
| variables | object/array | No | Template variable values. |
Pagination
List endpoints use Laravel pagination and accept per_page up to 100. Keep integrations tolerant of pagination metadata changing order, and always read the response envelope.
Unsupported/private endpoints
Do not use internal Customer, Super Admin, Razorpay, Meta webhook, infrastructure, debug, billing-provider, or private ticket endpoints as public API. Only the allowlisted /api/public/* endpoints above are documented for customer developer use.
