Skip to content

Get note field definitions

client.Note.Definitions(ctx) (*NoteDefinitionsResponse, error)
GET/v1/notes/definitions

Returns the schema for the field and relationship definitions available on notes. Useful for understanding the shape of note data before creating or updating records. See Fields and relationships for more details.

Required scope: notes:read

Rate limit category: Read

ReturnsExpand Collapse
type NoteDefinitionsResponse struct{…}
FieldDefinitions map[string, NoteDefinitionsResponseFieldDefinition]

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 NoteDefinitionsResponseFieldDefinitionTypeConfiguration

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 NoteDefinitionsResponseFieldDefinitionTypeConfigurationHandleServiceTwitter NoteDefinitionsResponseFieldDefinitionTypeConfigurationHandleService = "TWITTER"
const NoteDefinitionsResponseFieldDefinitionTypeConfigurationHandleServiceLinkedin NoteDefinitionsResponseFieldDefinitionTypeConfigurationHandleService = "LINKEDIN"
const NoteDefinitionsResponseFieldDefinitionTypeConfigurationHandleServiceFacebook NoteDefinitionsResponseFieldDefinitionTypeConfigurationHandleService = "FACEBOOK"
const NoteDefinitionsResponseFieldDefinitionTypeConfigurationHandleServiceInstagram NoteDefinitionsResponseFieldDefinitionTypeConfigurationHandleService = "INSTAGRAM"
MultipleValues boolOptional

Whether this field accepts multiple values.

Options []NoteDefinitionsResponseFieldDefinitionTypeConfigurationOptionOptional

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.

ParentID stringOptional

For a dependent select, the ID of the option in the parent field named by typeConfiguration.parentFieldKey that owns this option. Absent for ordinary selects.

ParentFieldKey stringOptional

For a dependent select, the field key whose selected option determines which of this field’s options apply. Absent for ordinary selects.

Unique boolOptional

Whether values for this field must be unique.

ValueType string

Data type of the field.

One of the following:
const NoteDefinitionsResponseFieldDefinitionValueTypeAddress NoteDefinitionsResponseFieldDefinitionValueType = "ADDRESS"
const NoteDefinitionsResponseFieldDefinitionValueTypeCheckbox NoteDefinitionsResponseFieldDefinitionValueType = "CHECKBOX"
const NoteDefinitionsResponseFieldDefinitionValueTypeCurrency NoteDefinitionsResponseFieldDefinitionValueType = "CURRENCY"
const NoteDefinitionsResponseFieldDefinitionValueTypeDatetime NoteDefinitionsResponseFieldDefinitionValueType = "DATETIME"
const NoteDefinitionsResponseFieldDefinitionValueTypeEmail NoteDefinitionsResponseFieldDefinitionValueType = "EMAIL"
const NoteDefinitionsResponseFieldDefinitionValueTypeFullName NoteDefinitionsResponseFieldDefinitionValueType = "FULL_NAME"
const NoteDefinitionsResponseFieldDefinitionValueTypeMarkdown NoteDefinitionsResponseFieldDefinitionValueType = "MARKDOWN"
const NoteDefinitionsResponseFieldDefinitionValueTypeMultiSelect NoteDefinitionsResponseFieldDefinitionValueType = "MULTI_SELECT"
const NoteDefinitionsResponseFieldDefinitionValueTypeNumber NoteDefinitionsResponseFieldDefinitionValueType = "NUMBER"
const NoteDefinitionsResponseFieldDefinitionValueTypeSingleSelect NoteDefinitionsResponseFieldDefinitionValueType = "SINGLE_SELECT"
const NoteDefinitionsResponseFieldDefinitionValueTypeSocialHandle NoteDefinitionsResponseFieldDefinitionValueType = "SOCIAL_HANDLE"
const NoteDefinitionsResponseFieldDefinitionValueTypeTelephone NoteDefinitionsResponseFieldDefinitionValueType = "TELEPHONE"
const NoteDefinitionsResponseFieldDefinitionValueTypeText NoteDefinitionsResponseFieldDefinitionValueType = "TEXT"
const NoteDefinitionsResponseFieldDefinitionValueTypeURL NoteDefinitionsResponseFieldDefinitionValueType = "URL"
const NoteDefinitionsResponseFieldDefinitionValueTypeHTML NoteDefinitionsResponseFieldDefinitionValueType = "HTML"
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, NoteDefinitionsResponseRelationshipDefinition]

