Skip to main content
GET
/
v1
/
groups
/
{id}
/
state
/
counters
/
{key}
Get a group counter
curl --request GET \
  --url https://api.scrip.dev/v1/groups/{id}/state/counters/{key} \
  --header 'X-API-Key: <api-key>'
{
  "key": "purchases",
  "last_reset_at": "2024-01-15T10:30:00Z",
  "reset_after": "720h",
  "value": "42"
}
Returns a single counter by key, including its effective value. The key is passed as a path parameter. For counters with reset_after configured, the returned value accounts for the reset window. If the time since last_reset_at exceeds reset_after, the effective value returned is 0.
For usage patterns and examples, see the State Management guide.

Authorizations

X-API-Key
string
header
required

API key passed in the X-API-Key header.

Path Parameters

id
string<uuid>
required

Group ID

key
string
required

Counter key

Response

Counter value

key
string

Counter key

Example:

"purchases"

last_reset_at
string<date-time>

When the counter was last reset

Example:

"2024-01-15T10:30:00Z"

reset_after
string

Auto-reset duration, if configured

Example:

"720h"

value
string

Counter value as a string for precision

Example:

"42"