Integrate SafariChat's AI-powered messaging capabilities into your applications with our comprehensive REST API.
v2.1The SafariChat API provides programmatic access to our AI sales automation platform. You can send messages, manage contacts, analyze conversations, and integrate with your existing systems. Our API is RESTful, uses JSON for data exchange, and requires API key authentication.
Base URL: https://api.safarichat.com/v2
SafariChat API uses API keys for authentication. You can generate and manage your API keys from your dashboard.
Include your API key in the Authorization header of every request:
Get started with the SafariChat API in minutes. Here's a simple example to send your first AI-powered message:
Here are the main API endpoints available in SafariChat API v2.1:
Send an AI-powered message to a contact
| Parameter | Type | Required | Description |
|---|---|---|---|
| to | string | Required | Recipient phone number (E.164 format) |
| message | string | Required | Message content |
| ai_enabled | boolean | Optional | Enable AI processing (default: true) |
Retrieve message history and conversation data
| Parameter | Type | Required | Description |
|---|---|---|---|
| contact | string | Optional | Filter by contact phone number |
| limit | integer | Optional | Number of messages (max: 100) |
| offset | integer | Optional | Pagination offset |
Add a new contact to your address book
| Parameter | Type | Required | Description |
|---|---|---|---|
| phone | string | Required | Contact phone number |
| name | string | Optional | Contact full name |
| tags | array | Optional | Contact tags for organization |
Get conversation analytics and performance metrics
| Parameter | Type | Required | Description |
|---|---|---|---|
| period | string | Optional | Time period (day, week, month) |
| start_date | date | Optional | Start date (ISO 8601 format) |
| end_date | date | Optional | End date (ISO 8601 format) |
Webhooks allow you to receive real-time notifications about events in your SafariChat account. Configure webhook endpoints to receive instant updates about message deliveries, AI responses, and conversation events.
Available Events:
message.received - New message received from contactmessage.sent - Message successfully sentai.response - AI has generated a responsecontact.created - New contact addedconversation.started - New conversation initiatedThe SafariChat API uses conventional HTTP response codes to indicate success or failure. Error responses include detailed error messages to help you debug issues.
| HTTP Code | Error Type | Description |
|---|---|---|
| 200 | Success | Request completed successfully |
| 400 | Bad Request | Invalid request parameters |
| 401 | Unauthorized | Invalid or missing API key |
| 429 | Rate Limited | Too many requests |
| 500 | Server Error | Internal server error |
To ensure fair usage and optimal performance, the SafariChat API implements rate limiting:
| Plan | Rate Limit | Burst Limit |
|---|---|---|
| Starter | 100 requests/minute | 200 requests/minute |
| Professional | 500 requests/minute | 1000 requests/minute |
| Enterprise | 2000 requests/minute | 5000 requests/minute |
Rate limit headers are included in every response:
We provide official SDKs and libraries to make integration easier:
Official PHP library for Laravel and other PHP frameworks
JavaScript/TypeScript SDK for Node.js applications
Python library for Django and Flask applications
Java library for Spring Boot and other frameworks
Check out our GitHub repositories for code examples, tutorials, and community support.