---
title: "v2_patch_account | Python SDK | AEO API"
description: "Create a custom tracking field for a brand, edit its definition, or set its value. Set section to the record type you want to change."
url: "https://aeoapi.dev/docs/sdks/python/v2-patch-account"
canonical: "https://aeoapi.dev/docs/sdks/python/v2-patch-account"
last_updated: "2026-11-30"
---

# v2_patch_account

Create a custom tracking field for a brand, edit its definition, or set its value. Set section to the record type you want to change.

See the REST reference for [`PATCH /v2/account`](https://aeoapi.dev/docs/api-reference#patch-v2-account).

## Signature

```
v2_patch_account(
    body: Mapping[str, Any],
) -> Response[Any]
```

## Parameters

**`body`**

Dictionary for the selected operation. See the REST reference for its required fields.

## Return value

A successful field creation returns the field ID and revision. Keep both if you plan to edit the field.

## 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.

## 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_account(
        body={
            'brand_id': '00000000-0000-4000-8000-000000000001',
            'command': {'action': 'field_create', 'label': 'Segment', 'type': 'text'},
            'mutation_id': '00000000-0000-4000-8000-000000000001',
            'section': 'prompt_fields',
        },
    )
    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_account(
            body={
                'brand_id': '00000000-0000-4000-8000-000000000001',
                'command': {'action': 'field_create', 'label': 'Segment', 'type': 'text'},
                'mutation_id': '00000000-0000-4000-8000-000000000001',
                'section': 'prompt_fields',
            },
        )
        print(response.body)

asyncio.run(main())
```

## Requests by feature

### Account and usage

- [Edit prompt columns](https://aeoapi.dev/docs/features/account-and-usage/patch-account-prompt-fields)
- [Edit topic columns](https://aeoapi.dev/docs/features/account-and-usage/patch-account-topic-fields)
- [Edit citation columns](https://aeoapi.dev/docs/features/account-and-usage/patch-account-citation-fields)

See [Python client setup](https://aeoapi.dev/docs/sdks/python) for the environment variables, response properties and retry settings.
