Skip to main content
POST
/
api
/
public
/
record-usage
curl -X POST "https://api.crovver.com/api/public/record-usage" \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "requestingEntityId": "workspace_123",
    "metricKey": "api_calls",
    "quantity": 1,
    "metadata": { "endpoint": "/api/export", "userId": "user_456" }
  }'
{
  "success": true,
  "data": {
    "recorded": true,
    "metricKey": "api_calls",
    "quantity": 1
  }
}
Records a usage event for a tenant. Crovver accumulates these events and checks them against the plan’s limits when check-usage-limit is called.

Request Body

requestingEntityId
string
required
The external tenant ID
metricKey
string
required
The metric to record (must match a key in plan.limits)
quantity
number
Amount to add. Defaults to 1.
metadata
object
Optional context (e.g., which user triggered the event)

Authentication

Requires a secret key (Authorization: Bearer sk_live_...).
curl -X POST "https://api.crovver.com/api/public/record-usage" \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "requestingEntityId": "workspace_123",
    "metricKey": "api_calls",
    "quantity": 1,
    "metadata": { "endpoint": "/api/export", "userId": "user_456" }
  }'
{
  "success": true,
  "data": {
    "recorded": true,
    "metricKey": "api_calls",
    "quantity": 1
  }
}