Skip to content
TipPage Docs
Esc
navigateopen⌘Jpreview

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}/increment
Authorization
AuthorizationBearer token (tp_live_... or tpat_...) · headerrequired
A 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
namestringrequired
The counter's name.
matches ^[a-z0-9_-]{1,64}$
Request body
application/json
byinteger
Non-zero; negative decrements.
default: 1
Responses
200The counter after the increment.
counterCounter
Show properties
namestring
The counter's name - its key on every surface (chat tokens, labels, this API).
valueinteger
created_atstring<date-time>
updated_atstring<date-time>
400Invalid name or value.
errorstringrequired
Human-readable message.
codestring
Machine-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).
errorstringrequired
Human-readable message.
codestring
Machine-readable code (e.g. `missing_scope`, `not_in_queue`).
403The key lacks the required scope (`missing_scope`).
errorstringrequired
Human-readable message.
codestring
Machine-readable code (e.g. `missing_scope`, `not_in_queue`).
required_scopestring
429Rate limit exceeded - check the `RateLimit-*` headers.
errorstring
Request
curl -X POST "https://api.tippage.com/v1/counters/string/increment" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "by": 1
}'
Response
{
  "counter": {
    "name": "deaths",
    "value": 0,
    "created_at": "2019-08-24T14:15:22Z",
    "updated_at": "2019-08-24T14:15:22Z"
  }
}