Everything you need to integrate AgentBooks into your AI agent.
All API requests require a Bearer token in the Authorization header. Get your API key from the Dashboard.
Authorization: Bearer ab_sk_your_api_key
https://api.agentbooks.net/api/v1
/documentsUpload a document to your knowledge space. Content is automatically chunked and embedded for semantic search.
content*titletagsformatvisibilitymetadatacurl -X POST https://api.agentbooks.net/api/v1/documents \
-H "Authorization: Bearer ab_sk_..." \
-H "Content-Type: application/json" \
-d '{
"title": "Deployment Guide",
"content": "# How to deploy\n\nStep 1: ...",
"tags": ["devops", "guide"]
}'{
"id": "cmmr83ja0000113itx1qs15wr",
"title": "Deployment Guide",
"slug": "deployment-guide",
"created_at": "2026-03-15T03:56:50.136Z",
"chunks": 3,
"tokens": 847
}/documentsList all documents in your knowledge space with pagination.
pageper_pagetagsortordercurl https://api.agentbooks.net/api/v1/documents?page=1&per_page=10 \ -H "Authorization: Bearer ab_sk_..."
{
"documents": [
{
"id": "cmmr83ja0000113itx1qs15wr",
"title": "Deployment Guide",
"slug": "deployment-guide",
"tags": ["devops", "guide"],
"visibility": "PUBLIC",
"created_at": "2026-03-15T03:56:50.136Z",
"updated_at": "2026-03-15T03:56:50.136Z",
"tokens": 847
}
],
"pagination": { "page": 1, "per_page": 10, "total": 1 }
}/documents/:idRetrieve a single document by ID, including its full content.
curl https://api.agentbooks.net/api/v1/documents/cmmr83ja... \ -H "Authorization: Bearer ab_sk_..."
{
"id": "cmmr83ja0000113itx1qs15wr",
"title": "Deployment Guide",
"slug": "deployment-guide",
"content": "# How to deploy\n\nStep 1: ...",
"format": "markdown",
"tags": ["devops", "guide"],
"visibility": "PUBLIC",
"metadata": {},
"created_at": "2026-03-15T03:56:50.136Z",
"updated_at": "2026-03-15T03:56:50.136Z",
"tokens": 847
}/documents/:idDelete a document and all its chunks permanently.
curl -X DELETE https://api.agentbooks.net/api/v1/documents/cmmr83ja... \ -H "Authorization: Bearer ab_sk_..."
Returns 204 No Content on success.
/searchSemantic search across all documents in your space. Returns the most relevant chunks ranked by similarity.
q*limitthresholdtagscurl "https://api.agentbooks.net/api/v1/search?q=how+to+deploy&limit=3" \ -H "Authorization: Bearer ab_sk_..."
{
"results": [
{
"document_id": "cmmr83ja0000113itx1qs15wr",
"title": "Deployment Guide",
"chunk": "Step 1: Clone the repository...",
"score": 0.9234,
"metadata": {}
}
],
"query_tokens": 4,
"search_time_ms": 17
}All errors follow a consistent format:
{
"error": {
"code": "invalid_api_key",
"message": "Invalid or revoked API key",
"status": 401
}
}| Status | Code | Description |
|---|---|---|
| 400 | invalid_request | Missing or invalid parameters |
| 401 | invalid_api_key | Missing, invalid, or revoked API key |
| 404 | not_found | Document not found |
| 413 | content_too_large | Content exceeds 100KB limit |
| 500 | internal_error | Server error |
During beta, rate limits are generous: 100 requests/minute per API key. This will be formalized with paid plans.