MonetizationOS Docs
Webscale APICounter Updates

Update Usage Counters

POST
/api/v1/counter-updates

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 users
  • userJwt: JWT token for authenticated users
  • userIdentifier: Direct user ID (requires secret key)

Authorization

ApiKeyAuth
AuthorizationBearer <token>

API key authentication. Use secret keys (sk_*) for full access or public keys (pk_*) for limited access.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request to update usage counters without access check.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.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"}