Skip to content

    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.

    PATCH /v2/brands/{brand_id}

    • Body section is voice.

    Authentication and access

    Authentication
    Bearer API key
    Scopes
    optimizations:write
    Roles
    editor, owner, service
    Plans
    Optimizer
    Credits
    No credit charge.

    Parameters

    Request parameters
    NameWhereTypeRequiredDescription
    brand_idpathstring (uuid)Yes

    Request body

    {
      "audience": "Office managers",
      "expected_revision": 0,
      "language": "en",
      "section": "voice",
      "tone": "Direct and concrete"
    }
    Request body fields 1
    NameTypeRequiredDescription
    audiencestringYes
    avoided_termsarray of stringNo
    call_to_actionstring | nullNo
    editorial_guidelinesstring | nullNo
    expected_revisionintegerYes
    languagestringYes
    openingstring | nullNo
    preferred_termsarray of stringNo
    section"voice"Yes
    tonestringYes
    writing_samplesarray of stringNo

    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.json
    import 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.

    HTTP 200 response fields 1
    NameTypeRequiredDescription
    dataobjectYesThe requested result. See the fields below for its contents.
    data.revisionintegerYes
    data.voiceobject | nullYes
    data.voice.audiencestringConditional
    data.voice.avoided_termsarray of stringNo
    data.voice.call_to_actionstring | nullNo
    data.voice.editorial_guidelinesstring | nullNo
    data.voice.languagestringConditional
    data.voice.openingstring | nullNo
    data.voice.preferred_termsarray of stringNo
    data.voice.tonestringConditional
    data.voice.writing_samplesarray of stringNo
    metaobjectYesInformation 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.

    Content drafts and editorial generation reference