Map of relationship keys to their definitions. Self-referential relationships include optional directional metadata on the bare definition.

Cardinality string

Whether this is a has_one or has_many relationship.

One of the following:
const NoteDefinitionsResponseRelationshipDefinitionCardinalityHasOne NoteDefinitionsResponseRelationshipDefinitionCardinality = "HAS_ONE"
const NoteDefinitionsResponseRelationshipDefinitionCardinalityHasMany NoteDefinitionsResponseRelationshipDefinitionCardinality = "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.

Directions NoteDefinitionsResponseRelationshipDefinitionDirectionsOptional

Directional metadata for a self-referential relationship. List filters use the relationship key with :asSource or :asDestination; writes continue to use the bare key.

AsDestination NoteDefinitionsResponseRelationshipDefinitionDirectionsAsDestination

The current record is the destination (incoming) endpoint.

Cardinality string

Whether this endpoint direction is HAS_ONE or HAS_MANY.

One of the following:
const NoteDefinitionsResponseRelationshipDefinitionDirectionsAsDestinationCardinalityHasOne NoteDefinitionsResponseRelationshipDefinitionDirectionsAsDestinationCardinality = "HAS_ONE"
const NoteDefinitionsResponseRelationshipDefinitionDirectionsAsDestinationCardinalityHasMany NoteDefinitionsResponseRelationshipDefinitionDirectionsAsDestinationCardinality = "HAS_MANY"
Label string

Human-readable display name for this endpoint direction.

AsSource NoteDefinitionsResponseRelationshipDefinitionDirectionsAsSource

The current record is the source (outgoing) endpoint.

Cardinality string

Whether this endpoint direction is HAS_ONE or HAS_MANY.

One of the following:
const NoteDefinitionsResponseRelationshipDefinitionDirectionsAsSourceCardinalityHasOne NoteDefinitionsResponseRelationshipDefinitionDirectionsAsSourceCardinality = "HAS_ONE"
const NoteDefinitionsResponseRelationshipDefinitionDirectionsAsSourceCardinalityHasMany NoteDefinitionsResponseRelationshipDefinitionDirectionsAsSourceCardinality = "HAS_MANY"
Label string

Human-readable display name for this endpoint direction.

Get note 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"),
  )
  noteDefinitionsResponse, err := client.Note.Definitions(context.TODO())
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", noteDefinitionsResponse.FieldDefinitions)
}
{
  "fieldDefinitions": {
    "foo": {
      "description": "description",
      "label": "label",
      "typeConfiguration": {
        "currency": "currency",
        "handleService": "TWITTER",
        "multipleValues": true,
        "options": [
          {
            "id": "id",
            "label": "label",
            "description": "description",
            "parentId": "parentId"
          }
        ],
        "parentFieldKey": "parentFieldKey",
        "unique": true
      },
      "valueType": "ADDRESS",
      "id": "id",
      "readOnly": true
    }
  },
  "objectType": "objectType",
  "relationshipDefinitions": {
    "foo": {
      "cardinality": "HAS_ONE",
      "description": "description",
      "label": "label",
      "objectType": "objectType",
      "id": "id",
      "directions": {
        "asDestination": {
          "cardinality": "HAS_ONE",
          "label": "label"
        },
        "asSource": {
          "cardinality": "HAS_ONE",
          "label": "label"
        }
      }
    }
  }
}
Returns Examples
{
  "fieldDefinitions": {
    "foo": {
      "description": "description",
      "label": "label",
      "typeConfiguration": {
        "currency": "currency",
        "handleService": "TWITTER",
        "multipleValues": true,
        "options": [
          {
            "id": "id",
            "label": "label",
            "description": "description",
            "parentId": "parentId"
          }
        ],
        "parentFieldKey": "parentFieldKey",
        "unique": true
      },
      "valueType": "ADDRESS",
      "id": "id",
      "readOnly": true
    }
  },
  "objectType": "objectType",
  "relationshipDefinitions": {
    "foo": {
      "cardinality": "HAS_ONE",
      "description": "description",
      "label": "label",
      "objectType": "objectType",
      "id": "id",
      "directions": {
        "asDestination": {
          "cardinality": "HAS_ONE",
          "label": "label"
        },
        "asSource": {
          "cardinality": "HAS_ONE",
          "label": "label"
        }
      }
    }
  }
}