---
title: "Update DTT training program"
method: PATCH
path: "/dtt/templates/{id}"
tags: ["DTT Templates"]
---

# Update DTT training program

`PATCH /dtt/templates/{id}`

## Request

- Base URL: `https://dashboard.researchanddesire.com/api/v1`
- URL: `https://dashboard.researchanddesire.com/api/v1/dtt/templates/{id}`
- Auth: one of:
  - HTTP bearer
  - OAuth 2
    - Authorization code: `/oauth/authorize`
    - Token URL: `/oauth/token` scopes: `dtt:write`

Update one or more fields on a training program. Only include the fields you want to change — all fields are optional.

If `Segment` is provided, it **replaces** the entire segment list (existing segments are deleted).

**Ultra-only fields:** `handsFreeMode`, `tagline`, and `iconId` require an Ultra subscription or higher.
Setting these to their "off" values (`false` / `null`) is always allowed.

## Path parameters

- `id` integer, required

## Request body

- UpdateDttTemplateRequest: All fields are optional. Only include the fields you want to change. If Segment is provided, it replaces the entire segment list.
  - `name` string: Program name (4–128 characters, cannot be blank)
  - `targetWindow` number: Target window size
  - `targetDepth` number: Target depth percentage
  - `toyId` integer, nullable: Associated toy ID (0 or null to unset)
  - `message` string, nullable: Completion message (max 50 chars, defaults to "Good Work!")
  - `handsFreeMode` boolean: Enable hands-free mode (Ultra only)
  - `tagline` string, nullable: Short tagline (Ultra only, max 25 chars)
  - `toyTagline` string, nullable: Toy tagline (max 25 chars)
  - `iconId` integer, nullable: Icon ID (Ultra only)
  - `isPublic` boolean: Whether the program is publicly shared
  - `description` string, nullable: Program description (max 500 chars)
  - `Segment` DttSegmentInput[]: Full replacement segment list. If provided, all existing segments are deleted and replaced with these.
    - `type` 'repetition' | 'endurance' | 'freeform' | 'bounce', required: Segment type
    - `duration` integer, required: Duration (meaning varies by type)
    - `speed` number, required: Speed setting (1–1000)
    - `repeat` integer: Number of times to repeat this segment
    - `passFailEnabled` boolean: Whether pass/fail grading is enabled
    - `passGradeThreshold` integer: Minimum grade to pass (0–100)
    - `failureText` string, nullable: Message shown on failure (max 80 chars)

## Response `200`

Updated template with segments

- DttTemplateDetailResponse
  - `ok` true, required
  - `data` DttTemplateDetail, required
    - `id` integer: Template ID
    - `bubbleId` string: Unique public identifier
    - `ownerId` integer: Owner user ID
    - `name` string: Program name
    - `description` string: Program description
    - `tagline` string: Short tagline
    - `message` string: Welcome message
    - `isPublic` boolean: Whether publicly visible
    - `isActive` boolean: Whether currently active
    - `handsFreeMode` boolean: Hands-free mode enabled
    - `targetDepth` integer: Target depth percentage
    - `targetWindow` integer: Target window size
    - `toyId` integer, nullable: Associated toy ID
    - `createdDate` string, date-time: Creation date
    - `updatedAt` string, date-time: Last update time
    - `Segment` DttSegment[]
      - `id` integer
      - `type` 'repetition' | 'endurance' | 'freeform' | 'bounce': Segment type
      - `duration` integer: Duration (meaning varies by type)
      - `speed` number: Speed setting (1–1000)
      - `repeat` integer: Number of times to repeat
      - `order` integer: Position in the segment list (0-based)
      - `passFailEnabled` boolean: Whether pass/fail grading is enabled
      - `passGradeThreshold` integer: Minimum grade to pass (0–100)
      - `failureText` string, nullable: Message shown on failure

## Other responses

- `400`: Invalid request
- `401`: Authentication required or token invalid
- `403`: Ultra subscription required for this field
- `404`: DTT template not found
- `422`: Validation failed — per-field errors

## Changes

- **2026-09-28** `cad555a1bf4b`: 1 breaking, 1 info
  - the `data/allOf[subschema #2]/Segment/items/speed` response's property type changed from `integer` to `number` for status `200`
  - the `Segment/items/speed` request property type was generalized from `integer` to `number`
- **2026-09-22** `2411203b3c10`: 2 info
  - the endpoint scheme security `bearerAuth` was added to the API
  - the endpoint scheme security `oauth2` was added to the API

[Operation history](https://skmtc.dev/researchanddesire/apis/research-and-desire-api/changes/dtt/templates/:id/patch.md)

---

[API](https://skmtc.dev/researchanddesire/apis/research-and-desire-api.md) - [All operations](https://skmtc.dev/researchanddesire/apis/research-and-desire-api/llms.txt) - [OpenAPI document](https://skmtc.dev/researchanddesire/apis/research-and-desire-api/revisions/682fc4d7f6d5?raw)
