> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.staple.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.staple.ai/_mcp/server.

# The data behind your charts

This chapter lists the tables you can build a chart from, explains what each one captures, and describes what each column means and what you would use it for.

---

## 1. How to read this chapter

When you start a new question, the **Pick your starting data** list shows the tables described here. Every one of them is scoped to your own organisation: you never see another customer's rows, whatever you build.

**Names appear differently in the picker.** This chapter uses the underlying names, in lower case with underscores, because they sort predictably and are easier to search for. The Business Dashboard shows them with spaces and capitals: `analytics_documents` appears as **Analytics Documents**, `analytics_export_logs` as **Analytics Export Logs**, and so on.

### 1.1 Three shapes of table, and why it matters

The tables are not all built the same way, and the shape decides what you can ask of them.

| **Shape**            | **What it means**                                     | **Consequence**                                                                                                      |
| -------------------- | ----------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| **Per-record**       | One row per document, per export, per scan, per field | You can filter by any date on the row, group by any dimension, and drill into the individual records behind a number |
| **Daily**            | Already summed to one row per day                     | Fast, and safe to plot over time, but you can only slice by the columns that were kept when it was summed            |
| **All-time summary** | One row per queue, with no date at all                | The figures cover all time, so a **Date** filter has nothing to act on and the chart will not respond to it          |

**This is the most useful thing to know before you build.** If a card does not move when you change the **Date** filter, it is almost always built on an all-time summary table. To get a dated version, rebuild it on the per-record table underneath. Each entry below states which shape it is.

### 1.2 Columns you will see nearly everywhere

These are described once here rather than in every table.

| **Column**    | **What it holds**                 | **What you would use it for**                                                           |
| ------------- | --------------------------------- | --------------------------------------------------------------------------------------- |
| `document_id` | The unique number of one document | Counting documents with **Number of distinct values**, and joining one table to another |
| `queue_id`    | The queue the record belongs to   | Grouping or filtering by queue. It displays the queue name, not the number              |
| `model_id`    | The extraction model used         | Grouping or filtering by model. It displays the model name, not the number              |

You may also see a few housekeeping columns, such as `synced_at`, which records when a row was last refreshed. **Build date filters on a business date** such as `uploaded_at` or `exported_at`, never on `synced_at`.

### 1.3 How each entry is laid out

Every table below gives you its shape, its grain (what one row represents), which columns you can filter dates on, and then its columns with their meaning and use.

---

## 2. Documents

### 2.1 `analytics_documents`

The central table. One row for every document in your queues, carrying its current status, the people who touched it, and the timestamp of each stage it passed through. Most questions can be answered from this table alone, without joining anything.

**Shape:** per-record · **Grain:** one row per document · **Dates:** `created_at`, `uploaded_at`, `completed_at`, `exported_at`, `rejected_at`, `first_review_at`, `last_review_at`

| **Column**             | **What it holds**                                                                                 | **What you would use it for**                                                                                 |
| ---------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| `document_id`          | The document's unique number                                                                      | Counting documents, drilling to the individual record                                                         |
| `user_id`              | The person who uploaded it                                                                        | Volume per uploader                                                                                           |
| `queue_id`             | The queue it sits in                                                                              | Comparing queues                                                                                              |
| `doc_type`             | The document type, such as **INVOICE** or **RECEIPT**                                             | Filtering to one type, or splitting a chart by type                                                           |
| `model_id`             | The extraction model applied                                                                      | Comparing model performance                                                                                   |
| `use_created_model`    | True when a model your organisation built was used, false when a Staple predefined model was used | Separating custom model results from predefined ones                                                          |
| `status`               | Where the document currently stands                                                               | Counting by outcome. Values are listed in section 10                                                          |
| `company`              | The company or entity named on the document, where one was captured                               | Splitting by entity                                                                                           |
| `uploaded_by`          | The email address of whoever uploaded it                                                          | Attribution by person                                                                                         |
| `uploaded_from`        | The channel it arrived through, such as **email**, **API**, **UI** or **dropbox**                 | Seeing which ingestion route carries your volume                                                              |
| `completed_by`         | The person who marked it **Completed**                                                            | Reviewer throughput                                                                                           |
| `exported_by`          | The email address of whoever exported it                                                          | Attribution for exports                                                                                       |
| `rejected_by`          | The person who rejected it                                                                        | Who is rejecting, and how much                                                                                |
| `exported_type`        | The format it was exported as, such as **XML**, **CSV** or **CONCUR**                             | Splitting exports by destination format                                                                       |
| `created_at`           | When the record was created in Staple                                                             | The creation date for generated documents                                                                     |
| `uploaded_at`          | When the document entered its queue                                                               | **The main volume date.** Use this for "how much arrived"                                                     |
| `completed_at`         | When it was marked **Completed**                                                                  | Completion volume over time, and the end point of review duration                                             |
| `exported_at`          | When it was exported                                                                              | Export volume over time, and the end point of end-to-end duration                                             |
| `rejected_at`          | When it was rejected                                                                              | Rejection volume over time                                                                                    |
| `first_review_at`      | The first time someone opened it for review                                                       | The start of hands-on time                                                                                    |
| `last_review_at`       | The most recent time someone opened it for review                                                 | The end of hands-on time                                                                                      |
| `time_process_scan_ms` | How long scanning took, in milliseconds                                                           | Scan duration. Divide by 1000 for seconds, and restrict to values above zero                                  |
| `completeness`         | The percentage of expected fields that were filled                                                | Finding thinly extracted documents. Empty on documents that never reached extraction                          |
| `error_message`        | The processing error recorded against it, where there was one                                     | Counting failures by message. **DUPLICATE** appears here rather than in `status`                              |
| `scanning_error`       | The error recorded at the scanning stage                                                          | Isolating scan failures from later failures                                                                   |
| `status_code`          | The numeric result code from processing                                                           | Grouping failures by kind. **200** succeeded, **409** is a duplicate, codes in the 500s are processing errors |
| `num_pages`            | How many pages the document has                                                                   | **Sum** it for page volume                                                                                    |
| `created_by_supernova` | True when Staple generated the document rather than someone uploading it                          | Separating generated documents from uploaded ones. Most other tables exclude generated documents              |

