Aurelis

Documentation Generator API

Overview

The Documentation Generator API provides automated documentation generation capabilities for codebases, creating comprehensive technical documentation from source code analysis.

Endpoints

Generate Documentation

POST /api/v1/docs/generate

Generates documentation for a specified codebase or project.

Request Body

{
  "project_path": "string",
  "output_format": "markdown|html|pdf",
  "include_private": false,
  "documentation_types": [
    "api",
    "architecture",
    "deployment",
    "user_guide"
  ],
  "template": "default|custom",
  "custom_template_path": "string",
  "language": "auto|python|javascript|typescript|java|csharp",
  "exclude_patterns": [
    "*/tests/*",
    "*/node_modules/*"
  ]
}

Response

{
  "success": true,
  "documentation_id": "doc_12345",
  "output_path": "/path/to/generated/docs",
  "generated_files": [
    {
      "type": "api",
      "path": "/path/to/api-docs.md",
      "size_bytes": 15420
    }
  ],
  "processing_time_ms": 2500,
  "warnings": []
}

Get Documentation Status

GET /api/v1/docs/status/{documentation_id}

Retrieves the status of a documentation generation task.

Response

{
  "id": "doc_12345",
  "status": "completed|processing|failed",
  "progress": 100,
  "created_at": "2025-06-17T10:30:00Z",
  "completed_at": "2025-06-17T10:32:30Z",
  "error_message": null
}

List Documentation Templates

GET /api/v1/docs/templates

Retrieves available documentation templates.

Response

{
  "templates": [
    {
      "name": "default",
      "description": "Standard technical documentation template",
      "supported_formats": ["markdown", "html", "pdf"],
      "documentation_types": ["api", "architecture", "deployment"]
    },
    {
      "name": "enterprise",
      "description": "Enterprise-grade documentation with compliance sections",
      "supported_formats": ["markdown", "html", "pdf"],
      "documentation_types": ["api", "architecture", "deployment", "security", "compliance"]
    }
  ]
}

Update Documentation

PUT /api/v1/docs/{documentation_id}

Updates existing documentation with new content or regenerates based on code changes.

Request Body

{
  "regenerate": true,
  "update_sections": ["api", "architecture"],
  "preserve_custom_content": true
}

Response

{
  "success": true,
  "updated_files": [
    "/path/to/updated-api-docs.md"
  ],
  "processing_time_ms": 1500
}

Delete Documentation

DELETE /api/v1/docs/{documentation_id}

Removes generated documentation and associated metadata.

Response

{
  "success": true,
  "message": "Documentation deleted successfully"
}

Configuration

Documentation Types

Output Formats

Template Customization

Custom templates can be provided using Jinja2 syntax:

{
  "template": "custom",
  "custom_template_path": "/path/to/custom-template.j2",
  "template_variables": {
    "company_name": "Aurelis",
    "version": "1.0.0",
    "author": "Development Team"
  }
}

Error Handling

Common Error Codes

Error Response Format

{
  "success": false,
  "error": {
    "code": "INVALID_PROJECT_PATH",
    "message": "The specified project path does not exist or is not accessible",
    "details": {
      "path": "/invalid/path",
      "suggestion": "Verify the path exists and has proper permissions"
    }
  }
}

Rate Limiting

Examples

Generate API Documentation

curl -X POST "https://api.aurelis.dev/v1/docs/generate" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "project_path": "/workspace/my-project",
    "output_format": "markdown",
    "documentation_types": ["api", "architecture"],
    "include_private": false
  }'

Check Generation Status

curl -X GET "https://api.aurelis.dev/v1/docs/status/doc_12345" \
  -H "Authorization: Bearer YOUR_API_KEY"

Integration

Python SDK

from aurelis import DocsGenerator

generator = DocsGenerator(api_key="your_api_key")

# Generate documentation
result = generator.generate(
    project_path="/workspace/my-project",
    output_format="markdown",
    documentation_types=["api", "architecture"]
)

# Check status
status = generator.get_status(result.documentation_id)

CLI Integration

aurelis docs generate \
  --project-path /workspace/my-project \
  --output-format markdown \
  --types api,architecture \
  --template enterprise

Best Practices

  1. Project Structure: Ensure your project follows standard conventions for better documentation quality
  2. Code Comments: Include comprehensive docstrings and comments for better API documentation
  3. Template Selection: Choose templates that match your organization’s documentation standards
  4. Regular Updates: Set up automated documentation updates as part of your CI/CD pipeline
  5. Version Control: Track documentation changes alongside code changes

Limitations

Support

For issues with documentation generation, contact support with: