Skip to content

Account

Accounts represent companies or organizations in Lightfield. Each account can have contacts, opportunities, tasks, and notes associated with it.

Get account field definitions
client.Account.Definitions(ctx) (*AccountDefinitionsResponse, error)
GET/v1/accounts/definitions
Create an account
client.Account.New(ctx, body) (*AccountCreateResponse, error)
POST/v1/accounts
Update an account
client.Account.Update(ctx, id, body) (*AccountUpdateResponse, error)
POST/v1/accounts/{id}
Retrieve an account
client.Account.Get(ctx, id) (*AccountRetrieveResponse, error)
GET/v1/accounts/{id}
List accounts
client.Account.List(ctx, query) (*AccountListResponse, error)
GET/v1/accounts
ModelsExpand Collapse
type AccountCreateResponse struct{…}
ID string

Unique identifier for the entity.

CreatedAt string

ISO 8601 timestamp of when the entity was created.

Fields map[string, AccountCreateResponseField]

Map of field names to their typed values. System fields are prefixed with $ (e.g. $name, $email); custom attributes use their bare slug.

Value AccountCreateResponseFieldValueUnion

The field value, or null if unset.

One of the following:
string
float64
bool
type AccountCreateResponseFieldValueArray []string
type AccountCreateResponseFieldValueAddress 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 AccountCreateResponseFieldValueFullName 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 AccountCreateResponseFieldValueTypeAddress AccountCreateResponseFieldValueType = "ADDRESS"
const AccountCreateResponseFieldValueTypeCheckbox AccountCreateResponseFieldValueType = "CHECKBOX"
const AccountCreateResponseFieldValueTypeCurrency AccountCreateResponseFieldValueType = "CURRENCY"
const AccountCreateResponseFieldValueTypeDatetime AccountCreateResponseFieldValueType = "DATETIME"
const AccountCreateResponseFieldValueTypeEmail AccountCreateResponseFieldValueType = "EMAIL"
const AccountCreateResponseFieldValueTypeFullName AccountCreateResponseFieldValueType = "FULL_NAME"
const AccountCreateResponseFieldValueTypeMarkdown AccountCreateResponseFieldValueType = "MARKDOWN"
const AccountCreateResponseFieldValueTypeMultiSelect AccountCreateResponseFieldValueType = "MULTI_SELECT"
const AccountCreateResponseFieldValueTypeNumber AccountCreateResponseFieldValueType = "NUMBER"
const AccountCreateResponseFieldValueTypeSingleSelect AccountCreateResponseFieldValueType = "SINGLE_SELECT"
const AccountCreateResponseFieldValueTypeSocialHandle AccountCreateResponseFieldValueType = "SOCIAL_HANDLE"
const AccountCreateResponseFieldValueTypeTelephone AccountCreateResponseFieldValueType = "TELEPHONE"
const AccountCreateResponseFieldValueTypeText AccountCreateResponseFieldValueType = "TEXT"
const AccountCreateResponseFieldValueTypeURL AccountCreateResponseFieldValueType = "URL"
Relationships map[string, AccountCreateResponseRelationship]

Map of relationship names to their associated entities. System relationships are prefixed with $ (e.g. $owner, $contact).

Cardinality string

Whether the relationship is has_one or has_many.

ObjectType string

The type of the related object (e.g. account, contact).

Values []string

IDs of the related entities.

UpdatedAt string

ISO 8601 timestamp of when the entity was last updated, or null.

ExternalID stringOptional

External identifier for the entity, or null if unset.

type AccountDefinitionsResponse struct{…}
FieldDefinitions map[string, AccountDefinitionsResponseFieldDefinition]

Map of field keys to their definitions, including both system and custom fields.

Description string

Description of the field, or null.

Label string

Human-readable display name of the field.

TypeConfiguration AccountDefinitionsResponseFieldDefinitionTypeConfiguration

Type-specific configuration (e.g. select options, currency code).

Currency stringOptional

ISO 4217 3-letter currency code.

HandleService stringOptional

Social platform associated with this handle field.