### 2.2 `analytics_document_counts`

A set of headline totals per queue: how many documents you have in total, this month, last month, and how many were removed, duplicated or ended in an exception.

**Shape:** all-time summary · **Grain:** one row per queue · **Dates:** none

| **Column**                 | **What it holds**                                                 | **What you would use it for**                      |
| -------------------------- | ----------------------------------------------------------------- | -------------------------------------------------- |
| `queue_id`                 | The queue                                                         | Comparing queues                                   |
| `total_documents`          | Every document in that queue, for all time                        | A headline total                                   |
| `current_month_documents`  | Documents uploaded since the first of this month                  | A month-to-date figure                             |
| `previous_month_documents` | Documents uploaded during the whole of last month                 | Month-on-month comparison against the column above |
| `removed_documents`        | Documents that were deleted                                       | Measuring how much gets removed                    |
| `duplicate_documents`      | Documents rejected as already seen                                | Measuring duplicate load                           |
| `anomaly_documents`        | Documents that were rejected, failed to export, or failed to scan | One combined exceptions figure                     |

**The month columns are fixed.** *This month* and *last month* are calculated from today's date, not from your **Date** filter.

### 2.3 `analytics_status_counts`

How many documents sit in each status, per queue.

**Shape:** all-time summary · **Grain:** one row per queue and status · **Dates:** none

| **Column**  | **What it holds**                                | **What you would use it for**           |
| ----------- | ------------------------------------------------ | --------------------------------------- |
| `queue_id`  | The queue                                        | Comparing queues                        |
| `status`    | The status, such as **EXPORTED** or **RECEIVED** | The category axis of a status breakdown |
| `documents` | How many documents hold that status              | **Sum** it for the bar or pie value     |

### 2.4 `analytics_document_actions_by_day`

The five headline document actions, counted per day and per queue, each on its own date. A document uploaded on Monday and exported on Friday is counted under Monday in `received` and under Friday in `exported`.

**Shape:** daily · **Grain:** one row per queue and day · **Dates:** `event_date`

| **Column**      | **What it holds**                       | **What you would use it for** |
| --------------- | --------------------------------------- | ----------------------------- |
| `queue_id`      | The queue                               | Comparing queues              |
| `event_date`    | The day the action happened             | The time axis                 |
| `received`      | Documents that arrived that day         | Intake volume                 |
| `completed`     | Documents marked **Completed** that day | Review output                 |
| `exported`      | Documents exported that day             | Delivery volume               |
| `rejected`      | Documents rejected that day             | Rejection volume              |
| `export_failed` | Documents whose export failed that day  | Failure volume                |

### 2.5 `analytics_document_events`

Every stage a document can pass through, as a single list of dated events. Because the stage is a column rather than a set of columns, one chart can carry all of them as separate lines.

**Shape:** daily · **Grain:** one row per day, stage, queue and model · **Dates:** `event_date`

| **Column**   | **What it holds**                                                                                                                                   | **What you would use it for**             |
| ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------- |
| `event_date` | The day the stage happened                                                                                                                          | The time axis                             |
| `event_type` | Which stage: **Uploaded**, **Generated**, **Scanned**, **Scan Failed**, **Rescanned**, **Completed**, **Rejected**, **Exported**, **Export Failed** | Splitting one chart into a line per stage |
| `queue_id`   | The queue                                                                                                                                           | Comparing queues                          |
| `model_id`   | The model                                                                                                                                           | Comparing models                          |
| `docs`       | How many documents hit that stage that day                                                                                                          | **Sum** it for the line value             |

**This is usually the table you want for a processing funnel over time**, because a single chart can show intake, output and failure together.

### 2.6 `analytics_page_events`

The same idea as the table above, counted in pages rather than documents.

**Shape:** daily · **Grain:** one row per day, stage, queue and model · **Dates:** `event_date`

| **Column**   | **What it holds**                                                                                     | **What you would use it for** |
| ------------ | ----------------------------------------------------------------------------------------------------- | ----------------------------- |
| `event_date` | The day the stage happened                                                                            | The time axis                 |
| `event_type` | **Pages Uploaded**, **Pages Generated**, **Pages Scanned**, **Pages Rescanned** or **Pages Exported** | A line per stage              |
| `queue_id`   | The queue                                                                                             | Comparing queues              |
| `model_id`   | The model                                                                                             | Comparing models              |
| `pages`      | How many pages hit that stage that day                                                                | **Sum** it for the line value |

### 2.7 `analytics_uploads_by_day`

Upload volume alone, already broken out by queue, document type and model.

