Documentation / API Reference

API Reference

Programmatic access to the SovereignCMS Marketplace. Manage products, downloads, and integrate with your applications.

Authentication Required: Most API endpoints require an API token. Generate your token in Account Settings. Include it in requests as: Authorization: Bearer YOUR_TOKEN

Products

GET /api/products

Retrieve a list of all published products.

Query Parameters

type string Filter by type: theme, module, language, background
limit integer Number of results (default: 20, max: 100)
offset integer Pagination offset
{
  "success": true,
  "data": [
    {
      "id": 1,
      "name": "Neon Theme",
      "slug": "neon-theme",
      "type": "theme",
      "version": "1.0.0",
      "price": 0,
      "downloads": 1250
    }
  ]
}
GET /api/products/{slug}

Retrieve details for a specific product by its slug.

{
  "success": true,
  "data": {
    "id": 1,
    "name": "Neon Theme",
    "slug": "neon-theme",
    "type": "theme",
    "description": "A vibrant neon-styled theme...",
    "version": "1.0.0",
    "price": 0,
    "downloads": 1250,
    "author": "developer123",
    "created_at": "2024-01-15T10:30:00Z"
  }
}

Downloads

GET /api/downloads/{slug}

Get a download link for a product. Requires authentication and valid purchase/free product access.

Response

download_url string Temporary signed URL for downloading the product
expires_at datetime When the download URL expires
GET /api/user/purchases

List all products purchased by the authenticated user.

{
  "success": true,
  "data": [
    {
      "product_id": 5,
      "product_name": "Premium Module",
      "product_slug": "premium-module",
      "purchased_at": "2024-02-20T14:22:00Z",
      "price_paid": 19.99
    }
  ]
}

Version Checking

GET /api/version/{slug}

Check the latest version of a product. Useful for auto-update systems.

{
  "success": true,
  "data": {
    "slug": "neon-theme",
    "current_version": "1.2.0",
    "changelog": "- Fixed mobile responsiveness\n- Added dark mode support",
    "released_at": "2024-03-01T09:00:00Z"
  }
}
POST /api/version/check

Check multiple products for updates at once.

Request Body

products array Array of {slug, version} objects to check
// Request
{
  "products": [
    {"slug": "neon-theme", "version": "1.0.0"},
    {"slug": "chat-module", "version": "2.1.0"}
  ]
}

// Response
{
  "success": true,
  "updates": [
    {
      "slug": "neon-theme",
      "current_version": "1.0.0",
      "latest_version": "1.2.0",
      "update_available": true
    }
  ]
}

Rate Limits

API requests are rate limited to ensure fair usage:

  • General API: 100 requests per minute
  • Downloads: 20 downloads per hour
  • Version checks: 60 requests per minute

Rate limit headers are included in all responses: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset

Error Handling

All API errors follow a consistent format:

{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Invalid or expired API token"
  }
}

Common Error Codes

  • UNAUTHORIZED - Missing or invalid API token
  • FORBIDDEN - Access denied to this resource
  • NOT_FOUND - Resource does not exist
  • RATE_LIMITED - Too many requests
  • VALIDATION_ERROR - Invalid request parameters
Back to Documentation