Skip to main content
POST
/
v1
/
usage
/
delete
Node.js
import { PriceOS } from "priceos";
import type { MyFeatures } from "./priceos.types";

const priceos = new PriceOS<MyFeatures>(process.env.PRICEOS_API_KEY!);

const result = await priceos.usage.deleteEvents({
  eventIds: ["event_123", "event_456"],
});
{
  "deletedCount": 123
}

Headers

x-api-key
string
required

API key from your PriceOS dashboard.

Body

application/json
customerId
string | null

Internal customer ID. Required when deleting by filters instead of eventIds.

featureKey
string | null

Optional feature key to scope deletes. Only valid when customerId is provided.

customRange
object

Optional custom time range (Unix ms start/end) for deletes. Only valid with customerId. Mutually exclusive with period.

period
enum<string>

Optional usage period to delete for (current or previous). Only valid with customerId. Mutually exclusive with customRange.

Available options:
current,
previous
eventIds
string<uuid>[]

Optional usage event IDs to delete directly. Cannot be combined with customerId filters.

Required array length: 1 - 1000 elements

Response

Usage events deleted

Usage event delete result.

deletedCount
integer
required

Number of usage events deleted.