Content Generation

Operations for generating content and managing generation jobs

Initiate content generation with enhanced processing

post

Creates a new content generation job with advanced parameter handling, direct job processing, and comprehensive validation.

This endpoint supports multiple authentication methods:

  • API Key authentication via x-api-key header

  • Session-based authentication

  • Admin authentication

  • User ID fallback for backwards compatibility

The endpoint performs comprehensive validation including:

  • Project ownership verification

  • Subscription limits checking

  • Active job conflict detection

  • File processing and URL generation for research

Authorizations
Body
projectIdstring · uuidRequired

ID of the project to generate content for

Example: 123e4567-e89b-12d3-a456-426614174000
promptstringRequired

Main generation prompt describing the content to create

Example: Write a comprehensive guide about artificial intelligence
authorstringRequired

Author name for the document

Example: John Doe
emailstring · emailRequired

Author email address

Example: [email protected]
outline_textstringOptional

Additional outline instructions or structure guidance

Example: Include sections on history, current applications, and future trends
has_technical_diagramsstring · enumOptional

Whether to include technical diagrams in the content

Default: autoPossible values:
has_tableofcontentsstring · enumOptional

Whether to include table of contents

Default: autoPossible values:
use_web_researchstring · enumOptional

Whether to use web research for content enhancement

Default: autoPossible values:
page_lengthstringOptional

Desired document length (pages or word count)

Example: 10-15 pages
max_pagesnumber · min: 1 · max: 350Optional

Maximum pages allowed for generation (overrides subscription limits for admins)

Example: 50
Responses
200
Job created successfully
application/json
post
POST /api/generateWork HTTP/1.1
Host: 
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 172

{
  "projectId": "123e4567-e89b-12d3-a456-426614174000",
  "prompt": "Write a comprehensive guide about artificial intelligence",
  "author": "John Doe",
  "email": "[email protected]"
}
{
  "message": "Job started successfully",
  "jobId": "987fcdeb-51a2-43d7-8f9e-123456789abc"
}

Generate content using the wizard workflow

post

Creates and processes a content generation job using the wizard workflow. This endpoint is specifically designed for the wizard interface and includes enhanced parameter handling and direct job processing.

Authorizations
Body
projectIdstring · uuidRequired

ID of the project to generate content for

promptstringRequired

Main generation prompt

authorstringRequired

Author name for the document

emailstring · emailRequired

Author email address

outline_textstringOptional

Additional outline instructions

has_technical_diagramsstring · enumOptionalDefault: autoPossible values:
has_tableofcontentsstring · enumOptionalDefault: autoPossible values:
use_web_researchstring · enumOptionalDefault: autoPossible values:
page_lengthstringOptional

Desired document length

max_pagesnumberOptional

Maximum pages allowed for generation

Responses
200
Job created successfully
application/json
post
POST /api/generateWizardWork HTTP/1.1
Host: 
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 253

{
  "projectId": "123e4567-e89b-12d3-a456-426614174000",
  "prompt": "text",
  "author": "text",
  "email": "[email protected]",
  "outline_text": "text",
  "has_technical_diagrams": "auto",
  "has_tableofcontents": "auto",
  "use_web_research": "auto",
  "page_length": "text",
  "max_pages": 1
}
{
  "message": "Job started successfully",
  "jobId": "123e4567-e89b-12d3-a456-426614174000"
}

Format and enhance prompts

post

Processes and formats user prompts using AI to improve clarity and effectiveness. Supports URL research integration and question-answer processing.

Authorizations
Body
promptstringRequired

The prompt to format and enhance

projectIdstring · uuidOptional

Associated project ID for file access

Responses
200
Prompt formatted successfully
application/json
post
POST /api/formatPrompt HTTP/1.1
Host: 
x-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 68

{
  "prompt": "text",
  "projectId": "123e4567-e89b-12d3-a456-426614174000"
}
{
  "formatted_prompt": "text"
}

Download generated content as PDF

get

Downloads the generated content for a completed job as a PDF file

Authorizations
Path parameters
jobIdstring · uuidRequired

ID of the completed job

Responses
200
PDF file
application/pdf
Responsestring · binary
get
GET /api/downloadPdf/{jobId} HTTP/1.1
Host: 
Authorization: Bearer JWT
Accept: */*
binary

Preview generated content as PDF

get

Previews the generated content for a completed job as a PDF in the browser

Authorizations
Path parameters
jobIdstring · uuidRequired

ID of the completed job

Responses
200
PDF file for preview
application/pdf
Responsestring · binary
get
GET /api/previewPdf/{jobId} HTTP/1.1
Host: 
Authorization: Bearer JWT
Accept: */*
binary