> ## Documentation Index
> Fetch the complete documentation index at: https://docs.researchanddesire.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Modify active lock session

> Modify the duration of the active lock session. Only keyholders or
test lock owners can modify sessions (self-lock owners may only
extend, never shorten).

Provide either `duration` (absolute new duration in seconds) **or**
`durationChange` (relative delta in seconds — positive to add time,
negative to subtract). The delta form is intended for game / external
integrations that want to add or remove time without first fetching
the current session.




## OpenAPI

````yaml https://dashboard.researchanddesire.com/openapi.yaml patch /lkbx/session/current
openapi: 3.1.0
info:
  title: Research And Desire API
  description: >
    The Research And Desire API provides programmatic access to your devices and
    data.


    All responses follow a standard envelope format:

    - Success: `{ "ok": true, "data": <result> }`

    - Error: `{ "ok": false, "error": "<message>" }`


    ## Pagination


    List endpoints support pagination via query parameters:

    - `limit`: Number of records to return (default: 50, max: 100)

    - `offset`: Number of records to skip (default: 0)


    Paginated responses include pagination metadata alongside the data array.


    ## Authentication


    All endpoints require a Bearer token in the Authorization header.

    Tokens can be created in the Dashboard settings (requires Ultra
    subscription).
  version: 1.0.0
  contact:
    name: Research And Desire Support
    url: https://www.researchanddesire.com/support
servers:
  - url: https://dashboard.researchanddesire.com/api/v1
    description: Production API
security:
  - bearerAuth: []
tags:
  - name: Users
    description: User account information
  - name: DTT
    description: Deepthroat Trainer devices
  - name: DTT Templates
    description: Deepthroat Trainer training program templates
  - name: DTT Sessions
    description: Deepthroat Trainer training session history
  - name: LKBX
    description: Chastity Lockbox devices
  - name: Lock Templates
    description: Lock templates
  - name: Lock Sessions
    description: Lock session management
  - name: OSSM
    description: Open Source Sex Machine devices
paths:
  /lkbx/session/current:
    patch:
      tags:
        - Lock Sessions
      summary: Modify active lock session
      description: |
        Modify the duration of the active lock session. Only keyholders or
        test lock owners can modify sessions (self-lock owners may only
        extend, never shorten).

        Provide either `duration` (absolute new duration in seconds) **or**
        `durationChange` (relative delta in seconds — positive to add time,
        negative to subtract). The delta form is intended for game / external
        integrations that want to add or remove time without first fetching
        the current session.
      operationId: modifyActiveLockSession
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ModifyLockSessionRequest'
            examples:
              setAbsoluteDuration:
                summary: Set absolute duration
                value:
                  duration: 86400
              addTime:
                summary: Add 5 minutes
                value:
                  durationChange: 300
              subtractTime:
                summary: Remove 3 minutes
                value:
                  durationChange: -180
      responses:
        '200':
          description: Lock session updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ModifyLockSessionResponse'
              example:
                ok: true
                data:
                  id: 7
                  duration: 86400
                  endDate: '2026-02-17T18:00:00Z'
                  lockState: locked
                  isActive: true
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                invalidDuration:
                  summary: Invalid duration
                  value:
                    ok: false
                    error: Duration must be a positive number (in seconds)
                noFields:
                  summary: No valid fields
                  value:
                    ok: false
                    error: No valid fields to update
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          description: Not authorized to modify
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                ok: false
                error: Only keyholders or test locks can modify the active session
        '404':
          description: No active session or user not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                ok: false
                error: No active lock session found
components:
  schemas:
    ModifyLockSessionRequest:
      type: object
      description: |
        Provide exactly one of `duration` (absolute) or `durationChange`
        (delta). Mixing both, or providing neither, returns 400.
      properties:
        duration:
          type: integer
          minimum: 1
          description: New absolute duration in seconds.
        durationChange:
          type: integer
          description: |
            Delta in seconds, added to the current duration. Positive to
            extend the lock, negative to shorten. The resulting duration
            must be > 0; use the `unlock` action to end the lock.
        targetUserId:
          type: integer
          description: User whose session to modify (defaults to authenticated user)
      oneOf:
        - required:
            - duration
        - required:
            - durationChange
    ModifyLockSessionResponse:
      type: object
      required:
        - ok
        - data
      properties:
        ok:
          type: boolean
          const: true
        data:
          type: object
          properties:
            id:
              type: integer
            duration:
              type: integer
            endDate:
              type: string
              format: date-time
            lockState:
              type: string
            isActive:
              type: boolean
    ErrorResponse:
      type: object
      required:
        - ok
        - error
      properties:
        ok:
          type: boolean
          const: false
        error:
          type: string
  responses:
    Unauthorized:
      description: Authentication required or token invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            ok: false
            error: Unauthorized
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: |
        API tokens can be created in the Dashboard settings.
        Requires an Ultra subscription.

````