Skip to main content
โšก๐Ÿ’ป๐Ÿ”ŒapiSource: opendocs-core

Documents API

Complete reference for the Documents REST API endpoints.

1 min read184 words

Documents API #

The Documents API allows you to create, read, update, and delete documentation pages.

Endpoints #

List Documents #

http
GET /api/v1/documents

Query Parameters:

ParameterTypeDescription
pagenumberPage number (default: 1)
perpagenumberItems per page (default: 20, max: 100)
statusstringFilter by status: draft, published, archived
categorystringFilter by category slug
qstringFull-text search query
tagstringFilter by tag
Response:
json
{
  "success": true,
  "data": [...],
  "meta": {
    "page": 1,
    "perpage": 20,
    "total": 100,
    "totalpages": 5
  }
}

Create Document #

http
POST /api/v1/documents
Authorization: Bearer YOURAPIKEY
Content-Type: application/json

Request Body:

json
{
  "title": "My Document",
  "content": "# Hello World",
  "description": "Optional description",
  "category": "guides",
  "tags": ["tutorial", "beginner"],
  "sourceurl": "https://example.com/original",
  "sourceidentifier": "example.com",
  "status": "published"
}

Get Document #

http
GET /api/v1/documents/{slug}

Update Document #

http
PUT /api/v1/documents/{slug}
Authorization: Bearer YOURAPIKEY

Delete Document #

http
DELETE /api/v1/documents/{slug}
Authorization: Bearer YOURAPI_KEY