API Overview
AIChatVault exposes a REST API under /api/v1 for programmatic access to your leads, conversations, and webhooks. All endpoints require an API key and return JSON.
Base URL
https://www.aichatvault.com/api/v1
www address. Requests to aichatvault.com (without www) or over http:// are redirected, and most HTTP clients (Postman, curl, fetch) drop the Authorization header when following a redirect. You will then see "API key is required" even though your key is valid.Authentication
Pass your API key in the Authorization header as a Bearer token:
Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Content-Type: application/json
Alternatively, you can send it in the X-API-Key header:
X-API-Key: sk_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Available endpoints (account-level)
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/auth/test | Verify API key and get account info |
| GET | /api/v1/leads | List leads (paginated) |
| GET | /api/v1/leads/{id} | Get a single lead with conversation transcript |
| PUT | /api/v1/leads/{id} | Update lead fields |
| GET | /api/v1/sample/lead | Sample lead object for testing |
| GET | /api/v1/conversations | List conversations (paginated) |
| GET | /api/v1/conversations/{id} | Get a single conversation with messages |
| POST | /api/v1/conversations/{id}/messages | Add a message to a conversation |
| POST | /api/v1/conversations/{id}/end | Mark a conversation as ended |
| GET | /api/v1/sample/conversation | Sample conversation object for testing |
| GET | /api/v1/webhooks | List registered webhooks |
| POST | /api/v1/webhooks | Register a new webhook |
| DELETE | /api/v1/webhooks/{id} | Delete a webhook |
Chatbot REST API (build your own chat UI)
Beyond the account-level endpoints above, a separate slug-based endpoint group lets you embed an AIChatVault chatbot inside your own app or UI — start conversations, send messages, get AI replies, and capture leads over plain HTTP:
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/chatbots | List all your active chatbots |
| GET | /api/v1/chatbots/{slug} | Get chatbot config — name, greeting, colors, branding |
| POST | /api/v1/chatbots/{slug}/conversations | Start a new conversation session |
| POST | /api/v1/chatbots/{slug}/conversations/{id}/messages | Send a user message and receive an AI reply |
| POST | /api/v1/chatbots/{slug}/conversations/{id}/messages/rate | Rate an assistant message as good or bad |
| GET | /api/v1/chatbots/{slug}/conversations/{id} | Retrieve full conversation history |
| POST | /api/v1/chatbots/{slug}/conversations/{id}/end | End a conversation and record its duration |
| POST | /api/v1/chatbots/{slug}/conversations/{id}/leads | Submit visitor contact details as a lead |
Response format
All responses follow the same envelope structure:
{
"success": true,
"data": { ... } // object or array
"meta": { ... } // pagination info (list endpoints only)
"links": { ... } // pagination URLs (list endpoints only)
}Error responses
| HTTP status | Meaning |
|---|---|
| 401 | Missing, invalid, or expired API key |
| 403 | API key is valid but resource belongs to a different organisation |
| 400 | Bad request (e.g. conversation already ended) |
| 404 | Resource not found |
| 422 | Validation error — check the errors field |
| 500 | Server error |
Verify authentication
Use the GET /api/v1/auth/test endpoint to confirm your key is valid before building further:
curl -X GET https://www.aichatvault.com/api/v1/auth/test \
-H "Authorization: Bearer sk_live_your_key_here"
# Response
{
"success": true,
"message": "Authentication successful",
"data": {
"user_id": 42,
"organization_id": 7,
"email": "you@example.com"
}
}Was this page helpful?
