> ## 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.

# Update Usage Event

> Update a usage event by ID.



## OpenAPI

````yaml PUT /v1/usage/{id}
openapi: 3.1.0
info:
  title: PriceOS Public API
  version: 1.0.0
servers: []
security: []
paths:
  /v1/usage/{id}:
    put:
      summary: Update usage event
      description: Update a usage event by ID.
      parameters:
        - schema:
            type: string
            format: uuid
            description: Usage event ID.
          required: true
          description: Usage event ID.
          name: id
          in: path
        - 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:
                amount:
                  type: number
                  exclusiveMinimum: 0
                  description: Optional updated usage amount.
                occurredAt:
                  type: integer
                  description: >-
                    Optional updated Unix timestamp (ms) when the event
                    occurred.
                eventKey:
                  type:
                    - string
                    - 'null'
                  description: >-
                    Stable unique identifier for this event. Reuse it on retries
                    and for deduplication. Use null to clear.
                metadata:
                  type:
                    - object
                    - 'null'
                  additionalProperties:
                    type: string
                  description: >-
                    Optional updated metadata (string key/value pairs). Use null
                    to clear.
      responses:
        '200':
          description: Usage event updated
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: Usage event ID.
                  amount:
                    type: number
                    description: Usage amount recorded.
                  occurredAt:
                    type: integer
                    description: Unix timestamp (ms) when the event occurred.
                  eventKey:
                    type:
                      - string
                      - 'null'
                    description: >-
                      Stable unique identifier for this event. Reuse it on
                      retries and for deduplication.
                  source:
                    type: string
                    enum:
                      - usage
                      - usage_set_adjustment
                    description: Usage event source.
                  metadata:
                    type: object
                    additionalProperties:
                      type: string
                    description: Event metadata (string key/value pairs).
                required:
                  - id
                  - amount
                  - occurredAt
                  - source
                description: Updated usage event.
        '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.updateEvent({
              id: "event_123",
              amount: 2,
              metadata: {
                source: "admin_tool",
              },
            });
        - lang: bash
          label: cURL
          source: |-
            curl -X PUT "https://api.priceos.com/v1/usage/event_123" \
              -H "x-api-key: PRICEOS_API_KEY" \
              -H "Content-Type: application/json" \
              -d '{
                "amount": 2,
                "metadata": {
                  "source": "admin_tool"
                }
              }'

````