One of the following:
const AccountDefinitionsResponseFieldDefinitionTypeConfigurationHandleServiceTwitter AccountDefinitionsResponseFieldDefinitionTypeConfigurationHandleService = "TWITTER"
const AccountDefinitionsResponseFieldDefinitionTypeConfigurationHandleServiceLinkedin AccountDefinitionsResponseFieldDefinitionTypeConfigurationHandleService = "LINKEDIN"
const AccountDefinitionsResponseFieldDefinitionTypeConfigurationHandleServiceFacebook AccountDefinitionsResponseFieldDefinitionTypeConfigurationHandleService = "FACEBOOK"
const AccountDefinitionsResponseFieldDefinitionTypeConfigurationHandleServiceInstagram AccountDefinitionsResponseFieldDefinitionTypeConfigurationHandleService = "INSTAGRAM"
MultipleValues boolOptional

Whether this field accepts multiple values.

Options []AccountDefinitionsResponseFieldDefinitionTypeConfigurationOptionOptional

Available options for select fields.

ID string

Unique identifier of the select option.

Label string

Human-readable display name of the option.

Description stringOptional

Description of the option, or null.

Unique boolOptional

Whether values for this field must be unique.

ValueType string

Data type of the field.

One of the following:
const AccountDefinitionsResponseFieldDefinitionValueTypeAddress AccountDefinitionsResponseFieldDefinitionValueType = "ADDRESS"
const AccountDefinitionsResponseFieldDefinitionValueTypeCheckbox AccountDefinitionsResponseFieldDefinitionValueType = "CHECKBOX"
const AccountDefinitionsResponseFieldDefinitionValueTypeCurrency AccountDefinitionsResponseFieldDefinitionValueType = "CURRENCY"
const AccountDefinitionsResponseFieldDefinitionValueTypeDatetime AccountDefinitionsResponseFieldDefinitionValueType = "DATETIME"
const AccountDefinitionsResponseFieldDefinitionValueTypeEmail AccountDefinitionsResponseFieldDefinitionValueType = "EMAIL"
const AccountDefinitionsResponseFieldDefinitionValueTypeFullName AccountDefinitionsResponseFieldDefinitionValueType = "FULL_NAME"
const AccountDefinitionsResponseFieldDefinitionValueTypeMarkdown AccountDefinitionsResponseFieldDefinitionValueType = "MARKDOWN"
const AccountDefinitionsResponseFieldDefinitionValueTypeMultiSelect AccountDefinitionsResponseFieldDefinitionValueType = "MULTI_SELECT"
const AccountDefinitionsResponseFieldDefinitionValueTypeNumber AccountDefinitionsResponseFieldDefinitionValueType = "NUMBER"
const AccountDefinitionsResponseFieldDefinitionValueTypeSingleSelect AccountDefinitionsResponseFieldDefinitionValueType = "SINGLE_SELECT"
const AccountDefinitionsResponseFieldDefinitionValueTypeSocialHandle AccountDefinitionsResponseFieldDefinitionValueType = "SOCIAL_HANDLE"
const AccountDefinitionsResponseFieldDefinitionValueTypeTelephone AccountDefinitionsResponseFieldDefinitionValueType = "TELEPHONE"
const AccountDefinitionsResponseFieldDefinitionValueTypeText AccountDefinitionsResponseFieldDefinitionValueType = "TEXT"
const AccountDefinitionsResponseFieldDefinitionValueTypeURL AccountDefinitionsResponseFieldDefinitionValueType = "URL"
ID stringOptional

Unique identifier of the field definition.

ReadOnly boolOptional

true for fields that are not writable via the API (e.g. AI-generated summaries). false or absent for writable fields.

ObjectType string

The object type these definitions belong to (e.g. account).

RelationshipDefinitions map[string, AccountDefinitionsResponseRelationshipDefinition]

Map of relationship keys to their definitions.

Cardinality string

Whether this is a has_one or has_many relationship.

One of the following:
const AccountDefinitionsResponseRelationshipDefinitionCardinalityHasOne AccountDefinitionsResponseRelationshipDefinitionCardinality = "HAS_ONE"
const AccountDefinitionsResponseRelationshipDefinitionCardinalityHasMany AccountDefinitionsResponseRelationshipDefinitionCardinality = "HAS_MANY"
Description string

Description of the relationship, or null.

Label string

Human-readable display name of the relationship.

ObjectType string

The type of the related object (e.g. account, contact).

ID stringOptional

Unique identifier of the relationship definition.

type AccountListResponse struct{…}
Data []AccountListResponseData