**Shape:** daily · **Grain:** one row per day, queue, document type and model · **Dates:** `event_date`

| **Column**   | **What it holds** | **What you would use it for** |
| ------------ | ----------------- | ----------------------------- |
| `event_date` | The day of upload | The time axis                 |
| `queue_id`   | The queue         | Comparing queues              |
| `doc_type`   | The document type | A line per document type      |
| `model_id`   | The model         | Comparing models              |
| `documents`  | How many arrived  | **Sum** it for the line value |

---

## 3. Extracted fields and accuracy

### 3.1 `analytics_document_fields`

Every field value Staple extracted, one row per field per document. This is the largest table you have access to, and it is where the extracted values live, so it is what you use to chart the contents of your documents rather than their processing.

**Shape:** per-record · **Grain:** one row per document and field · **Dates:** `uploaded_at`, `completed_at`

| **Column**          | **What it holds**                                                                                                | **What you would use it for**                                                           |
| ------------------- | ---------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `document_id`       | The document the value came from                                                                                 | Counting documents, joining to `analytics_documents`                                    |
| `queue_id`          | The queue                                                                                                        | Comparing queues                                                                        |
| `doc_type`          | The document type                                                                                                | Filtering to one type                                                                   |
| `status`            | The document's status at the time the row was written                                                            | Restricting to exported or completed documents only                                     |
| `document_language` | The language detected on the document                                                                            | Splitting by language                                                                   |
| `field_key`         | The internal name of the field                                                                                   | Filtering to one field. Use this rather than `field_name`, because it does not change   |
| `field_name`        | The label shown for that field in Staple                                                                         | Readable axis labels                                                                    |
| `field_category`    | The section the field sits in, such as **Basic Information** or **VAT & Amounts**                                | Grouping fields into areas                                                              |
| `field_type`        | What kind of field it is, such as **Text**, **Amount** or **Date**                                               | Restricting to fields you can total                                                     |
| `value_kind`        | Which of the value columns below is populated: **text**, **number**, **date**, **boolean**, **json** or **null** | Filtering to rows whose value you can chart                                             |
| `value_text`        | The value as text, for every row                                                                                 | Grouping by value, counting occurrences                                                 |
| `value_number`      | The value as a number, where it is one                                                                           | **Sum** or **Average** it, for example totalling invoice amounts                        |
| `value_date`        | The value as a date, where it is one                                                                             | Plotting by a date on the document, such as invoice date, rather than a processing date |
| `value_boolean`     | The value as true or false, where it is one                                                                      | Counting how often a checkbox was ticked                                                |
| `uploaded_at`       | When the parent document arrived                                                                                 | The time axis                                                                           |
| `completed_at`      | When the parent document was completed                                                                           | An alternative time axis                                                                |

**Two things to know before you total anything here.** Rows where `value_kind` is **json** hold a structure rather than a single value, which is how line-item tables are stored, so `value_text` on those rows is structured data rather than a plain figure. And because there is one row per field, a plain count counts fields, not documents: use **Number of distinct values** on `document_id` when you mean documents.

### 3.2 `analytics_document_field_catalog`

The list of which fields exist on which queue, without any of the values. Use it to find out what you can chart before you go looking for it.

**Shape:** all-time summary · **Grain:** one row per queue and field · **Dates:** none

| **Column**              | **What it holds**                      | **What you would use it for**                               |
| ----------------------- | -------------------------------------- | ----------------------------------------------------------- |
| `queue_id`              | The queue                              | Seeing which fields a queue captures                        |
| `doc_type`              | The document type the field belongs to | Filtering to one type                                       |
| `field_key`             | The internal name of the field         | The value to use when filtering `analytics_document_fields` |
| `field_name`            | The label shown in Staple              | Recognising the field                                       |
| `field_category`        | The section it sits in                 | Browsing fields by area                                     |
| `field_type`            | What kind of field it is               | Judging whether it can be totalled                          |
| `available_value_kinds` | Every value kind seen on that field    | Checking a field holds numbers before you try to sum it     |

### 3.3 `analytics_field_differentials`

One row for every field a reviewer looked at, recording what Staple predicted and what the value ended up being. This is the source of every accuracy figure in the product.

**Shape:** per-record · **Grain:** one row per field per document reviewed · **Dates:** `created_at`

| **Column**              | **What it holds**                                                    | **What you would use it for**                                                                  |
| ----------------------- | -------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| `differential_id`       | The reference for one document's whole review comparison             | Counting reviewed documents. There is roughly one of these per document                        |
| `field_differential_id` | The reference for this single field row                              | Counting individual field comparisons                                                          |
| `document_id`           | The document                                                         | Counting documents that needed correction                                                      |
| `user_id`               | The reviewer                                                         | Correction volume per person                                                                   |
| `queue_id`              | The queue                                                            | Comparing queues                                                                               |
| `model_id`              | The model that made the prediction                                   | Comparing model accuracy                                                                       |
| `field_key`             | Which field                                                          | Finding the fields that need the most review effort                                            |
| `predicted`             | What Staple extracted                                                | Inspecting individual differences on drill-through                                             |
| `ground_truth`          | What the value was after review                                      | The same                                                                                       |
| `is_match`              | True when the prediction was left alone, false when it was corrected | **The accuracy column.** Count where false for corrections, or average it for an accuracy rate |
| `differential_accuracy` | How close the prediction was, for partial matches                    | A finer measure than the true or false above                                                   |
| `created_at`            | When the review happened                                             | The time axis                                                                                  |

