Skip to content

    v2_patch_brands_brand_id

    Change a brand or its settings. For a brand edit, set section to brand and pass the current revision as if_match.

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

    Signature

    v2_patch_brands_brand_id(
        brand_id: str,
        body: Mapping[str, Any],
        *,
        website: str | None = None,
        idempotency_key: str | None = None,
        if_match: str | int | None = None,
        hubspot_access_token: str | None = None,
    ) -> Response[Any]

    Parameters

    brand_id
    Identifier for the brand.
    body
    Dictionary for the selected operation. See the REST reference for its required fields.
    website
    Website for the selected brand or connection.
    idempotency_key
    Value for Idempotency-Key. For requests that require this header, the SDK generates a UUID if you omit it. Send the original value if your application repeats the same write.
    if_match
    Current revision as an integer, decimal string, or quoted numeric ETag. Required for edits that check the revision.
    hubspot_access_token
    Your HubSpot credential for a connection action that requires it. Omit it for other requests.

    Return value

    For an update, response.data contains the changed brand and its revision. Use the new revision on your next edit.

    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.
    • PreconditionFailedError means the revision has changed. Read the current record before editing it again.
    • 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(
            brand_id='00000000-0000-4000-8000-000000000001',
            body={'action': 'update', 'name': 'Example Plumbing', 'section': 'brand'},
            if_match=1,
        )
        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(
                brand_id='00000000-0000-4000-8000-000000000001',
                body={'action': 'update', 'name': 'Example Plumbing', 'section': 'brand'},
                if_match=1,
            )
            print(response.body)
    
    asyncio.run(main())

    Requests by feature

    Brands, locations and connections

    Content drafts and editorial generation

    See Python client setup for the environment variables, response properties and retry settings.