Docs / Agent Workflow API

Agent Workflow API

Give AI agents the production lane they actually need: choose from a content plan, write a whole draft, check Voice DNA, run section-aware QA, add images, and publish after approval.

Base URL: wordflowsai.com/api/agent Auth: X-API-Key header (one key, all orgs)

What problem does this solve?

AI agents writing content for a business lack persistent organizational context. Every session starts from zero — the agent doesn't know the brand voice, content strategy, existing published posts, or writing style rules.

Wordflows stores project context and exposes a curated workflow API, so agents can stay in the content-production lane instead of choosing among every internal setup and management route.

Endpoints

GET /api/agent/projects

When: First call - discover available projects

Returns: List of projects with id, name, website, and industry

GET /api/agent/project-context ?organization_id=X&purpose=write

When: Need scoped context for writing, review, image, publish, brief, outline, or discovery

Returns: Task-specific markdown context instead of a full project dump

GET /api/agent/content-plans ?organization_id=X

When: Choosing what to write next

Returns: Saved content plans for the project

GET /api/agent/content-plans/{id} ?organization_id=X

When: Inspecting a plan and selecting the next post

Returns: Plan details and all items; the agent infers the next item

POST/PUT /api/agent/content ?organization_id=X

When: Creating or revising the full draft before section QA

Returns: Draft content ID, assembled markdown, and preview URL

POST /api/agent/content/{id}/draft-voice-check ?organization_id=X

When: Checking the whole draft before sectioning

Returns: Voice DNA violations for the agent to fix in the whole document

POST/GET /api/agent/content/{id}/quality-pipeline ?organization_id=X

When: Running later QA after the whole draft is acceptable

Returns: Section-aware status for fact check, AI sanitization, voice review, internal links, and TOC

Legacy Management Endpoints

These lower-level routes still work for admin and setup automations, but they are hidden from default generated schema/tool discovery so normal MCP clients see the smaller workflow surface.

Onboarding

GET /manage/onboarding/get-started
GET /manage/onboarding/checklist

Organization

GET /manage/org/startup-context
GET /manage/org
PUT /manage/org
POST /manage/org/analyze-website
POST /manage/org/rescan-sitemaps
POST /manage/org/sync-blog

Offers

GET /manage/offers
POST /manage/offers
PUT /manage/offers/{id}
DELETE /manage/offers/{id}

CTAs

GET /manage/ctas
POST /manage/ctas
PUT /manage/ctas/{id}
DELETE /manage/ctas/{id}

Memories

GET /manage/memories
POST /manage/memories
PUT /manage/memories/{id}
DELETE /manage/memories/{id}

Brand & Style Guides

GET /manage/brand-guide
PUT /manage/brand-guide
GET /manage/style-guide
PUT /manage/style-guide

Sitemaps

GET /manage/sitemaps
POST /manage/sitemaps

Brain Materials

GET /manage/materials
POST /manage/materials/from-url
POST /manage/materials/from-text
POST /manage/materials/from-file
DELETE /manage/materials/{id}

Pages

POST /manage/pages/add-to-brain

Task Polling

GET /manage/tasks/{id}
GET /manage/tasks

Knowledge Search

POST /manage/knowledge/search

Voice Tuning

GET /manage/voice/available
GET /manage/voice
POST /manage/voice/generate
PUT /manage/voice

Content Plans

GET /manage/content-plans
GET /manage/content-plans/inventory
GET /manage/content-plans/{id}
POST /manage/content-plans/bulk
PUT /manage/content-plans/{id}/items/bulk
POST /manage/content-plans/{id}/items/{item_id}/move
POST /manage/content-plans/{id}/items/{item_id}/content/attach
POST /manage/content-plans/{id}/items/{item_id}/content/move
POST /manage/content-plans/{id}/items/{item_id}/content/replace
DELETE /manage/content-plans/{id}/items/{item_id}/content
POST /manage/content-plans/{id}/approve

Publishing

GET /manage/publishing/profiles
POST /manage/publishing/content/{id}

Example: agent managing org config

# Legacy /manage endpoints remain available for admin/setup automations,
# but they are hidden from default generated tool discovery.
import httpx

headers = {"X-API-Key": "wf_ak_your_key_here"}
base = "https://wordflowsai.com/api/agent"
org_id = 42

# Bootstrap the project and pick a voice first
startup = httpx.get(f"{base}/manage/org/startup-context", headers=headers,
    params={"organization_id": org_id}).json()
voice_id = startup["default_voice_id"]

# Add a new offer
httpx.post(f"{base}/manage/offers", headers=headers,
    params={"organization_id": org_id},
    json={"name": "Pro Plan", "description": "Full access", "offer_type": "product", "price_info": "$49/mo"})

# Update content strategy
httpx.put(f"{base}/manage/org", headers=headers,
    params={"organization_id": org_id},
    json={"content_strategy": "Focus on developer education and cloud-native tutorials"})

# Add knowledge from a URL
httpx.post(f"{base}/manage/materials/from-url", headers=headers,
    params={"organization_id": org_id},
    json={"url": "https://acme.com/about", "title": "About Us", "category": "company_info"})

# Save a preference
httpx.post(f"{base}/manage/memories", headers=headers,
    params={"organization_id": org_id},
    json={"content": "Always mention our free tier in blog posts", "category": "instruction"})

# Inspect the selected voice
voice = httpx.get(f"{base}/manage/voice", headers=headers,
    params={"organization_id": org_id, "voice_id": voice_id}).json()

