Skip to main content

What This Endpoint Does

POST /generate starts a new content generation job. It accepts the selected template, the selected style profile, and the structured inputs required for that request. The response returns a request_id rather than a completed draft because generation runs asynchronously.

Request

POST https://api.writerzroom.com/v1/generate
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
{
  "template_id": "blog_article_generator",
  "style_profile_id": "general_blog",
  "inputs": {
    "topic": "The future of AI in content marketing",
    "audience": "Marketing directors at B2B SaaS companies",
    "objective": "Educate on practical AI adoption strategies",
    "key_points": ["ROI measurement", "Team workflows", "Tool selection"]
  },
  "vertical": "saas_tech",
  "brand_voice_id": "bv_abc123"
}

Response

{
  "request_id": "req_xyz789",
  "status": "pending",
  "created_at": "2026-03-10T20:00:00Z"
}

Core Request Pattern

  1. Choose a template identifier
  2. Choose a style profile identifier
  3. Provide the required user input fields as a structured object
  4. Submit the request and store the returned request_id
  5. Poll /generate/status/{request_id} until complete

Best Practice

Validate template and style identifiers before submitting large batches of requests. That reduces avoidable failures and makes automation more reliable.
Use the /templates and /style-profiles endpoints to fetch valid slugs programmatically rather than hardcoding them.
Last modified on March 11, 2026