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

# Object Types

> Define the entities that matter to your organization with typed properties and validation rules.

An object type is a schema that describes a category of real-world entity — a company, a deal, a person, a product. It defines what properties each instance will have, what types those properties are, and which constraints apply.

## Creating an Object Type

<Steps>
  <Step title="Open the editor">
    From the [Ontology Builder](/docs/ontology/ontology-builder), click **New Object Type** in the top-right corner, or double-click anywhere on the canvas.
  </Step>

  <Step title="Set the basics">
    Enter a **Name** for the object type (e.g., "Deal", "Client", "Candidate"). Optionally add a **Description** explaining what this type represents and an **Icon URL** for visual identification.
  </Step>

  <Step title="Add properties">
    Define the properties (fields) for this object type. Each property needs a name and type. You can add constraints like required, default values, and min/max limits.
  </Step>

  <Step title="Set the title property">
    Select one of the required text properties as the **Title Property**. This is the display name shown in search results, tabs, and mentions.
  </Step>

  <Step title="Save">
    Click **Save** (or **Create** for new types). The object type is immediately available for agents and the Ontology Builder graph.
  </Step>
</Steps>

## Templates

To get started quickly, Athena provides built-in templates for common entity types. Click any template to pre-populate the property list with a sensible starting schema.

<CardGroup cols={3}>
  <Card title="Person" icon="user">
    Contact or individual. Properties: first name, last name, email, phone, title, company, LinkedIn URL, status.
  </Card>

  <Card title="Company" icon="building">
    Organization or business. Properties: name, legal name, domain, industry, founded year, employee count, revenue, type.
  </Card>

  <Card title="Deal" icon="handshake">
    Sales opportunity. Properties: deal name, account, contact, value, probability, close date, owner, pipeline stage.
  </Card>

  <Card title="Client" icon="briefcase">
    Client account. Properties: company name, primary contact, industry, website, revenue, employee count, tier.
  </Card>

  <Card title="Recruit" icon="user-plus">
    Hiring candidate. Properties: full name, email, position applied, years experience, expected salary, pipeline stage.
  </Card>

  <Card title="Place" icon="map-pin">
    Physical location. Properties: name, address, city, state, postal code, country, coordinates, location type.
  </Card>
</CardGroup>

Templates are a starting point — you can add, remove, or modify any property after loading a template.

## Property Types

Every property has a type that determines what values it can hold and how it's validated.

<Tabs>
  <Tab title="Text">
    Free-form string values. Use for names, emails, URLs, descriptions, and notes.

    **Optional constraints:**

    * **Min Length** / **Max Length** — restrict the character count
    * **Pattern** — a regular expression the value must match (e.g., email format)

    ```
    firm_name: Text (required)
    email: Text
    notes: Text (max length: 2000)
    ```
  </Tab>

  <Tab title="Number">
    Decimal numeric values. Use for revenue, prices, coordinates, percentages.

    **Optional constraints:**

    * **Minimum** / **Maximum** — restrict the value range

    ```
    annual_revenue: Number (min: 0)
    latitude: Number (min: -90, max: 90)
    deal_value: Number (min: 0)
    ```
  </Tab>

  <Tab title="Integer">
    Whole number values. Use for counts, years, quantities.

    **Optional constraints:**

    * **Minimum** / **Maximum** — restrict the value range

    ```
    employee_count: Integer (min: 1)
    founded_year: Integer (min: 1800, max: 2030)
    quantity: Integer (min: 0)
    ```
  </Tab>

  <Tab title="Boolean">
    True or false values. Use for flags and binary states.

    ```
    is_active: Boolean
    is_verified: Boolean
    ```
  </Tab>

  <Tab title="Date">
    Calendar date values. Use for deadlines, start dates, timestamps.

    ```
    close_date: Date
    contract_start: Date
    date_of_birth: Date
    ```
  </Tab>

  <Tab title="Enum">
    A fixed set of allowed values. Use for statuses, categories, tiers, and pipeline stages.

    **Configuration:**

    * **Enum Values** — the list of allowed options
    * **Default Value** — the initial value for new instances

    ```
    stage: Enum [prospecting, qualification, proposal, negotiation, closed_won, closed_lost]
    tier: Enum [enterprise, mid_market, smb, startup] (default: mid_market)
    ```
  </Tab>
</Tabs>

## Title Property

Every object type must have a **title property** — a required text property that serves as the display name for each instance. The title property is shown:

* In **search results** when querying ontology data
* In **tab headers** when viewing an instance in Spaces
* In **mentions** when referencing an instance in conversations
* In **relationship displays** when showing linked objects

<Note>Only properties that are both **required** and **text type** are eligible to be the title property. If you don't have one yet, create a required text property first.</Note>

## Property Builder

The property builder provides a drag-and-drop interface for defining and ordering properties:

* **Reorder** properties by dragging the handle on the left
* **Expand** any property to configure its type, description, constraints, and required/default settings
* **Delete** a property by clicking the remove icon
* **Add** new properties with the "Add Property" button at the bottom

Properties are automatically synced to a JSON Schema representation, visible in the right panel of the editor. You can also edit the JSON Schema directly — changes are reflected back in the property builder.

## JSON Schema

Under the hood, each object type's properties are stored as a [JSON Schema](https://json-schema.org/). The editor's right panel shows a live preview of the generated schema:

```json theme={null}
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "title": "Deal",
  "properties": {
    "deal_name": {
      "type": "string",
      "description": "Deal or opportunity name"
    },
    "deal_value": {
      "type": "number",
      "description": "Total deal value in USD",
      "minimum": 0
    },
    "stage": {
      "type": "string",
      "enum": ["prospecting", "qualification", "proposal", "negotiation", "closed_won", "closed_lost"],
      "description": "Pipeline stage"
    }
  },
  "required": ["deal_name", "stage"]
}
```

You can switch between the visual property builder and the raw JSON editor at any time. Edits in one are reflected in the other.

### Importing a Schema

If you already have a JSON Schema from another tool or specification, click the **Import JSON Schema** button in the template bar. Paste your schema and click **Import** — the properties will be populated automatically. This is useful for bootstrapping object types from existing data models.

## Editing and Deleting

* To **edit** an existing object type, click on its node in the Ontology Builder graph, or double-click it to open the editor directly.
* To **delete** an object type, use the delete action from the node's context menu. Deleting an object type also permanently deletes all its instances and any relationships that reference it.

<Warning>Deleting an object type is permanent. All instances and connected relationships will be removed and cannot be recovered.</Warning>
