mutation ReportUsage($input: ReportUsageInput!) {
reportUsage(input: $input) {
createdAt
credit {
consumed
currencyId
currentUsage
timestamp
usageLimit
usagePeriodEnd
}
currentUsage
customerId
environmentId
featureId
}
}{
"input": {
"customerId": "string",
"featureId": "string",
"value": 1.5
}
}{
"data": {
"reportUsage": {
"createdAt": "value",
"credit": {
"consumed": 1.5,
"currencyId": "string",
"currentUsage": 1.5,
"timestamp": "value",
"usageLimit": 1.5,
"usagePeriodEnd": "value"
},
"currentUsage": 1.5,
"customerId": "string",
"environmentId": "string",
"featureId": "string"
}
}
}reportUsage
Report usage
reportUsage(input: ReportUsageInput!): UsageMeasurementWithCurrentUsage!Arguments
Input parameters for reporting usage
Returns
Timestamp of when the record was created
The optimistic balance of the credit wallet (currency) that this feature consumes from, in credit units. It is the per-currency total shared across every feature drawing on that currency — not this feature’s individual consumption — and reflects usage before async reconciliation. Populated only for credit-backed features.
The current measured usage value
Customer id
The unique identifier for the environment
Feature id
Unique identifier for the entity
The date when the next usage reset will occur
The customer resource this usage applies to. Optional — only required if the customer has multiple resources (for example, one subscription per workspace or site) and usage needs to be tracked separately per resource; omit it to report usage at the customer level.
Timestamp
The end date of the usage period in which this measurement resides (for entitlements with a reset period)
The start date of the usage period in which this measurement resides (for entitlements with a reset period)
The usage measurement record
mutation ReportUsage($input: ReportUsageInput!) {
reportUsage(input: $input) {
createdAt
credit {
consumed
currencyId
currentUsage
timestamp
usageLimit
usagePeriodEnd
}
currentUsage
customerId
environmentId
featureId
}
}{
"input": {
"customerId": "string",
"featureId": "string",
"value": 1.5
}
}{
"data": {
"reportUsage": {
"createdAt": "value",
"credit": {
"consumed": 1.5,
"currencyId": "string",
"currentUsage": 1.5,
"timestamp": "value",
"usageLimit": 1.5,
"usagePeriodEnd": "value"
},
"currentUsage": 1.5,
"customerId": "string",
"environmentId": "string",
"featureId": "string"
}
}
}