Create a style guide
curl --request POST \
--url https://api.dittowords.com/v2/styleguides \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Acme Inc.",
"description": "Voice and tone for Acme Inc. product text.",
"sections": [
{
"sectionId": "foundations",
"name": "Foundations",
"kind": "rules"
},
{
"sectionId": "word-list",
"name": "Word List",
"kind": "wordlist"
}
]
}
'import requests
url = "https://api.dittowords.com/v2/styleguides"
payload = {
"name": "Acme Inc.",
"description": "Voice and tone for Acme Inc. product text.",
"sections": [
{
"sectionId": "foundations",
"name": "Foundations",
"kind": "rules"
},
{
"sectionId": "word-list",
"name": "Word List",
"kind": "wordlist"
}
]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Acme Inc.',
description: 'Voice and tone for Acme Inc. product text.',
sections: [
{sectionId: 'foundations', name: 'Foundations', kind: 'rules'},
{sectionId: 'word-list', name: 'Word List', kind: 'wordlist'}
]
})
};
fetch('https://api.dittowords.com/v2/styleguides', 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.dittowords.com/v2/styleguides",
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([
'name' => 'Acme Inc.',
'description' => 'Voice and tone for Acme Inc. product text.',
'sections' => [
[
'sectionId' => 'foundations',
'name' => 'Foundations',
'kind' => 'rules'
],
[
'sectionId' => 'word-list',
'name' => 'Word List',
'kind' => 'wordlist'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.dittowords.com/v2/styleguides"
payload := strings.NewReader("{\n \"name\": \"Acme Inc.\",\n \"description\": \"Voice and tone for Acme Inc. product text.\",\n \"sections\": [\n {\n \"sectionId\": \"foundations\",\n \"name\": \"Foundations\",\n \"kind\": \"rules\"\n },\n {\n \"sectionId\": \"word-list\",\n \"name\": \"Word List\",\n \"kind\": \"wordlist\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.dittowords.com/v2/styleguides")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Acme Inc.\",\n \"description\": \"Voice and tone for Acme Inc. product text.\",\n \"sections\": [\n {\n \"sectionId\": \"foundations\",\n \"name\": \"Foundations\",\n \"kind\": \"rules\"\n },\n {\n \"sectionId\": \"word-list\",\n \"name\": \"Word List\",\n \"kind\": \"wordlist\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dittowords.com/v2/styleguides")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Acme Inc.\",\n \"description\": \"Voice and tone for Acme Inc. product text.\",\n \"sections\": [\n {\n \"sectionId\": \"foundations\",\n \"name\": \"Foundations\",\n \"kind\": \"rules\"\n },\n {\n \"sectionId\": \"word-list\",\n \"name\": \"Word List\",\n \"kind\": \"wordlist\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "acme-inc",
"name": "Acme Inc."
}{
"message": "At least one wordlist section is required"
}Style guides
Create a style guide
Creates a new style guide in your workspace. Sections organize the guide’s rules and word list entries — each must have a unique sectionId and a kind of ‘rules’ or ‘wordlist’. If sections is omitted, a default set of sections is used. Use POST /styleguides/rules afterward to add rules to a section.
POST
/
styleguides
Create a style guide
curl --request POST \
--url https://api.dittowords.com/v2/styleguides \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Acme Inc.",
"description": "Voice and tone for Acme Inc. product text.",
"sections": [
{
"sectionId": "foundations",
"name": "Foundations",
"kind": "rules"
},
{
"sectionId": "word-list",
"name": "Word List",
"kind": "wordlist"
}
]
}
'import requests
url = "https://api.dittowords.com/v2/styleguides"
payload = {
"name": "Acme Inc.",
"description": "Voice and tone for Acme Inc. product text.",
"sections": [
{
"sectionId": "foundations",
"name": "Foundations",
"kind": "rules"
},
{
"sectionId": "word-list",
"name": "Word List",
"kind": "wordlist"
}
]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Acme Inc.',
description: 'Voice and tone for Acme Inc. product text.',
sections: [
{sectionId: 'foundations', name: 'Foundations', kind: 'rules'},
{sectionId: 'word-list', name: 'Word List', kind: 'wordlist'}
]
})
};
fetch('https://api.dittowords.com/v2/styleguides', 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.dittowords.com/v2/styleguides",
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([
'name' => 'Acme Inc.',
'description' => 'Voice and tone for Acme Inc. product text.',
'sections' => [
[
'sectionId' => 'foundations',
'name' => 'Foundations',
'kind' => 'rules'
],
[
'sectionId' => 'word-list',
'name' => 'Word List',
'kind' => 'wordlist'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.dittowords.com/v2/styleguides"
payload := strings.NewReader("{\n \"name\": \"Acme Inc.\",\n \"description\": \"Voice and tone for Acme Inc. product text.\",\n \"sections\": [\n {\n \"sectionId\": \"foundations\",\n \"name\": \"Foundations\",\n \"kind\": \"rules\"\n },\n {\n \"sectionId\": \"word-list\",\n \"name\": \"Word List\",\n \"kind\": \"wordlist\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.dittowords.com/v2/styleguides")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Acme Inc.\",\n \"description\": \"Voice and tone for Acme Inc. product text.\",\n \"sections\": [\n {\n \"sectionId\": \"foundations\",\n \"name\": \"Foundations\",\n \"kind\": \"rules\"\n },\n {\n \"sectionId\": \"word-list\",\n \"name\": \"Word List\",\n \"kind\": \"wordlist\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dittowords.com/v2/styleguides")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Acme Inc.\",\n \"description\": \"Voice and tone for Acme Inc. product text.\",\n \"sections\": [\n {\n \"sectionId\": \"foundations\",\n \"name\": \"Foundations\",\n \"kind\": \"rules\"\n },\n {\n \"sectionId\": \"word-list\",\n \"name\": \"Word List\",\n \"kind\": \"wordlist\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": "acme-inc",
"name": "Acme Inc."
}{
"message": "At least one wordlist section is required"
}Authorizations
Body
application/json
The name of the new style guide.
Minimum string length:
1A description of the style guide's purpose.
Minimum string length:
1Sections to organize rules and word list entries into. Each section's sectionId must be unique within the style guide. Must include at least one 'rules' section and one 'wordlist' section. If omitted, a default set of sections is used.
Show child attributes
Show child attributes
Whether this style guide is enabled by default for all projects. Defaults to true.
⌘I