POST https://api.prosecaptain.com/api/generate/draft?token=YOUR_TOKEN

Creates an article with a draft (outline) from a topic. The draft is in EditorJS block format. The article lands in your workspace, where you can expand it in the app.

Request body

{
  "context": "How to choose an AI chatbot for a service business",
  "title": "AI chatbots for service businesses",
  "keywords": ["AI chatbot", "customer service"],
  "toneOfVoice": "professional",
  "complexity": "moderate",
  "language": "english",
  "includeImages": true
}
FieldRequiredDescription
contextyesTopic or brief for the article.
titlenoTitle, up to 120 characters. Defaults to the first line of context.
articleIdnoAn existing article in your workspace to attach the draft to.
includeImagesnoWhether to generate a thumbnail. Default true.

Plus the common fields.

Response

{
  "success": true,
  "article_id": "6f1c…",
  "draft": {
    "blocks": [
      { "type": "header", "data": { "text": "AI chatbots for service businesses", "level": 1 } },
      { "type": "paragraph", "data": { "text": "Introduction…" } }
    ],
    "version": "2.29.1"
  },
  "processing_time_ms": 41250,
  "workspace": { "id": "…", "name": "…" }
}

Errors

StatuscodeDescription
400validation_failedInvalid fields, details in errors.
404article_not_foundarticleId does not exist in your workspace.
504draft_generation_timeoutGeneration took too long. Try a shorter context.
500generation_failedGeneration failed. Retry the request.