Submit a generation request
curl --request POST \
--url https://api.writerzroom.com/api/generate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"template_id": "<string>",
"template": "<string>",
"style_profile_id": "<string>",
"style_profile": "<string>",
"user_input": {},
"generation_settings": {},
"generation_mode": "<string>",
"request_id": "<string>",
"user_id": "<string>",
"dynamic_parameters": {},
"vertical_id": "<string>",
"brand_voice_id": "<string>",
"audience_id": "<string>",
"target_platform": "<string>"
}
'import requests
url = "https://api.writerzroom.com/api/generate"
payload = {
"template_id": "<string>",
"template": "<string>",
"style_profile_id": "<string>",
"style_profile": "<string>",
"user_input": {},
"generation_settings": {},
"generation_mode": "<string>",
"request_id": "<string>",
"user_id": "<string>",
"dynamic_parameters": {},
"vertical_id": "<string>",
"brand_voice_id": "<string>",
"audience_id": "<string>",
"target_platform": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
template_id: '<string>',
template: '<string>',
style_profile_id: '<string>',
style_profile: '<string>',
user_input: {},
generation_settings: {},
generation_mode: '<string>',
request_id: '<string>',
user_id: '<string>',
dynamic_parameters: {},
vertical_id: '<string>',
brand_voice_id: '<string>',
audience_id: '<string>',
target_platform: '<string>'
})
};
fetch('https://api.writerzroom.com/api/generate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.writerzroom.com/api/generate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'template_id' => '<string>',
'template' => '<string>',
'style_profile_id' => '<string>',
'style_profile' => '<string>',
'user_input' => [
],
'generation_settings' => [
],
'generation_mode' => '<string>',
'request_id' => '<string>',
'user_id' => '<string>',
'dynamic_parameters' => [
],
'vertical_id' => '<string>',
'brand_voice_id' => '<string>',
'audience_id' => '<string>',
'target_platform' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.writerzroom.com/api/generate"
payload := strings.NewReader("{\n \"template_id\": \"<string>\",\n \"template\": \"<string>\",\n \"style_profile_id\": \"<string>\",\n \"style_profile\": \"<string>\",\n \"user_input\": {},\n \"generation_settings\": {},\n \"generation_mode\": \"<string>\",\n \"request_id\": \"<string>\",\n \"user_id\": \"<string>\",\n \"dynamic_parameters\": {},\n \"vertical_id\": \"<string>\",\n \"brand_voice_id\": \"<string>\",\n \"audience_id\": \"<string>\",\n \"target_platform\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.writerzroom.com/api/generate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"template_id\": \"<string>\",\n \"template\": \"<string>\",\n \"style_profile_id\": \"<string>\",\n \"style_profile\": \"<string>\",\n \"user_input\": {},\n \"generation_settings\": {},\n \"generation_mode\": \"<string>\",\n \"request_id\": \"<string>\",\n \"user_id\": \"<string>\",\n \"dynamic_parameters\": {},\n \"vertical_id\": \"<string>\",\n \"brand_voice_id\": \"<string>\",\n \"audience_id\": \"<string>\",\n \"target_platform\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.writerzroom.com/api/generate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"template_id\": \"<string>\",\n \"template\": \"<string>\",\n \"style_profile_id\": \"<string>\",\n \"style_profile\": \"<string>\",\n \"user_input\": {},\n \"generation_settings\": {},\n \"generation_mode\": \"<string>\",\n \"request_id\": \"<string>\",\n \"user_id\": \"<string>\",\n \"dynamic_parameters\": {},\n \"vertical_id\": \"<string>\",\n \"brand_voice_id\": \"<string>\",\n \"audience_id\": \"<string>\",\n \"target_platform\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
A WriterzRoom API key.
Body
Template id, such as blog_article_generator. Required unless template is sent.
1Older name for template_id.
1Style profile id, such as general_blog.
1Older name for style_profile_id.
1The template's inputs (topic and the template's own parameters), plus optional length_preset, word_range, practice_area and reference_files.
Run settings. generation_mode here is read when the top-level field is absent.
Tier: quick, standard or premium. Premium requires a Professional or Enterprise plan.
Your id for this run, 8-128 letters, digits, _ or -. Resending the same id returns the existing run instead of starting another.
Ignored. The caller is identified by the API key.
Merged with user_input; user_input wins on a conflict.
Vertical whose rules, disclaimers and verifiers apply, such as legal or medical_ai.
One of your Brand Voice profiles.
One of your saved audiences.
Publishing destination the draft is shaped for, such as linkedin or wordpress.
Response
Successful Response
curl --request POST \
--url https://api.writerzroom.com/api/generate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"template_id": "<string>",
"template": "<string>",
"style_profile_id": "<string>",
"style_profile": "<string>",
"user_input": {},
"generation_settings": {},
"generation_mode": "<string>",
"request_id": "<string>",
"user_id": "<string>",
"dynamic_parameters": {},
"vertical_id": "<string>",
"brand_voice_id": "<string>",
"audience_id": "<string>",
"target_platform": "<string>"
}
'import requests
url = "https://api.writerzroom.com/api/generate"
payload = {
"template_id": "<string>",
"template": "<string>",
"style_profile_id": "<string>",
"style_profile": "<string>",
"user_input": {},
"generation_settings": {},
"generation_mode": "<string>",
"request_id": "<string>",
"user_id": "<string>",
"dynamic_parameters": {},
"vertical_id": "<string>",
"brand_voice_id": "<string>",
"audience_id": "<string>",
"target_platform": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
template_id: '<string>',
template: '<string>',
style_profile_id: '<string>',
style_profile: '<string>',
user_input: {},
generation_settings: {},
generation_mode: '<string>',
request_id: '<string>',
user_id: '<string>',
dynamic_parameters: {},
vertical_id: '<string>',
brand_voice_id: '<string>',
audience_id: '<string>',
target_platform: '<string>'
})
};
fetch('https://api.writerzroom.com/api/generate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.writerzroom.com/api/generate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'template_id' => '<string>',
'template' => '<string>',
'style_profile_id' => '<string>',
'style_profile' => '<string>',
'user_input' => [
],
'generation_settings' => [
],
'generation_mode' => '<string>',
'request_id' => '<string>',
'user_id' => '<string>',
'dynamic_parameters' => [
],
'vertical_id' => '<string>',
'brand_voice_id' => '<string>',
'audience_id' => '<string>',
'target_platform' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.writerzroom.com/api/generate"
payload := strings.NewReader("{\n \"template_id\": \"<string>\",\n \"template\": \"<string>\",\n \"style_profile_id\": \"<string>\",\n \"style_profile\": \"<string>\",\n \"user_input\": {},\n \"generation_settings\": {},\n \"generation_mode\": \"<string>\",\n \"request_id\": \"<string>\",\n \"user_id\": \"<string>\",\n \"dynamic_parameters\": {},\n \"vertical_id\": \"<string>\",\n \"brand_voice_id\": \"<string>\",\n \"audience_id\": \"<string>\",\n \"target_platform\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.writerzroom.com/api/generate")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"template_id\": \"<string>\",\n \"template\": \"<string>\",\n \"style_profile_id\": \"<string>\",\n \"style_profile\": \"<string>\",\n \"user_input\": {},\n \"generation_settings\": {},\n \"generation_mode\": \"<string>\",\n \"request_id\": \"<string>\",\n \"user_id\": \"<string>\",\n \"dynamic_parameters\": {},\n \"vertical_id\": \"<string>\",\n \"brand_voice_id\": \"<string>\",\n \"audience_id\": \"<string>\",\n \"target_platform\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.writerzroom.com/api/generate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"template_id\": \"<string>\",\n \"template\": \"<string>\",\n \"style_profile_id\": \"<string>\",\n \"style_profile\": \"<string>\",\n \"user_input\": {},\n \"generation_settings\": {},\n \"generation_mode\": \"<string>\",\n \"request_id\": \"<string>\",\n \"user_id\": \"<string>\",\n \"dynamic_parameters\": {},\n \"vertical_id\": \"<string>\",\n \"brand_voice_id\": \"<string>\",\n \"audience_id\": \"<string>\",\n \"target_platform\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}