Backups & Restorations Bootstrapping New Documentation

When you create a new documentation project, you don't have to start from a blank slate. GitDocAI provides a variety of initialization methods to bootstrap your content quickly, whether you're importing an existing OpenAPI spec, scraping a website, or generating a structure using AI.

Once your documentation is up and running, you can easily configure repositories to manage backups and restorations, keeping your content safe and versioned.

flowchart TD
    A[Pending Documentation] --> B{Choose Bootstrapping Method}
    B -->|AI Prompt| C["AI Generated"]
    B -->|OpenAPI Spec| D["API Reference"]
    B -->|GitHub Repo| E["Imported Repository"]
    B -->|Templates & Files| F["Standard Scaffold"]
    C & D & E & F --> G[Active Documentation]
    G --> H[("Backup Repository")]
    H -->|Restore| G

Depending on your source material, you can initialize your documentation using different strategies. Here are the most common ways to get started:

OpenAPI / Swagger

Automatically generate a complete API reference by importing your OpenAPI specification file.

AI Prompt

Describe your product to our AI, and it will generate a tailored documentation structure and initial content for you.

GitHub Repository

Point GitDocAI to your existing GitHub repository to pull in your current Markdown files and structure.

All Initialization Endpoints

If you are automating your documentation setup via the GitDocAI API, you can use the following POST endpoints. Replace {organization_id} and {documentation_id} with your respective IDs.

Initialization MethodAPI Endpoint (POST)Best For
Blank Scaffold/v1/documentation/.../initialize-blankStarting completely from scratch with a default structure.
AI Prompt/v1/documentation/.../initialize-from-aiCreating a custom outline based on a text description.
File Import/v1/documentation/.../initialize-from-fileUploading a .zip of existing Markdown files.
OpenAPI Spec/v1/documentation/.../initialize-from-openapiBuilding an API reference from a Swagger/OpenAPI file.
GitHub Repo/v1/documentation/.../initialize-from-repositorySyncing docs directly from your source code repository.
Preset Template/v1/documentation/.../initialize-from-templateUsing one of GitDocAI's industry-standard templates.
Website Scrape/v1/documentation/.../initialize-from-websiteMigrating from an existing public documentation site.

You can only initialize a documentation project while it is in a "pending" state. Once initialized, you will manage content through the standard editor or sync features.

Documentation Management Endpoints

Before initializing, you must create a documentation project. You can manage the overall lifecycle and configuration of your documentation using these standard API endpoints:

ActionAPI EndpointMethod
Create/v1/documentation/{organization_id}POST
List/v1/documentation/{organization_id}/listGET
Get Details/v1/documentation/{organization_id}/{documentation_id}GET
Update/v1/documentation/{organization_id}/{documentation_id}PUT
Update Config/v1/documentation/{organization_id}/{documentation_id}/configPUT
Delete/v1/documentation/{organization_id}/{documentation_id}DELETE

Backups & Restorations

Protecting your documentation is critical. GitDocAI allows you to connect a backup repository, manually trigger backups, and restore your documentation to a previous state if something goes wrong.

Configuring a Backup Repository

Before you can create a backup, you need to tell GitDocAI where to store it.

  1. 1

    Check current configuration

    Make a GET request to /v1/documentation/{organization_id}/{documentation_id}/backup/repository to see if a repository is already configured.

  2. 2

    Set the repository

    Make a PUT request to the same endpoint with your repository details (such as the Git URL and authentication credentials) to configure your backup destination.

Managing Backups

Once your repository is configured, you can manage your backups via the API:

  • Create a Backup: Send a POST request to /v1/documentation/{organization_id}/{documentation_id}/backup to immediately snapshot your current documentation state.

  • List Backups: Send a GET request to the same endpoint to retrieve a history of all successful backups.

Restoring a Backup
Sending a POST request to /v1/documentation/{organization_id}/{documentation_id}/backup/restore will overwrite your current live documentation with the selected backup state. Ensure your team is aware before initiating a restoration, as unbacked-up changes made after the snapshot will be lost.

Frequently Asked Questions

Can I change my initialization method after starting?

No. Initialization is a one-time process used to bootstrap a pending documentation project. If you need to start over, you will need to create a new documentation project or manually delete the initialized content.

How often should I back up my documentation?

We recommend triggering a backup before making major structural changes, importing large amounts of new content, or changing your underlying templates.