Array of entity objects for the current page.

ID string

Unique identifier for the entity.

CreatedAt string

ISO 8601 timestamp of when the entity was created.

Fields map[string, AccountListResponseDataField]

Map of field names to their typed values. System fields are prefixed with $ (e.g. $name, $email); custom attributes use their bare slug.

Value AccountListResponseDataFieldValueUnion

The field value, or null if unset.

One of the following:
string
float64
bool
type AccountListResponseDataFieldValueArray []string
type AccountListResponseDataFieldValueAddress 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 AccountListResponseDataFieldValueFullName 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 AccountListResponseDataFieldValueTypeAddress AccountListResponseDataFieldValueType = "ADDRESS"
const AccountListResponseDataFieldValueTypeCheckbox AccountListResponseDataFieldValueType = "CHECKBOX"
const AccountListResponseDataFieldValueTypeCurrency AccountListResponseDataFieldValueType = "CURRENCY"
const AccountListResponseDataFieldValueTypeDatetime AccountListResponseDataFieldValueType = "DATETIME"
const AccountListResponseDataFieldValueTypeEmail AccountListResponseDataFieldValueType = "EMAIL"
const AccountListResponseDataFieldValueTypeFullName AccountListResponseDataFieldValueType = "FULL_NAME"
const AccountListResponseDataFieldValueTypeMarkdown AccountListResponseDataFieldValueType = "MARKDOWN"
const AccountListResponseDataFieldValueTypeMultiSelect AccountListResponseDataFieldValueType = "MULTI_SELECT"
const AccountListResponseDataFieldValueTypeNumber AccountListResponseDataFieldValueType = "NUMBER"
const AccountListResponseDataFieldValueTypeSingleSelect AccountListResponseDataFieldValueType = "SINGLE_SELECT"
const AccountListResponseDataFieldValueTypeSocialHandle AccountListResponseDataFieldValueType = "SOCIAL_HANDLE"
const AccountListResponseDataFieldValueTypeTelephone AccountListResponseDataFieldValueType = "TELEPHONE"
const AccountListResponseDataFieldValueTypeText AccountListResponseDataFieldValueType = "TEXT"
const AccountListResponseDataFieldValueTypeURL AccountListResponseDataFieldValueType = "URL"
Relationships map[string, AccountListResponseDataRelationship]

Map of relationship names to their associated entities. System relationships are prefixed with $ (e.g. $owner, $contact).

Cardinality string

Whether the relationship is has_one or has_many.

ObjectType string

The type of the related object (e.g. account, contact).

Values []string

IDs of the related entities.

UpdatedAt string

ISO 8601 timestamp of when the entity was last updated, or null.

ExternalID stringOptional

External identifier for the entity, or null if unset.

Object string

The object type, always "list".

TotalCount int64

Total number of entities matching the query.

minimum0
maximum9007199254740991
type AccountRetrieveResponse struct{…}
ID string

Unique identifier for the entity.

CreatedAt string

ISO 8601 timestamp of when the entity was created.

Fields map[string, AccountRetrieveResponseField]

Map of field names to their typed values. System fields are prefixed with $ (e.g. $name, $email); custom attributes use their bare slug.

Value AccountRetrieveResponseFieldValueUnion

The field value, or null if unset.

