Whether you are building a custom documentation portal, integrating help content into your app, or syncing content from an external source, the GitDocAI API provides powerful endpoints for retrieving and managing your documentation entries.
This guide covers how to fetch documentation structures, retrieve specific entries, and manage your content programmatically.
Understanding the Content Hierarchy
Before making API requests, it is helpful to understand how GitDocAI structures documentation. Every entry lives within a specific hierarchy, and you will need the corresponding IDs to construct your API requests.
flowchart LR
A["Organization"] --> B["Documentation"]
B --> C["Version"]
C --> D["Section"]
D --> E["Entry"]All API requests require standard authentication. Ensure you include your API key in the request headers before attempting to retrieve or modify content.
Retrieving Content
Use the following GET endpoints to fetch your documentation data.
1. List all Documentations
To get started, you might want to retrieve all documentation projects associated with your organization.
GET /v1/documentation/{organization_id}/list2. Fetch a Section's Entry Tree
When building a sidebar navigation or a table of contents, fetching entries one by one is inefficient. Instead, use the tree endpoint to retrieve the entire nested structure of entries for a specific section in a single call.
GET /v1/documentation/{organization_id}/{documentation_id}/version/{version_id}/section/{section_id}/entry/treeBest Practice: Use the tree endpoint on initial page load to render your navigation menu, then fetch individual entry content only when a user clicks on a specific item.
3. Get a Specific Entry
To retrieve the actual content and metadata of a single documentation entry, use its unique entry_id.
GET /v1/documentation/{organization_id}/{documentation_id}/version/{version_id}/section/{section_id}/entry/{entry_id}4. List all Entries in a Section
If you need a flat list of all documentation entries for a specific section rather than a nested tree, use the base entry endpoint.
GET /v1/documentation/{organization_id}/{documentation_id}/version/{version_id}/section/{section_id}/entryManaging Entries and Structure
Beyond retrieving content, the API offers comprehensive endpoints for creating, updating, and organizing your documentation entries.
Entry Management Endpoints
Use these endpoints to modify individual entries or perform batch operations within a section.
| Action | Method | Endpoint Path |
|---|---|---|
| Create | POST | /v1/.../section/{section_id}/entry |
| Batch Create | POST | /v1/.../section/{section_id}/entry/batch |
| Update | PUT | /v1/.../section/{section_id}/entry/{entry_id} |
| Delete | DELETE | /v1/.../section/{section_id}/entry/{entry_id} |
(Note: The ... represents the standard /documentation/{org_id}/{doc_id}/version/{version_id} prefix).
Organization and Reordering Endpoints
Keep your documentation structured exactly how you want it by moving and reordering entries.
| Action | Method | Endpoint Path |
|---|---|---|
| Reorder | POST | /v1/.../section/{section_id}/entry/reorder |
| Move | POST | /v1/.../section/{section_id}/entry/{entry_id}/move |
Managing Top-Level Documentation
If you need to manage the documentation projects themselves (rather than the entries inside them), GitDocAI provides a set of top-level endpoints.
| Action | Method | Endpoint |
|---|---|---|
| Create Project | POST | /v1/documentation/{organization_id} |
| Get Project | GET | /v1/documentation/{organization_id}/{documentation_id} |
| Update Project | PUT | /v1/documentation/{organization_id}/{documentation_id} |
| Update Config | PUT | /v1/documentation/{organization_id}/{documentation_id}/config |
| Delete Project | DELETE | /v1/documentation/{organization_id}/{documentation_id} |
Deleting a top-level documentation project (DELETE /v1/documentation/...) is a destructive action that will permanently remove all associated versions, sections, and entries. Proceed with caution.