# Data dictionary

Every Data Export dataset and column, with types, keys, allowed values and privacy classes.

<!-- Generated by scripts/sync-data-dictionary.mjs. Do not edit by hand. -->

This page lists every dataset that [Data Export](/tenant-setup/data-export/) delivers. To download
the files and build current tables, see [Retrieve Data Export files](/reference/data-export-files/).
To try the data, use the [sample data explorer](/reference/sample-data-explorer/).

The **Type** cell gives three things:

- The logical type of the Parquet column. Timestamps are in UTC, to the microsecond.
- **nullable** if the column can be empty.
- The privacy class, for your own data governance: `identifier` (an opaque ID),
  `business`, `free_text` (text people typed) or `personal` (about a person). ToolboxFM exports
  every class.

## Shared columns

These columns identify and order changes to a record. The hourly QR page-view dataset uses
counts instead of changes; its differences are listed in [qr_page_views_hourly](#qr_page_views_hourly).

| Column | Type | Description |
| --- | --- | --- |
| `record_id` | string<br/>identifier | Stable merge key; opaque ID. |
| `event_id` | string<br/>identifier | Stable deduplication key. |
| `op` | string<br/>business | Row operation. Values: `insert`, `update`, `delete`. |
| `event_seq` | int64<br/>business | Counts the changes to this record from 1. Order changes per record by this value alone. |
| `occurred_at` | timestamp (UTC)<br/>business | When the change was made. Do not use it to order changes; use event_seq. |
| `schema_major` | int32<br/>business | 0 means draft, not a released major. |

## work_activities

One row per work activity change. Folder: `project=<project-id>/`. Key: `activity_id`. Status: draft, schema version 0, revision 1.

- IDs are opaque strings. record_id is the merge key; activity_id carries the same activity identity. User fields contain IDs, not names or email addresses.

Columns, after the [shared columns](#shared-columns):

| Column | Type | Description |
| --- | --- | --- |
| `project_id` | string<br/>identifier | Opaque project ID. References `projects.project_id`. |
| `activity_id` | string<br/>identifier | Opaque activity ID. |
| `subcontractor_id` | string<br/>nullable<br/>identifier | Opaque subcontractor ID. References `subcontractors.subcontractor_id`. |
| `title` | string<br/>free_text | Activity title entered by the organisation. |
| `level_area` | string<br/>nullable<br/>business | Activity level or area. |
| `elevations` | list of strings<br/>nullable<br/>business | Elevation selections; NULL differs from an empty list. |
| `hazards` | list of strings<br/>nullable<br/>business | Hazard codes; NULL in rows recorded before this field existed. Values: `asbestos`, `confined_spaces`, `demolition`, `silica_dust`, `electrical`, `excavation`, `fatigue`, `hazardous_chemicals`, `manual_tasks`, `noise`, `plant_machinery`, `scaffolding`, `precast_concrete`, `traffic_management`, `working_at_heights`, `concrete_pumping`. |
| `work_start_at` | timestamp (UTC)<br/>business | Planned window start, inclusive. |
| `work_end_at` | timestamp (UTC)<br/>business | Planned window end, exclusive. |
| `lifecycle` | string<br/>business | A paused activity still has lifecycle = active. Values: `scheduled`, `active`, `completed`, `cancelled`. |
| `paused` | boolean<br/>business | True while the activity is paused; false in rows recorded before this field existed. |
| `approval_status` | string<br/>business | Approval state. Values: `pending`, `approved`, `rejected`. |
| `completion_source` | string<br/>nullable<br/>business | NULL until completed. Values: `manual`, `auto_end`, `auto_timeout`, `auto_overrun`, `auto_missed`, `approved_retroactive`. |
| `signage_required` | boolean<br/>business | Whether signage is required. |
| `dropped_objects_contained` | boolean<br/>nullable<br/>business | NULL means not asked, never no; NULL in rows recorded before this field existed. |
| `reviewed_at` | timestamp (UTC)<br/>nullable<br/>business | When the activity was reviewed. |
| `created_at` | timestamp (UTC)<br/>business | When the record was created. |
| `updated_at` | timestamp (UTC)<br/>business | When the record last changed. |
| `notes` | string<br/>nullable<br/>free_text | Activity notes entered by the organisation. |
| `signage_location` | string<br/>nullable<br/>free_text | Where signage is placed. |
| `spotter_name` | string<br/>nullable<br/>personal | Spotter's name. |
| `spotter_mobile` | string<br/>nullable<br/>personal | Spotter's mobile number as entered; not normalised. |
| `dropped_objects_comment` | string<br/>nullable<br/>free_text | Set only when dropped_objects_contained is false; NULL in rows recorded before this field existed. |
| `rejection_reason` | string<br/>nullable<br/>free_text | Reviewer's reason for a rejection. |
| `created_by` | string<br/>personal | Opaque user ID of the requester. |
| `reviewed_by` | string<br/>nullable<br/>personal | Opaque user ID of the reviewer. |
| `consulted_by` | string<br/>nullable<br/>personal | Opaque user ID of the approver who confirmed consulting the requester; NULL in rows recorded before this field existed. |
| `consulted_at` | timestamp (UTC)<br/>nullable<br/>business | When consultation was confirmed; set with consulted_by. NULL in rows recorded before this field existed. |
| `approval_mitigations` | string<br/>nullable<br/>free_text | Mitigations recorded at consultation; NULL in rows recorded before this field existed. |
| `below_exclusion` | string<br/>nullable<br/>business | Whether the area below a concrete placement is also excluded. NULL means not asked; set only with concrete_pumping. NULL in rows recorded before this field existed. Values: `zone`, `unlisted`, `none`. |
| `below_exclusion_zone_id` | string<br/>nullable<br/>identifier | Opaque ID of the exclusion zone below the placement; set only when below_exclusion is zone, and NULL after that zone is deleted. NULL in rows recorded before this field existed. References `zones.zone_id`. |
| `below_exclusion_note` | string<br/>nullable<br/>free_text | Requester's description of the area below; set only when below_exclusion is unlisted. NULL in rows recorded before this field existed. |

## subcontractors

One row per subcontractor change. Folder: `_tenant/`. Key: `subcontractor_id`. Status: draft, schema version 0, revision 1.

- Organisation-wide data, delivered under _tenant. It has no project_id column; project assignments are not part of this dataset.
- Archiving arrives as op = update with is_active = false and deleted_at set; reactivation clears deleted_at. Keep these rows in current state. A deleted record arrives as op = delete.
- IDs are opaque strings. record_id is the merge key; subcontractor_id carries the same identity. User fields contain IDs, not names or email addresses.

Columns, after the [shared columns](#shared-columns):

| Column | Type | Description |
| --- | --- | --- |
| `subcontractor_id` | string<br/>identifier | Opaque subcontractor ID. |
| `company` | string<br/>business | Company (business) name entered by the organisation. |
| `is_active` | boolean<br/>business | False after archiving; moves with deleted_at. |
| `deleted_at` | timestamp (UTC)<br/>nullable<br/>business | When the record was archived; NULL while active. |
| `created_at` | timestamp (UTC)<br/>business | When the record was created. |
| `updated_at` | timestamp (UTC)<br/>business | When the record last changed. |
| `created_by` | string<br/>personal | Opaque user ID of the creator. |
| `deleted_by` | string<br/>nullable<br/>personal | Opaque user ID of the archiver; moves with deleted_at and survives deletion of the user. |

## projects

One row per project change. Folder: `project=<project-id>/`. Key: `project_id`. Status: draft, schema version 0, revision 1.

- Each project's own row is delivered in its own project=<project-id> folder.
- IDs are opaque strings. project_id is the key; record_id carries the same identity. User fields contain IDs, not names or email addresses.

Columns, after the [shared columns](#shared-columns):

| Column | Type | Description |
| --- | --- | --- |
| `project_id` | string<br/>identifier | Opaque project ID. |
| `name` | string<br/>business | Project name entered by the organisation. |
| `address` | string<br/>nullable<br/>business | Project site address. |
| `description` | string<br/>nullable<br/>free_text | Project description entered by the organisation. |
| `timezone` | string<br/>business | IANA time zone for the project's local times, such as work hours. |
| `status` | string<br/>business | Project status. Values: `active`, `inactive`, `completed`. |
| `work_hours_start` | time<br/>business | Start of the project's work-hours view, local time in timezone. |
| `work_hours_end` | time<br/>business | End of the project's work-hours view, local time in timezone. |
| `created_at` | timestamp (UTC)<br/>business | When the record was created. |
| `updated_at` | timestamp (UTC)<br/>business | When the record last changed. |
| `created_by` | string<br/>personal | Opaque user ID of the creator. |

## zones

One row per exclusion zone change. Folder: `project=<project-id>/`. Key: `zone_id`. Status: draft, schema version 0, revision 1.

- Exclusion zones of one project, delivered in its project=<project-id> folder.
- Archiving arrives as op = update with is_archived = true; keep these rows in current state. A deleted record arrives as op = delete.
- IDs are opaque strings. record_id is the merge key; zone_id carries the same identity. User fields contain IDs, not names or email addresses.

Columns, after the [shared columns](#shared-columns):

| Column | Type | Description |
| --- | --- | --- |
| `project_id` | string<br/>identifier | Opaque project ID. References `projects.project_id`. |
| `zone_id` | string<br/>identifier | Opaque zone ID. |
| `name` | string<br/>business | Zone name entered by the organisation; unique per project among zones that are not archived. |
| `zone_type` | string<br/>business | Zone type code, such as general or hot_works. Open vocabulary: the list can grow without a schema change, and older rows can hold other values. |
| `description` | string<br/>nullable<br/>free_text | Zone description entered by the organisation. |
| `level_area` | string<br/>nullable<br/>business | Level or area entered by the organisation. |
| `building_structure` | string<br/>nullable<br/>business | Building or structure entered by the organisation. |
| `elevations` | list of strings<br/>nullable<br/>business | Elevations entered by the organisation. NULL and an empty list are distinct. |
| `notes` | string<br/>nullable<br/>free_text | Zone notes entered by the organisation. |
| `sort_order` | int32<br/>business | Display order within the project; lower first. |
| `is_archived` | boolean<br/>business | True after archiving. |
| `created_at` | timestamp (UTC)<br/>business | When the record was created. |
| `updated_at` | timestamp (UTC)<br/>business | When the record last changed. |
| `created_by` | string<br/>personal | Opaque user ID of the creator. |

## work_activity_zones

One row per work activity zone link change. Folder: `project=<project-id>/`. Key: `activity_id`, `zone_id`. Status: draft, schema version 0, revision 1.

- Links work activities to the exclusion zones they book. Combine rows using record_id, or both activity_id and zone_id. Treat record_id as an opaque value; do not calculate it yourself.
- work_window_start and work_window_end give the activity’s planned start and end. Changes to the planned times or booking status arrive as updates.
- blocking is true when the activity is approved and scheduled or active. The zone is reserved for that time. A paused activity still reserves its zone.
- A record can be deleted and added again. Keep the change with the highest event_seq, then exclude it only if that change has op = delete.

Columns, after the [shared columns](#shared-columns):

| Column | Type | Description |
| --- | --- | --- |
| `project_id` | string<br/>identifier | Opaque project ID. References `projects.project_id`. |
| `activity_id` | string<br/>identifier | Opaque activity ID; first key column. References `work_activities.activity_id`. |
| `zone_id` | string<br/>identifier | Opaque exclusion-zone ID; second key column. References `zones.zone_id`. |
| `work_window_start` | timestamp (UTC)<br/>nullable<br/>business | Start of the linked activity's planned window, inclusive; equals its work_start_at. Can be NULL. |
| `work_window_end` | timestamp (UTC)<br/>nullable<br/>business | End of the linked activity's planned window, exclusive; equals its work_end_at. Can be NULL. |
| `blocking` | boolean<br/>business | True while the activity is approved and scheduled or active; a paused activity keeps blocking. |
| `created_at` | timestamp (UTC)<br/>business | When the activity was linked to the zone. |

## work_activity_pauses

One row per work activity pause change. Folder: `project=<project-id>/`. Key: `pause_id`. Status: draft, schema version 0, revision 1.

- One row per pause of an active work activity. A paused activity still has lifecycle = active. A pause is open while resumed_at is NULL; an activity has at most one open pause.
- IDs are opaque strings. record_id is the merge key; pause_id carries the same identity. User fields contain IDs, not names or email addresses.

Columns, after the [shared columns](#shared-columns):

| Column | Type | Description |
| --- | --- | --- |
| `project_id` | string<br/>identifier | Opaque project ID. References `projects.project_id`. |
| `pause_id` | string<br/>identifier | Opaque pause ID. |
| `activity_id` | string<br/>identifier | Opaque ID of the paused work activity. References `work_activities.activity_id`. |
| `reason` | string<br/>business | Pause reason code. lunch_break is retired: only older pauses carry it. Values: `safety`, `design_rfi`, `access_restricted`, `weather`, `plant_breakdown`, `materials_installation`, `quality`, `lunch_break`. |
| `weather_type` | string<br/>nullable<br/>business | Set only on a weather pause, and only when the user chose a type; NULL in rows recorded before this field existed. Values: `heat`, `rain`, `wind`, `snow`. |
| `paused_at` | timestamp (UTC)<br/>business | Pause start. |
| `resumed_at` | timestamp (UTC)<br/>nullable<br/>business | When work resumed; NULL while the pause is open. |
| `created_at` | timestamp (UTC)<br/>business | When the record was created. |
| `updated_at` | timestamp (UTC)<br/>business | When the record last changed. |
| `comment` | string<br/>nullable<br/>free_text | Pause comment entered by the user. |
| `paused_by` | string<br/>personal | Opaque user ID of the person who paused the work. |
| `resumed_by` | string<br/>nullable<br/>personal | Opaque user ID of the person who resumed the work; set with resumed_at. |

## work_activity_extensions

One row per work activity extension change. Folder: `project=<project-id>/`. Key: `extension_id`. Status: draft, schema version 0, revision 1.

- An extension is the time an approved activity runs past its planned end. An activity has at most one open extension (ended_at NULL), and can have more than one over its life.
- ended_at is when the extension was closed in ToolboxFM. A close-out can later correct the finish in corrected_ended_at; ended_at stays as recorded. The effective finish is COALESCE(corrected_ended_at, ended_at), and a corrected_ended_at equal to started_at means the activity did not run over.
- IDs are opaque strings. record_id is the merge key; extension_id carries the same identity.

Columns, after the [shared columns](#shared-columns):

| Column | Type | Description |
| --- | --- | --- |
| `project_id` | string<br/>identifier | Opaque project ID. References `projects.project_id`. |
| `extension_id` | string<br/>identifier | Opaque extension ID. |
| `activity_id` | string<br/>identifier | Opaque ID of the extended activity. References `work_activities.activity_id`. |
| `scheduled_end_at` | timestamp (UTC)<br/>business | The activity's planned end when the extension started. |
| `started_at` | timestamp (UTC)<br/>business | When the extension started. |
| `ended_at` | timestamp (UTC)<br/>nullable<br/>business | When the extension ended; NULL while open. Set with ended_reason. |
| `ended_reason` | string<br/>nullable<br/>business | Why the extension closed; NULL while open. Set with ended_at. Values: `completed`, `cancelled`, `rescheduled`. |
| `corrected_ended_at` | timestamp (UTC)<br/>nullable<br/>business | Finish corrected by the close-out, between started_at and ended_at; NULL means not corrected. NULL in rows recorded before this field existed. |
| `created_at` | timestamp (UTC)<br/>business | When the record was created. |
| `updated_at` | timestamp (UTC)<br/>business | When the record last changed. |

## work_activity_closeouts

One row per work activity close-out change. Folder: `project=<project-id>/`. Key: `closeout_id`. Status: draft, schema version 0, revision 1.

- One close-out per work activity. It is created when the activity completes or is cancelled, and moves from pending to draft to submitted.
- A NULL answer means the question was never asked or not yet answered, never no. Keep it NULL in aggregates. A list NULL differs from an empty list.
- delay_reasons, delay_cause, access_issues, plant_used and safety_events hold codes. Treat them as open strings: new codes can appear. The code other pairs with the matching *_other text.
- Photos are not included.
- IDs are opaque strings. record_id is the merge key; closeout_id carries the same identity. User fields contain IDs, not names or email addresses.

Columns, after the [shared columns](#shared-columns):

| Column | Type | Description |
| --- | --- | --- |
| `project_id` | string<br/>identifier | Opaque project ID. References `projects.project_id`. |
| `closeout_id` | string<br/>identifier | Opaque close-out ID. |
| `activity_id` | string<br/>identifier | Opaque ID of the closed-out activity; unique per close-out. References `work_activities.activity_id`. |
| `status` | string<br/>business | Close-out progress. Values: `pending`, `draft`, `submitted`. |
| `outcome` | string<br/>nullable<br/>business | Activity outcome; NULL until answered. Values: `completed`, `cancelled`, `rescheduled`. |
| `work_completed` | string<br/>nullable<br/>business | Share of the work completed; NULL until answered. Values: `100`, `75_99`, `50_74`, `under_50`. |
| `delay_reasons` | list of strings<br/>business | Delay reason codes; never NULL, so empty also means not yet answered or not shown. Read lost_time for whether delay was asked. |
| `lost_time` | string<br/>nullable<br/>business | Time lost; NULL means never asked, never none. Values: `none`, `under_30m`, `30_60m`, `1_2h`, `2_4h`, `over_4h`. |
| `delay_cause` | string<br/>nullable<br/>business | Delay cause code; NULL means never asked. |
| `zone_fit` | string<br/>nullable<br/>business | Exclusion zone fit; NULL until answered. Values: `adequate`, `too_small`, `too_large`, `wrong_location`. |
| `affected_by_activity_id` | string<br/>nullable<br/>identifier | Activity that affected this one; can be in another project of the organisation. Set to NULL when that activity is deleted. References `work_activities.activity_id`. |
| `access_ok` | boolean<br/>nullable<br/>business | Access was fine; NULL means not answered, never no. |
| `access_issues` | list of strings<br/>nullable<br/>business | Access issue codes; NULL differs from an empty list. |
| `resources_adequate` | boolean<br/>nullable<br/>business | Resources were adequate; NULL means not answered. |
| `worker_count` | int32<br/>nullable<br/>business | Number of workers; NULL means not answered. |
| `plant_used` | list of strings<br/>nullable<br/>business | Plant codes; NULL differs from an empty list. |
| `materials_shortage` | boolean<br/>nullable<br/>business | Materials were short; NULL means not answered. |
| `safety_events` | list of strings<br/>business | Safety event codes; empty until answered, never NULL. |
| `finished_in_window` | boolean<br/>nullable<br/>business | Work finished inside the planned window; NULL means not answered. NULL in rows recorded before this field existed. |
| `actual_finished_at` | timestamp (UTC)<br/>nullable<br/>business | Corrected finish time; set only when finished_in_window is false. NULL in rows recorded before this field existed. |
| `submitted_at` | timestamp (UTC)<br/>nullable<br/>business | When the close-out was submitted; NULL until submitted. |
| `created_at` | timestamp (UTC)<br/>business | When the activity completed or was cancelled. |
| `updated_at` | timestamp (UTC)<br/>business | When the record last changed. |
| `delay_reason_other` | string<br/>nullable<br/>free_text | Text for the other delay reason. |
| `delay_cause_other` | string<br/>nullable<br/>free_text | Text for the other delay cause. |
| `access_issues_other` | string<br/>nullable<br/>free_text | Text for the other access issue. |
| `plant_used_other` | string<br/>nullable<br/>free_text | Text for other plant. |
| `materials_detail` | string<br/>nullable<br/>free_text | Materials shortage detail. |
| `safety_detail` | string<br/>nullable<br/>free_text | Safety event detail. |
| `comments` | string<br/>nullable<br/>free_text | Comments entered by the organisation. |
| `submitted_by` | string<br/>nullable<br/>personal | Opaque user ID of the submitter. |

## qr_page_views_hourly

One row per project × zone × kind × UTC hour view count. Folder: `project=<project-id>/`. Key: `project_id`, `zone_id`, `kind`, `hour_start`. Status: draft, schema version 0, revision 1.

- Each row counts views of one public QR page during one UTC hour. Later deliveries can include a higher count for the same hour.
- Keep the highest view_count for each record_id; do not add repeated counts together. op is always upsert. event_id, event_seq and occurred_at are always NULL. Use hour_start for the time of the views.
- Counts already exported are not removed when a zone or project is deleted.
- Historical coverage can be incomplete. Ask ToolboxFM to confirm coverage for your reporting period. A missing hour does not prove that there were no views.
- Treat IDs as opaque values; do not calculate or interpret them.

Columns, including the shared columns that differ for this dataset:

| Column | Type | Description |
| --- | --- | --- |
| `record_id` | string<br/>identifier | Stable record identifier. Use it to combine repeated rows. Do not calculate it yourself. |
| `event_id` | string<br/>nullable<br/>identifier | Always NULL: an aggregate row has no event. |
| `op` | string<br/>business | Always upsert: the row is the current value of its record. Values: `upsert`. |
| `event_seq` | int64<br/>nullable<br/>business | Always NULL: an aggregate row has no event sequence. |
| `occurred_at` | timestamp (UTC)<br/>nullable<br/>business | Always NULL: an aggregate row has no change time. Use hour_start for the time of the views. |
| `project_id` | string<br/>identifier | Opaque project ID. References `projects.project_id`. |
| `zone_id` | string<br/>nullable<br/>identifier | Opaque zone ID of a zone QR page; NULL for the project QR page. |
| `kind` | string<br/>business | Which public QR page: site is the project page, zone is a zone page. Values: `site`, `zone`. |
| `hour_start` | timestamp (UTC)<br/>business | Start of the UTC hour that the count covers, inclusive. |
| `view_count` | int64<br/>business | Page views in the hour so far. Never decreases. |