### 3.4 `analytics_accuracy_by_day`

Accuracy already worked out per day, model, queue and field.

**Shape:** daily · **Grain:** one row per day, model, queue and field · **Dates:** `event_date`

| **Column**     | **What it holds**                                  | **What you would use it for**                                          |
| -------------- | -------------------------------------------------- | ---------------------------------------------------------------------- |
| `event_date`   | The day                                            | The time axis                                                          |
| `model_id`     | The model                                          | A line per model                                                       |
| `queue_id`     | The queue                                          | Comparing queues                                                       |
| `field_key`    | The field                                          | Accuracy for one field over time                                       |
| `accuracy`     | The percentage of fields left uncorrected that day | The chart value                                                        |
| `field_count`  | How many fields were reviewed                      | Weighting, and judging whether a day's percentage rests on enough data |
| `edited_count` | How many were corrected                            | Correction volume                                                      |

**Averaging `accuracy` treats a day with three fields the same as a day with three thousand.** Where the difference matters, build the percentage from `edited_count` and `field_count` instead.

### 3.5 `analytics_ocr_rework_load`

Which fields your reviewers correct most, per queue. This is the table for "where is our manual effort going".

**Shape:** all-time summary · **Grain:** one row per queue and field · **Dates:** none

| **Column**            | **What it holds**                        | **What you would use it for**                            |
| --------------------- | ---------------------------------------- | -------------------------------------------------------- |
| `queue_id`            | The queue                                | Comparing queues                                         |
| `field`               | The field                                | The category axis                                        |
| `edited_count`        | How many times that field was corrected  | Ranking fields by correction volume                      |
| `document_count`      | How many documents the field appeared on | Context for the count above                              |
| `edited_per_document` | Corrections divided by documents         | A fair ranking that does not simply favour common fields |

### 3.6 `analytics_ocr_rework_summary`

The two headline automation figures per queue: what share of documents went through untouched, and how much of what was extracted was kept after review.

**Shape:** all-time summary · **Grain:** one row per queue · **Dates:** none

| **Column**                   | **What it holds**                               | **What you would use it for** |
| ---------------------------- | ----------------------------------------------- | ----------------------------- |
| `queue_id`                   | The queue                                       | Comparing queues              |
| `documents`                  | Documents in the queue                          | The denominator               |
| `straight_through_documents` | Documents nobody had to correct                 | The numerator                 |
| `stp`                        | Straight-through rate as a percentage           | The automation headline       |
| `accuracy`                   | Percentage of extracted fields left uncorrected | The accuracy headline         |

**This table powers the two all-time cards on Staple Dashboard**, which is why they do not respond to the Date filter. For a dated version, build on `analytics_field_differentials` or `analytics_accuracy_by_day` instead.

---

## 4. Processing time

### 4.1 `analytics_process_time_comparison`

Average duration per day for three stages of processing.

**Shape:** daily · **Grain:** one row per queue, day and stage · **Dates:** `event_date`

| **Column**    | **What it holds**                                                            | **What you would use it for**                                                          |
| ------------- | ---------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- |
| `queue_id`    | The queue                                                                    | Comparing queues                                                                       |
| `event_date`  | The day the documents were uploaded                                          | The time axis                                                                          |
| `chart_type`  | Which stage: **TIME_TO_EXPORT**, **TIME_TO_SCAN** or **TIME_TO_REVIEW**      | **Filter to one of these.** Mixing stages in one chart mixes very different magnitudes |
| `none_edit`   | The average duration for every document that day                             | The main line                                                                          |
| `fields_only` | The average duration for the documents that had at least one field corrected | Comparing corrected documents against the overall average                              |

**Every figure in this table is in hours**, including the scanning stage, which is why scan times read as small fractions. Multiply by 60 for minutes or 3600 for seconds.

**The two value columns overlap rather than add up.** `none_edit` covers all documents and `fields_only` covers the corrected subset of those same documents.

**For a document-weighted average, build it from `analytics_documents` instead.** This table averages each day first, so a day with two documents counts as much as a day with two thousand. Section 2.1 has the timestamps you need.

---

## 5. Scanning

### 5.1 `analytics_billing_scan_attempts`

Every scan of every document, first scans and rescans together.

**Shape:** per-record · **Grain:** one row per scan attempt · **Dates:** `attempt_at`

| **Column**     | **What it holds**                                     | **What you would use it for**                    |
| -------------- | ----------------------------------------------------- | ------------------------------------------------ |
| `attempt_id`   | The attempt's unique reference                        | Counting attempts                                |
| `document_id`  | The document scanned                                  | Counting distinct documents rather than attempts |
| `queue_id`     | The queue                                             | Comparing queues                                 |
| `model_id`     | The model                                             | Comparing models                                 |
| `attempt_type` | **INITIAL** for a first scan, **RESCAN** for a repeat | Separating new work from repeat scans            |
| `status`       | **SUCCESS**, **FAILED** or **PENDING**                | Scan success and failure rates                   |
| `attempt_at`   | When the scan ran                                     | The time axis                                    |
| `num_pages`    | Pages in that attempt                                 | **Sum** it for scanned page volume               |

### 5.2 `analytics_rescan_attempts`

Rescans only, in more detail than the table above carries.

