Skip to main content
POST /generate starts a new content generation job relative to the https://api.writerzroom.com/api base URL. It accepts the selected template, selected style profile, generation mode, optional vertical, and structured user input required for that request. The response returns a request_id rather than a completed draft because generation runs asynchronously.

Generation Overview

Template
Defines the content structure.
Style
Controls tone, voice, and audience fit.
Input
Supplies topic, audience, and requirements.
Request ID
Tracks the job until completion.

Request

Uploaded sources

For a template parameter with type: file_upload, upload the file first using authenticated POST /parse-file with multipart/form-data and a file field. Use the same authenticated account for upload and generation. The response contains a stored source_id, a short preview_text, extraction coverage, and context size information. Full extracted text and location offsets stay in the server-owned record. Pass the ID under that template parameter’s name. For example, a template with reference_files accepts this inside user_input or dynamic_parameters:
Use at most five files per parameter and ten per request. The backend resolves the template itself and checks source ownership, accepted formats, template size limits and stored coverage. Browser-supplied text or a claimed complete coverage status cannot satisfy a required source. A missing, partial, empty, unavailable, foreign or over-budget source produces a corrective 422 response before credits are charged. Storage failures return 503 without starting generation. All selected sources must fit one combined 60,000-character context budget, including labels. Oversized work needs a smaller relevant selection or separate requests; it is not silently truncated. OCR is not performed. Scanned pages and detected image content require a searchable text-only copy or a reviewed export. Old payloads containing only *_extracted_text must be uploaded again. Accepted requests return source_coverage; the generation metadata and content passport retain that coverage and the extracted source locations. This records ingestion, not factual verification or release approval.

Response

Core Request Fields

Core Request Pattern

1

Choose a template identifier

Select the content structure that matches the output you want to create.
2

Choose a style profile identifier

Select the writing behavior that controls tone, voice, depth, and audience fit.
3

Provide required input fields

Add the required fields inside the user_input object.
4

Submit the request

Call POST /generate and store the returned request_id.
5

Poll until complete

Poll /generate/status/{request_id} until the request returns completed or failed.

Best Practice

Validate template and style identifiers before submitting large batches of requests. That reduces avoidable failures and makes automation more reliable.
Use /templates and /style-profiles to fetch valid identifiers programmatically rather than hardcoding them.

Check Generation Status

Poll the request until content completes or fails.

Endpoints Reference

Review available API endpoints.

Saved source versions

GET /sources lists accessible versions with a next_cursor for pagination. GET /sources/{source_id} returns the authorized extraction and location offsets; GET /sources/{source_id}/original downloads its original bytes privately. These routes require authentication and recheck source access for each request. Upload a new version through POST /parse-file?supersedes_source_id={source_id} with the original file as multipart form data. Only the owner can add a version, and the supplied ID must be the latest version. Existing references stay pinned. Owners manage explicit teammate access using POST /sources/{source_id}/grants with user_id, org_id and can_use (false means read-only). Both users must be active workspace members. Grants cover all versions. DELETE /sources/{source_id}/grants/{recipient_id} revokes a grant; POST /sources/{source_id}/revoke permanently revokes the source lineage for future use. Generation resolves stored IDs and permissions before charging and rechecks them at later execution boundaries. Release also rechecks source fingerprints and access. Client-supplied extracted text cannot establish permission or coverage.
Last modified on September 7, 2026