Docs/Developer Guide/API Overview

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

MethodEndpointDescription
GET/api/v1/auth/testVerify API key and get account info
GET/api/v1/leadsList 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/leadSample lead object for testing
GET/api/v1/conversationsList conversations (paginated)
GET/api/v1/conversations/{id}Get a single conversation with messages
POST/api/v1/conversations/{id}/messagesAdd a message to a conversation
POST/api/v1/conversations/{id}/endMark a conversation as ended
GET/api/v1/sample/conversationSample conversation object for testing
GET/api/v1/webhooksList registered webhooks
POST/api/v1/webhooksRegister 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 statusMeaning
401Missing, invalid, or expired API key
403API key is valid but resource belongs to a different organisation
400Bad request (e.g. conversation already ended)
404Resource not found
422Validation error — check the errors field
500Server 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?