All API requests must be authenticated via HTTPS using a bearer token.
https://www.chastitytracker.org
GET /api/v2/histories.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}
}
Histories are read-only records generated by the system to track changes during a session (games, penalties, manual adjustments, dom actions).
type: START | ADD | SUBunit: seconds (integer). Only for ADD/SUB, null for STARTsource: DICE | LINK | LUCK | MANUAL | PENALTY | DOM (nullable)dom: 0/1 (1 means performed by a dom)schedule: UTC datetime target affected by the changehappened: UTC datetime(3) when the change occurredGET /api/v2/histories.php (list)Returns history items for a specific session (token owner only).
session: integer (required)type: START | ADD | SUB (optional)source: DICE | LINK | LUCK | MANUAL | PENALTY | DOM (optional)dom: 0/1 (optional)from: UTC datetime (optional) โ filter on happened >= fromto: UTC datetime (optional) โ filter on happened <= tolimit: integer (default 50, max 200)cursor: string (optional, cursor pagination)happened DESC, schedule DESC, source ASC.
GET /api/v2/histories.php?session=123&limit=50 HTTP/2
Host: www.chastitytracker.org
Authorization: Bearer {YOUR_API_TOKEN}
{
"ok": true,
"data": {
"count": 2,
"limit": 50,
"cursor_next": "eyJoYXBwZW5lZCI6IjIwMjYtMDItMDMgMDk6MzA6MDcuMTIzIiwic2NoZWR1bGUiOiIyMDI2LTAyLTEwIDAwOjAwOjAwIiwic291cmNlIjoiRElDRSJ9",
"has_games_changes": 1,
"items": [
{
"session": 123,
"type": "START",
"unit": null,
"source": null,
"dom": 0,
"schedule": "2026-02-10 00:00:00",
"happened": "2026-02-03 09:30:07.123"
},
{
"session": 123,
"type": "ADD",
"unit": 86400,
"source": "DICE",
"dom": 0,
"schedule": "2026-02-11 00:00:00",
"happened": "2026-02-03 10:02:11.456"
}
]
},
"meta":{"version":2}
}
200 OK โ Returned400 Bad Request โ Validation error401 Unauthorized โ Missing/invalid token500 Internal Server Error โ Server errorunit is expressed in seconds to match the trackerโs existing logic/UI.