v47

latestOpenAPI 3.1.0raw.githubusercontent.com2025-11-064829.2 KB
API Metering

Meter an API request

Meter an API request

post/v2/apis/requests

Request body

transactionIdstring required

A client-supplied unique identifier used to correlate request and response pairs across /meter/v2/apis/requests and /meter/v2/apis/response endpoints. Must be consistent between related API calls to ensure proper usage tracking and analytics.

sourceIdstring

Sources are typically individual API endpoints. For existing sources, the ID can be found in the Revenium platform on the sources page or retrieved programmatically via the list sources endpoint. A sourceId is created automatically for new sources.

credentialstring

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'

Specifies the originating platform or gateway of the metered API traffic. This helps Revenium properly process and categorize incoming metrics according to their source system architecture. If not specified, defaults to 'UNKNOWN'.

method'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'OPTIONS' | 'HEAD'

The HTTP method of the request

resourcestring
        Visible in the ‘resource’ field when viewing sources in the revenium application. 
        The resource field (often a full URL or relative URI) can be used to auto-match 
        transactions to existing sources based on the URL/URI accessed in the API call.
    
contentTypestring

The content type of the request

remoteHoststring

The IP address for the origin of the request. Used by Revenium to report API usage by geography.

userAgentstring

The user agent of the request

requestMessageSizeinteger

The size of the request message in bytes

Example request

{
  "transactionId": "123e4567-e89b-12d3-a456-426614174000",
  "sourceId": "5Agqrm:c4917580-281d-48e1-a206-05e595f006ec",
  "credential": "The credential used to access the API.  Visible on the subscriber credentials in page in the Revenium platform.",
  "sourceType": "KONG",
  "method": "GET",
  "resource": "https://api.example.com/resource",
  "contentType": "application/json",
  "remoteHost": "192.168.1.1",
  "userAgent": "Mozilla/5.0",
  "requestMessageSize": 1024
}

Response

API request successfully metered

objectstring required

Type of the object, typically 'metering'

labelstring required

A descriptive label for the metering response

createdstring

ISO8601 formatted timestamp when the response was created

updatedstring

ISO8601 formatted timestamp when the response was last updated

idstring required

Unique identifier for the metering response

signaturestring required

Signature used for validating the response data

_linksLinks

Example response

{
  "object": "metering",
  "label": "Metering Response",
  "created": "2025-03-02T15:04:05Z",
  "updated": "2025-03-02T15:04:06Z",
  "id": "abc123",
  "signature": "signature123"
}