## Get definitions for a custom object type

`client.customObject.definitions(stringentitySlug, RequestOptionsoptions?): ObjectDefinitionsResponse`

**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

- `ObjectDefinitionsResponse`

  - `fieldDefinitions: Record<string, FieldDefinitions>`

    Map of field keys to their definitions, including both system and custom fields.

    - `description: string | null`

      Description of the field, or null.

    - `label: string`

      Human-readable display name of the field.

    - `typeConfiguration: TypeConfiguration`

      Type-specific configuration (e.g. select options, currency code).

      - `currency?: string`

        ISO 4217 3-letter currency code.

      - `handleService?: "TWITTER" | "LINKEDIN" | "FACEBOOK" | "INSTAGRAM"`

        Social platform associated with this handle field.

        - `"TWITTER"`

        - `"LINKEDIN"`

        - `"FACEBOOK"`

        - `"INSTAGRAM"`

      - `multipleValues?: boolean`

        Whether this field accepts multiple values.

      - `options?: Array<Option>`

        Available options for select fields.

        - `id: string`

          Unique identifier of the select option.

        - `label: string`

          Human-readable display name of the option.

        - `description?: string | null`

          Description of the option, or null.

      - `unique?: boolean`

        Whether values for this field must be unique.

    - `valueType: "ADDRESS" | "CHECKBOX" | "CURRENCY" | 12 more`

      Data type of the field.

      - `"ADDRESS"`

      - `"CHECKBOX"`

      - `"CURRENCY"`

      - `"DATETIME"`

      - `"EMAIL"`

      - `"FULL_NAME"`

      - `"MARKDOWN"`

      - `"MULTI_SELECT"`

      - `"NUMBER"`

      - `"SINGLE_SELECT"`

      - `"SOCIAL_HANDLE"`

      - `"TELEPHONE"`

      - `"TEXT"`

      - `"URL"`

      - `"HTML"`

    - `id?: string`

      Unique identifier of the field definition.

    - `readOnly?: boolean`

      `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: Record<string, RelationshipDefinitions>`

    Map of relationship keys to their definitions.

    - `cardinality: "HAS_ONE" | "HAS_MANY"`

      Whether this is a `has_one` or `has_many` relationship.

      - `"HAS_ONE"`

      - `"HAS_MANY"`

    - `description: string | null`

      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

```typescript
import Lightfield from 'lightfield';

const client = new Lightfield({
  apiKey: 'My API Key',
});

const response = await client.customObject.definitions('entitySlug');

console.log(response.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"
    }
  }
}
```
