Skip to main content

API Overview

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

Base URL

https://your-domain.com/api/v1

Authentication

All API requests require authentication via API key:

curl -H "Authorization: Bearer YOUR_API_KEY" \
https://your-domain.com/api/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/api/v1/searchSearch documents
POST/api/v1/search/facetedFaceted search
POST/api/v1/teams/{teamId}/chatChat with AI
POST/api/v1/teams/{teamId}/chat/streamStreaming chat

Agents

MethodEndpointDescription
GET/api/v1/agentsList agents
POST/api/v1/agentsCreate agent
GET/api/v1/agents/{id}Get agent
PUT/api/v1/agents/{id}Update agent
DELETE/api/v1/agents/{id}Delete agent
POST/api/v1/agents/{id}/execute/streamExecute agent (streaming)

Documents

MethodEndpointDescription
GET/api/v1/documents/{id}/contentGet document content
GET/api/v1/documents/{id}/summaryGet document summary
DELETE/api/v1/documents/{id}Delete document

Collections

MethodEndpointDescription
GET/api/v1/collectionsList collections
POST/api/v1/collectionsCreate collection
GET/api/v1/collections/{id}Get collection
PUT/api/v1/collections/{id}Update collection
DELETE/api/v1/collections/{id}Delete collection
POST/api/v1/collections/{id}/refresh-statsRefresh collection stats

Connectors

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

Pagination

List endpoints support pagination:

GET /api/v1/collections?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