Docs / Agent Context API

Agent Context API

Give AI agents full organizational context for content creation. Six endpoints that serve exactly the context needed at each step — as structured markdown ready for prompt injection.

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 all organizational context and serves it through a step-aware API. Each endpoint returns structured markdown that agents inject directly into their prompts.

Endpoints

GET /api/agent/orgs

When: First call — discover available organizations

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

GET /api/agent/context/discovery ?organization_id=X

When: Deciding what to write about

Returns: Content strategy, pillars, audience personas, existing blog posts, learned preferences

GET /api/agent/context/brief ?organization_id=X

When: Defining a specific content piece

Returns: Full brand guide, style guide, offers, CTAs, internal linking targets

GET /api/agent/context/outline ?organization_id=X

When: Structuring the content

Returns: Heading rules, intro/conclusion guidelines, paragraph structure, tone direction

GET /api/agent/context/section ?organization_id=X&topic=Y

When: Writing actual content

Returns: Voice writing instructions, style rules, brand constraints, relevant knowledge base content

GET /api/agent/context/review ?organization_id=X

When: Checking voice compliance

Returns: Voice compliance rules, quantitative writing baselines, AI-tell detection rules, brand constraints

GET /api/agent/context/full ?organization_id=X

When: Need everything in one call

Returns: Complete unified context dump — all of the above, deduplicated

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

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 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

- 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
- 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: