> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fieldiu.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Models

> Request and response model reference for the FieldIU API

This page documents all request body models used across the FieldIU API.

***

## AccountRequest

Used by [POST /api/v1/accounts](/developer-guide/accounts#create-account).

| Field                 | Type              | Description               |
| --------------------- | ----------------- | ------------------------- |
| `name`                | `string \| null`  | Account display name      |
| `email`               | `string \| null`  | Email address             |
| `accountType`         | `integer \| null` | Account type code         |
| `legalName`           | `string \| null`  | Legal registered name     |
| `defaultPaymentTerms` | `integer \| null` | Payment terms code        |
| `trnNumber`           | `string \| null`  | Tax registration number   |
| `licenseNumber`       | `string \| null`  | Business license number   |
| `businessPhone`       | `string \| null`  | Business phone number     |
| `buildingLocation`    | `string \| null`  | Building or location name |
| `street1`             | `string \| null`  | Street address line 1     |
| `street2`             | `string \| null`  | Street address line 2     |
| `city`                | `string \| null`  | City                      |
| `postalCode`          | `string \| null`  | Postal / ZIP code         |
| `state`               | `string \| null`  | State or province         |
| `country`             | `string \| null`  | Country                   |

***

## ContactRequest

Used by [POST /api/v1/contacts](/developer-guide/contacts#create-contact).

| Field              | Type             | Description               |
| ------------------ | ---------------- | ------------------------- |
| `firstName`        | `string \| null` | First name                |
| `lastName`         | `string \| null` | Last name                 |
| `email`            | `string \| null` | Email address             |
| `mobilePhone`      | `string \| null` | Mobile phone number       |
| `businessPhone`    | `string \| null` | Business phone number     |
| `accountId`        | `string \| null` | ID of the linked account  |
| `buildingLocation` | `string \| null` | Building or location name |
| `street1`          | `string \| null` | Street address line 1     |
| `street2`          | `string \| null` | Street address line 2     |
| `city`             | `string \| null` | City                      |
| `postalCode`       | `string \| null` | Postal / ZIP code         |
| `state`            | `string \| null` | State or province         |
| `country`          | `string \| null` | Country                   |

***

## LeadRequest

Used by [POST /api/v1/leads](/developer-guide/leads#create-lead).

| Field                | Type              | Description                     |
| -------------------- | ----------------- | ------------------------------- |
| `firstName`          | `string \| null`  | First name                      |
| `lastName`           | `string \| null`  | Last name                       |
| `title`              | `string \| null`  | Job title                       |
| `companyName`        | `string \| null`  | Company name                    |
| `email`              | `string \| null`  | Email address                   |
| `mobilePhone`        | `string \| null`  | Mobile phone number             |
| `businessPhone`      | `string \| null`  | Business phone number           |
| `leadSource`         | `integer \| null` | Lead source code                |
| `accountType`        | `integer \| null` | Account type code               |
| `rating`             | `integer \| null` | Lead quality rating code        |
| `estimatedValue`     | `number \| null`  | Estimated deal value (double)   |
| `estimatedCloseDate` | `string \| null`  | Estimated close date (ISO 8601) |
| `buildingLocation`   | `string \| null`  | Building or location name       |
| `street1`            | `string \| null`  | Street address line 1           |
| `street2`            | `string \| null`  | Street address line 2           |
| `city`               | `string \| null`  | City                            |
| `postalCode`         | `string \| null`  | Postal / ZIP code               |
| `state`              | `string \| null`  | State or province               |
| `country`            | `string \| null`  | Country                         |

***

## AIAskModel

Used by [POST /api/v1/ai-agent/ask](/developer-guide/ai-agent#ask-the-ai).

| Field    | Type            | Description                        |
| -------- | --------------- | ---------------------------------- |
| `query`  | `string`        | The natural language query to send |
| `chatId` | `string (uuid)` | Conversation thread identifier     |
| `userId` | `string (uuid)` | ID of the user sending the query   |

***

## WorkorderConfirmationRequest

Used by [POST /api/v1/ai-agent/confirm-workorder](/developer-guide/ai-agent#confirm-work-order).

| Field        | Type              | Description                              |
| ------------ | ----------------- | ---------------------------------------- |
| `wo_number`  | `string \| null`  | Work order number                        |
| `confirmed`  | `boolean \| null` | `true` to confirm, `false` to cancel     |
| `visit_date` | `string`          | Scheduled visit date and time (ISO 8601) |

***

## WorkorderBookingAvailableRequest

Used by [POST /api/v1/ai-agent/is-booking-available](/developer-guide/ai-agent#check-booking-availability).

| Field      | Type             | Description                       |
| ---------- | ---------------- | --------------------------------- |
| `dateTime` | `string \| null` | Date and time to check (ISO 8601) |

***

## WorkorderBookingAvailableExactDateRequest

Used by [POST /api/v1/ai-agent/available-appointments](/developer-guide/ai-agent#get-available-appointments).

| Field      | Type             | Description                                      |
| ---------- | ---------------- | ------------------------------------------------ |
| `dateTime` | `string \| null` | Starting date and time to search from (ISO 8601) |

***

## IncidentCreatingRequest

Used by [POST /api/v1/ai-agent/create-incident](/developer-guide/ai-agent#create-incident).

| Field        | Type             | Description                                                    |
| ------------ | ---------------- | -------------------------------------------------------------- |
| `clientName` | `string \| null` | Client name                                                    |
| `insectName` | `string \| null` | Pest or insect type                                            |
| `dateTime`   | `string`         | Incident date and time (ISO 8601, e.g. `2017-07-21T17:32:28Z`) |

***

## CreateQuoteRequestModel

Used by [POST /api/v1/ai-agent/create-quote-request](/developer-guide/ai-agent#create-quote-request).

| Field         | Type     | Description         |
| ------------- | -------- | ------------------- |
| `clientName`  | `string` | Client name         |
| `description` | `string` | Service description |

***

## GetWorkOrderDetailsModel

Used by [POST /api/v1/ai-agent/get-wo-details](/developer-guide/ai-agent#get-work-order-details).

| Field      | Type     | Description                  |
| ---------- | -------- | ---------------------------- |
| `woNumber` | `string` | Work order number to look up |

***

## Enum Types

These integer fields use CRM option set codes. Contact your FieldIU administrator for the full list of values specific to your organization.

| Model Field                   | Type                                       |
| ----------------------------- | ------------------------------------------ |
| `account.accountType`         | `NullableOfaccount_ha_accounttype`         |
| `account.defaultPaymentTerms` | `NullableOfaccount_ha_defaultpaymentterms` |
| `lead.accountType`            | `NullableOflead_ha_accounttype`            |
| `lead.rating`                 | `NullableOflead_leadqualitycode`           |
| `lead.leadSource`             | `NullableOflead_leadsourcecode`            |
