Skip to main content

API Overview

The ZenSearch API provides programmatic access to search, chat, agents, and content management features.

Base URL

Production: https://api.zensearch.ai/v1
Self-hosted: https://your-domain.com/api/v1

Authentication

All API requests require authentication via API key:

curl -H "Authorization: Bearer YOUR_API_KEY" \
https://api.zensearch.ai/v1/search

See Authentication for details.

Response Format

All responses use JSON format:

{
"data": { ... },
"meta": {
"requestId": "req_abc123",
"timestamp": "2024-01-15T10:30:00Z"
}
}

Error Responses

{
"error": {
"code": "invalid_request",
"message": "Missing required parameter: query",
"details": { ... }
},
"meta": {
"requestId": "req_abc123"
}
}

Endpoints

Search & Chat

MethodEndpointDescription
POST/searchSearch documents
POST/chatChat with AI
POST/chat/streamStreaming chat

Agents

MethodEndpointDescription
GET/agentsList agents
POST/agentsCreate agent
GET/agents/{id}Get agent
PUT/agents/{id}Update agent
DELETE/agents/{id}Delete agent
POST/agents/{id}/runExecute agent

Documents

MethodEndpointDescription
GET/documentsList documents
GET/documents/{id}Get document
DELETE/documents/{id}Delete document

Collections

MethodEndpointDescription
GET/collectionsList collections
POST/collectionsCreate collection
GET/collections/{id}Get collection
PUT/collections/{id}Update collection
DELETE/collections/{id}Delete collection

Connectors

MethodEndpointDescription
GET/connectorsList connectors
POST/connectorsCreate connector
GET/connectors/{id}Get connector
PUT/connectors/{id}Update connector
DELETE/connectors/{id}Delete connector
POST/connectors/{id}/syncTrigger sync

Pagination

List endpoints support pagination:

GET /documents?page=2&limit=50

Response includes pagination info:

{
"data": [...],
"meta": {
"page": 2,
"limit": 50,
"total": 1234,
"hasMore": true
}
}

Rate Limits

See Rate Limits for current limits.

Rate limit headers are included in responses:

X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1609459200

SDKs

Official SDKs are available:

  • JavaScript/TypeScript: npm install @zensearch/sdk
  • Python: pip install zensearch
  • Go: go get github.com/ZenousAI/zensearch-go

Next Steps