## Get field value history

`client.contact.fieldHistory(stringfieldKey, ContactFieldHistoryParamsparams, RequestOptionsoptions?): ContactFieldHistoryResponse`

**get** `/v1/contacts/{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](/using-the-api/scopes/):** `contacts:read`

**[Rate limit category](/using-the-api/rate-limits/):** Read

### Parameters

- `fieldKey: string`

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

- `params: ContactFieldHistoryParams`

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

### Returns

- `ContactFieldHistoryResponse`

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

      - `string`

      - `number`

      - `boolean`

      - `Array<string>`

      - `Address`

        - `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?: 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.

      - `"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.

### Example

```typescript
import Lightfield from 'lightfield';

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

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

console.log(contactFieldHistoryResponse.data);
```

#### Response

```json
{
  "data": [
    {
      "displayValue": "displayValue",
      "isCreate": true,
      "recordedAt": "recordedAt",
      "value": "string",
      "valueType": "ADDRESS"
    }
  ],
  "hasMore": true,
  "nextCursor": "nextCursor"
}
```
