[**Documentation**](../../../README)

***

[Documentation](../../../README) / [zerotal](../../README) / [orm](../README) / InsertPayload

# Type Alias: InsertPayload\<T\>

> **InsertPayload**\<`T`\> = `Omit`\<`Pick`\<`T`, `ColumnKeys`\<`T`\>\>, `AutoManagedKeys`\>

Defined in: [packages/orm/src/model/payload.ts:93](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/orm/src/model/payload.ts#L93)

Data shape required to create a new model record.

- Retains all writable column properties, including Carbon dates and JSON
  columns, while stripping relations, methods, computed getters, and the
  ORM-managed fields (id, createdAt, updatedAt, deletedAt).
- Preserves required (`name!: string`) vs optional (`role?: string`)
  exactly as declared on the model — no manual DTO needed.

## Type Parameters

### T

`T`

## Example

```ts
// In a controller:
const user = await User.create(await ctx.body<InsertPayload<User>>());

// Alias pattern (recommended — keeps controllers clean):
export type NewUser = InsertPayload<User>;
const user = await User.create({ name: "Alice", email: "alice@example.com", password: "…" });
```
