Skip to content

Get contact field definitions

client.Contact.Definitions(ctx) (*ContactDefinitionsResponse, error)
GET/v1/contacts/definitions

Returns the schema for all field and relationship definitions available on contacts, including both system-defined and custom fields. Useful for understanding the shape of contact data before creating or updating records. See Fields and relationships for more details.

Required scope: contacts:read

Rate limit category: Read

ReturnsExpand Collapse
type ContactDefinitionsResponse struct{…}
FieldDefinitions map[string, ContactDefinitionsResponseFieldDefinition]

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 ContactDefinitionsResponseFieldDefinitionTypeConfiguration

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 ContactDefinitionsResponseFieldDefinitionTypeConfigurationHandleServiceTwitter ContactDefinitionsResponseFieldDefinitionTypeConfigurationHandleService = "TWITTER"
const ContactDefinitionsResponseFieldDefinitionTypeConfigurationHandleServiceLinkedin ContactDefinitionsResponseFieldDefinitionTypeConfigurationHandleService = "LINKEDIN"
const ContactDefinitionsResponseFieldDefinitionTypeConfigurationHandleServiceFacebook ContactDefinitionsResponseFieldDefinitionTypeConfigurationHandleService = "FACEBOOK"
const ContactDefinitionsResponseFieldDefinitionTypeConfigurationHandleServiceInstagram ContactDefinitionsResponseFieldDefinitionTypeConfigurationHandleService = "INSTAGRAM"
MultipleValues boolOptional

Whether this field accepts multiple values.

Options []ContactDefinitionsResponseFieldDefinitionTypeConfigurationOptionOptional

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 ContactDefinitionsResponseFieldDefinitionValueTypeAddress ContactDefinitionsResponseFieldDefinitionValueType = "ADDRESS"
const ContactDefinitionsResponseFieldDefinitionValueTypeCheckbox ContactDefinitionsResponseFieldDefinitionValueType = "CHECKBOX"
const ContactDefinitionsResponseFieldDefinitionValueTypeCurrency ContactDefinitionsResponseFieldDefinitionValueType = "CURRENCY"
const ContactDefinitionsResponseFieldDefinitionValueTypeDatetime ContactDefinitionsResponseFieldDefinitionValueType = "DATETIME"
const ContactDefinitionsResponseFieldDefinitionValueTypeEmail ContactDefinitionsResponseFieldDefinitionValueType = "EMAIL"
const ContactDefinitionsResponseFieldDefinitionValueTypeFullName ContactDefinitionsResponseFieldDefinitionValueType = "FULL_NAME"
const ContactDefinitionsResponseFieldDefinitionValueTypeMarkdown ContactDefinitionsResponseFieldDefinitionValueType = "MARKDOWN"
const ContactDefinitionsResponseFieldDefinitionValueTypeMultiSelect ContactDefinitionsResponseFieldDefinitionValueType = "MULTI_SELECT"
const ContactDefinitionsResponseFieldDefinitionValueTypeNumber ContactDefinitionsResponseFieldDefinitionValueType = "NUMBER"
const ContactDefinitionsResponseFieldDefinitionValueTypeSingleSelect ContactDefinitionsResponseFieldDefinitionValueType = "SINGLE_SELECT"
const ContactDefinitionsResponseFieldDefinitionValueTypeSocialHandle ContactDefinitionsResponseFieldDefinitionValueType = "SOCIAL_HANDLE"
const ContactDefinitionsResponseFieldDefinitionValueTypeTelephone ContactDefinitionsResponseFieldDefinitionValueType = "TELEPHONE"
const ContactDefinitionsResponseFieldDefinitionValueTypeText ContactDefinitionsResponseFieldDefinitionValueType = "TEXT"
const ContactDefinitionsResponseFieldDefinitionValueTypeURL ContactDefinitionsResponseFieldDefinitionValueType = "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, ContactDefinitionsResponseRelationshipDefinition]

Map of relationship keys to their definitions.

Cardinality string

Whether this is a has_one or has_many relationship.

One of the following:
const ContactDefinitionsResponseRelationshipDefinitionCardinalityHasOne ContactDefinitionsResponseRelationshipDefinitionCardinality = "HAS_ONE"
const ContactDefinitionsResponseRelationshipDefinitionCardinalityHasMany ContactDefinitionsResponseRelationshipDefinitionCardinality = "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.

Get contact field definitions

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"),
  )
  contactDefinitionsResponse, err := client.Contact.Definitions(context.TODO())
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", contactDefinitionsResponse.FieldDefinitions)
}
{
  "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"
    }
  }
}
Returns Examples
{
  "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"
    }
  }
}