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

# Data Model

> Understand the shared entity model that links records across Office, Sales, Careers, Project, and Guard.

Essal's six apps share a common data model that allows records from different apps to reference and relate to each other. Understanding this model helps you design integrations that move data naturally across the platform.

## Core Entity Types

Every entity in Essal has a universally unique ID with a type prefix:

| Prefix  | Entity              | App     |
| ------- | ------------------- | ------- |
| `doc_`  | Document            | Office  |
| `sht_`  | Sheet               | Office  |
| `fil_`  | File                | Office  |
| `usr_`  | User                | Access  |
| `grp_`  | Group               | Access  |
| `cnt_`  | Contact             | Sales   |
| `deal_` | Deal                | Sales   |
| `pip_`  | Pipeline            | Sales   |
| `job_`  | Job Posting         | Careers |
| `app_`  | Application         | Careers |
| `proj_` | Project             | Project |
| `task_` | Task                | Project |
| `pol_`  | Policy              | Guard   |
| `evt_`  | Event / Audit Entry | Guard   |

## Linked Resources

Any entity can carry a `linked_resources` array that holds typed references to related entities in other apps:

```json theme={null}
{
  "id": "proj_01HXYZ9876",
  "name": "Website Relaunch",
  "linked_resources": [
    { "type": "sales.deal", "id": "deal_01HXYZ5432", "label": "Acme Corp - Web Retainer" },
    { "type": "office.document", "id": "doc_01HXYZ1111", "label": "Project Brief" }
  ]
}
```

## Ownership and Attribution

All entities carry a standard set of ownership fields:

```json theme={null}
{
  "created_by": "usr_01HXYZ1234",
  "updated_by": "usr_01HXYZ5678",
  "created_at": "2026-05-01T09:00:00Z",
  "updated_at": "2026-06-20T11:30:00Z",
  "workspace_id": "ws_01HXYZABC"
}
```

## Soft Deletion

Essal uses soft deletion by default. Deleted entities are marked `"status": "deleted"` and excluded from list responses unless you pass `?include_deleted=true`. Hard deletion is available for data retention compliance and is irreversible.

<Warning>
  Hard deletion cannot be undone and will cascade to all `linked_resources` references pointing to the deleted entity. Guard audit logs for the entity are preserved regardless.
</Warning>

## Custom Fields

All entity types support custom fields, allowing you to extend the data model without schema changes. Custom fields are defined per workspace and are accessible in the API via the `custom_fields` object on any entity response.

```json theme={null}
{
  "id": "cnt_01HXYZ9999",
  "display_name": "John Smith",
  "custom_fields": {
    "account_tier": "enterprise",
    "region": "EMEA"
  }
}
```
