Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.neuraldraft.io/llms.txt

Use this file to discover all available pages before exploring further.

The CMS pillar is what turns a static AI-generated site into a real, editable property. Every text node and image you mark up with our conventions becomes a field in the project’s admin — no schemas, no migrations, no glue code.

What this gives you

  • Translation keys — dot-namespaced keys (hero.headline, pricing.tiers.0.title) with per-language values. One bulk endpoint feeds your build process.
  • Image keysdata-image-key="hero.background" on an <img>. The customer can swap the image in the admin; your build resolves the URL.
  • Brand context — voice, colors, fonts, audience exposed as a single resource. Read once at build time, or hot-fetch per request.
  • Register-component — turn AI-generated HTML into an admin-editable section in one call, with data-translate keys auto-discovered.

Quick example

Bulk-fetch every key for a locale at build time. One request, one response.
curl "https://api.neuraldraft.io/v1/content/bulk?keys=hero.headline,hero.subhead,cta.label&lang=en" \
  -H "Authorization: Bearer $NEURAL_DRAFT_API_KEY"
Response:
{
  "hero.headline": "Welcome",
  "hero.subhead": "We build software that scales.",
  "cta.label": "Get started"
}
Update one key:
curl -X PUT https://api.neuraldraft.io/v1/content/hero.headline \
  -H "Authorization: Bearer $NEURAL_DRAFT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"lang":"en","value":"Welcome to Acme"}'

Common workflows

1. Build-time fetch for SSG

Static-site generators (Next.js, Astro, Nuxt, Hugo) call /v1/content/bulk once per locale at build time. Cache the response — re-fetch only when the content.changed webhook fires.

2. Click-to-edit overlay on a live site

Drop a tiny JS snippet into your HTML. It looks for data-translate attributes and turns them into inline-editable fields when the user is signed into the admin in the same browser.
<script src="https://widgets.neuraldraft.io/v1/edit-overlay.js" defer></script>
The overlay calls /v1/content/{key} on save. Same backend, no rebuild.

3. AI registers a generated section

When the AI in your editor generates a hero, it calls register_component(html, intent) via MCP. The component appears in your admin instantly:
POST /v1/components/register
{
  "html": "<section data-component='hero'><h1 data-translate='hero.headline'>Welcome</h1></section>",
  "intent": "marketing hero"
}
{
  "component_id": "cmp_2NgcaXxFqLPo",
  "editor_url": "https://app.neuraldraft.io/components/cmp_2NgcaXxFqLPo",
  "keys_created": ["hero.headline"]
}
The admin auto-discovers hero.headline as an editable text field. No schema work.

4. Translate a key into N languages

curl -X POST https://api.neuraldraft.io/v1/content/hero.headline/translate \
  -H "Authorization: Bearer $NEURAL_DRAFT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"target_langs":["fr","de","es"]}'
Returns a Job id. Poll /v1/jobs/{id} for the result, or subscribe to the content.changed webhook event to get notified once each language lands.

5. Brand context for AI prompts

Read brand once, pass it into your AI calls. The MCP server does this for you; if you’re calling the API directly:
curl https://api.neuraldraft.io/v1/brand \
  -H "Authorization: Bearer $NEURAL_DRAFT_API_KEY"
{
  "name": "Acme",
  "description": "Software that scales.",
  "voice": "friendly_professional",
  "audience": "indie founders building with AI tools",
  "colors": { "primary": "#7C3AED", "secondary": "#0F172A", "accent": "#A78BFA" },
  "fonts": { "heading": "Inter", "body": "Inter" },
  "default_language": "en",
  "target_languages": ["en", "fr", "de"]
}

Conventions

The two attributes the AI uses everywhere:
<h1 data-translate="hero.headline">Welcome</h1>
<p data-translate="hero.subhead">We build software that scales.</p>

<img data-image-key="hero.background" src="..." alt="...">
Keys are case-sensitive, dot-namespaced, and lowercase by convention. Index keys for arrays follow section.field.0.subfield.

Reference

EndpointTag
GET /v1/content/bulkContent
GET /v1/content/{key}Content
PUT /v1/content/{key}Content
PUT /v1/content (batch)Content
POST /v1/content/{key}/translateContent
POST /v1/components/registerComponents
GET /v1/componentsComponents
GET /v1/brandBrand
PATCH /v1/brandBrand
POST /v1/images/uploadImages
POST /v1/images/generateImages
POST /v1/newsletters/subscribe (public)Forms
GET /v1/newslettersForms
DELETE /v1/newsletters/{id}Forms
POST /v1/contact-forms (public)Forms
GET /v1/contact-formsForms
DELETE /v1/contact-forms/{id}Forms

Forms — newsletter & contact

Most AI-built sites need two simple capture surfaces: an email-collector for newsletters and a free-form contact form. Neural Draft ships both as first-class endpoints — no schemas to design, no spam-handling glue, and free (no credits charged, since these are storage + delivery, not AI).

Public submit

The submit endpoints are public. Authenticate the project with a server-side API key in X-NeuralDraft-Project-Key (or pass ?project_id= for unauthenticated client-side embeds where you don’t want to ship a key):
# Newsletter — idempotent. Re-submitting an existing email returns 200 with
# status="already_subscribed" instead of an error.
curl -X POST https://api.neuraldraft.io/v1/newsletters/subscribe \
  -H "X-NeuralDraft-Project-Key: $NEURAL_DRAFT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"email":"jane@example.com","app_lead":false}'

# Contact form — `data` is free-form JSON for whatever your form collects;
# IP and user-agent are merged in server-side for spam triage.
curl -X POST https://api.neuraldraft.io/v1/contact-forms \
  -H "X-NeuralDraft-Project-Key: $NEURAL_DRAFT_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "jane@example.com",
    "subject": "Demo request",
    "message": "We are evaluating Neural Draft for our next launch.",
    "data": {"company":"Acme","headcount":12}
  }'

Webhook events

Both submits fire webhook events through the standard fan-out so you can pipe them into Slack, a CRM, or your own automation:
  • newsletter.subscribed{ id, email, app_lead, subscribed_at }
  • contact_form.submitted{ id, email, subject, message, data, submitted_at }

Admin list & delete

Listing and deleting submissions requires an API key with forms:read / forms:write scope (or *). Both list endpoints support ?page / ?page_size (max 200) and ?search=; the newsletter list also accepts ?app_lead=true to filter out trial leads from your real subscriber list.