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.
X-API-Key: your-api-key-hereEndpoints
Base URL: https://codaiq.com/api
/api/generateGenerate a website from a text promptTriggers AI website generation. Returns a project ID and build status. Poll GET /api/project to track build progress.
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"
}'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();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"]/api/project?projectId={id}List or retrieve project detailsReturns the project and all associated websites, including build status, domain, and metadata.
curl "https://codaiq.com/api/project?projectId=PROJECT_ID" \
-H "X-API-Key: your-api-key-here"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;/api/projectUpdate website metadataUpdate a website's name, metadata fields, or custom settings without regenerating the site.
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" }
}'/api/leads/submitSubmit a leadCapture a lead against a specific website. Used by embedded Codaiq lead capture forms and available for direct integration.
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."
}'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.",
}),
});/api/analytics?websiteId={id}Get analytics dataReturns pageview counts, unique visitor counts, top pages, and referrer breakdown for the specified website.
curl "https://codaiq.com/api/analytics?websiteId=WEBSITE_ID&range=7d" \
-H "X-API-Key: your-api-key-here"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"]/api/export?projectId={id}&websiteId={id}Export website codeReturns a ZIP archive containing all pages, components, styles, and assets for the website.
curl "https://codaiq.com/api/export?projectId=PROJECT_ID&websiteId=WEBSITE_ID" \
-H "X-API-Key: your-api-key-here" \
-o website-export.zipRate 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.
| Plan | Requests | Per | Burst limit |
|---|---|---|---|
| Free | 100 | day | 10 / min |
| Pro | 2,000 | day | 60 / min |
| Agency | 20,000 | day | 200 / min |
| Enterprise | Unlimited | — | Custom |
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.
| Event | Description |
|---|---|
| website.created | A new website was created |
| website.updated | Website code or metadata was updated |
| website.published | Website was deployed successfully |
| lead.captured | A new lead was captured from a form |
| form.submitted | A website form was submitted |
Example payload
{
"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 soonPython SDK
pip install codaiqComing soon