Update Usage Counters
Updates usage counters without performing a full access check. This is useful for tracking usage after access has already been verified, or for batch counter updates.
Unlike access checks, this endpoint only updates counters and returns a simple success response.
User Identity
You can identify users in three ways (only one should be specified per request):
anonymousIdentifier: For anonymous/unauthenticated usersuserJwt: JWT token for authenticated usersuserIdentifier: Direct user ID (requires secret key)
API key authentication. Use secret keys (sk_*) for full access or public keys (pk_*) for limited access.
In: header
Properties used to identify the user or session that the request is associated with
Request with direct user identifier
Authenticated user identifier. Can only be used with an organization's secret keys. Use this when you have a direct user ID from your system.
Request with JWT token
JWT token for user authentication. The JWT must be valid according to your configured JWT integrations.
Request with anonymous identifier
Identifier for anonymous/unauthenticated users. Use this for guest sessions or before user login.
ID of the resource being tracked
Amount to add to the counter (can be negative)
1Unique identifier for the counter to update
Request information specific to requests made from Cloudflare Workers. (requires secret key)
Response Body
curl -X POST "https://api.monetizationos.com/api/v1/counter-updates" \ -H "Content-Type: application/json" \ -d '{ "identity": { "anonymousIdentifier": "anon_session_789" }, "counterId": "default:feat_123456.requests", "update": 1 }'{
"status": "success"
}{
"status": "error",
"statusCode": 400,
"message": "Invalid JSON body"
}{
"status": "error",
"statusCode": 401,
"message": "Invalid API key"
}{
"status": "error",
"statusCode": 404,
"message": "Organization not found"
}{
"status": "error",
"statusCode": 500,
"message": "Internal server error"
}