**Shape:** per-record · **Grain:** one row per rescan · **Dates:** `started_at`, `finished_at`

| **Column**        | **What it holds**                         | **What you would use it for**                                             |
| ----------------- | ----------------------------------------- | ------------------------------------------------------------------------- |
| `attempt_id`      | The attempt's unique reference            | Counting rescans                                                          |
| `document_id`     | The document                              | Finding documents rescanned repeatedly                                    |
| `queue_id`        | The queue                                 | Comparing queues                                                          |
| `model_id`        | The model                                 | Comparing models                                                          |
| `requested_by`    | Who asked for the rescan                  | Attribution                                                               |
| `engine`          | Which scanning engine ran it              | Comparing engines                                                         |
| `scan_type`       | **hard_rescan** or **soft_rescan**        | Separating a full re-extraction from a light one                          |
| `status`          | **SUCCESS**, **FAILED** or **PENDING**    | Rescan success rate                                                       |
| `document_status` | The document's status when the rescan ran | Context                                                                   |
| `outcome`         | **success**, **duplicate** or **error**   | A finer result than `status`, because it separates duplicates from errors |
| `status_code`     | The numeric result code                   | Grouping errors by kind                                                   |
| `error_message`   | The error text                            | Reading what failed on drill-through                                      |
| `started_at`      | When the rescan began                     | The time axis                                                             |
| `finished_at`     | When it ended                             | The end point of duration                                                 |
| `duration_ms`     | How long it took, in milliseconds         | **Average** it for rescan duration. Divide by 1000 for seconds            |
| `num_pages`       | Pages rescanned                           | **Sum** it for rescanned page volume                                      |

---

## 6. Exports

### 6.1 `analytics_export_logs`

One row per export attempt, including the attempts that failed. A document exported three times appears three times.

**Shape:** per-record · **Grain:** one row per export attempt · **Dates:** `created_at`

| **Column**      | **What it holds**                                               | **What you would use it for**                                                         |
| --------------- | --------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| `export_log_id` | The attempt's unique reference                                  | Counting attempts                                                                     |
| `document_id`   | The document exported                                           | Counting distinct documents rather than attempts                                      |
| `user_id`       | Who triggered the export                                        | Attribution                                                                           |
| `export_type`   | The destination format, such as **CONCUR**, **CSV** or **JSON** | Comparing integrations                                                                |
| `web_hook_id`   | The webhook used, where one was                                 | Tying failures to a specific integration                                              |
| `is_successful` | True when the export went through                               | **The success rate column.** Average it for a rate, or count where false for failures |
| `created_at`    | When the attempt happened                                       | The time axis                                                                         |

### 6.2 `analytics_export_fail_reasons`

Every reason recorded against a failed export, one row per reason. A document that failed for three reasons appears three times.

**Shape:** per-record · **Grain:** one row per document and reason · **Dates:** `exported_at`

| **Column**    | **What it holds**                         | **What you would use it for**            |
| ------------- | ----------------------------------------- | ---------------------------------------- |
| `document_id` | The document that failed                  | Counting distinct documents affected     |
| `reason`      | The message the receiving system returned | The category axis of a failure breakdown |
| `exported_at` | When the export was attempted             | The time axis                            |

**This is the export failure table to use for a specific period**, because it carries a date.

### 6.3 `analytics_export_fail_reason_snapshots`

The same information with all of a document's reasons held together in one row as a list.

**Shape:** per-record · **Grain:** one row per document · **Dates:** `exported_at`

| **Column**    | **What it holds**                         | **What you would use it for**                                                             |
| ------------- | ----------------------------------------- | ----------------------------------------------------------------------------------------- |
| `document_id` | The document                              | Counting documents                                                                        |
| `reasons`     | Every reason for that document, as a list | Counting how many distinct problems one document had. For charting reasons, 6.2 is easier |
| `exported_at` | When the export was attempted             | The time axis                                                                             |

### 6.4 `analytics_export_failure_reasons`

Failure reasons already counted per queue.

**Shape:** all-time summary · **Grain:** one row per queue and reason · **Dates:** none

| **Column** | **What it holds**                         | **What you would use it for** |
| ---------- | ----------------------------------------- | ----------------------------- |
| `queue_id` | The queue                                 | Comparing queues              |
| `reason`   | The failure message                       | The category axis             |
| `num_docs` | How many documents failed for that reason | **Sum** it for the bar value  |

**Quick to use, and covers all time.** If you need the breakdown for a period, use 6.2.

### 6.5 `analytics_export_reliability`

A two-way split of your documents: those that exported cleanly, and those that failed at least once.

**Shape:** all-time summary · **Grain:** one row per queue · **Dates:** none

| **Column**                         | **What it holds**                        | **What you would use it for** |
| ---------------------------------- | ---------------------------------------- | ----------------------------- |
| `queue_id`                         | The queue                                | Comparing queues              |
| `zero_export_failure_docs`         | Documents that never had a failed export | The clean share               |
| `at_least_one_export_failure_docs` | Documents that failed at least once      | The exception share           |

### 6.6 `analytics_third_parties`

Volume by external system, covering both directions: what each channel brought in, and what each format sent out.

**Shape:** all-time summary · **Grain:** one row per queue and system · **Dates:** none

