5-minute quickstart
From zero to your first lead read through the API and your first webhook received.
1. Create an API key
In the dashboard open Settings → Developers and click Create key. Pick the “Zapier / Make” access to start. The key is shown only once: copy it into a password manager or an environment variable.
curl https://aichat.md/api/public/v1/me \
-H "Authorization: Bearer $AICHAT_API_KEY"Only the workspace admin (or the account owner) can create keys. Never put a key in website or mobile app code.
2. Check the key
GET /me needs no permission: it confirms the key and returns your workspace and credits.
{
"object": "me",
"key": {
"id": "key_k3P9xQ2m",
"name": "Zapier — leads",
"prefix": "aik_live_k3P9xQ2m",
"scopes": ["leads:read", "webhooks:manage"],
"created_at": "2026-11-27T10:00:00.000Z",
"expires_at": null
},
"workspace": {
"id": "ws_dTE2Mw",
"name": "Clinica Dent",
"credits": { "object": "credit_balance", "limit": 5000, "used": 1240, "remaining": 3760, "warning_threshold": 100 }
}
}3. Read your leads
curl "https://aichat.md/api/public/v1/leads?limit=10&status=new" \
-H "Authorization: Bearer $AICHAT_API_KEY"A lead looks like this:
{
"id": "lead_MTEy",
"object": "lead",
"contact_id": "ct_MTEy",
"conversation_id": "conv_MTEy",
"channel": "instagram",
"agent_id": "agt_YWdlbnQtMQ",
"name": "Ana Popescu",
"phone": "+37369123456",
"email": null,
"status": "new",
"score": 82,
"tags": ["high_intent"],
"summary": "Wants a cleaning appointment on Thursday after 5 pm.",
"source": null,
"external_id": null,
"metadata": {},
"dashboard_url": "https://aichat.md/ro/private/inbox?thread=…",
"created_at": "2026-11-27T10:15:00.000Z",
"updated_at": "2026-11-27T10:16:40.000Z"
}4. Get leads in real time
Instead of asking the API every minute, register a webhook: we send you a signed POST for every new lead.
curl https://aichat.md/api/public/v1/webhook_endpoints \
-H "Authorization: Bearer $AICHAT_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{"url": "https://example.com/aichat/webhook", "events": ["lead.created"]}'In the dashboard, Send test next to the webhook sends a webhook.test event right away. Then verify the signature on every request.
5. Next steps
- Zapier, Make or n8n — leads in Google Sheets, Pipedrive, HubSpot without code.
- Conventions — pagination, idempotency, limits.
- The full API reference.