Skip to content
Oclavex is in private preview, available to selected users. Public signup is blocked. Request access at [email protected].

Charges consumption on a metered asset. Supply idempotencyKey so a retried consume returns the original decision instead of charging twice.

POST
/api/v1/provision/usage/consume/{sessionId}/{metric}
curl --request POST \
--url https://example.com/api/v1/provision/usage/consume/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/example

A metric the entitlement does not track answers 404 (license.metric_not_tracked) and charges nothing, a session that no longer exists answers 409 (license.no_active_session), and a plan without usage metering answers 403 (license.usage_metering_not_licensed) and charges nothing.

sessionId
required
string format: uuid

Active license session.

metric
required
string

Metric name.

amount
number | string format: double
/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/

Quantity to commit.

idempotencyKey
string

Optional idempotency key. When supplied, a repeated consume with the same key returns the original outcome and applies the usage only once.

OK

object
tier
required
string
currentValue
required
null | number | string format: double
/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/
start
required
null | number | string format: double
/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/
limit
required
null | number | string format: double
/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/
usagePercentage
required
null | number | string format: double
/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/
quotaUsageLevel
required
Allowed values: None Normal Warning Critical OverUsage
quotaUsagePolicy
required

Defines the enforcement behavior applied by the resource controller or interceptor when a specific usage tier threshold is reached. Ordered from least to most restrictive.

Allowed values: None NotifyOnly AllowWithOverage AllowWithGrace RateLimit Deny SuspendUsage
periodResetAt
null | string format: date-time
creditsCharged
null | number | string format: double
/^-?(?:0|[1-9]\d*)(?:\.\d+)?$/
fundedUnits
null | number | string format: double
/^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/
reason

Why a consumption the quota tiers allowed could not be settled against the balance funding the overage. Accompanies a Deny decision so a refusal that is about money rather than about the quota can be told apart.

default: None
Allowed values: None NoCredit SpendingDisabled BalanceExpired BalanceSuspended

Bad Request

object
type
null | string
title
null | string
status
null | integer | string format: int32
/^-?(?:0|[1-9]\d*)$/
detail
null | string
instance
null | string

Forbidden

object
type
null | string
title
null | string
status
null | integer | string format: int32
/^-?(?:0|[1-9]\d*)$/
detail
null | string
instance
null | string

Not Found

object
type
null | string
title
null | string
status
null | integer | string format: int32
/^-?(?:0|[1-9]\d*)$/
detail
null | string
instance
null | string

Conflict

object
type
null | string
title
null | string
status
null | integer | string format: int32
/^-?(?:0|[1-9]\d*)$/
detail
null | string
instance
null | string