---
title: "Meter an event"
method: POST
path: "/v2/events"
tags: ["Event Metering"]
---

# Meter an event

`POST /v2/events`

## Request

- Base URL: `https://api.revenium.io/meter`
- URL: `https://api.revenium.io/meter/v2/events`
- Auth: API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/revenium/apis/revenium-metering-api/docs/v2/events/post.ts> (a function with typed inputs; its response is checked against the schema)

Meter an event

## Request body

- MeteringEvent: The metering event
  - `transactionId` string, required: The unique identifier of the metering event
  - `payload` string, required: The rating payload as a JSON object. For example, if you are sending key value pairs of 'requestTokens' and 'responseTokens' with values of '1' and '2' respectively, the payload would be { "requestTokens": "1", "responseTokens": "2"}. If these keys do not already exist in Revenium, each key you send will be configured as a metering element on the relevant data source.
  - `sourceId` string: the sourceId
  - `subscriberCredentialId` string: The unique identifier of the credential
  - `sourceType` 'UNKNOWN' | 'AI' | 'SDK_PYTHON' | 'SDK_JS' | 'SDK_JVM' | 'SDK_SPRING' | 'SDK_DOTNET' | 'SDK_GOLANG' | 'SDK_RUST' | 'EBPF' | 'AWS' | 'AZURE' | 'SNOWFLAKE' | 'KONG' | 'GRAVITEE' | 'MULESOFT' | 'BOOMI' | 'REVENIUM' | 'INTERNAL', required: the source type

## Response `201`

API response successfully metered

- MeteringResponseResource: Metering response resource details for the metering API, providing metadata about response creation and validation.
  - `object` string, required: Type of the object, typically 'metering'
  - `label` string, required: A descriptive label for the metering response
  - `created` string: ISO8601 formatted timestamp when the response was created
  - `updated` string: ISO8601 formatted timestamp when the response was last updated
  - `id` string, required: Unique identifier for the metering response
  - `signature` string, required: Signature used for validating the response data
  - `_links` Links

## Other responses

- `400`: Invalid input data
- `401`: Unauthorized - Authentication required
- `403`: Forbidden - Insufficient permissions
- `404`: Not Found
- `409`: Conflict

## Changes

- **2025-11-06** `8fb79ecfebda`: 3 breaking, 1 warning, 5 info
  - the request property `sourceType` became required
  - the `payload` request property type changed from `object` to `string`
  - removed the required property `resourceType` from the response with the `201` status
  - removed the request property `subscriberCredential`
  - …5 more
- **2025-11-06** `2042270cbdca`: 2 breaking, 1 warning, 6 info
  - the `payload` request property type changed from `string` to `object`
  - removed the required property `object` from the response with the `201` status
  - removed the request property `subscriberCredentialId`
  - added the new optional request property `subscriberCredential`
  - …5 more
- **2025-06-18** `8fb79ecfebda`: 2 breaking, 1 warning, 2 info
  - the `payload` request property type changed from `object` to `string`
  - removed the required property `resourceType` from the response with the `201` status
  - removed the request property `subscriberCredential`
  - added the new optional request property `subscriberCredentialId`
  - …1 more
- **2025-06-18** `8a82b089285a`: 2 breaking, 1 warning, 2 info
  - the `payload` request property type changed from `string` to `object`
  - removed the required property `object` from the response with the `201` status
  - removed the request property `subscriberCredentialId`
  - added the new optional request property `subscriberCredential`
  - …1 more
- …earlier changes not shown

[Operation history](https://skmtc.dev/revenium/apis/revenium-metering-api/changes/v2/events/post.md)

---

[API](https://skmtc.dev/revenium/apis/revenium-metering-api.md) - [All operations](https://skmtc.dev/revenium/apis/revenium-metering-api/llms.txt) - [OpenAPI document](https://skmtc.dev/revenium/apis/revenium-metering-api/revisions/8fb79ecfebda?raw)
