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://aichatvault.com/api/v1
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
| 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 |
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://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"
}
}ℹ️
All endpoints are scoped to your organisation. You can only access leads, conversations, and webhooks belonging to your workspace.
Was this page helpful?
