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

# Delete Usage Events (Batch)

> Delete usage events by IDs or by customer selectors.



## OpenAPI

````yaml POST /v1/usage/delete
openapi: 3.1.0
info:
  title: PriceOS Public API
  version: 1.0.0
servers: []
security: []
paths:
  /v1/usage/delete:
    post:
      summary: Delete usage events
      description: Delete usage events by IDs or by customer selectors.
      parameters:
        - schema:
            type: string
            description: API key from your PriceOS dashboard.
          required: true
          description: API key from your PriceOS dashboard.
          name: x-api-key
          in: header
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                customerId:
                  type:
                    - string
                    - 'null'
                  description: >-
                    Internal customer ID. Required when deleting by filters
                    instead of eventIds.
                featureKey:
                  type:
                    - string
                    - 'null'
                  description: >-
                    Optional feature key to scope deletes. Only valid when
                    customerId is provided.
                customRange:
                  type: object
                  properties:
                    start:
                      type: integer
                      description: Unix timestamp (ms) start for the custom range.
                    end:
                      type: integer
                      description: Unix timestamp (ms) end for the custom range.
                  required:
                    - start
                    - end
                  description: >-
                    Optional custom time range (Unix ms start/end) for deletes.
                    Only valid with customerId. Mutually exclusive with period.
                period:
                  type: string
                  enum:
                    - current
                    - previous
                  description: >-
                    Optional usage period to delete for (current or previous).
                    Only valid with customerId. Mutually exclusive with
                    customRange.
                eventIds:
                  type: array
                  items:
                    type: string
                    format: uuid
                  minItems: 1
                  maxItems: 1000
                  description: >-
                    Optional usage event IDs to delete directly. Cannot be
                    combined with customerId filters.
      responses:
        '200':
          description: Usage events deleted
          content:
            application/json:
              schema:
                type: object
                properties:
                  deletedCount:
                    type: integer
                    description: Number of usage events deleted.
                required:
                  - deletedCount
                description: Usage event delete result.
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message.
                required:
                  - error
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message.
                required:
                  - error
        '404':
          description: Not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message.
                required:
                  - error
        '500':
          description: Server error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error message.
                required:
                  - error
      x-codeSamples:
        - lang: typescript
          label: Node.js
          source: >-
            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"],
            });
        - lang: bash
          label: cURL
          source: |-
            curl -X POST "https://api.priceos.com/v1/usage/delete" \
              -H "x-api-key: PRICEOS_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{
                "eventIds": ["event_123", "event_456"]
              }'

````