Chastity Tracker API Documentation: Insert live session

  1. πŸ” Authentication

    All API requests must be authenticated via https using a bearer token with write permission.

    Generating a Token

    • Users can generate a secure API token from their profile page.
    • Tokens are shown only once and must be stored securely.
    • Only hashed versions are stored on the server.

    Usage

    URL

    https://www.chastitytracker.org

    HEADER

    GET /api/liveinsert.php HTTP/2
    Host: www.chastitytracker.org
    Authorization: Bearer {YOUR_API_TOKEN}
  2. πŸ“Œ Endpoint: POST /api/liveinsert.php

    1. LIVE SESSION:

      Creates a new chastity live session. Requires a valid authentication token (with write permission) and parameter(s) via json body (underlined means mandatory).

      Parameters

      • insertl: 1
      • startdate: YYYY-MM-DD
      • starttime: HH:MM (default 00:00)
      • public: 0/1 to make session public or not
      • lockedby: string
      • scheduledend: YYYY-MM-DD
      • scheduledendtime: HH:MM (default 00:00)

      Example Request

      POST /api/liveinsert.php HTTP/2
      Host: www.chastitytracker.org
      Authorization: Bearer {YOUR_API_TOKEN}
      Content-Type: application/json

      {
        "insertl":1,
        "scheduledend":"2025-12-31",
        "scheduledendtime":"17:30",
      }
    2. Response

      {
        "message": "Session started succesfully",
        "session_id": 1234
      }

    Status Codes

    • 201 Created β€” Session inserted
    • 400 Bad Request β€” Missing or malformed input (an info about the error will be returned)
    • 401 Unauthorized β€” Invalid or missing token
    • 403 Forbidden β€” Missing authorization
    • 409 Conflict β€” Overlapping session exists
    • 500 Internal Server Error β€” Something went wrong server-side
  3. ⚠️ Security Notes

    • Tokens must be stored securely by third parties.
    • Users can revoke or regenerate tokens at any time.
    • Never share a user’s token or sensitive info.
  4. πŸ“… Changelog

    • 2025-06-06: Initial public API version released

To go back to documentation index click here.