v2PutBrandsBrandIdDraftsDraftId
Create a draft under a brand using a draft ID you supply. The blog example references a content item and source passage.
See the REST reference for PUT /v2/brands/{brand_id}/drafts/{draft_id}.
Signature
v2PutBrandsBrandIdDraftsDraftId(
brand_id: string,
draft_id: string,
body: Record<string, unknown>,
options?: {
signal?: AbortSignal;
},
): Promise<ApiResponse<unknown>>Parameters
brand_id- ID of the brand that owns the record.
draft_id- ID of the draft under this brand.
body- JSON object for this action. The example includes the fields for default.
options- Pass the named options in the signature. The selected action or view determines which fields are required.
options.signal- Optional AbortSignal to cancel the HTTP request.
Return value
Promise<ApiResponse<unknown>>. The editorial draft in body.data includes its draft_id, status and revision. Use the revision when you edit it.
Errors
- The SDK throws AeoApiError if the API returns an error. Inspect status, code, fieldErrors and requestId.
- AeoTransportError means the request failed to connect or the client could not finish reading a successful response. Invalid JSON in a successful response throws SyntaxError. If you abort the request, the SDK throws the reason from the AbortSignal.
- For HTTP 422, check fieldErrors for the input field and validation message.
TypeScript example
import { AeoClient } from "@aeoapi/aeo-sdk";
const apiKey = process.env.AEO_API_KEY;
if (!apiKey) throw new Error("Set AEO_API_KEY on your server.");
const client = new AeoClient(apiKey, { baseUrl: "https://api.aeoapi.dev" });
// Substitute your own record IDs and values.
const body = {
"format": "blog",
"item_id": "00000000-0000-4000-8000-000000000001",
"keywords": [
{
"country": "US",
"estimated_monthly_searches": 120,
"keyword": "setup",
"language": "en",
"measured_on": "2026-11-24",
"source": "example",
"source_reference": "fixture-measurement",
"volume_period_end": "2026-10-31",
"volume_period_start": "2026-10-01"
}
],
"primary_keyword": "setup",
"sections": [
{
"heading": "Getting started",
"passage_id": "00000000-0000-4000-8000-000000000001"
}
],
"title": "Setup instructions"
};
const response = await client.v2PutBrandsBrandIdDraftsDraftId("00000000-0000-4000-8000-000000000001", "00000000-0000-4000-8000-000000000002", body);
console.log(response.status, response.body);Requests by feature
Content drafts and editorial generation
See TypeScript client setup for authentication, timeouts and retry settings.