All API requests must be authenticated via HTTPS using a bearer token.
https://www.chastitytracker.org
GET /api/v2/sessions.php HTTP/2
Host: www.chastitytracker.org
Authorization: Bearer {YOUR_API_TOKEN}
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}
}
GET /api/v2/sessions.php (list)Returns session items for the token owner, with optional filters and pagination.
from: YYYY-MM-DD (optional, interpreted in user's timezone)to: YYYY-MM-DD (optional, interpreted in user's timezone)active: 0/1 (optional)public: 0/1 (optional)limit: integer (default 50, max 200)offset: integer (default 0)gamesis included only for active sessions.from/to is done using the user's timezone.has_history: 0/1whether the session has at least one history recordhas_games_changes: 0/1 whether the session has at least one game setting change record
GET /api/v2/sessions.php?from=2026-01-01&to=2026-02-01&active=0&limit=50&offset=0 HTTP/2
Host: www.chastitytracker.org
Authorization: Bearer {YOUR_API_TOKEN}
{
"ok": true,
"data": {
"count": 2,
"total": 10,
"limit": 50,
"offset": 0,
"items": [
{
"id": 123,
"start": "2026-01-15 10:00:00",
"end": "2026-01-17 10:00:00",
"scheduledend": null,
"active": 0,
"lockedby": null,
"notes": null,
"public": 0,
"timezonestart": "+01:00",
"timezoneend": "+01:00",
"inserted": "2026-01-17 10:12:30",
"has_history": 1,
"has_games_changes": 0
}
]
},
"meta":{"version":2}
}
GET /api/v2/sessions.php?id=ID (details)Returns a single session item owned by the token user.
games is included only for active sessions.from/to is done using the user's timezone.
GET /api/v2/sessions.php?id=123 HTTP/2
Host: www.chastitytracker.org
Authorization: Bearer {YOUR_API_TOKEN}
{
"ok": true,
"data": {
"id": 123,
"start": "2026-02-02 09:00:00",
"end": null,
"scheduledend": "2026-02-03 09:00:00",
"active": 1,
"lockedby": "PartnerNick",
"notes": null,
"public": 0,
"timezonestart": "+01:00",
"timezoneend": null,
"inserted": "2026-02-02 08:00:00",
"has_history": 1,
"has_games_changes": 0
"games": {...}
},
"meta":{"version":2}
}
POST /api/v2/sessions.php (insert/start)Create session(s). Requires token with write permission.
type: manual | live (default: manual)public: 0/1 (optional)lockedby: string or null (optional)notes: string or null (optional)startdate: YYYY-MM-DDstarttime: HH:MM (optional; if missing => 00:00)enddate: YYYY-MM-DDendtime: HH:MM (optional; if missing => 00:00)startdate: YYYY-MM-DD (optional; defaults to "now")starttime: HH:MM (optional)scheduledend: YYYY-MM-DD (optional)scheduledendtime: HH:MM (optional)maxend: 0/1 (optional; randomizes scheduled end between now and scheduledend)Games are inserted only on live sessions. If any game flag is enabled, scheduledend is required.
dices: enable Dice gamelinks: enable Public Link gameluck: enable Luck gameGames are created only if at least one of these flags is enabled:
dices: 0/1 (enable Dice game)links: 0/1 (enable Public Link game)luck: 0/1 (enable Luck game)dicenumber: integerdiceunit: MINUTE | HOUR | DAY | MONTH (invalid values default to DAY)dicetimewait: integerdicetimeunitwait: MINUTE | HOUR | DAY (invalid values default to HOUR)diceminmulti: number (float)dicemaxmulti: number (float)linkadd: integerlinkaddunit: MINUTE | HOUR | DAY | MONTH (invalid values default to DAY)linksub: integerlinksubunit: MINUTE | HOUR | DAY | MONTH (invalid values default to DAY)resetvotes: 0/1 (optional; if set, resets votes behavior; stored in DB field used for LINK)linkminmulti: number (float)linkmaxmulti: number (float)randadd: integerrandaddunit: MINUTE | HOUR | DAY | MONTH (invalid values default to DAY)randsub: integerrandsubunit: MINUTE | HOUR | DAY | MONTH (invalid values default to DAY)randtimewait: integerrandtimeunitwait: MINUTE | HOUR | DAY (invalid values default to HOUR)randminmulti: number (float)randmaxmulti: number (float)Penalties are created only if the corresponding game is enabled and its penalty flag is enabled.
dicespen: 0/1 (enable penalties for Dice)mindiceplay: integer (minimum plays required)pendicetime: integer (penalty amount)pendiceunit: MINUTE | HOUR | DAY | MONTH (invalid values default to DAY)diceplaylimit: 0/1 (optional; if omitted/empty => always=1; if set => always=0)luckpen: 0/1 (enable penalties for Luck)minluckplay: integer (minimum plays required)penlucktime: integer (penalty amount)penlcukunit: MINUTE | HOUR | DAY | MONTH (invalid values default to DAY)luckplaylimit: 0/1 (optional; if omitted/empty => always=1; if set => always=0)scheduledend is required when enabling any game (dices, links, luck).minmultiplier must be ≤ maxmultiplier.histories row with type=START and schedule=scheduledend.409.scheduledend is required.
POST /api/v2/sessions.php HTTP/2
Host: www.chastitytracker.org
Authorization: Bearer {YOUR_API_TOKEN}
Content-Type: application/json
{
"type":"manual",
"startdate":"2026-02-01",
"starttime":"09:00",
"enddate":"2026-02-03",
"endtime":"09:00",
"public":0
}
POST /api/v2/sessions.php HTTP/2
Host: www.chastitytracker.org
Authorization: Bearer {YOUR_API_TOKEN}
Content-Type: application/json
{
"type":"live",
"scheduledend":"2026-02-10",
"scheduledendtime":"09:00",
"public":0
}
POST /api/v2/sessions.php HTTP/2
Host: www.chastitytracker.org
Authorization: Bearer {YOUR_API_TOKEN}
Content-Type: application/json
{
"type":"live",
"scheduledend":"2026-02-10",
"scheduledendtime":"09:00",
"maxend":1,
"dices":1,
"dicenumber":2,
"diceunit":"DAY",
"dicetimewait":6,
"dicetimeunitwait":"HOUR",
"diceminmulti":1.0,
"dicemaxmulti":2.0
}
{
"ok": true,
"data": {
"status":"Session started successfully",
"id": 999,
"games": true
},
"meta":{"version":2}
}
201 Created β Inserted400 Bad Request β Validation error401 Unauthorized β Missing/invalid token403 Forbidden β Missing write permission409 Conflict β Active session exists / overlap500 Internal Server Error β Server errorPATCH /api/v2/sessions.php?id=ID (update/stop)Update session fields or stop a live session. Requires token with write permission. Only provided fields are updated.
public, lockedby, notesscheduledend, scheduledendtime (set scheduledend to null to remove)endNow: true (stop now)enddate: YYYY-MM-DD (+ optional endtime)active=1.
PATCH /api/v2/sessions.php?id=999 HTTP/2
Host: www.chastitytracker.org
Authorization: Bearer {YOUR_API_TOKEN}
Content-Type: application/json
{
"endNow": true
}
DELETE /api/v2/sessions.php?id=ID (delete)Delete session by id. Requires token with write permission.