API Reference: Integrations & Infrastructure Importing Assets into Documentation

When building and managing documentation, you often need to bring in external files, images, or even AI-generated content. The GitDocAI API provides a comprehensive suite of endpoints to handle direct file uploads, URL imports, AI content generation, and tracking the progress of multi-step setup wizards.

This guide walks you through the various ways you can import and manage assets programmatically.

Common Path Parameters
Most endpoints in this guide require two standard path parameters:

  • organization_id: The unique identifier for your organization.

  • documentation_id: The unique identifier for the target documentation project.

Direct File Uploads

To securely upload physical files (like images or PDFs) into your documentation, GitDocAI uses a two-step signed URL process. This ensures files are uploaded directly to our secure storage without bottlenecking the main API.

sequenceDiagram
    participant C as Client
    participant A as GitDocAI API
    participant S as Cloud Storage
    
    C->>A: POST /file-resources/upload-url
    A-->>C: Returns Signed URL
    C->>S: PUT File to Signed URL
    S-->>C: 200 OK Upload Successful
    C->>A: POST /file-resources/finalize
    A-->>C: Asset Created & Linked
  1. 1

    Request a signed upload URL

    First, request a secure, temporary URL where you can upload your file.

    Endpoint:
    POST /v1/documentation/{organization_id}/{documentation_id}/file-resources/upload-url

  2. 2

    Upload your file

    Using the URL returned in the previous step, perform a standard PUT request containing your file's binary data directly to the cloud storage provider.

  3. 3

    Finalize the upload

    Once the file is successfully uploaded to the signed URL, notify GitDocAI so the asset can be registered and linked to your documentation project.

    Endpoint:
    POST /v1/documentation/{organization_id}/{documentation_id}/file-resources/finalize

Signed URLs expire shortly after they are generated. Always request a new signed URL immediately before you intend to upload a file.

Importing Assets from a URL

If your asset is already hosted publicly on the internet, you can instruct GitDocAI to fetch and import it directly, skipping the manual download and upload process.

Endpoint:
POST /v1/documentation/{organization_id}/{documentation_id}/asset/import

Pass the source URL in your request body, and GitDocAI will download the asset, store it securely, and make it available in your documentation's media library.

Managing Assets

Once assets are imported or uploaded into your documentation project, you can manage them using the standard asset endpoints. This allows you to retrieve, update, or delete existing assets, as well as serve the underlying files.

ActionEndpointDescription
List AssetsGET /v1/documentation/{organization_id}/{documentation_id}/assetRetrieves all assets for a specific documentation project.
Upload AssetPOST /v1/documentation/{organization_id}/{documentation_id}/assetDirectly uploads a new asset.
Get AssetGET /v1/documentation/{organization_id}/{documentation_id}/asset/{asset_id}Retrieves metadata for a specific asset by its ID.
Update AssetPUT /v1/documentation/{organization_id}/{documentation_id}/asset/{asset_id}Updates the metadata of an existing asset.
Delete AssetDELETE /v1/documentation/{organization_id}/{documentation_id}/asset/{asset_id}Removes an asset from the documentation project.
Serve FileGET /v1/documentation/{organization_id}/{documentation_id}/asset/{asset_id}/fileServes the actual file content of the asset.

AI-Generated Assets and Content

You can leverage GitDocAI's built-in artificial intelligence to generate new assets or refine existing content on the fly.

ActionEndpointDescription
Generate ImagePOST /documentation/{organization_id}/{documentation_id}/ai/generate-imagePrompts the AI to create an image and automatically stores it as an asset in your project.
Edit ContentPOST /documentation/{organization_id}/{documentation_id}/ai/editSends existing text to the AI for rewriting, formatting, or grammar correction.

When generating images, provide as much descriptive context as possible in your prompt to ensure the resulting asset matches your documentation's style and tone.

Tracking Wizard Progress

When users are importing large amounts of documentation or going through a complex onboarding setup, you can track their progress using the Wizard Progress endpoints. This allows you to save their state and let them resume later if they get interrupted.

Save or Update Progress (Upsert)

Endpoint: POST /v1/organization/{organization_id}/wizard-progress/{documentation_id}

Use this to save the current step, selected options, or completion percentage of an active setup wizard.

Retrieve Progress

Endpoint: GET /v1/organization/{organization_id}/wizard-progress/{documentation_id}

Fetch the saved state when a user returns to the application so you can drop them exactly where they left off.

Clear Progress

Endpoint: DELETE /v1/organization/{organization_id}/wizard-progress/{documentation_id}

Once the wizard is complete, or if the user chooses to restart, use this endpoint to clear the saved state.