Rewrite one section of existing content, optionally under an instruction (1 credit)
POST
/
api
/
content
/
regenerate-section
Rewrite one section of existing content, optionally under an instruction (1 credit)
curl --request POST \
--url https://api.writerzroom.com/api/content/regenerate-section \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"section_content": "<string>",
"content_id": "<string>",
"section_heading": "<string>",
"preceding_context": "<string>",
"following_context": "<string>",
"full_document_title": "<string>",
"template_id": "<string>",
"style_profile_id": "<string>",
"instruction": "<string>",
"max_tokens": 8000,
"temperature": 0.5
}
'import requests
url = "https://api.writerzroom.com/api/content/regenerate-section"
payload = {
"section_content": "<string>",
"content_id": "<string>",
"section_heading": "<string>",
"preceding_context": "<string>",
"following_context": "<string>",
"full_document_title": "<string>",
"template_id": "<string>",
"style_profile_id": "<string>",
"instruction": "<string>",
"max_tokens": 8000,
"temperature": 0.5
}
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({
section_content: '<string>',
content_id: '<string>',
section_heading: '<string>',
preceding_context: '<string>',
following_context: '<string>',
full_document_title: '<string>',
template_id: '<string>',
style_profile_id: '<string>',
instruction: '<string>',
max_tokens: 8000,
temperature: 0.5
})
};
fetch('https://api.writerzroom.com/api/content/regenerate-section', 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/content/regenerate-section",
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([
'section_content' => '<string>',
'content_id' => '<string>',
'section_heading' => '<string>',
'preceding_context' => '<string>',
'following_context' => '<string>',
'full_document_title' => '<string>',
'template_id' => '<string>',
'style_profile_id' => '<string>',
'instruction' => '<string>',
'max_tokens' => 8000,
'temperature' => 0.5
]),
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/content/regenerate-section"
payload := strings.NewReader("{\n \"section_content\": \"<string>\",\n \"content_id\": \"<string>\",\n \"section_heading\": \"<string>\",\n \"preceding_context\": \"<string>\",\n \"following_context\": \"<string>\",\n \"full_document_title\": \"<string>\",\n \"template_id\": \"<string>\",\n \"style_profile_id\": \"<string>\",\n \"instruction\": \"<string>\",\n \"max_tokens\": 8000,\n \"temperature\": 0.5\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/content/regenerate-section")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"section_content\": \"<string>\",\n \"content_id\": \"<string>\",\n \"section_heading\": \"<string>\",\n \"preceding_context\": \"<string>\",\n \"following_context\": \"<string>\",\n \"full_document_title\": \"<string>\",\n \"template_id\": \"<string>\",\n \"style_profile_id\": \"<string>\",\n \"instruction\": \"<string>\",\n \"max_tokens\": 8000,\n \"temperature\": 0.5\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.writerzroom.com/api/content/regenerate-section")
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 \"section_content\": \"<string>\",\n \"content_id\": \"<string>\",\n \"section_heading\": \"<string>\",\n \"preceding_context\": \"<string>\",\n \"following_context\": \"<string>\",\n \"full_document_title\": \"<string>\",\n \"template_id\": \"<string>\",\n \"style_profile_id\": \"<string>\",\n \"instruction\": \"<string>\",\n \"max_tokens\": 8000,\n \"temperature\": 0.5\n}"
response = http.request(request)
puts response.read_body{
"regenerated_content": "<string>",
"word_count": 123,
"credits_charged": 1
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
A WriterzRoom API key.
Body
application/json
The section text to rewrite.
The saved document this section belongs to, if any.
The section's heading.
Text before the section, so the rewrite connects to it.
Text after the section, so the rewrite connects to it.
The document's title.
Template the document was written with.
Style profile to keep the rewrite in.
What to change, such as "make this more concise".
Output ceiling; raised automatically when the section needs more.
Sampling temperature, where the model supports one.
⌘I
Rewrite one section of existing content, optionally under an instruction (1 credit)
curl --request POST \
--url https://api.writerzroom.com/api/content/regenerate-section \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"section_content": "<string>",
"content_id": "<string>",
"section_heading": "<string>",
"preceding_context": "<string>",
"following_context": "<string>",
"full_document_title": "<string>",
"template_id": "<string>",
"style_profile_id": "<string>",
"instruction": "<string>",
"max_tokens": 8000,
"temperature": 0.5
}
'import requests
url = "https://api.writerzroom.com/api/content/regenerate-section"
payload = {
"section_content": "<string>",
"content_id": "<string>",
"section_heading": "<string>",
"preceding_context": "<string>",
"following_context": "<string>",
"full_document_title": "<string>",
"template_id": "<string>",
"style_profile_id": "<string>",
"instruction": "<string>",
"max_tokens": 8000,
"temperature": 0.5
}
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({
section_content: '<string>',
content_id: '<string>',
section_heading: '<string>',
preceding_context: '<string>',
following_context: '<string>',
full_document_title: '<string>',
template_id: '<string>',
style_profile_id: '<string>',
instruction: '<string>',
max_tokens: 8000,
temperature: 0.5
})
};
fetch('https://api.writerzroom.com/api/content/regenerate-section', 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/content/regenerate-section",
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([
'section_content' => '<string>',
'content_id' => '<string>',
'section_heading' => '<string>',
'preceding_context' => '<string>',
'following_context' => '<string>',
'full_document_title' => '<string>',
'template_id' => '<string>',
'style_profile_id' => '<string>',
'instruction' => '<string>',
'max_tokens' => 8000,
'temperature' => 0.5
]),
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/content/regenerate-section"
payload := strings.NewReader("{\n \"section_content\": \"<string>\",\n \"content_id\": \"<string>\",\n \"section_heading\": \"<string>\",\n \"preceding_context\": \"<string>\",\n \"following_context\": \"<string>\",\n \"full_document_title\": \"<string>\",\n \"template_id\": \"<string>\",\n \"style_profile_id\": \"<string>\",\n \"instruction\": \"<string>\",\n \"max_tokens\": 8000,\n \"temperature\": 0.5\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/content/regenerate-section")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"section_content\": \"<string>\",\n \"content_id\": \"<string>\",\n \"section_heading\": \"<string>\",\n \"preceding_context\": \"<string>\",\n \"following_context\": \"<string>\",\n \"full_document_title\": \"<string>\",\n \"template_id\": \"<string>\",\n \"style_profile_id\": \"<string>\",\n \"instruction\": \"<string>\",\n \"max_tokens\": 8000,\n \"temperature\": 0.5\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.writerzroom.com/api/content/regenerate-section")
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 \"section_content\": \"<string>\",\n \"content_id\": \"<string>\",\n \"section_heading\": \"<string>\",\n \"preceding_context\": \"<string>\",\n \"following_context\": \"<string>\",\n \"full_document_title\": \"<string>\",\n \"template_id\": \"<string>\",\n \"style_profile_id\": \"<string>\",\n \"instruction\": \"<string>\",\n \"max_tokens\": 8000,\n \"temperature\": 0.5\n}"
response = http.request(request)
puts response.read_body{
"regenerated_content": "<string>",
"word_count": 123,
"credits_charged": 1
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}