REST APIv1

API Documentation

The Codaiq REST API lets you generate websites, manage projects, capture leads, and retrieve analytics data programmatically. All requests are authenticated with an API key.

Authentication

Include your API key in the X-API-Key header on every request. You can find and manage your API keys in Account Settings.

http
X-API-Key: your-api-key-here
Keep your key secret. Do not expose it in client-side code or public repositories. Rotate it immediately from Settings if it is ever compromised.

Endpoints

Base URL: https://codaiq.com/api

POST/api/generateGenerate a website from a text prompt

Triggers AI website generation. Returns a project ID and build status. Poll GET /api/project to track build progress.

curl
curl -X POST https://codaiq.com/api/generate \
  -H "X-API-Key: your-api-key-here" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A modern SaaS landing page for a project management tool",
    "name":   "My SaaS Site"
  }'
javascript
const res = await fetch("https://codaiq.com/api/generate", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.CODAIQ_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    prompt: "A modern SaaS landing page for a project management tool",
    name:   "My SaaS Site",
  }),
});
const { projectId, websiteId, status } = await res.json();
python
import requests

response = requests.post(
    "https://codaiq.com/api/generate",
    headers={
        "X-API-Key": os.environ["CODAIQ_API_KEY"],
        "Content-Type": "application/json",
    },
    json={
        "prompt": "A modern SaaS landing page for a project management tool",
        "name":   "My SaaS Site",
    },
)
data = response.json()
project_id = data["projectId"]
GET/api/project?projectId={id}List or retrieve project details

Returns the project and all associated websites, including build status, domain, and metadata.

curl
curl "https://codaiq.com/api/project?projectId=PROJECT_ID" \
  -H "X-API-Key: your-api-key-here"
javascript
const res = await fetch(
  `https://codaiq.com/api/project?projectId=${projectId}`,
  { headers: { "X-API-Key": process.env.CODAIQ_API_KEY } }
);
const { websites } = await res.json();
const buildStatus = websites[0]?.metadata?.buildStatus;
PATCH/api/projectUpdate website metadata

Update a website's name, metadata fields, or custom settings without regenerating the site.

curl
curl -X PATCH https://codaiq.com/api/project \
  -H "X-API-Key: your-api-key-here" \
  -H "Content-Type: application/json" \
  -d '{
    "projectId": "PROJECT_ID",
    "websiteId": "WEBSITE_ID",
    "name":      "Updated Site Name",
    "metadata":  { "seoTitle": "My Updated Title" }
  }'
POST/api/leads/submitSubmit a lead

Capture a lead against a specific website. Used by embedded Codaiq lead capture forms and available for direct integration.

curl
curl -X POST https://codaiq.com/api/leads/submit \
  -H "X-API-Key: your-api-key-here" \
  -H "Content-Type: application/json" \
  -d '{
    "websiteId": "WEBSITE_ID",
    "name":      "Jane Smith",
    "email":     "jane@example.com",
    "phone":     "+44 7700 900000",
    "message":   "I am interested in your services."
  }'
javascript
await fetch("https://codaiq.com/api/leads/submit", {
  method: "POST",
  headers: {
    "X-API-Key": process.env.CODAIQ_API_KEY,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    websiteId: "WEBSITE_ID",
    name:      "Jane Smith",
    email:     "jane@example.com",
    message:   "Interested in your services.",
  }),
});
GET/api/analytics?websiteId={id}Get analytics data

Returns pageview counts, unique visitor counts, top pages, and referrer breakdown for the specified website.

curl
curl "https://codaiq.com/api/analytics?websiteId=WEBSITE_ID&range=7d" \
  -H "X-API-Key: your-api-key-here"
python
response = requests.get(
    "https://codaiq.com/api/analytics",
    headers={"X-API-Key": os.environ["CODAIQ_API_KEY"]},
    params={"websiteId": website_id, "range": "30d"},
)
analytics = response.json()
total_views = analytics["totalPageviews"]
GET/api/export?projectId={id}&websiteId={id}Export website code

Returns a ZIP archive containing all pages, components, styles, and assets for the website.

curl
curl "https://codaiq.com/api/export?projectId=PROJECT_ID&websiteId=WEBSITE_ID" \
  -H "X-API-Key: your-api-key-here" \
  -o website-export.zip

Rate Limits

Rate limits are enforced per API key. Exceeding a limit returns HTTP 429 Too Many Requests. The response includes a Retry-After header indicating when you may resume.

PlanRequestsPerBurst limit
Free100day10 / min
Pro2,000day60 / min
Agency20,000day200 / min
EnterpriseUnlimitedCustom

Webhooks

Configure a webhook endpoint in your project settings to receive real-time event notifications. Codaiq sends a POST request to your URL with a JSON payload whenever an event fires.

EventDescription
website.createdA new website was created
website.updatedWebsite code or metadata was updated
website.publishedWebsite was deployed successfully
lead.capturedA new lead was captured from a form
form.submittedA website form was submitted

Example payload

json
{
  "event":     "lead.captured",
  "timestamp": "2026-04-21T10:00:00.000Z",
  "websiteId": "WEBSITE_ID",
  "projectId": "PROJECT_ID",
  "data": {
    "leadId":  "LEAD_ID",
    "name":    "Jane Smith",
    "email":   "jane@example.com",
    "message": "Interested in your services."
  }
}

Validate webhook authenticity by checking the X-Codaiq-Signature header, which is an HMAC-SHA256 signature of the raw request body using your webhook secret.

SDKs

Official SDKs are in development. Star us on GitHub to be notified when they launch.

JavaScript / TypeScript SDK

npm install codaiqComing soon

Python SDK

pip install codaiqComing soon
Star us on GitHub