Advanced Features & Technical Guides Retrieving Documentation Entries via API

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}/list

2. 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/tree

Best 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}/entry

Managing 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.

ActionMethodEndpoint Path
CreatePOST/v1/.../section/{section_id}/entry
Batch CreatePOST/v1/.../section/{section_id}/entry/batch
UpdatePUT/v1/.../section/{section_id}/entry/{entry_id}
DeleteDELETE/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.

ActionMethodEndpoint Path
ReorderPOST/v1/.../section/{section_id}/entry/reorder
MovePOST/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.

ActionMethodEndpoint
Create ProjectPOST/v1/documentation/{organization_id}
Get ProjectGET/v1/documentation/{organization_id}/{documentation_id}
Update ProjectPUT/v1/documentation/{organization_id}/{documentation_id}
Update ConfigPUT/v1/documentation/{organization_id}/{documentation_id}/config
Delete ProjectDELETE/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.