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

# Importing feature usage

<Warning>
  Importing feature usage is supported only for metered features with a Calculated Usage meter type.
</Warning>

<Warning>
  Before importing feature usage, ensure that the relevant customers have been imported to Stigg.
</Warning>

## Using the CLI

1. Create a file named `usage.json` containing the latest usage data for all features. The file **must follow this schema**:

<CodeGroup>
  ```json JSON theme={null}
  {
    "usages": [
      {
        "customerId": "lorem-ipsum",
        "resourceId": "site-1", // optional - required for multiple subscriptions product
        "featureId": "feature-seats",
        "usage": 5
      }
      // ...
    ]
  }
  ```
</CodeGroup>

2. Initiate the bulk import process:

<CodeGroup>
  ```shell shell theme={null}
  npx @stigg/bulk-import --usage-file usage.json
  ```
</CodeGroup>

<Note>
  The import function is idempotent; therefore, importing usage multiple times will produce the same result.
</Note>

## Using the API and SDKs

Use the [Report Usage Bulk](/api-and-sdks/api-reference/mutations/report-usage-bulk) endpoint and include the `updateBehavior: UsageUpdateBehavior.SET` property in each usage report.

<Note>
  The Report Usage Bulk endpoint supports up to **100 records per request** and has a rate limit of **600 requests per minute**. Requests are processed **synchronously**.
</Note>
