API Documentation

Enterprise-grade AI content generation powered by multi-agent LangGraph workflows. Production-ready REST API with 13+ templates and 60+ style profiles.

https://writerzroom-backend-api-732324345493.us-central1.run.app

Authentication

WriterzRoom uses Google OAuth 2.0 for authentication. All API endpoints require a valid session token obtained through the web interface at https://writerzroom.com.

Step 1

Sign in with Google OAuth

Navigate to https://writerzroom.com and authenticate using Google OAuth 2.0

Step 2

Obtain Session Cookie

After authentication, your session cookie is automatically set by NextAuth

Cookie: next-auth.session-token=<your-session-token>
Step 3

Make Authenticated Requests

Include your session cookie in all API requests to the backend

curl -X POST "https://writerzroom-backend-api-732324345493.us-central1.run.app/api/v1/generation/generate" \
  -H "Content-Type: application/json" \
  -H "Cookie: next-auth.session-token=<your-session-token>" \
  -d '{
    "template_id": "blog_post",
    "style_profile_id": "technical_dive",
    "parameters": {
      "topic": "LangGraph Multi-Agent Systems",
      "target_length": "2000",
      "target_audience": "AI/ML Engineers"
    }
  }'

Security Note

Session tokens are HTTP-only cookies managed by NextAuth. Never expose your session token in client-side code. All requests must originate from authenticated sessions through the WriterzRoom platform.

API Endpoints

POST/api/v1/generation/generate
GenerationAuth Required

Generate content using templates and style profiles with multi-agent orchestration

GET/api/v1/generation/status/{request_id}
GenerationAuth Required

Poll generation status for long-running content creation tasks

GET/api/v1/templates
TemplatesAuth Required

List all available content templates (13+ types)

GET/api/v1/styles
Style ProfilesAuth Required

List all style profiles (60+ voices and tones)

GET/api/v1/dashboard/stats
AnalyticsAuth Required

Retrieve user analytics and usage statistics

GET/api/v1/analytics/performance
AnalyticsAuth Required

Performance metrics for content generation pipeline

GET/api/v1/analytics/templates
AnalyticsAuth Required

Template usage statistics and performance data

GET/health
SystemPublic

System health check endpoint

Content Generation

Generate Content

Initiate content generation by specifying a template, style profile, and dynamic parameters. The multi-agent system orchestrates planning, research, writing, editing, SEO optimization, and formatting.

Request

{
  "template_id": "blog_post",
  "style_profile_id": "technical_dive",
  "parameters": {
    "topic": "Enterprise AI Content Generation",
    "target_length": "2500",
    "target_audience": "CTOs and Technical Leaders",
    "seo_keywords": ["AI content", "enterprise automation", "LangGraph"]
  }
}

Response

{
  "request_id": "gen_abc123xyz",
  "status": "processing",
  "message": "Generation started. Use request_id to poll status.",
  "estimated_time_seconds": 45
}

Poll Generation Status

Content generation is asynchronous. Use the request_id to poll for completion status and retrieve generated content.

Polling Request

curl -X GET "https://writerzroom-backend-api-732324345493.us-central1.run.app/api/v1/generation/status/gen_abc123xyz" \
  -H "Cookie: next-auth.session-token=<your-session-token>"

Success Response

{
  "request_id": "gen_abc123xyz",
  "status": "completed",
  "content": {
    "title": "Enterprise AI Content Generation: A Technical Deep Dive",
    "body": "...",
    "metadata": {
      "word_count": 2547,
      "seo_score": 87,
      "readability": "college"
    }
  },
  "agents_used": ["planner", "researcher", "writer", "editor", "seo", "formatter"],
  "total_tokens": 15420,
  "generation_time_seconds": 42
}

Error Response

{
  "request_id": "gen_abc123xyz",
  "status": "failed",
  "error": {
    "code": "TEMPLATE_NOT_FOUND",
    "message": "Template 'invalid_template' does not exist",
    "details": "Available templates: blog_post, social_media_campaign, ..."
  }
}

Multi-Agent Architecture

Each generation request flows through specialized agents: Planner (content strategy),Researcher (real-time data via Tavily API), Writer (content creation),Editor (quality refinement), SEO Agent (optimization), and Formatter (final output). State managed via LangGraph for reliable orchestration.

Content Templates

Templates define the structure, format, and behavior of generated content. Each template is YAML-driven with dynamic parameter extraction and multi-agent orchestration rules.

Marketing

  • Social Media Campaign
  • Email Marketing
  • Ad Copy
  • Product Description

Content

  • Blog Post
  • Article
  • Press Release
  • Case Study

Technical

  • Technical Documentation
  • API Reference
  • Tutorial
  • Whitepaper

Creative

  • Story
  • Script
  • Poem
  • Song Lyrics

Retrieve Available Templates

curl -X GET "https://writerzroom-backend-api-732324345493.us-central1.run.app/api/v1/templates" \
  -H "Cookie: next-auth.session-token=<your-session-token>"

Style Profiles

Style profiles define voice, tone, complexity, and formatting preferences. Apply consistent branding and communication styles across all generated content.

Professional

Enterprise and professional communication styles

Technical DiveExecutive SummaryAcademicFormal Business

Marketing

Marketing and promotional content voices

Persuasive SalesThought LeadershipBrand StorytellingSocial Media

Creative

Engaging and audience-focused styles

ConversationalHumorousInspirationalEducational

Specialized

Purpose-built for specific use cases

SEO-OptimizedNews ReportingTutorialInterview

Retrieve Available Style Profiles

curl -X GET "https://writerzroom-backend-api-732324345493.us-central1.run.app/api/v1/styles" \
  -H "Cookie: next-auth.session-token=<your-session-token>"

Rate Limits & Subscription Tiers

Demo

$9.99

7 days

5 total

generations

Starter

$39/mo

Monthly

500/month

generations

Professional

$79/mo

Monthly

1000/month

generations

Enterprise

$149/mo

Monthly

2000/month

generations

Rate Limit Enforcement

Exceeding your tier's monthly limit returns HTTP 429 (Too Many Requests). Monitor usage via the/api/v1/dashboard/stats endpoint. Admin users bypass limits.

Support & Resources

System Status

Monitor real-time system health, uptime, and performance metrics.

View System Status

Feedback & Issues

Report bugs, request features, or provide feedback on the platform.

Contact Support

Enterprise Integration Support

Need custom integrations, dedicated support, or white-label solutions? Enterprise customers receive priority API access, dedicated account management, and custom SLA agreements.

View Enterprise Plans