Skip to content

    v2_patch_brands_brand_id_drafts_draft_id

    Edit a draft or advance its review. To submit a draft, send the current revision with the submit transition.

    See the REST reference for PATCH /v2/brands/{brand_id}/drafts/{draft_id}.

    Signature

    v2_patch_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 the submit transition, response.data includes the updated status and revision. Check both before the next review decision.

    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_patch_brands_brand_id_drafts_draft_id(
            brand_id='00000000-0000-4000-8000-000000000001',
            draft_id='00000000-0000-4000-8000-000000000002',
            body={'expected_revision': 1, 'transition': 'submit'},
        )
        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_patch_brands_brand_id_drafts_draft_id(
                brand_id='00000000-0000-4000-8000-000000000001',
                draft_id='00000000-0000-4000-8000-000000000002',
                body={'expected_revision': 1, 'transition': 'submit'},
            )
            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.