Content drafts and editorial generation
Set the writing voice
Replace the brand voice at its current revision. Use revision zero for the first setup. Existing drafts keep the voice revision used for their copy.
- Body
sectionisvoice.
Authentication and access
- Authentication
- Bearer API key
- Scopes
- optimizations:write
- Roles
- editor, owner, service
- Plans
- Optimizer
- Credits
- No credit charge.
Parameters
| Name | Where | Type | Required | Description |
|---|---|---|---|---|
brand_id | path | string (uuid) | Yes |
Request body
{
"audience": "Office managers",
"expected_revision": 0,
"language": "en",
"section": "voice",
"tone": "Direct and concrete"
}| Name | Type | Required | Description |
|---|---|---|---|
audience | string | Yes | |
avoided_terms | array of string | No | |
call_to_action | string | null | No | |
editorial_guidelines | string | null | No | |
expected_revision | integer | Yes | |
language | string | Yes | |
opening | string | null | No | |
preferred_terms | array of string | No | |
section | "voice" | Yes | |
tone | string | Yes | |
writing_samples | array of string | No |
Request examples
Set AEO_API_BASE_URL to https://api.aeoapi.dev and AEO_API_KEY to your server-side API key. Set the other environment variables to the values for your request.
Save the JSON request body as request.json. Replace sample IDs, revisions and other values with your own.
curl --fail-with-body -X PATCH "$AEO_API_BASE_URL/v2/brands/$BRAND_ID" \
-H "Authorization: Bearer $AEO_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @request.jsonimport json
from pathlib import Path
from os import environ
from aeo_sdk import AeoClient
body = json.loads(Path("request.json").read_text())
with AeoClient(environ["AEO_API_KEY"], base_url=environ["AEO_API_BASE_URL"]) as client:
response = client.v2_patch_brands_brand_id(
brand_id=environ["BRAND_ID"],
body=body,
)
print(response.body)import { AeoClient } from "@aeoapi/aeo-sdk";
import { readFile } from "node:fs/promises";
const client = new AeoClient(process.env.AEO_API_KEY!, {
baseUrl: process.env.AEO_API_BASE_URL!,
});
const body = JSON.parse(await readFile("request.json", "utf8"));
const response = await client.v2PatchBrandsBrandId(
process.env.BRAND_ID!,
body,
);
console.log(response.body);Responses
HTTP 200
Successful Response
application/json
Response fields are listed below.
| Name | Type | Required | Description |
|---|---|---|---|
data | object | Yes | The requested result. See the fields below for its contents. |
data.revision | integer | Yes | |
data.voice | object | null | Yes | |
data.voice.audience | string | Conditional | |
data.voice.avoided_terms | array of string | No | |
data.voice.call_to_action | string | null | No | |
data.voice.editorial_guidelines | string | null | No | |
data.voice.language | string | Conditional | |
data.voice.opening | string | null | No | |
data.voice.preferred_terms | array of string | No | |
data.voice.tone | string | Conditional | |
data.voice.writing_samples | array of string | No | |
meta | object | Yes | Information about this response, including any warnings or pagination details. |
Errors
Read code and message in the error response. Keep request_id when you contact support.
- HTTP 400
invalid_request - HTTP 401
unauthenticated - HTTP 403
forbidden - HTTP 404
not_found - HTTP 409
conflict - HTTP 422
validation_error - HTTP 429
rate_limited