Metering Events

List metering events

Changed on

List ingested events.

get/v3/openmeter/events

Request

  • Base URL
    https://global.api.konghq.com
  • Auth
    • HTTP bearer
    • or HTTP bearer
    • or HTTP bearer
    • or HTTP bearer

Query parameters

page, CursorPaginationQueryPage

Determines which page of the collection to retrieve.

size, integer

The number of items to include per page.

after, string

Request the next page of data, starting with the item after this parameter.

before, string

Request the previous page of data, starting with the item before this parameter.

filter, ListEventsParamsFilter

Filter options for listing ingested events.

id, object

Filter events by ID.

source, object

Filter events by source.

subject, object

Filter events by subject.

type, object

Filter events by type.

customer_id, union

Filter events by the associated customer ID.

time, union

Filter events by event time.

ingested_at, union

Filter events by the time the event was ingested.

stored_at, union

Filter events by the time the event was stored.

Filter events returned in the response.

To filter events by subject add the following query param: filter[subject][eq]=customer-1

{
  "customer_id": "01G65Z755AFWAKHE12NY0CQ9FH",
  "time": {
    "eq": "2022-03-30T07:20:50Z"
  },
  "ingested_at": {
    "eq": "2022-03-30T07:20:50Z"
  },
  "stored_at": {
    "eq": "2022-03-30T07:20:50Z"
  }
}
sort, string

The asc suffix is optional as the default sort order is ascending. The desc suffix is used to specify a descending order. Multiple sort attributes may be provided via a comma separated list. JSONPath notation may be used to specify a sub-attribute (eg: 'foo.bar desc').

Example:created_at desc

Sort events returned in the response. Supported sort attributes are:

  • time (default)
  • ingested_at
  • stored_at

When omitted, events are sorted by time desc (most recent first). When a sort field is provided without a suffix, it sorts descending. Append the asc suffix to sort ascending, or the desc suffix to sort descending.

Response

Cursor paginated response.

IngestedEventPaginatedResponse required

Cursor paginated response.

data, MeteringIngestedEvent[] required
meta, CursorMeta required

Pagination metadata.

Example response

{
  "data": [
    {
      "event": {
        "id": "5c10fade-1c9e-4d6c-8275-c52c36731d3c",
        "source": "service-name",
        "specversion": "1.0",
        "type": "prompt",
        "subject": "customer_key",
        "time": "2023-01-01T01:01:01.001Z"
      },
      "customer": {
        "id": "01G65Z755AFWAKHE12NY0CQ9FH"
      },
      "ingested_at": "2023-01-01T01:01:01.001Z",
      "stored_at": "2023-01-01T01:01:02.001Z"
    }
  ],
  "meta": {
    "page": {
      "size": 10
    }
  }
}

Changes

    • breaking

      added to the invalid_parameters/items response property oneOf list for the response status

    • warning

      added the new key_invalid enum value to the invalid_parameters/items/oneOf[#/components/schemas/InvalidParameterStandard]/rule response property for the response status

    • warning

      added the new unique enum value to the invalid_parameters/items/oneOf[#/components/schemas/InvalidParameterStandard]/rule response property for the response status