---
title: "Timeentry data model"
url: "https://docs.unified.to/legal/timeentry/model"
description: "The Timeentry data model object in Unified's Timeentry API: 18 fields, including created_at, updated_at and matter_id, with types and enum values."
---
# Timeentry data model

 View field support, webhooks, and list parameters for each integration on the [Supported Integrations](https://docs.unified.to/legal/integrations.md) page. 

| Field                    | Type                                                                                | Required | Description                                                                                                                       |
| ------------------------ | ----------------------------------------------------------------------------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------- |
| id                       | string                                                                              | No       |                                                                                                                                   |
| created\_at              | string (date-time)                                                                  | No       | (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)                                                                                          |
| updated\_at              | string (date-time)                                                                  | No       | (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)                                                                                          |
| matter\_id               | string                                                                              | No       | pointer to the Legal Matter this time is recorded against                                                                         |
| user\_id                 | string                                                                              | No       | HR Employee who is the timekeeper (reference to HrisEmployee)                                                                     |
| description              | string                                                                              | No       |                                                                                                                                   |
| worked\_at               | string (date-time)                                                                  | No       | date the work was performed (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)                                                              |
| minutes                  | number                                                                              | No       | duration worked, in minutes                                                                                                       |
| billable\_minutes        | number                                                                              | No       | billable duration after rounding, in minutes                                                                                      |
| rate\_amount             | number                                                                              | No       | hourly rate, or the flat amount for flat-rate entries                                                                             |
| total\_amount            | number                                                                              | No       |                                                                                                                                   |
| currency                 | string                                                                              | No       |                                                                                                                                   |
| is\_billable             | boolean                                                                             | No       |                                                                                                                                   |
| is\_billed               | boolean                                                                             | No       |                                                                                                                                   |
| invoice\_id              | string                                                                              | No       | pointer to the Accounting Invoice this time was billed on (reference to AccountingInvoice)                                        |
| activity\_code           | string                                                                              | No       | UTBMS/LEDES activity code                                                                                                         |
| task\_code               | string                                                                              | No       | UTBMS/LEDES task code                                                                                                             |
| metadata                 | [LegalMetadata](https://docs.unified.to/legal/timeentry/model.md#LegalMetadata)\[\] | No       | custom field values                                                                                                               |
| metadata\[\].id          | string                                                                              | No       |                                                                                                                                   |
| metadata\[\].slug        | string                                                                              | No       |                                                                                                                                   |
| metadata\[\].value       | object                                                                              | No       |                                                                                                                                   |
| metadata\[\].namespace   | string                                                                              | No       |                                                                                                                                   |
| metadata\[\].format      | enum                                                                                | No       | Values: TEXT, NUMBER, DATE, BOOLEAN, FILE, TEXTAREA, SINGLE\_SELECT, MULTIPLE\_SELECT, MEASUREMENT, PRICE, YES\_NO, CURRENCY, URL |
| metadata\[\].extra\_data | object                                                                              | No       |                                                                                                                                   |

## TypeScript

```typescript
export type LegalTimeentry = {
	id?: string;
	created_at?: string-time; // (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	updated_at?: string-time; // (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	matter_id?: string; // pointer to the Legal Matter this time is recorded against
	user_id?: string; // HR Employee who is the timekeeper (reference to HrisEmployee)
	description?: string;
	worked_at?: string-time; // date the work was performed (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
	minutes?: number; // duration worked, in minutes
	billable_minutes?: number; // billable duration after rounding, in minutes
	rate_amount?: number; // hourly rate, or the flat amount for flat-rate entries
	total_amount?: number;
	currency?: string;
	is_billable?: boolean;
	is_billed?: boolean;
	invoice_id?: string; // pointer to the Accounting Invoice this time was billed on (reference to AccountingInvoice)
	activity_code?: string; // UTBMS/LEDES activity code
	task_code?: string; // UTBMS/LEDES task code
	metadata?: []; // custom field values
	raw?: any;
} 
```

## Zod

```typescript
import { z } from 'zod';

export const ZodLegalTimeentry = z.object({
	id: z.string().optional(),
	created_at: z.string-time().optional().describe("(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	updated_at: z.string-time().optional().describe("(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	matter_id: z.string().optional().describe("pointer to the Legal Matter this time is recorded against"),
	user_id: z.string().optional().describe("HR Employee who is the timekeeper (reference to HrisEmployee)"),
	description: z.string().optional(),
	worked_at: z.string-time().optional().describe("date the work was performed (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"),
	minutes: z.number().optional().describe("duration worked, in minutes"),
	billable_minutes: z.number().optional().describe("billable duration after rounding, in minutes"),
	rate_amount: z.number().optional().describe("hourly rate, or the flat amount for flat-rate entries"),
	total_amount: z.number().optional(),
	currency: z.string().optional(),
	is_billable: z.boolean().optional(),
	is_billed: z.boolean().optional(),
	invoice_id: z.string().optional().describe("pointer to the Accounting Invoice this time was billed on (reference to AccountingInvoice)"),
	activity_code: z.string().optional().describe("UTBMS/LEDES activity code"),
	task_code: z.string().optional().describe("UTBMS/LEDES task code"),
	metadata: z.array().optional().describe("custom field values"),

});
```

## Python

```python
import dataclasses

@dataclasses.dataclass
class LegalTimeentry:
	id: Optional[str]
	"""(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	created_at: Optional[str]
	"""(ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	updated_at: Optional[str]
	"""pointer to the Legal Matter this time is recorded against"""
	matter_id: Optional[str]
	"""HR Employee who is the timekeeper (reference to HrisEmployee)"""
	user_id: Optional[str]
	description: Optional[str]
	"""date the work was performed (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)"""
	worked_at: Optional[str]
	"""duration worked, in minutes"""
	minutes: Optional[int]
	"""billable duration after rounding, in minutes"""
	billable_minutes: Optional[int]
	"""hourly rate, or the flat amount for flat-rate entries"""
	rate_amount: Optional[int]
	total_amount: Optional[int]
	currency: Optional[str]
	is_billable: Optional[bool]
	is_billed: Optional[bool]
	"""pointer to the Accounting Invoice this time was billed on (reference to AccountingInvoice)"""
	invoice_id: Optional[str]
	"""UTBMS/LEDES activity code"""
	activity_code: Optional[str]
	"""UTBMS/LEDES task code"""
	task_code: Optional[str]
	"""custom field values"""
	metadata: Optional[PropertyLegalTimeentryMetadata]

```