| **Column**         | **What it holds**                                                                                                          | **What you would use it for**                |
| ------------------ | -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------- |
| `queue_id`         | The queue                                                                                                                  | Comparing queues                             |
| `source`           | The system. Inbound channels such as **email**, **API** or **dropbox**, and outbound formats such as **CSV** or **CONCUR** | The category axis                            |
| `imported`         | Documents that arrived through it                                                                                          | Intake by channel                            |
| `exported`         | Documents successfully sent through it                                                                                     | Delivery by integration                      |
| `failed_to_export` | Documents that failed to send through it                                                                                   | Finding the integration that needs attention |

**Inbound and outbound share one column.** A row will usually have a figure in `imported` or in the two export columns, not both, so read the measure you asked for rather than the row as a whole.

---

## 7. People and review

### 7.1 `analytics_review_logs`

One row every time someone opened a document for review.

**Shape:** per-record · **Grain:** one row per review event · **Dates:** `reviewed_at`

| **Column**      | **What it holds**            | **What you would use it for**                                   |
| --------------- | ---------------------------- | --------------------------------------------------------------- |
| `review_log_id` | The event's unique reference | Counting review events                                          |
| `document_id`   | The document reviewed        | Counting distinct documents, or finding those opened many times |
| `user_id`       | Who reviewed it              | Reviewer activity over time                                     |
| `reviewed_at`   | When                         | The time axis                                                   |

**This is the table to use for review activity over a period**, because it is the one that carries a review date.

### 7.2 `analytics_user_activity`

A standing scorecard per person per queue: what they have uploaded, what is still open, what they finished, and how quickly.

**Shape:** all-time summary · **Grain:** one row per user and queue · **Dates:** `last_login_at` only

| **Column**                | **What it holds**                                                       | **What you would use it for**                     |
| ------------------------- | ----------------------------------------------------------------------- | ------------------------------------------------- |
| `queue_id`                | The queue                                                               | Comparing queues                                  |
| `user_id`                 | The person                                                              | The category axis                                 |
| `name`                    | Their name                                                              | Readable labels                                   |
| `email`                   | Their email address                                                     | Identifying them unambiguously                    |
| `last_login_at`           | The last time they signed in                                            | Finding inactive accounts. **The only date here** |
| `uploaded_docs`           | Documents they uploaded                                                 | Intake per person                                 |
| `outstanding_docs`        | Documents still open in their name                                      | Current workload                                  |
| `completed_docs`          | Documents they marked **Completed**                                     | Output per person                                 |
| `exported_docs`           | Documents they exported                                                 | Export activity per person                        |
| `completed_docs_log`      | Completions counted from the review log rather than the document record | Cross-checking the figure above                   |
| `completion_time_seconds` | Total time across the documents they completed                          | The numerator for a hand-built average            |
| `completion_time_docs`    | How many documents that total covers                                    | The denominator for it                            |
| `avg_time_hours`          | Their average time from upload to completion, in hours                  | Comparing turnaround between people               |
| `accuracy`                | The share of their extracted fields left uncorrected                    | Quality per person                                |

**Every figure except the last login is for all time**, so a chart from this table shows lifetime totals whatever the **Date** filter says. For reviewer activity over a period, use `analytics_review_logs`.

You may also see `analytics_user_activity_refresh` and `analytics_user_activity_source` in the picker. They hold the same columns and rows as this table; use `analytics_user_activity`.

### 7.3 `analytics_users`

The people in your organisation.

**Shape:** per-record · **Grain:** one row per user · **Dates:** `last_login_at`

| **Column**      | **What it holds**            | **What you would use it for**                   |
| --------------- | ---------------------------- | ----------------------------------------------- |
| `user_id`       | Their unique number          | Joining to any table with a `user_id`           |
| `email`         | Their email address          | Identifying them                                |
| `first_name`    | Their first name             | Readable labels                                 |
| `last_name`     | Their surname                | Readable labels                                 |
| `last_login_at` | The last time they signed in | Counting active accounts, finding inactive ones |

### 7.4 `analytics_queue_members`

Which people have access to which queues.

**Shape:** per-record · **Grain:** one row per user and queue · **Dates:** none

| **Column** | **What it holds** | **What you would use it for** |
| ---------- | ----------------- | ----------------------------- |
| `queue_id` | The queue         | Counting people per queue     |
| `user_id`  | The person        | Counting queues per person    |

---

## 8. Queues, models and labels

### 8.1 `analytics_queues`

Your queues, and how each is configured.

**Shape:** per-record · **Grain:** one row per queue · **Dates:** none

| **Column**          | **What it holds**                                 | **What you would use it for**                 |
| ------------------- | ------------------------------------------------- | --------------------------------------------- |
| `queue_id`          | Its unique number                                 | Joining to anything with a `queue_id`         |
| `queue_name`        | Its name                                          | Readable labels on any queue chart            |
| `doc_type`          | The document type it handles                      | Grouping queues by what they process          |
| `model_id`          | The model it uses                                 | Seeing which model a queue relies on          |
| `use_created_model` | True when it uses a model your organisation built | Separating custom setups from predefined ones |

### 8.2 `analytics_models`

The extraction models available to you.

**Shape:** per-record · **Grain:** one row per model · **Dates:** none

| **Column**   | **What it holds**                                            | **What you would use it for**         |
| ------------ | ------------------------------------------------------------ | ------------------------------------- |
| `model_id`   | Its unique number                                            | Joining to anything with a `model_id` |
| `model_name` | Its name                                                     | Readable labels on any model chart    |
| `language`   | The language it targets, such as **en**, **multi** or **ja** | Splitting performance by language     |

