cURL
curl --request POST \
--url https://us.api.flexprice.io/v1/events/delete \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"external_customer_ids": [
"<string>"
],
"period_end": "2026-03-28T00:00:00Z",
"period_start": "2026-03-01T00:00:00Z",
"event_ids": [
"<string>"
],
"feature_ids": [
"<string>"
],
"skip_payload": true
}
'from flexprice import Flexprice
from flexprice.utils import parse_datetime
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.events.delete_events(external_customer_ids=[
"<value 1>",
"<value 2>",
], period_end=parse_datetime("2026-03-28T00:00:00Z"), period_start=parse_datetime("2026-03-01T00:00:00Z"))
# Handle response
print(res)import { Flexprice } from "@flexprice/sdk";
const flexprice = new Flexprice({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await flexprice.events.deleteEvents({
externalCustomerIds: [
"<value 1>",
"<value 2>",
],
periodEnd: new Date("2026-03-28T00:00:00Z"),
periodStart: new Date("2026-03-01T00:00:00Z"),
});
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"github.com/flexprice/go-sdk/v2/types"
"github.com/flexprice/go-sdk/v2/models/types"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Events.DeleteEvents(ctx, types.DeleteEventsRequest{
ExternalCustomerIds: []string{
"<value 1>",
"<value 2>",
},
PeriodEnd: types.MustTimeFromString("2026-03-28T00:00:00Z"),
PeriodStart: types.MustTimeFromString("2026-03-01T00:00:00Z"),
})
if err != nil {
log.Fatal(err)
}
if res.DeleteEventsResponse != nil {
// handle response
}
}{
"deleted_events": 123,
"deleted_meter_usage_rows": 123
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Events
Delete events
Hard-deletes ingested events and the meter usage they produced for the named customers and period, optionally narrowed by feature or by exact event id. Refused when anything in scope has already been invoiced. Irreversible.
POST
/
events
/
delete
cURL
curl --request POST \
--url https://us.api.flexprice.io/v1/events/delete \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"external_customer_ids": [
"<string>"
],
"period_end": "2026-03-28T00:00:00Z",
"period_start": "2026-03-01T00:00:00Z",
"event_ids": [
"<string>"
],
"feature_ids": [
"<string>"
],
"skip_payload": true
}
'from flexprice import Flexprice
from flexprice.utils import parse_datetime
with Flexprice(
api_key_auth="<YOUR_API_KEY_HERE>",
) as f_client:
res = f_client.events.delete_events(external_customer_ids=[
"<value 1>",
"<value 2>",
], period_end=parse_datetime("2026-03-28T00:00:00Z"), period_start=parse_datetime("2026-03-01T00:00:00Z"))
# Handle response
print(res)import { Flexprice } from "@flexprice/sdk";
const flexprice = new Flexprice({
apiKeyAuth: "<YOUR_API_KEY_HERE>",
});
async function run() {
const result = await flexprice.events.deleteEvents({
externalCustomerIds: [
"<value 1>",
"<value 2>",
],
periodEnd: new Date("2026-03-28T00:00:00Z"),
periodStart: new Date("2026-03-01T00:00:00Z"),
});
console.log(result);
}
run();package main
import(
"context"
flexprice "github.com/flexprice/go-sdk/v2"
"github.com/flexprice/go-sdk/v2/types"
"github.com/flexprice/go-sdk/v2/models/types"
"log"
)
func main() {
ctx := context.Background()
s := flexprice.New(
flexprice.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Events.DeleteEvents(ctx, types.DeleteEventsRequest{
ExternalCustomerIds: []string{
"<value 1>",
"<value 2>",
},
PeriodEnd: types.MustTimeFromString("2026-03-28T00:00:00Z"),
PeriodStart: types.MustTimeFromString("2026-03-01T00:00:00Z"),
})
if err != nil {
log.Fatal(err)
}
if res.DeleteEventsResponse != nil {
// handle response
}
}{
"deleted_events": 123,
"deleted_meter_usage_rows": 123
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}{
"code": "http_client_error",
"http_status_code": 123,
"message": "<string>"
}Body
application/json
Deletion scope

