POST
/
events
/
usage
curl --request POST \
  --url https://api.cloud.flexprice.io/v1/events/usage \
  --header 'Content-Type: */*' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "aggregation_type": "COUNT",
  "customer_id": "customer456",
  "end_time": "2024-03-20T00:00:00Z",
  "event_name": "api_request",
  "external_customer_id": "customer456",
  "filters": {},
  "property_name": "request_size",
  "start_time": "2024-03-13T00:00:00Z",
  "window_size": "MINUTE"
}'
{
  "event_name": "<string>",
  "results": [
    {
      "value": 123,
      "window_size": "<string>"
    }
  ],
  "type": "COUNT",
  "value": 123
}

Authorizations

x-api-key
string
header
required

Enter your API key in the format x-api-key <api-key>*

Body

*/*
Request body
aggregation_type
enum<string>
required
Available options:
COUNT,
SUM,
AVG,
COUNT_UNIQUE
event_name
string
required
Example:

"api_request"

customer_id
string
Example:

"customer456"

end_time
string
Example:

"2024-03-20T00:00:00Z"

external_customer_id
string
Example:

"customer456"

filters
object
property_name
string

will be empty/ignored in case of COUNT

Example:

"request_size"

start_time
string
Example:

"2024-03-13T00:00:00Z"

window_size
enum<string>
Available options:
MINUTE,
HOUR,
DAY

Response

200
application/json
OK
event_name
string
results
object[]
type
enum<string>
Available options:
COUNT,
SUM,
AVG,
COUNT_UNIQUE
value
number