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:

StatusMeaning
200 OKSuccessful GET/PUT request
201 CreatedSuccessful POST request (resource created)
204 No ContentSuccessful DELETE request
400 Bad RequestInvalid request body or parameters
401 UnauthorizedMissing or invalid authentication
403 ForbiddenInsufficient permissions for this action
404 Not FoundResource not found
500 Server ErrorInternal server error

Endpoints

Authentication

MethodPathDescriptionAuth
POST/api/auth/registerCreate a new user accountNone
POST/api/auth/loginLog in and receive a JWT tokenNone
GET/api/auth/meGet the current authenticated userJWT / Token

Workspaces

MethodPathDescriptionAuth
GET/api/workspacesList all workspaces for the current userJWT / Token
POST/api/workspacesCreate a new workspaceJWT / Token
GET/api/workspaces/:idGet a workspace by IDJWT / Token
PUT/api/workspaces/:idUpdate a workspaceJWT / Token
DELETE/api/workspaces/:idDelete a workspaceJWT / Token
GET/api/workspaces/:id/membersList workspace membersJWT / Token
POST/api/workspaces/:id/membersInvite a member to the workspaceJWT / Token

Spaces

MethodPathDescriptionAuth
GET/api/workspaces/:id/spacesList all spaces in a workspaceJWT / Token
POST/api/workspaces/:id/spacesCreate a new spaceJWT / Token
GET/api/spaces/:idGet a space by IDJWT / Token
PUT/api/spaces/:idUpdate a spaceJWT / Token
DELETE/api/spaces/:idDelete a space and all its pagesJWT / Token

Pages

MethodPathDescriptionAuth
GET/api/spaces/:id/pagesList all pages in a space (tree structure)JWT / Token
POST/api/spaces/:id/pagesCreate a new page in a spaceJWT / Token
GET/api/pages/:idGet a single page by IDJWT / Token
PUT/api/pages/:idUpdate a page (title, content, slug, parent)JWT / Token
DELETE/api/pages/:idDelete a page and its childrenJWT / Token
GET/api/pages/:id/versionsList version history for a pageJWT / Token

Webhooks

MethodPathDescriptionAuth
GET/api/workspaces/:id/webhooksList webhooks for a workspaceJWT / Token
POST/api/workspaces/:id/webhooksCreate a webhookJWT / Token
PUT/api/webhooks/:idUpdate a webhookJWT / Token
DELETE/api/webhooks/:idDelete a webhookJWT / 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.../raw

Fetch 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