Increment a counter
Adds by (default 1, may be negative), creating the counter at by on first use - the same semantics as {count} in a chat command. Requires counters:manage.
POST
/counters/{name}/incrementAuthorization
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
application/jsonbyintegerNon-zero; negative decrements.
default: 1
Responses
200The counter after the increment.
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 POST "https://api.tippage.com/v1/counters/string/increment" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"by": 1
}'const response = await fetch("https://api.tippage.com/v1/counters/string/increment", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"by": 1
})
});import requests
response = requests.post(
"https://api.tippage.com/v1/counters/string/increment",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"by": 1
},
)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"
}