Skip to content

Get field value history

client.account.fieldHistory(stringfieldKey, AccountFieldHistoryParams { id, after, limit } params, RequestOptionsoptions?): AccountFieldHistoryResponse { data, hasMore, nextCursor }
GET/v1/accounts/{id}/fields/{fieldKey}/history

Returns the value-change history for a single field on a record, newest first. Consecutive identical values are collapsed. History is cursor-paginated: pass nextCursor from the previous response as after to page through older values. Only attribute-backed fields (custom attributes and attribute-backed system fields) have history — column-backed system fields return an error.

Required scope: accounts:read

Rate limit category: Read

ParametersExpand Collapse
fieldKey: string

Field key whose value history to return. System fields use a $ prefix (e.g. $status); custom attributes use their bare slug.

params: AccountFieldHistoryParams { id, after, limit }
id: string

Path param: Unique identifier of the record.

after?: string

Query param: Cursor from a previous response’s nextCursor to fetch the next page.

limit?: number

Query param: Maximum number of history entries to return. Defaults to 20, maximum 100.

minimum1
maximum9007199254740991
ReturnsExpand Collapse
AccountFieldHistoryResponse { data, hasMore, nextCursor }
data: Array<Data>

Recorded values for the field, newest first.

displayValue: string

Human-readable rendering of the value (e.g. a select option label), suitable for display.

isCreate: boolean

True for the record’s original value. Only set when the full history fits in the response (never on a truncated/paginated page).

recordedAt: string

ISO 8601 timestamp of when this value was recorded.

value: string | number | boolean | 3 more | null

The field value, or null if unset.

One of the following:
string
number
boolean
Array<string>
Address { city, country, latitude, 5 more }
city?: string | null

City name.

country?: string | null

2-letter ISO 3166-1 alpha-2 country code.

latitude?: number | null

Latitude coordinate.

longitude?: number | null

Longitude coordinate.

postalCode?: string | null

Postal or ZIP code.

state?: string | null

State or province.

street?: string | null

Street address line 1.

street2?: string | null

Street address line 2.

FullName { firstName, lastName }
firstName?: string | null

The contact’s first name.

lastName?: string | null

The contact’s last name.

valueType: "ADDRESS" | "CHECKBOX" | "CURRENCY" | 12 more

The data type of the field.

One of the following:
"ADDRESS"
"CHECKBOX"
"CURRENCY"
"DATETIME"
"EMAIL"
"FULL_NAME"
"MARKDOWN"
"MULTI_SELECT"
"NUMBER"
"SINGLE_SELECT"
"SOCIAL_HANDLE"
"TELEPHONE"
"TEXT"
"URL"
"HTML"
hasMore: boolean

Whether more history exists beyond this page.

nextCursor: string | null

Cursor to pass as after to fetch the next page, or null when there are no more entries.

Get field value history

import Lightfield from 'lightfield';

const client = new Lightfield({
  apiKey: 'My API Key',
});

const accountFieldHistoryResponse = await client.account.fieldHistory('fieldKey', { id: 'id' });

console.log(accountFieldHistoryResponse.data);
{
  "data": [
    {
      "displayValue": "displayValue",
      "isCreate": true,
      "recordedAt": "recordedAt",
      "value": "string",
      "valueType": "ADDRESS"
    }
  ],
  "hasMore": true,
  "nextCursor": "nextCursor"
}
Returns Examples
{
  "data": [
    {
      "displayValue": "displayValue",
      "isCreate": true,
      "recordedAt": "recordedAt",
      "value": "string",
      "valueType": "ADDRESS"
    }
  ],
  "hasMore": true,
  "nextCursor": "nextCursor"
}