Set a counter
Sets an absolute value, creating the counter if it doesn’t exist yet. Overlay labels bound to it update live and counter.updated fires. Requires counters:manage.
PUT
/counters/{name}Authorization
AuthorizationBearer token (tp_live_... or tpat_...) · headerrequiredA TipPage API key (`tp_live_...`, created in Dashboard → Settings → Developer) or an OAuth 2.0 access token (`tpat_...`, see the OAuth guide). Both carry the same scopes and are accepted on every endpoint.
Path parameters
namestringrequiredThe counter's name.
matches ^[a-z0-9_-]{1,64}$
Request body
requiredapplication/jsonvalueintegerrequiredNew absolute value.
Responses
200The counter after the write.
counterCounterShow propertiesHide properties
namestringThe counter's name - its key on every surface (chat tokens, labels, this API).
valueintegercreated_atstring<date-time>updated_atstring<date-time>400Invalid name or value.
errorstringrequiredHuman-readable message.
codestringMachine-readable code (e.g. `missing_scope`, `not_in_queue`).
401Missing or invalid credential (`missing_api_key` / `invalid_api_key`, or `invalid_token` for an expired/revoked OAuth access token).
errorstringrequiredHuman-readable message.
codestringMachine-readable code (e.g. `missing_scope`, `not_in_queue`).
403The key lacks the required scope (`missing_scope`).
errorstringrequiredHuman-readable message.
codestringMachine-readable code (e.g. `missing_scope`, `not_in_queue`).
required_scopestring429Rate limit exceeded - check the `RateLimit-*` headers.
errorstringRequest
curl -X PUT "https://api.tippage.com/v1/counters/string" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"value": 0
}'const response = await fetch("https://api.tippage.com/v1/counters/string", {
method: "PUT",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"value": 0
})
});import requests
response = requests.put(
"https://api.tippage.com/v1/counters/string",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"value": 0
},
)Response
{
"counter": {
"name": "deaths",
"value": 0,
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
}{
"error": "string",
"code": "string"
}{
"error": "string",
"code": "string"
}{
"error": "string",
"code": "string",
"required_scope": "string"
}{
"error": "string"
}