Agent Context API
Give AI agents full organizational context for content creation — and let them manage it too. Context endpoints serve exactly the right data at each step. Management endpoints let agents update strategy, offers, knowledge base, and more.
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 all organizational context and serves it through a step-aware API. Each endpoint returns structured markdown that agents inject directly into their prompts.
Endpoints
/api/agent/orgs When: First call — discover available organizations
Returns: List of orgs with id, name, website, and industry
/api/agent/context/discovery ?organization_id=XWhen: Deciding what to write about
Returns: Content strategy, pillars, audience personas, existing blog posts, learned preferences
/api/agent/context/brief ?organization_id=XWhen: Defining a specific content piece
Returns: Full brand guide, style guide, offers, CTAs, internal linking targets
/api/agent/context/outline ?organization_id=XWhen: Structuring the content
Returns: Heading rules, intro/conclusion guidelines, paragraph structure, tone direction
/api/agent/context/section ?organization_id=X&topic=YWhen: Writing actual content
Returns: Voice writing instructions, style rules, brand constraints, relevant knowledge base content
/api/agent/context/review ?organization_id=XWhen: Checking voice compliance
Returns: Voice compliance rules, quantitative writing baselines, AI-tell detection rules, brand constraints
/api/agent/context/full ?organization_id=XWhen: Need everything in one call
Returns: Complete unified context dump — all of the above, deduplicated
Management Endpoints
Agents can also read and update all organizational configuration — no dashboard login required.
All management endpoints use the same X-API-Key auth
and require ?organization_id=X.
Onboarding
/manage/onboarding/get-started /manage/onboarding/checklist Organization
/manage/org/startup-context /manage/org /manage/org /manage/org/analyze-website /manage/org/rescan-sitemaps /manage/org/sync-blog Offers
/manage/offers /manage/offers /manage/offers/{id} /manage/offers/{id} CTAs
/manage/ctas /manage/ctas /manage/ctas/{id} /manage/ctas/{id} Memories
/manage/memories /manage/memories /manage/memories/{id} /manage/memories/{id} Brand & Style Guides
/manage/brand-guide /manage/brand-guide /manage/style-guide /manage/style-guide Sitemaps
/manage/sitemaps /manage/sitemaps Brain Materials
/manage/materials /manage/materials/from-url /manage/materials/from-text /manage/materials/from-file /manage/materials/{id} Pages
/manage/pages/add-to-brain Task Polling
/manage/tasks/{id} /manage/tasks Knowledge Search
/manage/knowledge/search Voice Tuning
/manage/voice/available /manage/voice /manage/voice/generate /manage/voice Example: agent managing org config
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()
print(voice["status"])Response format
All endpoints return the same JSON structure. The markdown field contains structured markdown with ## headers — ready for direct prompt injection.
{
"step": "section",
"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
Sign up at wordflowsai.com and complete onboarding
Create a Voice DNA profile (from samples or via Voice Genesis)
Generate an API key from the dashboard
Call the API:
# First, list your organizations
curl -H "X-API-Key: wf_ak_your_key_here" \
https://wordflowsai.com/api/agent/orgs
# Then fetch context for a specific org
curl -H "X-API-Key: wf_ak_your_key_here" \
"https://wordflowsai.com/api/agent/context/discovery?organization_id=42"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 organizations
orgs = httpx.get(f"{base}/orgs", headers=headers).json()
org_id = orgs[0]["id"] # Pick the one you need
# Step 1: Planning — pick a topic
discovery = httpx.get(f"{base}/context/discovery", headers=headers, params={"organization_id": org_id}).json()["markdown"]
# Step 2: Brief — define the piece
brief = httpx.get(f"{base}/context/brief", headers=headers, params={"organization_id": org_id}).json()["markdown"]
# Step 3: Writing — generate with voice
section = httpx.get(
f"{base}/context/section",
headers=headers,
params={"organization_id": org_id, "topic": "kubernetes deployment"}
).json()["markdown"]
# Step 4: Review — check compliance
review = httpx.get(f"{base}/context/review", headers=headers, params={"organization_id": org_id}).json()["markdown"]Single-agent workflow
One agent handles everything. Call /full once and inject into the system prompt.
import httpx
headers = {"X-API-Key": "wf_ak_your_key_here"}
base = "https://wordflowsai.com/api/agent"
# Get orgs, pick one
orgs = httpx.get(f"{base}/orgs", headers=headers).json()
org_id = orgs[0]["id"]
# One call gets everything for that org
ctx = httpx.get(
f"{base}/context/full",
headers=headers,
params={"organization_id": org_id}
).json()["markdown"]
# Inject into your LLM system prompt
messages = [
{"role": "system", "content": f"You are a content writer.\n\n{ctx}"},
{"role": "user", "content": "Write a blog post about Kubernetes best practices"}
]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
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
Machine-readable documentation
For AI agents and automated tools, these files provide optimized documentation: