## Get account field definitions `client.Account.Definitions(ctx) (*AccountDefinitionsResponse, error)` **get** `/v1/accounts/definitions` Returns the schema for all field and relationship definitions available on accounts, including both system-defined and custom fields. Useful for understanding the shape of account data before creating or updating records. See [Fields and relationships](/using-the-api/fields-and-relationships/) for more details. **[Required scope](/using-the-api/scopes/):** `accounts:read` **[Rate limit category](/using-the-api/rate-limits/):** Read ### Returns - `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 string` ISO 4217 3-letter currency code. - `HandleService string` Social platform associated with this handle field. - `const AccountDefinitionsResponseFieldDefinitionTypeConfigurationHandleServiceTwitter AccountDefinitionsResponseFieldDefinitionTypeConfigurationHandleService = "TWITTER"` - `const AccountDefinitionsResponseFieldDefinitionTypeConfigurationHandleServiceLinkedin AccountDefinitionsResponseFieldDefinitionTypeConfigurationHandleService = "LINKEDIN"` - `const AccountDefinitionsResponseFieldDefinitionTypeConfigurationHandleServiceFacebook AccountDefinitionsResponseFieldDefinitionTypeConfigurationHandleService = "FACEBOOK"` - `const AccountDefinitionsResponseFieldDefinitionTypeConfigurationHandleServiceInstagram AccountDefinitionsResponseFieldDefinitionTypeConfigurationHandleService = "INSTAGRAM"` - `MultipleValues bool` Whether this field accepts multiple values. - `Options []AccountDefinitionsResponseFieldDefinitionTypeConfigurationOption` Available options for select fields. - `ID string` Unique identifier of the select option. - `Label string` Human-readable display name of the option. - `Description string` Description of the option, or null. - `Unique bool` Whether values for this field must be unique. - `ValueType string` Data type of the field. - `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 string` Unique identifier of the field definition. - `ReadOnly bool` `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. - `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 string` Unique identifier of the relationship definition. ### Example ```go 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"), ) accountDefinitionsResponse, err := client.Account.Definitions(context.TODO()) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", accountDefinitionsResponse.FieldDefinitions) } ``` #### Response ```json { "fieldDefinitions": { "foo": { "description": "description", "label": "label", "typeConfiguration": { "currency": "currency", "handleService": "TWITTER", "multipleValues": true, "options": [ { "id": "id", "label": "label", "description": "description" } ], "unique": true }, "valueType": "ADDRESS", "id": "id", "readOnly": true } }, "objectType": "objectType", "relationshipDefinitions": { "foo": { "cardinality": "HAS_ONE", "description": "description", "label": "label", "objectType": "objectType", "id": "id" } } } ```