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

# Companies

> Every company created in the export window.

## What it is

The **Companies** dataset is one row per company created in your space within the window. It's the simplest dataset — one table, **no joins**.

* **Grain:** one row per company (`id`).
* **Windowed on:** `created_at` (UTC timestamp) — the company's creation time.
* **Path segment:** `companies`.

A company's identity within a space is its numeric **`id`**. A company may carry a **`domain`**, an **`external_id`** (your own company identifier), or both — whichever identifiers were used to match events to it. `domain` is `null` for a company created from an external ID alone, with no associated email domain. The `id` is also locked because it's what the [Contacts](https://docs.cometly.com/data-warehouse/datasets/contacts.md) dataset's `primary_company_id` references — it's the key for joining the two exports in your warehouse.

Which identifier a company carries depends on your Space's company identity mode (Space Settings → Additional Setup → Company Tracking): in the default **Auto** mode, companies are grouped by email domain, so rows carry `domain`; in **External ID** mode, companies are grouped by your own `company_external_id` alone, so rows carry `external_id`. A company carries both only if you explicitly set both — for example via [Update Company](https://docs.cometly.com/api-reference/endpoint/update-company.md), or by switching identity modes over the company's lifetime.

> [!NOTE]
>
> Like [Contacts](https://docs.cometly.com/data-warehouse/datasets/contacts.md), companies are mutable. Each run carries a
> company's state **as of run time**, but a company created *before* the window is not re-exported
> when it later changes. For a full refresh, run a one-time export over all history.

> [!NOTE]
>
> A company that later gains an `external_id` (or a domain) is not re-exported by an incremental run —
> incremental runs are windowed on `created_at`, not on when the company last changed. Run a one-time
> export over all history to pick up identifiers assigned after a company's creation window. In
> particular, if you **enable External ID mode on an existing Space**, run a one-time export over all
> history so that companies which gain an `external_id` after their original creation window are
> picked up.

## Columns

### Company fields

| Column | Status | Description |
| - | - | - |
| `id` | Locked | Company ID — the join key referenced by the Contacts dataset's `primary_company_id`. |
| `created_at` | Locked | When the company was created (UTC). |
| `domain` | Optional (nullable) | The company's email domain, if it has one. `null` for a company identified only by `external_id`. |
| `external_id` | Optional (nullable) | The customer's own identifier for this company, if one was supplied. |
| `name` | Optional | Display name. For a company created from an external ID alone, this defaults to the supplied company name, falling back to the external ID itself. |
| `updated_at` | Optional | When the company was last updated (UTC). |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.