API Documentation

RESTful APIs to integrate your content with any website or application

Base URL

https://your-domain.com/api

Authentication

All API requests require authentication using an API key. Include your API key in the Authorization header:

Authorization: Bearer YOUR_API_KEY

Sites

GET /api/sites

Get all sites for a user

Query Parameters:

  • userId (required) - User ID
{
  "success": true,
  "data": [
    {
      "id": "site-1",
      "name": "My Website",
      "domain": "mywebsite.com",
      "userId": "user-1",
      "isActive": true,
      "createdAt": "2024-01-15T10:30:00Z",
      "updatedAt": "2024-03-10T16:20:00Z"
    }
  ]
}

POST /api/sites

Create a new site

Request Body:

{
  "name": "My New Site",
  "domain": "mynewsite.com",
  "userId": "user-1"
}

Pages

GET /api/pages

Get all pages for a site

Query Parameters:

  • siteId (required) - Site ID
{
  "success": true,
  "data": [
    {
      "id": "page-1",
      "siteId": "site-1",
      "title": "Home",
      "slug": "home",
      "content": "<h1>Welcome</h1><p>Content here...</p>",
      "metaTitle": "Home - My Website",
      "metaDescription": "Welcome to my website",
      "isPublished": true,
      "createdAt": "2024-01-15T11:00:00Z",
      "updatedAt": "2024-03-10T16:30:00Z"
    }
  ]
}

POST /api/pages

Create a new page

Request Body:

{
  "siteId": "site-1",
  "title": "About Us",
  "slug": "about",
  "content": "<h1>About Us</h1><p>Our story...</p>",
  "metaTitle": "About Us - My Website",
  "metaDescription": "Learn more about us",
  "isPublished": true
}

Blog Posts

GET /api/blogs

Get all blog posts for a site

Query Parameters:

  • siteId (required) - Site ID
{
  "success": true,
  "data": [
    {
      "id": "blog-1",
      "siteId": "site-1",
      "title": "My First Blog Post",
      "slug": "my-first-post",
      "content": "<h1>Title</h1><p>Content...</p>",
      "excerpt": "A brief summary of the post",
      "metaTitle": "My First Blog Post",
      "metaDescription": "Description for SEO",
      "featuredImage": "/images/featured.jpg",
      "author": "John Doe",
      "tags": ["web", "development"],
      "isPublished": true,
      "publishedAt": "2024-02-10T10:00:00Z",
      "createdAt": "2024-02-08T14:00:00Z",
      "updatedAt": "2024-02-10T10:00:00Z"
    }
  ]
}

POST /api/blogs

Create a new blog post

Request Body:

{
  "siteId": "site-1",
  "title": "New Blog Post",
  "slug": "new-post",
  "content": "<h1>Title</h1><p>Content...</p>",
  "excerpt": "Brief summary",
  "author": "John Doe",
  "tags": ["tag1", "tag2"],
  "isPublished": true
}

Forms

GET /api/forms

Get all forms for a site

Query Parameters:

  • siteId (required) - Site ID

POST /api/forms

Create a new form

Request Body:

{
  "siteId": "site-1",
  "name": "Contact Form",
  "fields": [
    {
      "id": "field-1",
      "name": "name",
      "label": "Full Name",
      "type": "text",
      "required": true
    },
    {
      "id": "field-2",
      "name": "email",
      "label": "Email",
      "type": "email",
      "required": true
    }
  ]
}

Navigation

GET /api/navigation

Get navigation for a site

Query Parameters:

  • siteId (required) - Site ID
  • type (optional) - “header” or “footer”

POST /api/navigation

Create or update navigation

Request Body:

{
  "siteId": "site-1",
  "type": "header",
  "items": [
    {
      "id": "nav-1",
      "label": "Home",
      "url": "/",
      "target": "_self"
    },
    {
      "id": "nav-2",
      "label": "About",
      "url": "/about",
      "target": "_self"
    }
  ]
}

Error Codes

200OK - Request successful
201Created - Resource created successfully
400Bad Request - Invalid request parameters
401Unauthorized - Invalid API key
404Not Found - Resource not found
409Conflict - Resource already exists
500Internal Server Error - Server error

SDK & Examples

We provide SDKs and examples for popular programming languages: