---
agentTools:
  projectIndex: https://contractorscloud.readme.io/llms.txt
---

# Account

An account is a person or business for whom projects are completed for.

## Attributes

| Attribute                 | Type     | Description                                                   |
| ------------------------- | -------- | ------------------------------------------------------------- |
| `id`                      | Integer  | The unique id of the Account.                                 |
| `tenant_id`               | Integer  | The id of the Tenant the Account belongs to.                  |
| `rep_id`                  | Integer  | The id of the User that is assigned as the Account rep.       |
| `created_by`              | Integer  | The id of the User who created the account.                   |
| `type`                    | Integer  | The Account type. 0: Person, 1: Business                      |
| `name`                    | String   | The Account's name.                                           |
| `address_street`          | String   | The Account's street address.                                 |
| `address_city`            | String   | The city for the Account's address.                           |
| `address_state`           | String   | The state for the Account's address.                          |
| `address_zip`             | String   | The post code for the Account's address.                      |
| `address_latitude`        | Float    | The latitude for the Account's address.                       |
| `address_longitude`       | Float    | The longitude for the Account's address.                      |
| `shipping_address_street` | String   | The Account's shipping street address.                        |
| `shipping_address_city`   | String   | The city for the Account's shipping address.                  |
| `shipping_address_state`  | String   | The state for the Account's shipping address.                 |
| `shipping_address_zip`    | String   | The zip for the Account's shipping address.                   |
| `notes`                   | String   | Optional notes or a description for the Account.              |
| `is_portal_enabled`       | Boolean  | Determines if the customer portal is enabled for the Account. |
| `created_at`              | DateTime | The date time of when the Account was created.                |
| `updated_at`              | DateTime | The date time of when the Account was last updated.           |

## Allowed includes

| Relation  | Type   | Description                                           |
| --------- | ------ | ----------------------------------------------------- |
| `rep`     | User   | The User that is assigned as the primary Account rep. |
| `tenant`  | Tenant | The Tenant the Account belongs to.                    |
| `creator` | User   | The User who created the Account.                     |

## Allowed filters

| Name         | Type    | Description                                             |
| ------------ | ------- | ------------------------------------------------------- |
| `id`         | Integer | Filter Accounts by their id.                            |
| `rep_id`     | Integer | Filter Accounts by their rep.                           |
| `created_by` | Integer | Filter Accounts by the id of the User who created them. |
| `type`       | Integer | Filter Accounts by their type. 0: Person, 1: Business   |
| `name`       | String  | Filter Accounts by their name.                          |
| `search`     | String  | Filter Accounts by a specific search term.              |

## Allowed sorts

| Name                      | Description                                          |
| ------------------------- | ---------------------------------------------------- |
| `type`                    | Sort Accounts by their type. 0: Person, 1: Business  |
| `name`                    | Sort Accounts by their name.                         |
| `primary_first_name`      | Sort Accounts by their primary Contact's first name. |
| `primary_last_name`       | Sort Accounts by their primary Contact's last name.  |
| `address_street`          | Sort Accounts by their street address.               |
| `address_city`            | Sort Accounts by their city address.                 |
| `address_state`           | Sort Accounts by their state address.                |
| `address_zip`             | Sort Accounts by their zip address.                  |
| `shipping_address_street` | Sort Accounts by their shipping street address.      |
| `shipping_address_city`   | Sort Accounts by their shipping city address.        |
| `shipping_address_state`  | Sort Accounts by their shipping state address.       |
| `shipping_address_zip`    | Sort Accounts by their shipping zip address.         |
| `created_at`              | Sort Accounts by when they where created.            |
| `updated_at`              | Sort Accounts by when they where last updated.       |