### 8.3 `analytics_labels`

The labels defined in your organisation.

**Shape:** per-record · **Grain:** one row per label · **Dates:** `created_at`, `deleted_at`

| **Column**   | **What it holds**                 | **What you would use it for**                       |
| ------------ | --------------------------------- | --------------------------------------------------- |
| `label_id`   | Its unique reference              | Joining to assignments                              |
| `name`       | The label text                    | Readable labels                                     |
| `color`      | Its colour in Staple              | Display only                                        |
| `type`       | **default** or **reconciliation** | Separating ordinary labels from reconciliation ones |
| `created_by` | Who created it                    | Attribution                                         |
| `created_at` | When it was created               | The time axis                                       |
| `is_deleted` | True when it has been deleted     | Excluding retired labels                            |
| `deleted_at` | When it was deleted               | Tracking label changes over time                    |

### 8.4 `analytics_label_assignments`

Every time a label was put on a document, and taken off again.

**Shape:** per-record · **Grain:** one row per assignment · **Dates:** `tagged_at`, `untagged_at`

| **Column**      | **What it holds**                                                              | **What you would use it for**                                                   |
| --------------- | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------- |
| `assignment_id` | Its unique reference                                                           | Counting assignments                                                            |
| `label_id`      | Which label                                                                    | Joining to 8.3                                                                  |
| `label_name`    | The label text                                                                 | Readable labels without a join                                                  |
| `document_id`   | The document labelled                                                          | Counting labelled documents                                                     |
| `queue_id`      | The queue                                                                      | Comparing queues                                                                |
| `tagged_by`     | Who applied it, where a person did                                             | Manual against automatic attribution                                            |
| `source`        | How it was applied: **rules**, **manual**, **vendor-master** or **datamapper** | **Measuring automation.** How much labelling is rule-driven rather than by hand |
| `tagged_at`     | When it was applied                                                            | The time axis                                                                   |
| `untagged_by`   | Who removed it                                                                 | Attribution for removals                                                        |
| `untagged_at`   | When it was removed                                                            | Measuring how long labels stay on                                               |
| `is_active`     | True when the label is still on the document                                   | Restricting to labels in force now                                              |

### 8.5 `analytics_label_actions`

The automated actions your labels trigger.

**Shape:** per-record · **Grain:** one row per action · **Dates:** `created_at`

| **Column**    | **What it holds**                                                                | **What you would use it for**        |
| ------------- | -------------------------------------------------------------------------------- | ------------------------------------ |
| `action_id`   | Its unique reference                                                             | Counting actions                     |
| `label_id`    | The label that triggers it                                                       | Joining to 8.3                       |
| `label_name`  | The label text                                                                   | Readable labels                      |
| `action_type` | What it does, such as **move_documents_to_another_queue** or **trigger_webhook** | Seeing which automations you rely on |
| `created_at`  | When the action was set up                                                       | The time axis                        |

---

## 9. Integrations

### 9.1 `analytics_webhooks`

The webhooks configured in your organisation.

**Shape:** per-record · **Grain:** one row per webhook · **Dates:** `created_at`

| **Column**   | **What it holds**           | **What you would use it for**                   |
| ------------ | --------------------------- | ----------------------------------------------- |
| `webhook_id` | Its unique reference        | Joining to deliveries                           |
| `name`       | Its name                    | Readable labels                                 |
| `url`        | Where it posts to           | Identifying the receiving system                |
| `is_active`  | True when it is switched on | Counting live integrations against retired ones |
| `created_by` | Who set it up               | Attribution                                     |
| `created_at` | When it was set up          | The time axis                                   |

### 9.2 `analytics_webhook_deliveries`

Every webhook that fired.

**Shape:** per-record · **Grain:** one row per delivery · **Dates:** `delivered_at`

| **Column**       | **What it holds**                        | **What you would use it for**  |
| ---------------- | ---------------------------------------- | ------------------------------ |
| `delivery_id`    | Its unique reference                     | Counting deliveries            |
| `webhook_id`     | Which webhook fired                      | Comparing integrations         |
| `webhook_name`   | Its name                                 | Readable labels without a join |
| `event_id`       | The event that triggered it              | Tracing one delivery           |
| `document_id`    | The document involved                    | Joining to the document        |
| `queue_id`       | The queue                                | Comparing queues               |
| `user_processed` | The person involved, where there was one | Attribution                    |
| `delivered_at`   | When it fired                            | Delivery volume over time      |

**To tell integrations apart**, use `webhook_id` or `name`.

### 9.3 `analytics_concur_reports`

Expense reports from SAP Concur, for organisations using that integration.

**Shape:** per-record · **Grain:** one row per report · **Dates:** `report_created_at`

| **Column**           | **What it holds**                                            | **What you would use it for**                               |
| -------------------- | ------------------------------------------------------------ | ----------------------------------------------------------- |
| `report_id`          | The report's reference                                       | Counting reports                                            |
| `report_status`      | The Concur status code: **C**, **F** or **O**                | Prefer `derived_status` in 9.4, which spells these out      |
| `error_code`         | The Concur error, where the report failed                    | Grouping failures by cause                                  |
| `rejection_remark`   | The rejection text                                           | Reading the reason on drill-through                         |
| `employee_email`     | The employee the report belongs to                           | Attribution                                                 |
| `employee_name`      | Their name                                                   | Readable labels                                             |
| `employee_number`    | Their staff number                                           | Joining to your own HR data                                 |
| `expense_category`   | The category, such as **Hotel** or **Airfare-International** | Spend breakdown by category                                 |
| `transaction_amount` | The amount claimed                                           | **Sum** it for spend, or **Average** it for a typical claim |
| `requires_mailing`   | True when a physical copy is required                        | Counting reports needing manual handling                    |
| `queue_id`           | The queue                                                    | Comparing queues                                            |
| `report_created_at`  | When the report was raised                                   | The time axis                                               |

