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

# Update DTT training program

`PATCH /dtt/templates/{id}`

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` integer, 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` integer — 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

---

[API](https://skmtc.net/researchanddesire/apis/research-and-desire-api.md) · [All operations](https://skmtc.net/researchanddesire/apis/research-and-desire-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/researchanddesire/research-and-desire-api/versions/9c6dc82bb579/schema)
