v2_put_brands_brand_id_drafts_draft_id
Create a draft at a draft ID you supply. The blog example supplies a board item, keyword measurements and a source passage for the section.
See the REST reference for PUT /v2/brands/{brand_id}/drafts/{draft_id}.
Signature
v2_put_brands_brand_id_drafts_draft_id(
brand_id: str,
draft_id: str,
body: Mapping[str, Any],
) -> Response[Any]Parameters
brand_id- Identifier for the brand.
draft_id- Identifier for the draft.
body- Dictionary for the selected operation. See the REST reference for its required fields.
Return value
For a content draft, response.data returns the draft ID, revision and status. Save the revision before submitting it for review.
Errors
- AeoApiError includes the HTTP status, error code and request ID. An invalid key raises UnauthenticatedError. Check the key’s scopes if you receive ForbiddenError.
- Invalid arguments can raise ValueError or TypeError before the SDK sends a request.
- AeoTransportError means the request could not reach the API after any allowed retries, or the response could not be read as JSON.
- For a conflict, read the error message before repeating the write. Check the saved record for a competing edit or a repeated request.
Python example
import os
from aeo_sdk import AeoClient
with AeoClient(os.environ["AEO_API_KEY"], base_url=os.environ["AEO_API_BASE_URL"]) as client:
response = client.v2_put_brands_brand_id_drafts_draft_id(
brand_id='00000000-0000-4000-8000-000000000001',
draft_id='00000000-0000-4000-8000-000000000002',
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',
},
)
print(response.body)Async example
import asyncio
import os
from aeo_sdk import AsyncAeoClient
async def main():
async with AsyncAeoClient(os.environ["AEO_API_KEY"], base_url=os.environ["AEO_API_BASE_URL"]) as client:
response = await client.v2_put_brands_brand_id_drafts_draft_id(
brand_id='00000000-0000-4000-8000-000000000001',
draft_id='00000000-0000-4000-8000-000000000002',
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',
},
)
print(response.body)
asyncio.run(main())Requests by feature
Content drafts and editorial generation
See Python client setup for the environment variables, response properties and retry settings.