API Reference
Interact with your EchoSDK agent programmatically using our REST API.
Authentication
We support two methods of authentication depending on the endpoint and use case:
- API Key: Used for backend/admin operations like ingestion. Passed via
X-API-Keyheader. Keys use the formatecho_followed by 32 alphanumeric characters. - Origin Verification: Used for public frontend queries. Configure allowed domains in your dashboard.
- Firebase Bearer Token: Used for dashboard and admin operations. Passed via
Authorization: Bearerheader.
Rate Limits
All endpoints are rate-limited per IP address and per app to ensure fair usage:
| Endpoint | Per IP | Per App |
|---|---|---|
| /query | 60 requests / minute | 1,000 requests / hour |
| /ingest | 10 requests / minute | 100 requests / hour |
When rate-limited, you will receive a 429 status with a Retry-After header.
/api/:appId/ingest
Ingest content into your agent's knowledge base. This endpoint accepts either a URL to crawl or raw text. Content is automatically chunked (1,000 chars with 200-char overlap), embedded, and stored for RAG queries.
Requires an Admin API Key or Firebase Bearer Token (app owner).
curl -X POST https://echosdk.com/api/your-app-id/ingest \
-H "Content-Type: application/json" \
-H "X-API-Key: echo_your32charalphanumerickey0123" \
-d '{
"text": "EchoSDK is a headless support platform...",
"url": "https://docs.echosdk.com/intro"
}'{
"success": true,
"chunksProcessed": 42,
"chunksFailed": 0,
"sourceId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}/api/:appId/query
Ask a question to your agent. Returns a streamed text/plain response for web widget usage. The response is generated using RAG over your ingested knowledge base.
Publicly accessible (protected by CORS whitelist or Firebase Bearer Token).
text/plain with Transfer-Encoding: chunked. Source documents referenced in the answer are returned via the x-echo-sources response header as a JSON array.curl -X POST https://echosdk.com/api/your-app-id/query \
-H "Content-Type: application/json" \
-d '{
"question": "How do I install the SDK?"
}'/api/handover
Escalate a conversation to human support. Creates a support ticket in your dashboard and sends notifications via configured integrations (Slack, email).
Publicly accessible (protected by CORS whitelist).
curl -X POST https://echosdk.com/api/handover \
-H "Content-Type: application/json" \
-d '{
"appId": "your-app-id",
"email": "user@example.com",
"question": "I need help with billing",
"url": "https://myapp.com/pricing",
"history": [
{ "role": "user", "text": "How much does the pro plan cost?" },
{ "role": "assistant", "text": "The pro plan is $49/month." }
]
}'{
"success": true,
"ticketId": "abc123def456"
}/api/apps/sources
Delete a source and all its associated chunks from your agent's knowledge base.
Requires a Firebase Bearer Token (app owner only).
curl -X DELETE "https://echosdk.com/api/apps/sources?appId=your-app-id&id=source-id-here" \
-H "Authorization: Bearer YOUR_FIREBASE_TOKEN"{
"success": true
}