# defineCustomObject

> API reference for defineCustomObject: parameters, properties, and return types.

Defines a custom object with typed field references, input parsers, and record operations. Pass the definition to `defineManifest` directly or through a component that references it. Add a list view with `defineListView` when deploying a new object through Metadata.

```ts
import { defineCustomObject } from '@rippling/rippling-sdk';
```

## Properties

| Property | Required | Type | Description |
| --- | --- | --- | --- |
| `apiName` | Required | `` `${string}__c` `` | Stable object API name, including the required `__c` suffix, such as `ticket__c`. |
| `description` | Required | `string` | Human-readable description of what this object represents. |
| `name` | Required | `string` | Singular display name shown in the Rippling UI, such as `Ticket`. |
| `category` | Optional | `[CategoryInput](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/CategoryInput-0433b5b9)<C>` | Category definition or full category API name ending in `__c`. When omitted, defines `<object-name>_category__c` using this object's name and description. |
| `defaultFieldSectionApiName` | Optional | `null \| string` | Full API name of the default field section, preserved when authoring fields separately. |
| `defaultFieldSectionName` | Optional | `null \| string` | Display name of the default field section, preserved when authoring fields separately. |
| `enableHistory` | Optional | `boolean` | Optional desired history-tracking state observed during metadata reconciliation. |
| `fields` | Optional | `[FieldDefinitions](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/defineCustomObject-fields-be3957b0)` | Custom-field definitions keyed by full API names ending in `__c`. The returned object's `fields` map preserves these keys for typed references. Omit this map when defining fields separately with `defineField`. |
| `friendlyName` | Optional | `null \| string` | SQL table name used for this object in the data catalog. |
| `icon` | Optional | `{ readonly emoji?: string \| null; readonly ripplingIcon?: string \| null; readonly s3Bucket?: string; readonly s3Key?: string; }` | Emoji, built-in Rippling icon, or S3 image displayed beside the object's name. |
| `nameField` | Optional | `[NameFieldDefinition](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/NameFieldDefinition-d9318e80)` | Name-field definition; omitted definitions use a text name field. |
| `nameFieldDetails` | Optional | `null \| { is_autonumber_field: boolean; autonumber_format: string; starting_number?: number \| undefined; }` | Auto-number settings for the name field, including format and starting number. |
| `ownerRole` | Optional | `string` | Optional owning role id applied during REST provisioning / reconciliation. |
| `pluralLabel` | Optional | `null \| string` | Plural display label used in the Rippling UI. |
| `pluralName` | Optional | `string` | Plural display label; takes precedence over `pluralLabel` when supplied. |
| `sections` | Optional | `[SectionDefinitions](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/defineCustomObject-sections-02b44cad)` | Field sections keyed by API names ending in `__c`; any explicit `sectionId` also needs `__c`. |
| `transformationApiName` | Optional | `null \| string` | API name of the transformation whose output is this object. |

[Complete options type](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/DefineCustomObjectProps-fc0996eb)

TypeScript signature

```ts
defineCustomObject<const A extends `${string}__c`, const F extends FieldDefinitions = {}, C extends string = `${Unsuffixed<A>}_category`, S extends SectionDefinitions = {}, N extends NameFieldDefinition = { kind: "text"; }>(props: DefineCustomObjectProps<A, F, C, S, N>): DefinedCustomObject<CustomObjectDefinition<LogicalCustomObjectName<Unsuffixed<A>>, LogicalCategoryName<C>, S, F, N>>;
```

## Returns

The object definition with typed `fields`, `inputs`, `records`, and `schema` helpers.

`[DefinedCustomObject](https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/types/DefinedCustomObject-ebb8f612)` 

Exact return type

```
DefinedCustomObject<CustomObjectDefinition<LogicalCustomObjectName<Unsuffixed<A>>, LogicalCategoryName<C>, S, F, N>>
```

## Availability

| Capability | Support |
| --- | --- |
| Pull into a project | Supported |
| Runtime operations | Available with an authenticated SDK client |

Source: https://developer.rippling.com/documentation/js-sdk/metadata-sdk/reference/defineCustomObject

> For the complete documentation index, see [llms.txt](https://developer.rippling.com/llms.txt). Public pages have a Markdown version at the same URL with .md added.
