Game-play requests may be public or require authentication depending on the mode. Updating game settings always requires authentication via HTTPS bearer token with write permission.
https://www.chastitytracker.org
POST /api/v2/games.php HTTP/2
Host: www.chastitytracker.org
Authorization: Bearer {YOUR_API_TOKEN}
Content-Type: application/json
POST /api/v2/games.php HTTP/2
Host: www.chastitytracker.org
Content-Type: application/json
All v2 endpoints return a unified JSON envelope.
{
"ok": true,
"data": { ... },
"meta": {"version":2}
}
{
"ok": false,
"error": {"code":"...", "message":"..."},
"meta": {"version":2}
}
Game actions modify a sessionβs scheduledend and generate a new entry in histories.
Game settings can also be added, updated, or explicitly deleted during an active session.
Supported games are: DICE, LUCK, LINK.
session: session iddom: 0/1 (1 means performed by a dom)operation: ADD | SUBseconds: seconds added or subrtractedscheduledend_utc: new UTC scheduled end after the operationmultiplier: random multiplierdom=0) if the user enabled the LINK game and shares the token link.POST /api/v2/games.phpPlays a game action and updates the session schedule.
{
"game": "dice" | "luck" | "link",
"dom": 0 | 1,
"session": 123,
"token": "PUBLIC_LINK_TOKEN",
"type": "add" | "sub" | "rand"
}
game: required. Allowed: dice, luck, link.dom: required. 0 = owner/public, 1 = dom action.session: required for DICE, LUCK, and LINK dom=1. Optional for LINK dom=0 if token is provided (session is resolved by token).token: required for LINK dom=0 (public vote). Optional elsewhere.type: required for LINK (both dom modes). Allowed: add, sub, rand.dom=0: bearer token user must be the session owner.dom=1: bearer token user must be the dom of the owner (active link required).dom=1: bearer token required, must be dom of the owner.dom=0: public vote, no bearer required. If bearer is present, it is used to identify the voter.For LINK dom=0, if the request includes a bearer token belonging to the session owner, the API triggers a penalty immediately:
penalty = 1type is forced to addmultiplier is forced to maxmultipliersource becomes PENALTYVotes are limited according to LINK configuration:
waitint=0: vote once ever.waitint=1: vote again after 24 hours.(token, session, user) only (IP is ignored).(token, session, ip) where user IS NULL.
POST /api/v2/games.php HTTP/2
Host: www.chastitytracker.org
Content-Type: application/json
{
"game":"link",
"dom":0,
"token":"AbCdEf123...",
"type":"rand"
}
POST /api/v2/games.php HTTP/2
Host: www.chastitytracker.org
Authorization: Bearer {YOUR_API_TOKEN}
Content-Type: application/json
{
"game":"link",
"dom":0,
"token":"AbCdEf123...",
"type":"add"
}
POST /api/v2/games.php HTTP/2
Host: www.chastitytracker.org
Authorization: Bearer {YOUR_API_TOKEN}
Content-Type: application/json
{
"game":"dice",
"dom":0,
"session":123
}
POST /api/v2/games.php HTTP/2
Host: www.chastitytracker.org
Authorization: Bearer {YOUR_API_TOKEN}
Content-Type: application/json
{
"game":"luck",
"dom":1,
"session":123
}
{
"ok": true,
"data": {
"game":"link",
"operation":"ADD",
"multiplier":1.37,
"time":3600,
"unit":"hour",
"int":1,
"seconds":3600,
"dom":0,
"scheduledend_utc":"2026-02-10 00:00:00",
"session":123,
"penalty":null
},
"meta":{"version":2}
}
{
"ok": true,
"data": {
"game":"dice",
"operation":"SUB",
"time":7200,
"sum":-3,
"dices":[6,1,2],
"dicesops":["","s",""],
"calc":"+6-1+2",
"multiplier":1.11,
"seconds":7200,
"dom":0,
"scheduledend_utc":"2026-02-10 00:00:00",
"session":123
},
"meta":{"version":2}
}
{
"ok": true,
"data": {
"game":"luck",
"operation":"ADD",
"time":86400,
"int":1,
"multiplier":1.22,
"seconds":86400,
"dom":1,
"scheduledend_utc":"2026-02-11 00:00:00",
"session":123
},
"meta":{"version":2}
}
200 OK β Played successfully400 Bad Request β Validation error (missing fields, cooldown, etc.)401 Unauthorized β Missing/invalid token (where required)403 Forbidden β Permission denied (not owner / not dom)404 Not Found β Link token or session not found405 Method Not Allowed β Not POST500 Internal Server Error β Server errorPATCH /api/v2/games.php?session=ID (update settings)Adds, updates, or explicitly deletes game settings for an active session. Requires a bearer token with write permission.
session is a required positive session id in the query string.dices: 1, links: 1, or luck: 1 adds or updates that game using its complete configuration.deletedices: 1, deletelinks: 1, or deleteluck: 1 explicitly deletes that game.0 and 1. A value of 0 is accepted but performs no action.When dices: 1 is supplied, all of these fields are required:
dicenumber: number of dice (maximum 5).diceunit: MINUTE | HOUR | DAY | MONTH.dicetime: wait amount between plays.dicetimeunit: MINUTE | HOUR | DAY.diceminmulti, dicemaxmulti: multiplier range; minimum must not exceed maximum.If dicepen: 1 is supplied, mindicenum, pendicetime, and pendiceunit are required. pendicelimit and pendicewindow are optional.
When links: 1 is supplied, all of these fields are required:
linkadd, linkaddunit: time added by a vote.linksub, linksubunit: time subtracted by a vote.linkminmulti, linkmaxmulti: multiplier range; minimum must not exceed maximum.linkvotes: optional 0/1; 1 allows voting again after 24 hours.linkminvotes: optional minimum vote count, within the service limit.Time units accept MINUTE, HOUR, DAY, or MONTH.
When luck: 1 is supplied, all of these fields are required:
luckadd, luckaddunit: possible time addition.lucksub, lucksubunit: possible time subtraction.lucktime: wait amount between plays.lucktimeunit: MINUTE | HOUR | DAY.luckminmulti, luckmaxmulti: multiplier range; minimum must not exceed maximum.If luckpen: 1 is supplied, minlucknum, penlucktime, and penluckunit are required. penlucklimit and penluckwindow are optional.
Link and Luck are not mentioned, so they remain unchanged.
PATCH /api/v2/games.php?session=123 HTTP/2
Host: www.chastitytracker.org
Authorization: Bearer {YOUR_API_TOKEN}
Content-Type: application/json
{
"dices":1,
"dicenumber":3,
"diceunit":"DAY",
"dicetime":6,
"dicetimeunit":"HOUR",
"diceminmulti":1.0,
"dicemaxmulti":2.0
}
PATCH /api/v2/games.php?session=123 HTTP/2
Host: www.chastitytracker.org
Authorization: Bearer {YOUR_API_TOKEN}
Content-Type: application/json
{
"deletelinks":1
}
{
"ok":true,
"data":{
"updated":true,
"session":123,
"mode":"keyholder"
},
"meta":{"version":2}
}
mode is keyholder for an active keyholder or self_harden for an eligible session owner. updated is false when the request causes no stored change.
games_changes.200 OK β Request processed successfully.400 Bad Request β Invalid JSON action/configuration, conflicting actions, self-hardening violation, or deletion of the final game.401 Unauthorized β Missing or invalid bearer token.403 Forbidden β Missing write permission or actor is not allowed to update the session.404 Not Found β Active session not found.405 Method Not Allowed β Unsupported method.500 Internal Server Error β Server error.histories for each game action.games.used/games.lastuse.