# Object ## Create a custom object record `client.Object.New(ctx, entitySlug, body) (*ObjectCreateResponse, error)` **post** `/v1/objects/{entitySlug}/values` Creates a new record for the specified custom object type. ### Parameters - `entitySlug string` The slug of the custom object type. - `body ObjectNewParams` - `Fields param.Field[map[string, ObjectNewParamsFieldUnion]]` Field names to values for the new record. - `string` - `float64` - `bool` - `type ObjectNewParamsFieldArray []string` - `type ObjectNewParamsFieldAddress struct{…}` - `City string` City name. - `Country string` 2-letter ISO 3166-1 alpha-2 country code. - `Latitude float64` Latitude coordinate. - `Longitude float64` Longitude coordinate. - `PostalCode string` Postal or ZIP code. - `State string` State or province. - `Street string` Street address line 1. - `Street2 string` Street address line 2. - `type ObjectNewParamsFieldFullName struct{…}` - `FirstName string` The contact's first name. - `LastName string` The contact's last name. - `Relationships param.Field[map[string, ObjectNewParamsRelationshipUnion]]` Relationship names to entity ID(s) to associate. - `string` - `type ObjectNewParamsRelationshipArray []string` ### Returns - `type ObjectCreateResponse struct{…}` - `ID string` Unique identifier for the entity. - `CreatedAt string` ISO 8601 timestamp of when the entity was created. - `Fields map[string, ObjectCreateResponseField]` Map of field names to their typed values. System fields are prefixed with `$` (e.g. `$name`, `$email`); custom attributes use their bare slug. - `Value ObjectCreateResponseFieldValueUnion` The field value, or null if unset. - `string` - `float64` - `bool` - `type ObjectCreateResponseFieldValueArray []string` - `type ObjectCreateResponseFieldValueAddress struct{…}` - `City string` City name. - `Country string` 2-letter ISO 3166-1 alpha-2 country code. - `Latitude float64` Latitude coordinate. - `Longitude float64` Longitude coordinate. - `PostalCode string` Postal or ZIP code. - `State string` State or province. - `Street string` Street address line 1. - `Street2 string` Street address line 2. - `type ObjectCreateResponseFieldValueFullName struct{…}` - `FirstName string` The contact's first name. - `LastName string` The contact's last name. - `ValueType string` The data type of the field. - `const ObjectCreateResponseFieldValueTypeAddress ObjectCreateResponseFieldValueType = "ADDRESS"` - `const ObjectCreateResponseFieldValueTypeCheckbox ObjectCreateResponseFieldValueType = "CHECKBOX"` - `const ObjectCreateResponseFieldValueTypeCurrency ObjectCreateResponseFieldValueType = "CURRENCY"` - `const ObjectCreateResponseFieldValueTypeDatetime ObjectCreateResponseFieldValueType = "DATETIME"` - `const ObjectCreateResponseFieldValueTypeEmail ObjectCreateResponseFieldValueType = "EMAIL"` - `const ObjectCreateResponseFieldValueTypeFullName ObjectCreateResponseFieldValueType = "FULL_NAME"` - `const ObjectCreateResponseFieldValueTypeMarkdown ObjectCreateResponseFieldValueType = "MARKDOWN"` - `const ObjectCreateResponseFieldValueTypeMultiSelect ObjectCreateResponseFieldValueType = "MULTI_SELECT"` - `const ObjectCreateResponseFieldValueTypeNumber ObjectCreateResponseFieldValueType = "NUMBER"` - `const ObjectCreateResponseFieldValueTypeSingleSelect ObjectCreateResponseFieldValueType = "SINGLE_SELECT"` - `const ObjectCreateResponseFieldValueTypeSocialHandle ObjectCreateResponseFieldValueType = "SOCIAL_HANDLE"` - `const ObjectCreateResponseFieldValueTypeTelephone ObjectCreateResponseFieldValueType = "TELEPHONE"` - `const ObjectCreateResponseFieldValueTypeText ObjectCreateResponseFieldValueType = "TEXT"` - `const ObjectCreateResponseFieldValueTypeURL ObjectCreateResponseFieldValueType = "URL"` - `const ObjectCreateResponseFieldValueTypeHTML ObjectCreateResponseFieldValueType = "HTML"` - `HTTPLink string` URL to view the entity in the Lightfield web app, or null. - `Relationships map[string, ObjectCreateResponseRelationship]` 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 string` External identifier for the entity, or null if unset. ### 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"), ) objectCreateResponse, err := client.Object.New( context.TODO(), "entitySlug", githubcomlightfldlightfieldgo.ObjectNewParams{ Fields: map[string]githubcomlightfldlightfieldgo.ObjectNewParamsFieldUnion{ "foo": githubcomlightfldlightfieldgo.ObjectNewParamsFieldUnion{ OfString: githubcomlightfldlightfieldgo.String("string"), }, }, }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", objectCreateResponse.ID) } ``` #### Response ```json { "id": "id", "createdAt": "createdAt", "fields": { "foo": { "value": "string", "valueType": "ADDRESS" } }, "httpLink": "httpLink", "relationships": { "foo": { "cardinality": "cardinality", "objectType": "objectType", "values": [ "string" ] } }, "updatedAt": "updatedAt", "externalId": "externalId" } ``` ## Get a custom object record `client.Object.Get(ctx, id, query) (*ObjectRetrieveResponse, error)` **get** `/v1/objects/{entitySlug}/values/{id}` Retrieves a single record by ID for the specified custom object type. ### Parameters - `id string` The ID of the record to retrieve. - `query ObjectGetParams` - `EntitySlug param.Field[string]` The slug of the custom object type. ### Returns - `type ObjectRetrieveResponse struct{…}` - `ID string` Unique identifier for the entity. - `CreatedAt string` ISO 8601 timestamp of when the entity was created. - `Fields map[string, ObjectRetrieveResponseField]` Map of field names to their typed values. System fields are prefixed with `$` (e.g. `$name`, `$email`); custom attributes use their bare slug. - `Value ObjectRetrieveResponseFieldValueUnion` The field value, or null if unset. - `string` - `float64` - `bool` - `type ObjectRetrieveResponseFieldValueArray []string` - `type ObjectRetrieveResponseFieldValueAddress struct{…}` - `City string` City name. - `Country string` 2-letter ISO 3166-1 alpha-2 country code. - `Latitude float64` Latitude coordinate. - `Longitude float64` Longitude coordinate. - `PostalCode string` Postal or ZIP code. - `State string` State or province. - `Street string` Street address line 1. - `Street2 string` Street address line 2. - `type ObjectRetrieveResponseFieldValueFullName struct{…}` - `FirstName string` The contact's first name. - `LastName string` The contact's last name. - `ValueType string` The data type of the field. - `const ObjectRetrieveResponseFieldValueTypeAddress ObjectRetrieveResponseFieldValueType = "ADDRESS"` - `const ObjectRetrieveResponseFieldValueTypeCheckbox ObjectRetrieveResponseFieldValueType = "CHECKBOX"` - `const ObjectRetrieveResponseFieldValueTypeCurrency ObjectRetrieveResponseFieldValueType = "CURRENCY"` - `const ObjectRetrieveResponseFieldValueTypeDatetime ObjectRetrieveResponseFieldValueType = "DATETIME"` - `const ObjectRetrieveResponseFieldValueTypeEmail ObjectRetrieveResponseFieldValueType = "EMAIL"` - `const ObjectRetrieveResponseFieldValueTypeFullName ObjectRetrieveResponseFieldValueType = "FULL_NAME"` - `const ObjectRetrieveResponseFieldValueTypeMarkdown ObjectRetrieveResponseFieldValueType = "MARKDOWN"` - `const ObjectRetrieveResponseFieldValueTypeMultiSelect ObjectRetrieveResponseFieldValueType = "MULTI_SELECT"` - `const ObjectRetrieveResponseFieldValueTypeNumber ObjectRetrieveResponseFieldValueType = "NUMBER"` - `const ObjectRetrieveResponseFieldValueTypeSingleSelect ObjectRetrieveResponseFieldValueType = "SINGLE_SELECT"` - `const ObjectRetrieveResponseFieldValueTypeSocialHandle ObjectRetrieveResponseFieldValueType = "SOCIAL_HANDLE"` - `const ObjectRetrieveResponseFieldValueTypeTelephone ObjectRetrieveResponseFieldValueType = "TELEPHONE"` - `const ObjectRetrieveResponseFieldValueTypeText ObjectRetrieveResponseFieldValueType = "TEXT"` - `const ObjectRetrieveResponseFieldValueTypeURL ObjectRetrieveResponseFieldValueType = "URL"` - `const ObjectRetrieveResponseFieldValueTypeHTML ObjectRetrieveResponseFieldValueType = "HTML"` - `HTTPLink string` URL to view the entity in the Lightfield web app, or null. - `Relationships map[string, ObjectRetrieveResponseRelationship]` 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 string` External identifier for the entity, or null if unset. ### 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"), ) objectRetrieveResponse, err := client.Object.Get( context.TODO(), "id", githubcomlightfldlightfieldgo.ObjectGetParams{ EntitySlug: "entitySlug", }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", objectRetrieveResponse.ID) } ``` #### Response ```json { "id": "id", "createdAt": "createdAt", "fields": { "foo": { "value": "string", "valueType": "ADDRESS" } }, "httpLink": "httpLink", "relationships": { "foo": { "cardinality": "cardinality", "objectType": "objectType", "values": [ "string" ] } }, "updatedAt": "updatedAt", "externalId": "externalId" } ``` ## Update a custom object record `client.Object.Update(ctx, id, params) (*ObjectUpdateResponse, error)` **post** `/v1/objects/{entitySlug}/values/{id}` Updates an existing record by ID for the specified custom object type. Only included fields and relationships are modified. ### Parameters - `id string` The ID of the record to update. - `params ObjectUpdateParams` - `EntitySlug param.Field[string]` Path param: The slug of the custom object type. - `Fields param.Field[map[string, ObjectUpdateParamsFieldUnion]]` Body param: Field names to values. Only provided fields are modified. - `string` - `float64` - `bool` - `type ObjectUpdateParamsFieldArray []string` - `type ObjectUpdateParamsFieldAddress struct{…}` - `City string` City name. - `Country string` 2-letter ISO 3166-1 alpha-2 country code. - `Latitude float64` Latitude coordinate. - `Longitude float64` Longitude coordinate. - `PostalCode string` Postal or ZIP code. - `State string` State or province. - `Street string` Street address line 1. - `Street2 string` Street address line 2. - `type ObjectUpdateParamsFieldFullName struct{…}` - `FirstName string` The contact's first name. - `LastName string` The contact's last name. - `Relationships param.Field[map[string, ObjectUpdateParamsRelationship]]` Body param: Relationship names to operations (`add`, `remove`, or `replace`). - `Add ObjectUpdateParamsRelationshipAddUnion` Entity ID(s) to add to the relationship. - `string` - `type ObjectUpdateParamsRelationshipAddArray []string` - `Remove ObjectUpdateParamsRelationshipRemoveUnion` Entity ID(s) to remove from the relationship. - `string` - `type ObjectUpdateParamsRelationshipRemoveArray []string` - `Replace ObjectUpdateParamsRelationshipReplaceUnion` A single entity ID or an array of entity IDs. - `string` - `type ObjectUpdateParamsRelationshipReplaceArray []string` ### Returns - `type ObjectUpdateResponse struct{…}` - `ID string` Unique identifier for the entity. - `CreatedAt string` ISO 8601 timestamp of when the entity was created. - `Fields map[string, ObjectUpdateResponseField]` Map of field names to their typed values. System fields are prefixed with `$` (e.g. `$name`, `$email`); custom attributes use their bare slug. - `Value ObjectUpdateResponseFieldValueUnion` The field value, or null if unset. - `string` - `float64` - `bool` - `type ObjectUpdateResponseFieldValueArray []string` - `type ObjectUpdateResponseFieldValueAddress struct{…}` - `City string` City name. - `Country string` 2-letter ISO 3166-1 alpha-2 country code. - `Latitude float64` Latitude coordinate. - `Longitude float64` Longitude coordinate. - `PostalCode string` Postal or ZIP code. - `State string` State or province. - `Street string` Street address line 1. - `Street2 string` Street address line 2. - `type ObjectUpdateResponseFieldValueFullName struct{…}` - `FirstName string` The contact's first name. - `LastName string` The contact's last name. - `ValueType string` The data type of the field. - `const ObjectUpdateResponseFieldValueTypeAddress ObjectUpdateResponseFieldValueType = "ADDRESS"` - `const ObjectUpdateResponseFieldValueTypeCheckbox ObjectUpdateResponseFieldValueType = "CHECKBOX"` - `const ObjectUpdateResponseFieldValueTypeCurrency ObjectUpdateResponseFieldValueType = "CURRENCY"` - `const ObjectUpdateResponseFieldValueTypeDatetime ObjectUpdateResponseFieldValueType = "DATETIME"` - `const ObjectUpdateResponseFieldValueTypeEmail ObjectUpdateResponseFieldValueType = "EMAIL"` - `const ObjectUpdateResponseFieldValueTypeFullName ObjectUpdateResponseFieldValueType = "FULL_NAME"` - `const ObjectUpdateResponseFieldValueTypeMarkdown ObjectUpdateResponseFieldValueType = "MARKDOWN"` - `const ObjectUpdateResponseFieldValueTypeMultiSelect ObjectUpdateResponseFieldValueType = "MULTI_SELECT"` - `const ObjectUpdateResponseFieldValueTypeNumber ObjectUpdateResponseFieldValueType = "NUMBER"` - `const ObjectUpdateResponseFieldValueTypeSingleSelect ObjectUpdateResponseFieldValueType = "SINGLE_SELECT"` - `const ObjectUpdateResponseFieldValueTypeSocialHandle ObjectUpdateResponseFieldValueType = "SOCIAL_HANDLE"` - `const ObjectUpdateResponseFieldValueTypeTelephone ObjectUpdateResponseFieldValueType = "TELEPHONE"` - `const ObjectUpdateResponseFieldValueTypeText ObjectUpdateResponseFieldValueType = "TEXT"` - `const ObjectUpdateResponseFieldValueTypeURL ObjectUpdateResponseFieldValueType = "URL"` - `const ObjectUpdateResponseFieldValueTypeHTML ObjectUpdateResponseFieldValueType = "HTML"` - `HTTPLink string` URL to view the entity in the Lightfield web app, or null. - `Relationships map[string, ObjectUpdateResponseRelationship]` 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 string` External identifier for the entity, or null if unset. ### 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"), ) objectUpdateResponse, err := client.Object.Update( context.TODO(), "id", githubcomlightfldlightfieldgo.ObjectUpdateParams{ EntitySlug: "entitySlug", }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", objectUpdateResponse.ID) } ``` #### Response ```json { "id": "id", "createdAt": "createdAt", "fields": { "foo": { "value": "string", "valueType": "ADDRESS" } }, "httpLink": "httpLink", "relationships": { "foo": { "cardinality": "cardinality", "objectType": "objectType", "values": [ "string" ] } }, "updatedAt": "updatedAt", "externalId": "externalId" } ``` ## List custom object records `client.Object.List(ctx, entitySlug, query) (*ObjectListResponse, error)` **get** `/v1/objects/{entitySlug}` Returns a paginated list of records for the specified custom object type. Use `offset` and `limit` to paginate through results, and `$field` query parameters to filter. See [List endpoints](/using-the-api/list-endpoints/) for more information about [pagination](/using-the-api/list-endpoints/#pagination) and [filtering](/using-the-api/list-endpoints/#filtering). ### Parameters - `entitySlug string` The slug of the custom object type. - `query ObjectListParams` - `Limit param.Field[int64]` Maximum number of records to return. Defaults to 25, maximum 25. - `Offset param.Field[int64]` Number of records to skip for pagination. Defaults to 0. ### Returns - `type ObjectListResponse struct{…}` - `Data []ObjectListResponseData` 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, ObjectListResponseDataField]` Map of field names to their typed values. System fields are prefixed with `$` (e.g. `$name`, `$email`); custom attributes use their bare slug. - `Value ObjectListResponseDataFieldValueUnion` The field value, or null if unset. - `string` - `float64` - `bool` - `type ObjectListResponseDataFieldValueArray []string` - `type ObjectListResponseDataFieldValueAddress struct{…}` - `City string` City name. - `Country string` 2-letter ISO 3166-1 alpha-2 country code. - `Latitude float64` Latitude coordinate. - `Longitude float64` Longitude coordinate. - `PostalCode string` Postal or ZIP code. - `State string` State or province. - `Street string` Street address line 1. - `Street2 string` Street address line 2. - `type ObjectListResponseDataFieldValueFullName struct{…}` - `FirstName string` The contact's first name. - `LastName string` The contact's last name. - `ValueType string` The data type of the field. - `const ObjectListResponseDataFieldValueTypeAddress ObjectListResponseDataFieldValueType = "ADDRESS"` - `const ObjectListResponseDataFieldValueTypeCheckbox ObjectListResponseDataFieldValueType = "CHECKBOX"` - `const ObjectListResponseDataFieldValueTypeCurrency ObjectListResponseDataFieldValueType = "CURRENCY"` - `const ObjectListResponseDataFieldValueTypeDatetime ObjectListResponseDataFieldValueType = "DATETIME"` - `const ObjectListResponseDataFieldValueTypeEmail ObjectListResponseDataFieldValueType = "EMAIL"` - `const ObjectListResponseDataFieldValueTypeFullName ObjectListResponseDataFieldValueType = "FULL_NAME"` - `const ObjectListResponseDataFieldValueTypeMarkdown ObjectListResponseDataFieldValueType = "MARKDOWN"` - `const ObjectListResponseDataFieldValueTypeMultiSelect ObjectListResponseDataFieldValueType = "MULTI_SELECT"` - `const ObjectListResponseDataFieldValueTypeNumber ObjectListResponseDataFieldValueType = "NUMBER"` - `const ObjectListResponseDataFieldValueTypeSingleSelect ObjectListResponseDataFieldValueType = "SINGLE_SELECT"` - `const ObjectListResponseDataFieldValueTypeSocialHandle ObjectListResponseDataFieldValueType = "SOCIAL_HANDLE"` - `const ObjectListResponseDataFieldValueTypeTelephone ObjectListResponseDataFieldValueType = "TELEPHONE"` - `const ObjectListResponseDataFieldValueTypeText ObjectListResponseDataFieldValueType = "TEXT"` - `const ObjectListResponseDataFieldValueTypeURL ObjectListResponseDataFieldValueType = "URL"` - `const ObjectListResponseDataFieldValueTypeHTML ObjectListResponseDataFieldValueType = "HTML"` - `HTTPLink string` URL to view the entity in the Lightfield web app, or null. - `Relationships map[string, ObjectListResponseDataRelationship]` 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 string` 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. ### 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"), ) objectListResponse, err := client.Object.List( context.TODO(), "entitySlug", githubcomlightfldlightfieldgo.ObjectListParams{ }, ) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", objectListResponse.Data) } ``` #### Response ```json { "data": [ { "id": "id", "createdAt": "createdAt", "fields": { "foo": { "value": "string", "valueType": "ADDRESS" } }, "httpLink": "httpLink", "relationships": { "foo": { "cardinality": "cardinality", "objectType": "objectType", "values": [ "string" ] } }, "updatedAt": "updatedAt", "externalId": "externalId" } ], "object": "object", "totalCount": 0 } ``` ## Get definitions for a custom object type `client.Object.Definitions(ctx, entitySlug) (*ObjectDefinitionsResponse, error)` **get** `/v1/objects/{entitySlug}/definitions` Returns field and relationship definitions for the specified custom object type. ### Parameters - `entitySlug string` The slug of the custom object type. ### Returns - `type ObjectDefinitionsResponse struct{…}` - `FieldDefinitions map[string, ObjectDefinitionsResponseFieldDefinition]` 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 ObjectDefinitionsResponseFieldDefinitionTypeConfiguration` 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 ObjectDefinitionsResponseFieldDefinitionTypeConfigurationHandleServiceTwitter ObjectDefinitionsResponseFieldDefinitionTypeConfigurationHandleService = "TWITTER"` - `const ObjectDefinitionsResponseFieldDefinitionTypeConfigurationHandleServiceLinkedin ObjectDefinitionsResponseFieldDefinitionTypeConfigurationHandleService = "LINKEDIN"` - `const ObjectDefinitionsResponseFieldDefinitionTypeConfigurationHandleServiceFacebook ObjectDefinitionsResponseFieldDefinitionTypeConfigurationHandleService = "FACEBOOK"` - `const ObjectDefinitionsResponseFieldDefinitionTypeConfigurationHandleServiceInstagram ObjectDefinitionsResponseFieldDefinitionTypeConfigurationHandleService = "INSTAGRAM"` - `MultipleValues bool` Whether this field accepts multiple values. - `Options []ObjectDefinitionsResponseFieldDefinitionTypeConfigurationOption` 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 ObjectDefinitionsResponseFieldDefinitionValueTypeAddress ObjectDefinitionsResponseFieldDefinitionValueType = "ADDRESS"` - `const ObjectDefinitionsResponseFieldDefinitionValueTypeCheckbox ObjectDefinitionsResponseFieldDefinitionValueType = "CHECKBOX"` - `const ObjectDefinitionsResponseFieldDefinitionValueTypeCurrency ObjectDefinitionsResponseFieldDefinitionValueType = "CURRENCY"` - `const ObjectDefinitionsResponseFieldDefinitionValueTypeDatetime ObjectDefinitionsResponseFieldDefinitionValueType = "DATETIME"` - `const ObjectDefinitionsResponseFieldDefinitionValueTypeEmail ObjectDefinitionsResponseFieldDefinitionValueType = "EMAIL"` - `const ObjectDefinitionsResponseFieldDefinitionValueTypeFullName ObjectDefinitionsResponseFieldDefinitionValueType = "FULL_NAME"` - `const ObjectDefinitionsResponseFieldDefinitionValueTypeMarkdown ObjectDefinitionsResponseFieldDefinitionValueType = "MARKDOWN"` - `const ObjectDefinitionsResponseFieldDefinitionValueTypeMultiSelect ObjectDefinitionsResponseFieldDefinitionValueType = "MULTI_SELECT"` - `const ObjectDefinitionsResponseFieldDefinitionValueTypeNumber ObjectDefinitionsResponseFieldDefinitionValueType = "NUMBER"` - `const ObjectDefinitionsResponseFieldDefinitionValueTypeSingleSelect ObjectDefinitionsResponseFieldDefinitionValueType = "SINGLE_SELECT"` - `const ObjectDefinitionsResponseFieldDefinitionValueTypeSocialHandle ObjectDefinitionsResponseFieldDefinitionValueType = "SOCIAL_HANDLE"` - `const ObjectDefinitionsResponseFieldDefinitionValueTypeTelephone ObjectDefinitionsResponseFieldDefinitionValueType = "TELEPHONE"` - `const ObjectDefinitionsResponseFieldDefinitionValueTypeText ObjectDefinitionsResponseFieldDefinitionValueType = "TEXT"` - `const ObjectDefinitionsResponseFieldDefinitionValueTypeURL ObjectDefinitionsResponseFieldDefinitionValueType = "URL"` - `const ObjectDefinitionsResponseFieldDefinitionValueTypeHTML ObjectDefinitionsResponseFieldDefinitionValueType = "HTML"` - `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, ObjectDefinitionsResponseRelationshipDefinition]` Map of relationship keys to their definitions. - `Cardinality string` Whether this is a `has_one` or `has_many` relationship. - `const ObjectDefinitionsResponseRelationshipDefinitionCardinalityHasOne ObjectDefinitionsResponseRelationshipDefinitionCardinality = "HAS_ONE"` - `const ObjectDefinitionsResponseRelationshipDefinitionCardinalityHasMany ObjectDefinitionsResponseRelationshipDefinitionCardinality = "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"), ) objectDefinitionsResponse, err := client.Object.Definitions(context.TODO(), "entitySlug") if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", objectDefinitionsResponse.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" } } } ``` ## List custom object types `client.Object.ListDefinitions(ctx) (*ObjectListDefinitionsResponse, error)` **get** `/v1/objects` Returns all custom object types available to the caller. ### Returns - `type ObjectListDefinitionsResponse struct{…}` - `Data []ObjectListDefinitionsResponseData` All object types available to the caller. - `Label string` Human-readable display name. - `ObjectType string` The slug used to reference this object type in the API. ### 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"), ) objectListDefinitionsResponse, err := client.Object.ListDefinitions(context.TODO()) if err != nil { panic(err.Error()) } fmt.Printf("%+v\n", objectListDefinitionsResponse.Data) } ``` #### Response ```json { "data": [ { "label": "label", "objectType": "objectType" } ] } ``` ## Domain Types ### Object Create Response - `type ObjectCreateResponse struct{…}` - `ID string` Unique identifier for the entity. - `CreatedAt string` ISO 8601 timestamp of when the entity was created. - `Fields map[string, ObjectCreateResponseField]` Map of field names to their typed values. System fields are prefixed with `$` (e.g. `$name`, `$email`); custom attributes use their bare slug. - `Value ObjectCreateResponseFieldValueUnion` The field value, or null if unset. - `string` - `float64` - `bool` - `type ObjectCreateResponseFieldValueArray []string` - `type ObjectCreateResponseFieldValueAddress struct{…}` - `City string` City name. - `Country string` 2-letter ISO 3166-1 alpha-2 country code. - `Latitude float64` Latitude coordinate. - `Longitude float64` Longitude coordinate. - `PostalCode string` Postal or ZIP code. - `State string` State or province. - `Street string` Street address line 1. - `Street2 string` Street address line 2. - `type ObjectCreateResponseFieldValueFullName struct{…}` - `FirstName string` The contact's first name. - `LastName string` The contact's last name. - `ValueType string` The data type of the field. - `const ObjectCreateResponseFieldValueTypeAddress ObjectCreateResponseFieldValueType = "ADDRESS"` - `const ObjectCreateResponseFieldValueTypeCheckbox ObjectCreateResponseFieldValueType = "CHECKBOX"` - `const ObjectCreateResponseFieldValueTypeCurrency ObjectCreateResponseFieldValueType = "CURRENCY"` - `const ObjectCreateResponseFieldValueTypeDatetime ObjectCreateResponseFieldValueType = "DATETIME"` - `const ObjectCreateResponseFieldValueTypeEmail ObjectCreateResponseFieldValueType = "EMAIL"` - `const ObjectCreateResponseFieldValueTypeFullName ObjectCreateResponseFieldValueType = "FULL_NAME"` - `const ObjectCreateResponseFieldValueTypeMarkdown ObjectCreateResponseFieldValueType = "MARKDOWN"` - `const ObjectCreateResponseFieldValueTypeMultiSelect ObjectCreateResponseFieldValueType = "MULTI_SELECT"` - `const ObjectCreateResponseFieldValueTypeNumber ObjectCreateResponseFieldValueType = "NUMBER"` - `const ObjectCreateResponseFieldValueTypeSingleSelect ObjectCreateResponseFieldValueType = "SINGLE_SELECT"` - `const ObjectCreateResponseFieldValueTypeSocialHandle ObjectCreateResponseFieldValueType = "SOCIAL_HANDLE"` - `const ObjectCreateResponseFieldValueTypeTelephone ObjectCreateResponseFieldValueType = "TELEPHONE"` - `const ObjectCreateResponseFieldValueTypeText ObjectCreateResponseFieldValueType = "TEXT"` - `const ObjectCreateResponseFieldValueTypeURL ObjectCreateResponseFieldValueType = "URL"` - `const ObjectCreateResponseFieldValueTypeHTML ObjectCreateResponseFieldValueType = "HTML"` - `HTTPLink string` URL to view the entity in the Lightfield web app, or null. - `Relationships map[string, ObjectCreateResponseRelationship]` 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 string` External identifier for the entity, or null if unset. ### Object Definitions Response - `type ObjectDefinitionsResponse struct{…}` - `FieldDefinitions map[string, ObjectDefinitionsResponseFieldDefinition]` 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 ObjectDefinitionsResponseFieldDefinitionTypeConfiguration` 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 ObjectDefinitionsResponseFieldDefinitionTypeConfigurationHandleServiceTwitter ObjectDefinitionsResponseFieldDefinitionTypeConfigurationHandleService = "TWITTER"` - `const ObjectDefinitionsResponseFieldDefinitionTypeConfigurationHandleServiceLinkedin ObjectDefinitionsResponseFieldDefinitionTypeConfigurationHandleService = "LINKEDIN"` - `const ObjectDefinitionsResponseFieldDefinitionTypeConfigurationHandleServiceFacebook ObjectDefinitionsResponseFieldDefinitionTypeConfigurationHandleService = "FACEBOOK"` - `const ObjectDefinitionsResponseFieldDefinitionTypeConfigurationHandleServiceInstagram ObjectDefinitionsResponseFieldDefinitionTypeConfigurationHandleService = "INSTAGRAM"` - `MultipleValues bool` Whether this field accepts multiple values. - `Options []ObjectDefinitionsResponseFieldDefinitionTypeConfigurationOption` 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 ObjectDefinitionsResponseFieldDefinitionValueTypeAddress ObjectDefinitionsResponseFieldDefinitionValueType = "ADDRESS"` - `const ObjectDefinitionsResponseFieldDefinitionValueTypeCheckbox ObjectDefinitionsResponseFieldDefinitionValueType = "CHECKBOX"` - `const ObjectDefinitionsResponseFieldDefinitionValueTypeCurrency ObjectDefinitionsResponseFieldDefinitionValueType = "CURRENCY"` - `const ObjectDefinitionsResponseFieldDefinitionValueTypeDatetime ObjectDefinitionsResponseFieldDefinitionValueType = "DATETIME"` - `const ObjectDefinitionsResponseFieldDefinitionValueTypeEmail ObjectDefinitionsResponseFieldDefinitionValueType = "EMAIL"` - `const ObjectDefinitionsResponseFieldDefinitionValueTypeFullName ObjectDefinitionsResponseFieldDefinitionValueType = "FULL_NAME"` - `const ObjectDefinitionsResponseFieldDefinitionValueTypeMarkdown ObjectDefinitionsResponseFieldDefinitionValueType = "MARKDOWN"` - `const ObjectDefinitionsResponseFieldDefinitionValueTypeMultiSelect ObjectDefinitionsResponseFieldDefinitionValueType = "MULTI_SELECT"` - `const ObjectDefinitionsResponseFieldDefinitionValueTypeNumber ObjectDefinitionsResponseFieldDefinitionValueType = "NUMBER"` - `const ObjectDefinitionsResponseFieldDefinitionValueTypeSingleSelect ObjectDefinitionsResponseFieldDefinitionValueType = "SINGLE_SELECT"` - `const ObjectDefinitionsResponseFieldDefinitionValueTypeSocialHandle ObjectDefinitionsResponseFieldDefinitionValueType = "SOCIAL_HANDLE"` - `const ObjectDefinitionsResponseFieldDefinitionValueTypeTelephone ObjectDefinitionsResponseFieldDefinitionValueType = "TELEPHONE"` - `const ObjectDefinitionsResponseFieldDefinitionValueTypeText ObjectDefinitionsResponseFieldDefinitionValueType = "TEXT"` - `const ObjectDefinitionsResponseFieldDefinitionValueTypeURL ObjectDefinitionsResponseFieldDefinitionValueType = "URL"` - `const ObjectDefinitionsResponseFieldDefinitionValueTypeHTML ObjectDefinitionsResponseFieldDefinitionValueType = "HTML"` - `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, ObjectDefinitionsResponseRelationshipDefinition]` Map of relationship keys to their definitions. - `Cardinality string` Whether this is a `has_one` or `has_many` relationship. - `const ObjectDefinitionsResponseRelationshipDefinitionCardinalityHasOne ObjectDefinitionsResponseRelationshipDefinitionCardinality = "HAS_ONE"` - `const ObjectDefinitionsResponseRelationshipDefinitionCardinalityHasMany ObjectDefinitionsResponseRelationshipDefinitionCardinality = "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. ### Object List Definitions Response - `type ObjectListDefinitionsResponse struct{…}` - `Data []ObjectListDefinitionsResponseData` All object types available to the caller. - `Label string` Human-readable display name. - `ObjectType string` The slug used to reference this object type in the API. ### Object List Response - `type ObjectListResponse struct{…}` - `Data []ObjectListResponseData` 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, ObjectListResponseDataField]` Map of field names to their typed values. System fields are prefixed with `$` (e.g. `$name`, `$email`); custom attributes use their bare slug. - `Value ObjectListResponseDataFieldValueUnion` The field value, or null if unset. - `string` - `float64` - `bool` - `type ObjectListResponseDataFieldValueArray []string` - `type ObjectListResponseDataFieldValueAddress struct{…}` - `City string` City name. - `Country string` 2-letter ISO 3166-1 alpha-2 country code. - `Latitude float64` Latitude coordinate. - `Longitude float64` Longitude coordinate. - `PostalCode string` Postal or ZIP code. - `State string` State or province. - `Street string` Street address line 1. - `Street2 string` Street address line 2. - `type ObjectListResponseDataFieldValueFullName struct{…}` - `FirstName string` The contact's first name. - `LastName string` The contact's last name. - `ValueType string` The data type of the field. - `const ObjectListResponseDataFieldValueTypeAddress ObjectListResponseDataFieldValueType = "ADDRESS"` - `const ObjectListResponseDataFieldValueTypeCheckbox ObjectListResponseDataFieldValueType = "CHECKBOX"` - `const ObjectListResponseDataFieldValueTypeCurrency ObjectListResponseDataFieldValueType = "CURRENCY"` - `const ObjectListResponseDataFieldValueTypeDatetime ObjectListResponseDataFieldValueType = "DATETIME"` - `const ObjectListResponseDataFieldValueTypeEmail ObjectListResponseDataFieldValueType = "EMAIL"` - `const ObjectListResponseDataFieldValueTypeFullName ObjectListResponseDataFieldValueType = "FULL_NAME"` - `const ObjectListResponseDataFieldValueTypeMarkdown ObjectListResponseDataFieldValueType = "MARKDOWN"` - `const ObjectListResponseDataFieldValueTypeMultiSelect ObjectListResponseDataFieldValueType = "MULTI_SELECT"` - `const ObjectListResponseDataFieldValueTypeNumber ObjectListResponseDataFieldValueType = "NUMBER"` - `const ObjectListResponseDataFieldValueTypeSingleSelect ObjectListResponseDataFieldValueType = "SINGLE_SELECT"` - `const ObjectListResponseDataFieldValueTypeSocialHandle ObjectListResponseDataFieldValueType = "SOCIAL_HANDLE"` - `const ObjectListResponseDataFieldValueTypeTelephone ObjectListResponseDataFieldValueType = "TELEPHONE"` - `const ObjectListResponseDataFieldValueTypeText ObjectListResponseDataFieldValueType = "TEXT"` - `const ObjectListResponseDataFieldValueTypeURL ObjectListResponseDataFieldValueType = "URL"` - `const ObjectListResponseDataFieldValueTypeHTML ObjectListResponseDataFieldValueType = "HTML"` - `HTTPLink string` URL to view the entity in the Lightfield web app, or null. - `Relationships map[string, ObjectListResponseDataRelationship]` 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 string` 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. ### Object Retrieve Response - `type ObjectRetrieveResponse struct{…}` - `ID string` Unique identifier for the entity. - `CreatedAt string` ISO 8601 timestamp of when the entity was created. - `Fields map[string, ObjectRetrieveResponseField]` Map of field names to their typed values. System fields are prefixed with `$` (e.g. `$name`, `$email`); custom attributes use their bare slug. - `Value ObjectRetrieveResponseFieldValueUnion` The field value, or null if unset. - `string` - `float64` - `bool` - `type ObjectRetrieveResponseFieldValueArray []string` - `type ObjectRetrieveResponseFieldValueAddress struct{…}` - `City string` City name. - `Country string` 2-letter ISO 3166-1 alpha-2 country code. - `Latitude float64` Latitude coordinate. - `Longitude float64` Longitude coordinate. - `PostalCode string` Postal or ZIP code. - `State string` State or province. - `Street string` Street address line 1. - `Street2 string` Street address line 2. - `type ObjectRetrieveResponseFieldValueFullName struct{…}` - `FirstName string` The contact's first name. - `LastName string` The contact's last name. - `ValueType string` The data type of the field. - `const ObjectRetrieveResponseFieldValueTypeAddress ObjectRetrieveResponseFieldValueType = "ADDRESS"` - `const ObjectRetrieveResponseFieldValueTypeCheckbox ObjectRetrieveResponseFieldValueType = "CHECKBOX"` - `const ObjectRetrieveResponseFieldValueTypeCurrency ObjectRetrieveResponseFieldValueType = "CURRENCY"` - `const ObjectRetrieveResponseFieldValueTypeDatetime ObjectRetrieveResponseFieldValueType = "DATETIME"` - `const ObjectRetrieveResponseFieldValueTypeEmail ObjectRetrieveResponseFieldValueType = "EMAIL"` - `const ObjectRetrieveResponseFieldValueTypeFullName ObjectRetrieveResponseFieldValueType = "FULL_NAME"` - `const ObjectRetrieveResponseFieldValueTypeMarkdown ObjectRetrieveResponseFieldValueType = "MARKDOWN"` - `const ObjectRetrieveResponseFieldValueTypeMultiSelect ObjectRetrieveResponseFieldValueType = "MULTI_SELECT"` - `const ObjectRetrieveResponseFieldValueTypeNumber ObjectRetrieveResponseFieldValueType = "NUMBER"` - `const ObjectRetrieveResponseFieldValueTypeSingleSelect ObjectRetrieveResponseFieldValueType = "SINGLE_SELECT"` - `const ObjectRetrieveResponseFieldValueTypeSocialHandle ObjectRetrieveResponseFieldValueType = "SOCIAL_HANDLE"` - `const ObjectRetrieveResponseFieldValueTypeTelephone ObjectRetrieveResponseFieldValueType = "TELEPHONE"` - `const ObjectRetrieveResponseFieldValueTypeText ObjectRetrieveResponseFieldValueType = "TEXT"` - `const ObjectRetrieveResponseFieldValueTypeURL ObjectRetrieveResponseFieldValueType = "URL"` - `const ObjectRetrieveResponseFieldValueTypeHTML ObjectRetrieveResponseFieldValueType = "HTML"` - `HTTPLink string` URL to view the entity in the Lightfield web app, or null. - `Relationships map[string, ObjectRetrieveResponseRelationship]` 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 string` External identifier for the entity, or null if unset. ### Object Update Response - `type ObjectUpdateResponse struct{…}` - `ID string` Unique identifier for the entity. - `CreatedAt string` ISO 8601 timestamp of when the entity was created. - `Fields map[string, ObjectUpdateResponseField]` Map of field names to their typed values. System fields are prefixed with `$` (e.g. `$name`, `$email`); custom attributes use their bare slug. - `Value ObjectUpdateResponseFieldValueUnion` The field value, or null if unset. - `string` - `float64` - `bool` - `type ObjectUpdateResponseFieldValueArray []string` - `type ObjectUpdateResponseFieldValueAddress struct{…}` - `City string` City name. - `Country string` 2-letter ISO 3166-1 alpha-2 country code. - `Latitude float64` Latitude coordinate. - `Longitude float64` Longitude coordinate. - `PostalCode string` Postal or ZIP code. - `State string` State or province. - `Street string` Street address line 1. - `Street2 string` Street address line 2. - `type ObjectUpdateResponseFieldValueFullName struct{…}` - `FirstName string` The contact's first name. - `LastName string` The contact's last name. - `ValueType string` The data type of the field. - `const ObjectUpdateResponseFieldValueTypeAddress ObjectUpdateResponseFieldValueType = "ADDRESS"` - `const ObjectUpdateResponseFieldValueTypeCheckbox ObjectUpdateResponseFieldValueType = "CHECKBOX"` - `const ObjectUpdateResponseFieldValueTypeCurrency ObjectUpdateResponseFieldValueType = "CURRENCY"` - `const ObjectUpdateResponseFieldValueTypeDatetime ObjectUpdateResponseFieldValueType = "DATETIME"` - `const ObjectUpdateResponseFieldValueTypeEmail ObjectUpdateResponseFieldValueType = "EMAIL"` - `const ObjectUpdateResponseFieldValueTypeFullName ObjectUpdateResponseFieldValueType = "FULL_NAME"` - `const ObjectUpdateResponseFieldValueTypeMarkdown ObjectUpdateResponseFieldValueType = "MARKDOWN"` - `const ObjectUpdateResponseFieldValueTypeMultiSelect ObjectUpdateResponseFieldValueType = "MULTI_SELECT"` - `const ObjectUpdateResponseFieldValueTypeNumber ObjectUpdateResponseFieldValueType = "NUMBER"` - `const ObjectUpdateResponseFieldValueTypeSingleSelect ObjectUpdateResponseFieldValueType = "SINGLE_SELECT"` - `const ObjectUpdateResponseFieldValueTypeSocialHandle ObjectUpdateResponseFieldValueType = "SOCIAL_HANDLE"` - `const ObjectUpdateResponseFieldValueTypeTelephone ObjectUpdateResponseFieldValueType = "TELEPHONE"` - `const ObjectUpdateResponseFieldValueTypeText ObjectUpdateResponseFieldValueType = "TEXT"` - `const ObjectUpdateResponseFieldValueTypeURL ObjectUpdateResponseFieldValueType = "URL"` - `const ObjectUpdateResponseFieldValueTypeHTML ObjectUpdateResponseFieldValueType = "HTML"` - `HTTPLink string` URL to view the entity in the Lightfield web app, or null. - `Relationships map[string, ObjectUpdateResponseRelationship]` 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 string` External identifier for the entity, or null if unset.