Skip to content

Get field value history

client.Account.FieldHistory(ctx, fieldKey, params) (*AccountFieldHistoryResponse, error)
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 param.Field[string]

Path param: Unique identifier of the record.

After param.Field[string]Optional

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

Limit param.Field[int64]Optional

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

minimum1
maximum9007199254740991
ReturnsExpand Collapse
type AccountFieldHistoryResponse struct{…}
Data []AccountFieldHistoryResponseData

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 bool

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 AccountFieldHistoryResponseDataValueUnion

The field value, or null if unset.

One of the following:
string
float64
bool
type AccountFieldHistoryResponseDataValueArray []string
type AccountFieldHistoryResponseDataValueAddress struct{…}
City stringOptional

City name.

Country stringOptional

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

Latitude float64Optional

Latitude coordinate.

Longitude float64Optional

Longitude coordinate.

PostalCode stringOptional

Postal or ZIP code.

State stringOptional

State or province.

Street stringOptional

Street address line 1.

Street2 stringOptional

Street address line 2.

type AccountFieldHistoryResponseDataValueFullName struct{…}
FirstName stringOptional

The contact’s first name.

LastName stringOptional

The contact’s last name.

ValueType string

The data type of the field.

One of the following:
const AccountFieldHistoryResponseDataValueTypeAddress AccountFieldHistoryResponseDataValueType = "ADDRESS"
const AccountFieldHistoryResponseDataValueTypeCheckbox AccountFieldHistoryResponseDataValueType = "CHECKBOX"
const AccountFieldHistoryResponseDataValueTypeCurrency AccountFieldHistoryResponseDataValueType = "CURRENCY"
const AccountFieldHistoryResponseDataValueTypeDatetime AccountFieldHistoryResponseDataValueType = "DATETIME"
const AccountFieldHistoryResponseDataValueTypeEmail AccountFieldHistoryResponseDataValueType = "EMAIL"
const AccountFieldHistoryResponseDataValueTypeFullName AccountFieldHistoryResponseDataValueType = "FULL_NAME"
const AccountFieldHistoryResponseDataValueTypeMarkdown AccountFieldHistoryResponseDataValueType = "MARKDOWN"
const AccountFieldHistoryResponseDataValueTypeMultiSelect AccountFieldHistoryResponseDataValueType = "MULTI_SELECT"
const AccountFieldHistoryResponseDataValueTypeNumber AccountFieldHistoryResponseDataValueType = "NUMBER"
const AccountFieldHistoryResponseDataValueTypeSingleSelect AccountFieldHistoryResponseDataValueType = "SINGLE_SELECT"
const AccountFieldHistoryResponseDataValueTypeSocialHandle AccountFieldHistoryResponseDataValueType = "SOCIAL_HANDLE"
const AccountFieldHistoryResponseDataValueTypeTelephone AccountFieldHistoryResponseDataValueType = "TELEPHONE"
const AccountFieldHistoryResponseDataValueTypeText AccountFieldHistoryResponseDataValueType = "TEXT"
const AccountFieldHistoryResponseDataValueTypeURL AccountFieldHistoryResponseDataValueType = "URL"
const AccountFieldHistoryResponseDataValueTypeHTML AccountFieldHistoryResponseDataValueType = "HTML"
HasMore bool

Whether more history exists beyond this page.

NextCursor string

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

Get field value history

package main

import (
  "context"
  "fmt"

  "github.com/Lightfld/lightfield-go"
  "github.com/Lightfld/lightfield-go/option"
)

func main() {
  client := githubcomlightfldlightfieldgo.NewClient(
    option.WithAPIKey("My API Key"),
  )
  accountFieldHistoryResponse, err := client.Account.FieldHistory(
    context.TODO(),
    "fieldKey",
    githubcomlightfldlightfieldgo.AccountFieldHistoryParams{
      ID: "id",
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", 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"
}