> ## 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.

# Activate DTT template

> Activates a training program template by ID. Only one template can be active at a time.

If your schedule type is "auto" or "weekly", it will be switched to "single" mode.
All other templates (owned and imported) will be deactivated.




## OpenAPI

````yaml https://dashboard.researchanddesire.com/openapi.yaml post /dtt/templates/{id}
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:
  /dtt/templates/{id}:
    post:
      tags:
        - DTT Templates
      summary: Activate DTT template
      description: >
        Activates a training program template by ID. Only one template can be
        active at a time.


        If your schedule type is "auto" or "weekly", it will be switched to
        "single" mode.

        All other templates (owned and imported) will be deactivated.
      operationId: activateDttTemplate
      parameters:
        - $ref: '#/components/parameters/DttTemplateId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActivateTemplateRequest'
            example:
              isActive: true
      responses:
        '200':
          description: Template activated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ActivateDttTemplateResponse'
              example:
                ok: true
                data:
                  id: 1
                  name: Beginner Program
                  isActive: true
                  scheduleTypeChanged: true
                  Segment:
                    - id: 1
                      type: warmup
                      duration: 60
        '400':
          description: Invalid request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                ok: false
                error: 'Request body must include { isActive: true }'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: Template not found or not owned
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                ok: false
                error: Template not found or not owned by user
components:
  parameters:
    DttTemplateId:
      name: id
      in: path
      required: true
      description: The DTT template (training program) ID
      schema:
        type: integer
        minimum: 1
        example: 1
  schemas:
    ActivateTemplateRequest:
      type: object
      required:
        - isActive
      properties:
        isActive:
          type: boolean
          const: true
          description: Must be true to activate
    ActivateDttTemplateResponse:
      type: object
      required:
        - ok
        - data
      properties:
        ok:
          type: boolean
          const: true
        data:
          allOf:
            - $ref: '#/components/schemas/DttTemplateDetail'
            - type: object
              properties:
                scheduleTypeChanged:
                  type: boolean
                  description: Whether schedule type was changed to single
    ErrorResponse:
      type: object
      required:
        - ok
        - error
      properties:
        ok:
          type: boolean
          const: false
        error:
          type: string
    DttTemplateDetail:
      allOf:
        - $ref: '#/components/schemas/DttTemplateSummary'
        - type: object
          properties:
            Segment:
              type: array
              items:
                $ref: '#/components/schemas/DttSegment'
    DttTemplateSummary:
      type: object
      properties:
        id:
          type: integer
          description: Template ID
        bubbleId:
          type: string
          description: Unique public identifier
        ownerId:
          type: integer
          description: Owner user ID
        name:
          type: string
          description: Program name
        description:
          type: string
          description: Program description
        tagline:
          type: string
          description: Short tagline
        message:
          type: string
          description: Welcome message
        isPublic:
          type: boolean
          description: Whether publicly visible
        isActive:
          type: boolean
          description: Whether currently active
        handsFreeMode:
          type: boolean
          description: Hands-free mode enabled
        targetDepth:
          type: integer
          description: Target depth percentage
        targetWindow:
          type: integer
          description: Target window size
        toyId:
          type: integer
          nullable: true
          description: Associated toy ID
        createdDate:
          type: string
          format: date-time
          description: Creation date
        updatedAt:
          type: string
          format: date-time
          description: Last update time
    DttSegment:
      type: object
      properties:
        id:
          type: integer
        type:
          type: string
          enum:
            - repetition
            - endurance
            - freeform
            - bounce
          description: Segment type
        duration:
          type: integer
          description: Duration (meaning varies by type)
        speed:
          type: integer
          description: Speed setting (1–1000)
        repeat:
          type: integer
          description: Number of times to repeat
        order:
          type: integer
          description: Position in the segment list (0-based)
        passFailEnabled:
          type: boolean
          description: Whether pass/fail grading is enabled
        passGradeThreshold:
          type: integer
          description: Minimum grade to pass (0–100)
        failureText:
          type: string
          nullable: true
          description: Message shown on failure
  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.

````