---
title: "v2PatchAccount | TypeScript SDK | AEO API"
description: "Define a tracking field for citations, prompts or topics, or set field values for records. The example adds a text field for citations."
url: "https://aeoapi.dev/docs/sdks/typescript/v2PatchAccount"
canonical: "https://aeoapi.dev/docs/sdks/typescript/v2PatchAccount"
last_updated: "2026-11-30"
---

# v2PatchAccount

Define a tracking field for citations, prompts or topics, or set field values for records. The example adds a text field for citations.

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

## Signature

```
v2PatchAccount(
  body: Record<string, unknown>,
  options?: {
    signal?: AbortSignal;
  },
): Promise<ApiResponse<unknown>>
```

## Parameters

**`body`**

JSON object for this action. The example includes the fields for citation_fields.

**`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 field_create command returns the field ID and revision. Save the ID to assign values later.

## 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 = {
  "brand_id": "00000000-0000-4000-8000-000000000001",
  "command": {
    "action": "field_create",
    "label": "Segment",
    "type": "text"
  },
  "mutation_id": "00000000-0000-4000-8000-000000000001",
  "section": "citation_fields"
};
const response = await client.v2PatchAccount(body);
console.log(response.status, response.body);
```

## 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 [TypeScript client setup](https://aeoapi.dev/docs/sdks/typescript) for authentication, timeouts and retry settings.
