API Documentation

Generate flyers and certificates dynamically using our fast API.

Authentication

All API requests must be authenticated via a Bearer token. You can generate an API key from your dashboard.

Authorization: Bearer af_1234567890abcdef

Endpoints

POST/api/v1/generate/image

Generates a high-quality PNG image from a template.

Request Body (JSON)

{
  "template_id": "votesphere_contestant",
  "format": "image",
  "branding": {
    "primary_color": "#2563eb",
    "background_color": "#050505"
  },
  "data": {
    "recipient_name": "Amina Bello",
    "title": "Icon of the Year",
    "event_name": "LAWSAN SE MERIT AWARDS",
    "avatar_url": "https://placehold.co/600x600/111111/white.png?text=JD",
    "logo_url": "https://placehold.co/100x100/2563eb/white.png?text=Logo",
    "brand_name": "Votesphere"
  }
}

POST/api/v1/generate/pdf

Generates a vector-based PDF document.

{
  "template_id": "luxury_gold",
  "format": "pdf",
  "data": {
    "recipient_name": "John Doe",
    "title": "Certificate of Completion",
    "description": "For outstanding achievement.",
    "signature_1_name": "Jane Smith"
  }
}

AI Agents & MCP Integration

Asset Forge includes a built-in Model Context Protocol (MCP) server. You can hook your favorite AI Assistants (Claude Desktop, Cursor, etc.) directly into Asset Forge so they can autonomously generate dynamic images and PDFs.

Connecting Your Agent

Add the following to your MCP client configuration:

{
  "mcpServers": {
    "asset-forge": {
      "command": "npx",
      "args": ["tsx", "/absolute/path/to/asset-forge/mcp/index.ts"],
      "env": {
        "ASSET_FORGE_API_KEY": "af_YOUR_API_KEY",
        "ASSET_FORGE_URL": "https://assetforge.votesphere.com.ng"
      }
    }
  }
}

Once connected, your AI agent will have access to the generate_asset tool! For full developer instructions, see docs/mcp-setup.md in the repository.