One of the following:
string
float64
bool
type AccountRetrieveResponseFieldValueArray []string
type AccountRetrieveResponseFieldValueAddress 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 AccountRetrieveResponseFieldValueFullName 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 AccountRetrieveResponseFieldValueTypeAddress AccountRetrieveResponseFieldValueType = "ADDRESS"
const AccountRetrieveResponseFieldValueTypeCheckbox AccountRetrieveResponseFieldValueType = "CHECKBOX"
const AccountRetrieveResponseFieldValueTypeCurrency AccountRetrieveResponseFieldValueType = "CURRENCY"
const AccountRetrieveResponseFieldValueTypeDatetime AccountRetrieveResponseFieldValueType = "DATETIME"
const AccountRetrieveResponseFieldValueTypeEmail AccountRetrieveResponseFieldValueType = "EMAIL"
const AccountRetrieveResponseFieldValueTypeFullName AccountRetrieveResponseFieldValueType = "FULL_NAME"
const AccountRetrieveResponseFieldValueTypeMarkdown AccountRetrieveResponseFieldValueType = "MARKDOWN"
const AccountRetrieveResponseFieldValueTypeMultiSelect AccountRetrieveResponseFieldValueType = "MULTI_SELECT"
const AccountRetrieveResponseFieldValueTypeNumber AccountRetrieveResponseFieldValueType = "NUMBER"
const AccountRetrieveResponseFieldValueTypeSingleSelect AccountRetrieveResponseFieldValueType = "SINGLE_SELECT"
const AccountRetrieveResponseFieldValueTypeSocialHandle AccountRetrieveResponseFieldValueType = "SOCIAL_HANDLE"
const AccountRetrieveResponseFieldValueTypeTelephone AccountRetrieveResponseFieldValueType = "TELEPHONE"
const AccountRetrieveResponseFieldValueTypeText AccountRetrieveResponseFieldValueType = "TEXT"
const AccountRetrieveResponseFieldValueTypeURL AccountRetrieveResponseFieldValueType = "URL"
Relationships map[string, AccountRetrieveResponseRelationship]

Map of relationship names to their associated entities. System relationships are prefixed with $ (e.g. $owner, $contact).

Cardinality string

Whether the relationship is has_one or has_many.

ObjectType string

The type of the related object (e.g. account, contact).

Values []string

IDs of the related entities.

UpdatedAt string

ISO 8601 timestamp of when the entity was last updated, or null.

ExternalID stringOptional

External identifier for the entity, or null if unset.

type AccountUpdateResponse struct{…}
ID string

Unique identifier for the entity.

CreatedAt string

ISO 8601 timestamp of when the entity was created.

Fields map[string, AccountUpdateResponseField]

Map of field names to their typed values. System fields are prefixed with $ (e.g. $name, $email); custom attributes use their bare slug.

Value AccountUpdateResponseFieldValueUnion

The field value, or null if unset.

One of the following:
string
float64
bool
type AccountUpdateResponseFieldValueArray []string
type AccountUpdateResponseFieldValueAddress 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 AccountUpdateResponseFieldValueFullName 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 AccountUpdateResponseFieldValueTypeAddress AccountUpdateResponseFieldValueType = "ADDRESS"
const AccountUpdateResponseFieldValueTypeCheckbox AccountUpdateResponseFieldValueType = "CHECKBOX"
const AccountUpdateResponseFieldValueTypeCurrency AccountUpdateResponseFieldValueType = "CURRENCY"
const AccountUpdateResponseFieldValueTypeDatetime AccountUpdateResponseFieldValueType = "DATETIME"
const AccountUpdateResponseFieldValueTypeEmail AccountUpdateResponseFieldValueType = "EMAIL"
const AccountUpdateResponseFieldValueTypeFullName AccountUpdateResponseFieldValueType = "FULL_NAME"
const AccountUpdateResponseFieldValueTypeMarkdown AccountUpdateResponseFieldValueType = "MARKDOWN"
const AccountUpdateResponseFieldValueTypeMultiSelect AccountUpdateResponseFieldValueType = "MULTI_SELECT"
const AccountUpdateResponseFieldValueTypeNumber AccountUpdateResponseFieldValueType = "NUMBER"
const AccountUpdateResponseFieldValueTypeSingleSelect AccountUpdateResponseFieldValueType = "SINGLE_SELECT"
const AccountUpdateResponseFieldValueTypeSocialHandle AccountUpdateResponseFieldValueType = "SOCIAL_HANDLE"
const AccountUpdateResponseFieldValueTypeTelephone AccountUpdateResponseFieldValueType = "TELEPHONE"
const AccountUpdateResponseFieldValueTypeText AccountUpdateResponseFieldValueType = "TEXT"
const AccountUpdateResponseFieldValueTypeURL AccountUpdateResponseFieldValueType = "URL"
Relationships map[string, AccountUpdateResponseRelationship]

Map of relationship names to their associated entities. System relationships are prefixed with $ (e.g. $owner, $contact).

Cardinality string

Whether the relationship is has_one or has_many.

ObjectType string

The type of the related object (e.g. account, contact).

Values []string

IDs of the related entities.

UpdatedAt string

ISO 8601 timestamp of when the entity was last updated, or null.

ExternalID stringOptional

External identifier for the entity, or null if unset.