---
title: "Bulk Insert Usage Events"
method: POST
path: "/api/v1/usage-events/bulk"
tags: ["Usage Events"]
---

# Bulk Insert Usage Events

`POST /api/v1/usage-events/bulk`

Create multiple usage events in a single request. Supports both priceId and priceSlug for each event.

## Request body

- object
  - `usageEvents` object[], required
    - `subscriptionId` string, required
    - `amount` integer, required
    - `usageDate` integer — The date the usage occurred. If the usage occurs in a date that is outside of the current billing period, the usage will still be attached to the current billing period. Epoch milliseconds.
    - `transactionId` string, required — A unique identifier for the transaction. This is used to prevent duplicate usage events from being created.
    - `properties` object, nullable — Properties for the usage event. Only required when using the "count_distinct_properties" aggregation type.
    - `priceId` string — The internal ID of the price. If not provided, priceSlug is required.
    - `priceSlug` string — The slug of the price. If not provided, priceId is required.

## Response `200`

Successful response

- object
  - `usageEvents` UsageEventClientSelectSchema[], required
    - `id` string, required
    - `createdAt` integer, required — Epoch milliseconds.
    - `updatedAt` integer, required — Epoch milliseconds.
    - `livemode` boolean, required
    - `customerId` string, required
    - `subscriptionId` string, required
    - `usageMeterId` string, required
    - `billingPeriodId` string, nullable — The billing period the usage belongs to. If the usage occurs in a date that is outside of the current billing period, the usage will still be attached to the current billing peirod.
    - `amount` integer, required
    - `usageDate` integer, required — The date the usage occurred. If the usage occurs in a date that is outside of the current billing period, the usage will still be attached to the current billing period. Epoch milliseconds.
    - `transactionId` string, required — A unique identifier for the transaction. This is used to prevent duplicate usage events from being created.
    - `priceId` string, required
    - `properties` object, nullable — Properties for the usage event. Only required when using the "count_distinct_properties" aggregation type.

## Other responses

- `400` — Invalid input data
- `401` — Authorization not provided
- `403` — Insufficient access
- `500` — Internal server error

## Changes

- **2025-11-25** `71d495f9b7d8` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/flowglad/apis/flowglad-api/changes/api/v1/usage-events/bulk/post.md)

---

[API](https://skmtc.dev/flowglad/apis/flowglad-api.md) · [All operations](https://skmtc.dev/flowglad/apis/flowglad-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/flowglad/flowglad-api/revisions/d53efdb1a902/schema)
