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

# How-to guides: Manage usage events

> This document shows how to find, create, and view usage-event collections, add data fields, send usage events, set up S3 ingestion for a usage-event collection, and download usage events.

## Find a usage-event collection

### Prerequisites

* You need a role with the **Can Read Usage Event** permission.

### Steps

1. Go to **Usage** > **Usage Events**.

   The list shows the [usage-event collections](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#usage-event-collection) of your [organization](https://zenskar.com/docs/20260301/zenskar-modules/settings/glossary.md#organization).

2. Optional: To narrow the list, click **FILTER**. In **Filter by...**, select **Name**, **API Slug**, or **Created At**. Select a condition and a value, and click **APPLY FILTER**.

   The list shows only the usage-event collections that match. To remove all filters, click **Clear All Filters**.

3. Optional: To sort the list, click a column header. Click it again to sort in descending order, and a third time to remove the sorting.

4. Optional: To see the [data schema](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#data-schema) of a usage-event collection, click **View** in its **Data Schema** column.

   The **Data Schema** window shows the data schema as JSON.

5. In **Search Usage Event**, enter part of the name, and select the usage-event collection from the results. You can also click the usage-event collection in the list.

The screen of the usage-event collection opens.

See [Usage Events screen: controls, columns, and filters](https://zenskar.com/docs/20260301/zenskar-modules/usage/reference/usage-events.md#usage-events-screen-controls-columns-and-filters).

## Create a usage-event collection

### Prerequisites

* You need a role with the **Can Create Usage Event** and **Can Read Usage Event** permissions.
* To read [usage events](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#usage-event) from Amazon S3, your organization needs a [bucket connection](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#bucket-connection). See [Connect the bucket in Zenskar](https://zenskar.com/docs/20260301/zenskar-modules/usage/how-to-guides/s3-ingestion.md#connect-the-bucket-in-zenskar).

### Steps

> [!CAUTION]
>
> You cannot change the name or the [API slug](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#api-slug) after you create the usage-event collection. You cannot remove or rename a [data field](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#data-field), or change its data type. Check them before you click **ADD USAGE EVENT**.

1. Go to **Usage** > **Usage Events**.

2. Click **ADD USAGE EVENT**. The **Add Usage Event** screen opens.

3. In **Usage Event Name**, enter a name.

4. Under **API Slug Endpoint**, check the API slug.

   By default, **Follow the usage event name** is selected, and the API slug follows the name.

5. Optional: To choose a different API slug, clear **Follow the usage event name**, and enter the API slug.

6. Optional: To read the usage events of the usage-event collection from Amazon S3, turn on **Enable S3 ingestion for this usage event**. The switch shows only when your organization has a bucket connection.

   **S3 Directory Name** shows the folder that Zenskar reads, after the name of the bucket. By default, the folder is the API slug.

7. Optional: In **Error / DLQ Directory Name**, enter an [error folder](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#error-folder). The field shows only when your organization has an [ingestion-error bucket](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#ingestion-error-bucket).

8. Under **Root Fields**, check the two [root fields](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#root-field), `customer_id` and `timestamp`.

9. Under **Your Data Schema**, click **+ ADD NEW DATA FIELD**.

10. In **Data field**, enter the name of the data field.

11. In **Data type**, select the data type. See [Data fields: the details that you add](https://zenskar.com/docs/20260301/zenskar-modules/usage/concepts/usage-events.md#data-fields-the-details-that-you-add).

12. Repeat steps 9 to 11 for each data field. To remove a data field before you save, click its delete icon.

13. Check **Data Schema Preview**. It shows the data schema as JSON.

14. Click **ADD USAGE EVENT**.

Zenskar creates the usage-event collection. The **Usage Events** list opens.

See [Add Usage Event screen: fields and their rules](https://zenskar.com/docs/20260301/zenskar-modules/usage/reference/usage-events.md#add-usage-event-screen-fields-and-their-rules).

## View a usage-event collection

### Prerequisites

* You need a role with the **Can Read Usage Event** permission.

### Steps

1. Go to **Usage** > **Usage Events**.

2. Click the [usage-event collection](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#usage-event-collection). The screen opens with the name of the usage-event collection as its title.

3. Optional: To copy the [API endpoint](https://developer.mozilla.org/en-US/docs/Glossary/REST), click the copy icon next to **API Slug Endpoint**.

   The API endpoint is `https://api.zenskar.com/usage/` followed by the [API slug](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#api-slug).

4. Optional: To see the [data schema](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#data-schema), click **View** next to **Data Schema**.

   The **Data Schema** window shows the data schema as JSON.

5. Check the **Events Table**.

   The table shows the 20 [usage events](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#usage-event) with the latest `timestamp`, newest first. It has one column for each field of the usage events.

6. Optional: To show usage events that just arrived, click **REFRESH TABLE**. A usage event can take a few seconds to show.

7. Optional: To narrow the table, click **FILTER**. In **Filter by...**, select a field. Select a condition and a value, and click **APPLY FILTER**.

   The table shows the 20 latest usage events that match. To see all matching usage events, download them. See [Download usage events](#download-usage-events).

See [Usage-event collection screen: details, data fields, S3 ingestion, and usage events](https://zenskar.com/docs/20260301/zenskar-modules/usage/reference/usage-events.md#usage-event-collection-screen-details-data-fields-s3-ingestion-and-usage-events).

## Add a data field

### Prerequisites

* You need a role with the **Can Update Usage Event** and **Can Read Usage Event** permissions.

### Steps

> [!CAUTION]
>
> You cannot remove or rename a [data field](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#data-field) after you add it. You cannot change its data type either. Check the name and the data type before you click **SUBMIT**.

> [!WARNING]
>
> When the name matches a data field that the [data schema](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#data-schema) already has, Zenskar keeps the existing data field and its data type. Zenskar adds nothing. Check the names in **Data Schema** first.

1. Go to **Usage** > **Usage Events**, and click the [usage-event collection](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#usage-event-collection).
2. Click **NEW FIELD TO DATA SCHEMA**. The section expands.
3. In **Data field name**, enter the name.
4. In **Data field type**, select the data type. See [Data fields: the details that you add](https://zenskar.com/docs/20260301/zenskar-modules/usage/concepts/usage-events.md#data-fields-the-details-that-you-add).
5. Click **SUBMIT**.

   [Usage events](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#usage-event) that arrived before you add the data field have no value for it.

Zenskar adds the data field to the data schema. To close the section without adding a data field, click **CANCEL**.

See [New field to data schema](https://zenskar.com/docs/20260301/zenskar-modules/usage/reference/usage-events.md#new-field-to-data-schema).

## Upload usage events from a CSV file

### Prerequisites

* You need a role with the **Can Create Usage Event** and **Can Read Usage Event** permissions.
* The CSV file must be at most 100 MB.
* The CSV file must have one column for each field of the [data schema](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#data-schema), and no other columns. The column headers are the field names: `customer_id`, `timestamp`, and the name of each [data field](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#data-field) without `data.` in front, such as `region`.

### Steps

1. Go to **Usage** > **Usage Events**, and click the [usage-event collection](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#usage-event-collection).

2. Click **UPLOAD CSV**. The **Upload CSV** window opens.

3. Optional: To get a file with the right columns, click **Download sample CSV file**.

   Your browser saves `sample.csv`. It has the columns that the data schema needs, and 100 rows of example values.

4. Click **Click to upload**, and select the file. You can also drag the file into the window.

5. If the window shows **Date Format** and **Timestamp Format**, select the formats that the file uses. The lists show the formats that Zenskar detects in the file.

6. Optional: To check the rows, click **Preview**. To download the rows as Zenskar reads them, click **Processed CSV**.

7. Click **IMPORT CSV DATA**. Keep the window open until the upload finishes.

   Zenskar checks every row against the data schema before it stores any row. If one row fails the check, Zenskar stores none of the rows. The dashboard shows the number of the row.

   > [!WARNING]
   >
   > When the upload stops partway after the check, for example because of a network error, some [usage events](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#usage-event) can already be stored. A usage event cannot be deleted, so a second upload of the same rows stores them twice. Check the **Events Table** before you upload the file again.

Zenskar stores the usage events. The window closes. A usage event can take a few seconds to show in the **Events Table**.

See [Upload CSV window](https://zenskar.com/docs/20260301/zenskar-modules/usage/reference/usage-events.md#upload-csv-window).

## Add a single usage event

Add one usage event from the dashboard, for example to test a usage-event collection.

### Prerequisites

* You need a role with the **Can Create Usage Event** and **Can Read Usage Event** permissions.

### Steps

1. Go to **Usage** > **Usage Events**, and click the [usage-event collection](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#usage-event-collection).

2. Next to **UPLOAD CSV**, click the arrow, and click **Add a single event**. The **Add New Event** panel opens.

3. In **Customer ID**, enter the customer ID.

4. Under **Timestamp**, in **Date**, select the date.

5. In **Time**, enter the time.

6. Optional: Enter a value for each [data field](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#data-field).

   The panel shows one entry for each data field, labeled with its name and data type.

7. Click **ADD EVENT**.

Zenskar stores the [usage event](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#usage-event). The panel closes. To close the panel without adding a usage event, click **CANCEL**.

See [Add New Event panel](https://zenskar.com/docs/20260301/zenskar-modules/usage/reference/usage-events.md#add-new-event-panel).

## Send usage events through the API

### Prerequisites

* You need a role with the **Can Read Usage Event** permission to open the sample request.
* You need an API key of your [organization](https://zenskar.com/docs/20260301/zenskar-modules/settings/glossary.md#organization). See [API keys](https://zenskar.com/docs/20260301/zenskar-modules/settings/api-keys.md).
* The [usage-event collection](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#usage-event-collection) must exist. See [Create a usage-event collection](#create-a-usage-event-collection).

### Steps

1. Go to **Usage** > **Usage Events**, and click the usage-event collection.

2. Next to **Sample Request**, click **View**.

   The **Sample Request** window shows a `curl` request to the [API endpoint](https://developer.mozilla.org/en-US/docs/Glossary/REST) of the usage-event collection, with the headers filled in.

3. Click the copy icon. To create an API key from the window, click **Create an API Key**.

4. In the copied request, replace `<your-api-key>` with your API key. Keep the `organisation` header. It holds the ID of your organization.

5. Replace the text after `--data-raw` with your [usage event](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#usage-event).

   Put the [root fields](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#root-field) at the top level, and the [data fields](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#data-field) inside `data`. Write `timestamp` as `YYYY-MM-DD HH:MM:SS`. The following request sends one usage event to the usage-event collection with the [API slug](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#api-slug) `api_calls`:

   ```bash theme={null}
   curl --location --request POST 'https://api.zenskar.com/usage/api_calls' \
   -H 'organisation: <organization-id>' \
   -H 'x-api-key: <your-api-key>' \
   -H 'Content-Type: application/json' \
   --data-raw '{"customer_id": "acme-corp", "timestamp": "2026-10-26 10:20:00", "data": {"region": "eu-west"}}'
   ```

   To send several usage events in one request, replace the single usage event with a JSON array of usage events:

   ```bash theme={null}
   --data-raw '[{"customer_id": "acme-corp", "timestamp": "2026-10-26 10:20:00", "data": {"region": "eu-west"}}, {"customer_id": "acme-corp", "timestamp": "2026-10-26 10:21:00", "data": {"region": "us-east"}}]'
   ```

6. Send the request.

See [Sample Request window](https://zenskar.com/docs/20260301/zenskar-modules/usage/reference/usage-events.md#sample-request-window).

## Set up S3 ingestion for a usage-event collection

### Prerequisites

* You need a role with the **Can Update Usage Event** and **Can Read Usage Event** permissions.
* Your [organization](https://zenskar.com/docs/20260301/zenskar-modules/settings/glossary.md#organization) needs a [bucket connection](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#bucket-connection). See [Connect the bucket in Zenskar](https://zenskar.com/docs/20260301/zenskar-modules/usage/how-to-guides/s3-ingestion.md#connect-the-bucket-in-zenskar).

### Steps

> [!WARNING]
>
> Zenskar reads only the files that arrive in the folder after you turn on [S3 ingestion](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#s3-ingestion). To read older files, upload them to the folder again after you save.

> [!WARNING]
>
> When your organization has no [ingestion-error bucket](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#ingestion-error-bucket), Zenskar keeps no record of the files that it rejects. To keep them, add an ingestion-error bucket before you upload files. See [Change the bucket connection](https://zenskar.com/docs/20260301/zenskar-modules/usage/how-to-guides/s3-ingestion.md#change-the-bucket-connection).

1. Go to **Usage** > **Usage Events**, and click the [usage-event collection](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#usage-event-collection).
2. Under **S3 Ingestion**, turn on the switch. The folder fields open.
3. In **S3 Directory Name**, check the folder. It starts as the [API slug](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#api-slug) of the usage-event collection, after the name of the bucket.
4. Optional: In **Error / DLQ Directory Name**, enter an [error folder](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#error-folder). The field shows only when your organization has an ingestion-error bucket.
5. Click **SAVE**.

See [S3 Ingestion](https://zenskar.com/docs/20260301/zenskar-modules/usage/reference/usage-events.md#s3-ingestion).

## Change the S3 folders of a usage-event collection

### Prerequisites

* You need a role with the **Can Update Usage Event** and **Can Read Usage Event** permissions.

### Steps

1. Go to **Usage** > **Usage Events**, and click the [usage-event collection](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#usage-event-collection).
2. Under **S3 Ingestion**, click **Edit**.
3. Change **S3 Directory Name**, or the [error folder](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#error-folder) in **Error / DLQ Directory Name**.
4. Click **SAVE**. To discard the change, click **CANCEL**.

To change the bucket, change the [bucket connection](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#bucket-connection). See [Change the bucket connection](https://zenskar.com/docs/20260301/zenskar-modules/usage/how-to-guides/s3-ingestion.md#change-the-bucket-connection).

See [S3 Ingestion](https://zenskar.com/docs/20260301/zenskar-modules/usage/reference/usage-events.md#s3-ingestion).

## Turn off S3 ingestion for a usage-event collection

### Prerequisites

* You need a role with the **Can Update Usage Event** and **Can Read Usage Event** permissions.

### Steps

> [!WARNING]
>
> Turning off [S3 ingestion](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#s3-ingestion) clears the folder and the [error folder](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#error-folder) of the usage-event collection. To read the folder again, turn S3 ingestion back on, and enter both folders again.

1. Go to **Usage** > **Usage Events**, and click the [usage-event collection](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#usage-event-collection).
2. Under **S3 Ingestion**, turn off the switch.

The dashboard turns off S3 ingestion right away, without asking for confirmation. Zenskar stops reading the folder.

## Download usage events

### Prerequisites

* You need a role with the **Can Read Usage Event** permission.

### Steps

> [!NOTE]
>
> One download holds at most 50,000 [usage events](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#usage-event). For more, add filters until the number is 50,000 or less, and download each part separately.

1. Go to **Usage** > **Usage Events**, and click the [usage-event collection](https://zenskar.com/docs/20260301/zenskar-modules/usage/glossary.md#usage-event-collection).

2. Optional: Filter the **Events Table**. See [View a usage-event collection](#view-a-usage-event-collection).

3. Click **DOWNLOAD EVENTS**.

   The **Export Events** window shows the number of usage events and the expected duration of the download.

4. If the **Events Table** has filters, the window lists them under **Use filters**, which is on. To download all usage events instead, turn off **Use filters**.

5. Click **EXPORT**. Keep the window open until the download finishes.

Your browser saves the file `events_export.csv`.

See [Export Events window](https://zenskar.com/docs/20260301/zenskar-modules/usage/reference/usage-events.md#export-events-window).


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