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

# CSV

> CSV data source — split out from the Data Sources overview

<Info>
  **Status: Full setup.** The CSV endpoint accepts a data file via `POST` request from any source capable of producing one.
</Info>

<Steps>
  <Step title="Send the file to the upload endpoint">
    ```text theme={null}
    https://<your-subdomain>.communityhub.cloud/api/data-hub/upload/csv
    ```
  </Step>

  <Step title="Include your organization's upload token">
    ```text theme={null}
    user-token: <your-upload-token>
    ```

    <Warning>
      Your upload token is a credential — treat it like a password. Generate and rotate tokens from your Data Hub organization settings; never share one in a support ticket or commit it to source control.
    </Warning>
  </Step>

  <Step title="Match the expected column format">
    The uploaded file should include the following columns:

    | Column                   | Description                                                          |
    | ------------------------ | -------------------------------------------------------------------- |
    | `data_source_id`         | ID for tracking the data source within Data Hub                      |
    | `data_source_name`       | Name of the datalogger                                               |
    | `variable_id`            | ID of the variable within Data Hub                                   |
    | `is_enabled`             | Whether the variable is enabled — only enabled variables record data |
    | `variable_type`          | `totalizer`, `instantaneous measurement`, or `average rate`          |
    | `source_name`            | Variable name as reported by the datalogger                          |
    | `display_name`           | Variable name shown to users in the Data Hub frontend                |
    | `last_recorded_data`     | Last value received from the datalogger                              |
    | `last_recorded_time`     | Timestamp of the last received value                                 |
    | `resource_type`          | Type of resource — e.g. water, electricity                           |
    | `source_unit`            | Unit as received from the datalogger                                 |
    | `storage_unit`           | Unit assigned after processing the incoming data                     |
    | `pulse_multiplier_value` | Multiplier value used in the pulse formula (pulse variables only)    |
    | `data_hub_id`            | Unique formula ID used across Data Hub                               |
    | `description`            | Free-text description (often imported from BuildingOS)               |

    <Note>
      A sample CSV template is available from the Data Hub team on request.
    </Note>
  </Step>
</Steps>
