API Reference
Complete reference for all AgentDocs REST API endpoints.
Interactive API Explorer: For a fully interactive experience with try-it-out functionality, visit the Swagger UI .
Base URL
All API endpoints are relative to the base URL:
https://agentdocs.eu
Request Format
All request bodies should be sent as JSON with the appropriate header:
Content-Type: application/json
Authentication is provided via the Authorization header. See the API Authentication guide for details.
Response Format
All responses are JSON unless otherwise noted (e.g., the /raw endpoint returns plain text). Successful responses use standard HTTP status codes:
| Status | Meaning |
|---|---|
| 200 OK | Successful GET/PUT request |
| 201 Created | Successful POST request (resource created) |
| 204 No Content | Successful DELETE request |
| 400 Bad Request | Invalid request body or parameters |
| 401 Unauthorized | Missing or invalid authentication |
| 403 Forbidden | Insufficient permissions for this action |
| 404 Not Found | Resource not found |
| 500 Server Error | Internal server error |
Endpoints
Authentication
| Method | Path | Description | Auth |
|---|---|---|---|
| POST | /api/auth/register | Create a new user account | None |
| POST | /api/auth/login | Log in and receive a JWT token | None |
| GET | /api/auth/me | Get the current authenticated user | JWT / Token |
Workspaces
| Method | Path | Description | Auth |
|---|---|---|---|
| GET | /api/workspaces | List all workspaces for the current user | JWT / Token |
| POST | /api/workspaces | Create a new workspace | JWT / Token |
| GET | /api/workspaces/:id | Get a workspace by ID | JWT / Token |
| PUT | /api/workspaces/:id | Update a workspace | JWT / Token |
| DELETE | /api/workspaces/:id | Delete a workspace | JWT / Token |
| GET | /api/workspaces/:id/members | List workspace members | JWT / Token |
| POST | /api/workspaces/:id/members | Invite a member to the workspace | JWT / Token |
Spaces
| Method | Path | Description | Auth |
|---|---|---|---|
| GET | /api/workspaces/:id/spaces | List all spaces in a workspace | JWT / Token |
| POST | /api/workspaces/:id/spaces | Create a new space | JWT / Token |
| GET | /api/spaces/:id | Get a space by ID | JWT / Token |
| PUT | /api/spaces/:id | Update a space | JWT / Token |
| DELETE | /api/spaces/:id | Delete a space and all its pages | JWT / Token |
Pages
| Method | Path | Description | Auth |
|---|---|---|---|
| GET | /api/spaces/:id/pages | List all pages in a space (tree structure) | JWT / Token |
| POST | /api/spaces/:id/pages | Create a new page in a space | JWT / Token |
| GET | /api/pages/:id | Get a single page by ID | JWT / Token |
| PUT | /api/pages/:id | Update a page (title, content, slug, parent) | JWT / Token |
| DELETE | /api/pages/:id | Delete a page and its children | JWT / Token |
| GET | /api/pages/:id/versions | List version history for a page | JWT / Token |
Webhooks
| Method | Path | Description | Auth |
|---|---|---|---|
| GET | /api/workspaces/:id/webhooks | List webhooks for a workspace | JWT / Token |
| POST | /api/workspaces/:id/webhooks | Create a webhook | JWT / Token |
| PUT | /api/webhooks/:id | Update a webhook | JWT / Token |
| DELETE | /api/webhooks/:id | Delete a webhook | JWT / Token |
Example Requests
Create a Page
curl -X POST https://agentdocs.eu/api/spaces/SPACE_ID/pages \
-H "Authorization: Token YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Getting Started",
"slug": "getting-started",
"content": "# Getting Started\n\nWelcome to our docs!",
"parent_id": null
}'
# Response (201 Created):
{
"page": {
"id": "pg_abc123",
"title": "Getting Started",
"slug": "getting-started",
"content": "# Getting Started\n\nWelcome to our docs!",
"parent_id": null,
"space_id": "sp_xyz789",
"created_by": "usr_def456",
"created_at": "2025-01-15T10:30:00.000Z",
"updated_at": "2025-01-15T10:30:00.000Z"
}
}Create a Share Link
curl -X POST https://agentdocs.eu/api/pages/pg_abc123/share \
-H "Authorization: Token YOUR_API_TOKEN"
# Response (201 Created):
{
"share_link": {
"id": "sl_abc123",
"token": "a1b2c3d4e5f6...",
"page_id": "pg_abc123",
"created_at": "2025-01-15T10:35:00.000Z"
}
}
# Now access the page:
# Human-readable: /shared/a1b2c3d4e5f6...
# Agent-friendly: /api/shared/a1b2c3d4e5f6.../rawFetch Raw Shared Page
curl https://agentdocs.eu/api/shared/a1b2c3d4e5f6/raw # Response (200 OK, Content-Type: text/plain): --- title: Getting Started shared_via: AgentDocs last_updated: 2025-01-15T10:30:00.000Z --- # Getting Started Welcome to our docs!
Want more details? The full interactive API documentation with request/response schemas, try-it-out functionality, and parameter descriptions is available at the Swagger UI .
AgentDocs v1.1.0 · 1814d7a