# Save a topical map drafted in ChatGPT/Codex
httpx.post(f"{base}/manage/content-plans/bulk", headers=headers,
    params={"organization_id": org_id},
    json={
        "plan": {"title": "AI Content Strategy Topical Map", "type": "topical_map"},
        "source": {"type": "chatgpt", "format": "markdown"},
        "items": [{
            "client_id": "pillar-1",
            "title": "AI Content Operations",
            "children": [{"client_id": "cluster-1-1", "title": "How to Build an AI Content Workflow"}]
        }]
    })

print(voice["status"])

Context response format

Context endpoints return scoped JSON. The markdown field contains structured markdown with ## headers — ready for direct prompt injection.

{
  "purpose": "write",
  "organization_id": 42,
  "markdown": "## Writing Voice (DNA)\n[Detailed voice instructions tailored to this organization...]\n\n## Style Rules\nGrammar: american_english\nOxford Comma: Yes\n\n## Brand Constraints\nProhibited Words: synergy, leverage, delve"
}

Quick start

1

Sign up at wordflowsai.com and complete onboarding

2

Create a Voice DNA profile (from samples or via Voice Genesis)

3

Generate an API key from the dashboard

4

Call the API:

# First, list your projects
curl -H "X-API-Key: wf_ak_your_key_here" \
  https://wordflowsai.com/api/agent/projects

# Then fetch scoped writing context for a project
curl -H "X-API-Key: wf_ak_your_key_here" \
  "https://wordflowsai.com/api/agent/project-context?organization_id=42&purpose=write&topic=ielts%20speaking"

Integration patterns

Multi-step agent pipeline

Each stage of content creation calls the endpoint it needs. Minimizes token usage per step.

import httpx

headers = {"X-API-Key": "wf_ak_your_key_here"}
base = "https://wordflowsai.com/api/agent"

# Step 0: Get available projects
projects = httpx.get(f"{base}/projects", headers=headers).json()
org_id = projects[0]["id"]

# Step 1: Inspect plans and choose the next item
plans = httpx.get(f"{base}/content-plans", headers=headers, params={"organization_id": org_id}).json()
plan = httpx.get(f"{base}/content-plans/{plans[0]['id']}", headers=headers, params={"organization_id": org_id}).json()
item = next(i for i in plan["items"] if not i.get("content_id"))

# Step 2: Get scoped writing context
ctx = httpx.get(
    f"{base}/project-context",
    headers=headers,
    params={"organization_id": org_id, "purpose": "write", "topic": item["topic"] or item["title"]}
).json()["markdown"]

# Step 3: After the agent writes a whole draft, save it
content = httpx.post(f"{base}/content", headers=headers,
    params={"organization_id": org_id},
    json={"title": item["title"], "markdown": draft_markdown, "content_plan_item_id": item["id"]}).json()

# Step 4: Check the whole draft voice, revise with the LLM, and save again if needed
voice_report = httpx.post(f"{base}/content/{content['content_id']}/draft-voice-check",
    headers=headers, params={"organization_id": org_id}).json()

# Step 5: Run section-aware QA once the whole draft is acceptable
httpx.post(f"{base}/content/{content['content_id']}/quality-pipeline",
    headers=headers, params={"organization_id": org_id}, json={})

Image workflow

Image-capable agents can generate or edit images themselves, then import the resulting file refs into Wordflows. Other agents can queue Wordflows image generation.

import httpx

headers = {"X-API-Key": "wf_ak_your_key_here"}
base = "https://wordflowsai.com/api/agent"

# Get project and visual brand kit before image work
projects = httpx.get(f"{base}/projects", headers=headers).json()
org_id = projects[0]["id"]
kit = httpx.get(f"{base}/image-brand-kit", headers=headers, params={"organization_id": org_id}).json()

# If the agent generated an image, import its ChatGPT file refs
httpx.post(f"{base}/content/{content_id}/attach-chatgpt-image",
    headers=headers,
    params={"organization_id": org_id},
    json={
        "openaiFileIdRefs": [{"download_link": image_download_link, "mime_type": "image/png"}],
        "image_type": "featured",
        "alt_text": "Featured image"
    })

What is Voice DNA?

Voice DNA is a forensic writing profile that captures exactly how a specific author or brand writes. It goes far beyond "be professional" or "use a friendly tone."

What makes it different

- Content that sounds like the author actually wrote it
- Catches and eliminates generic AI-sounding phrases
- Preserves the writer's natural rhythm and pacing
- Maintains consistent voice across any topic or format
- Works with any LLM — not model-specific
- Built from real writing analysis, not adjective checklists

How it's created

From existing writing: Upload blog posts or website content. Wordflows runs a two-pass forensic analysis to extract patterns and synthesize instructions.

From scratch (Voice Genesis): Describe the voice you want. Wordflows generates a fictional character, writes as that character, then analyzes the output forensically.

What is the Content Brain?

The Content Brain is the unified organizational knowledge layer served by this API. It includes:

Brand Guide

Tone, personality, messaging, positioning, dos/don'ts

Style Guide

Grammar, headings, content length, SEO rules

Voice DNA

Forensic writing profile and synthesized instructions

Content Strategy

Goals, pillars, guidelines

Offers & CTAs

Products, services, and calls-to-action with placement rules

Blog Inventory

Existing posts for dedup and internal linking

Knowledge Base

Embedded content chunks from website and uploads

Org Memories

Learned preferences from past interactions

Use cases

- Blog content creation — full pipeline from topic discovery to voice-compliant drafts
- Landing page copy — brand-aligned messaging with offers and CTAs
- Email marketing — voice-consistent copy with audience-appropriate tone
- Multi-agent content pipelines — specialized agents for each creation phase
- Content auditing — review existing content against voice DNA baselines
- Autonomous org management — agents that discover products, update strategy, and grow the knowledge base
- CMS integrations — feed context into WordPress, Ghost, or custom publishing flows

Machine-readable documentation

For AI agents and automated tools, these files provide optimized documentation: