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 for more details.
Required scope: accounts:read
Rate limit category: Read
Get account 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"),
)
accountDefinitionsResponse, err := client.Account.Definitions(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", accountDefinitionsResponse.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"
}
}
}