### 9.4 `analytics_concur_report_status`

The same reports with the status codes translated into plain words.

**Shape:** per-record · **Grain:** one row per report · **Dates:** `report_date`

| **Column**         | **What it holds**                                                 | **What you would use it for**                                                                                                                                       |
| ------------------ | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `report_id`        | The report's reference                                            | Counting reports                                                                                                                                                    |
| `queue_id`         | The queue                                                         | Comparing queues                                                                                                                                                    |
| `report_date`      | The day the report was raised                                     | The time axis                                                                                                                                                       |
| `report_status`    | The Concur code                                                   | Cross-referencing with Concur itself                                                                                                                                |
| `error_code`       | The Concur error                                                  | Grouping failures by cause                                                                                                                                          |
| `rejection_remark` | The rejection text                                                | Reading the reason on drill-through                                                                                                                                 |
| `employee_email`   | The employee                                                      | Attribution                                                                                                                                                         |
| `derived_status`   | **Approved**, **Rejected**, **Unexpectedly Rejected** or **Open** | **The status column to chart.** *Unexpectedly Rejected* marks a rejection whose code is not one of the known business reasons, which is usually worth a closer look |
| `requires_mailing` | True when a physical copy is required                             | Counting reports needing manual handling                                                                                                                            |

### 9.5 `analytics_concur_invoices`

Invoices from Concur, with their verification and duplicate outcomes.

**Shape:** per-record · **Grain:** one row per invoice · **Dates:** `invoice_created_at`

| **Column**            | **What it holds**                                                            | **What you would use it for**   |
| --------------------- | ---------------------------------------------------------------------------- | ------------------------------- |
| `invoice_id`          | The invoice reference                                                        | Counting invoices               |
| `report_id`           | The report it belongs to                                                     | Joining to 9.3 and 9.4          |
| `invoice_type`        | The kind of invoice, such as **Electronic Fapiao** or **Malaysia e-Invoice** | Splitting by regulatory type    |
| `vendor`              | The supplier                                                                 | Spend or volume by vendor       |
| `verification_status` | **Verified** or **Failed**                                                   | Verification pass rate          |
| `duplicate_status`    | **Unique** or **Duplicate**                                                  | Measuring duplicate submissions |
| `queue_id`            | The queue                                                                    | Comparing queues                |
| `invoice_created_at`  | When the invoice was raised                                                  | The time axis                   |

---

## 10. Value reference

The values you will meet most often when filtering.

**Document status** (`status` on `analytics_documents`)

| **Value**         | **Meaning**                                                                  |
| ----------------- | ---------------------------------------------------------------------------- |
| **RECEIVED**      | Arrived and scanned, waiting for review                                      |
| **PROCESSING**    | Being scanned now                                                            |
| **UPLOADED**      | Accepted but not yet in a queue                                              |
| **COMPLETED**     | Reviewed and approved, not yet exported                                      |
| **EXPORTED**      | Sent to the destination system                                               |
| **EXPORT_FAILED** | Export was attempted and did not go through                                  |
| **REJECTED**      | Turned away during review                                                    |
| **REMOVED**       | Deleted                                                                      |
| **SPLITTED**      | Split into separate documents                                                |
| **DUPLICATE**     | Already seen. Most duplicates are marked in `error_message` rather than here |

**Ingestion channel** (`uploaded_from`): **email**, **API**, **UI**, **plus_email**, **dropbox**, **drive**, **erp**, **peppol** and other connected systems.

**Export format** (`exported_type` and `export_type`): **XML**, **CSV**, **JSON**, **TXT**, **CONCUR**, **XERO**, **PEPPOL**, **SAP4HANA**, **IRAS**, **REDACTED_PDF**, **MATCHING**, **WEBHOOK**.

**Document type** (`doc_type`): **INVOICE**, **RECEIPT**, **PURCHASEORDER**, **BANKSTAT**, **PASSPORT**, **NRIC** and the regional invoice variants such as **INDIANINVOICE**, **USINVOICE**, **EMEAINVOICE**, **FAPIAOINVOICE**. A blank value means the document never reached classification.

---

## 11. Good to know

* **Only tables with a date column respond to the Date filter.** Each entry above states its dates. Where it says *Dates: none*, the figures cover all time.
* **Counting rows is not always counting documents.** In `analytics_document_fields`, `analytics_field_differentials`, `analytics_export_logs` and `analytics_review_logs`, one document produces many rows. Use **Number of distinct values** on `document_id` when you mean documents.
* **Generated documents are excluded from most tables.** Documents Staple created rather than you uploading them are left out of most summaries. `analytics_documents` keeps them, flagged by `created_by_supernova`.
* **Everything here is reachable through the question builder**, including calculations, using **Custom column** and **Custom expression**. See [Building a chart yourself](/business-dashboard/building-a-chart-yourself).