MindfulnessSessionRecord: Health Connect mindfulness data
Read from Google’s documentation on 2026-10-03 · Google’s reference page last updated 2026-06-24
MindfulnessSessionRecord is Health Connect's mindfulness record — an Interval record in Google's Wellness category. Its read permission is android.permission.health.READ_MINDFULNESS; its write permission is android.permission.health.WRITE_MINDFULNESS. It supports 1 aggregate metric (MINDFULNESS_DURATION_TOTAL). Mandatory fields per Google's table: endTime, metadata, mindfulnessSessionType and startTime.
What Google says MindfulnessSessionRecord is
Captures any mindfulness session a user does. This can be mindfulness sessions like meditation, breathing.
Each record needs a start time and end time. Records don't need to be back-to-back or directly after each other, there can be gaps in between.
The ability to insert or read this record type is dependent on the version of HealthConnect installed on the device. To check if available: call HealthConnectFeatures.getFeatureStatus and pass HealthConnectFeatures.FEATURE_MINDFULNESS_SESSION as an argument.
Quoted from Google’s MindfulnessSessionRecord Jetpack reference, last updated 2026-06-24, read 2026-10-03.
- Class
androidx.health.connect.client.records.MindfulnessSessionRecord- Google's category
- Wellness
- Record type
- Interval
- Unit class
- none named in Google's table
- Mandatory fields
endTimemetadatamindfulnessSessionTypestartTime- Added in (Jetpack)
1.1.0- Feature flag
FEATURE_MINDFULNESS_SESSION
Permissions
The exact strings Google’s data-types table declares for MindfulnessSessionRecord. Google’s page: “Before requesting any permissions, your app must declare them in the manifest.”
| Access | Permission string | Framework reference |
|---|---|---|
| Read | android.permission.health.READ_MINDFULNESS | API 36 · U Ext 15 |
| Write | android.permission.health.WRITE_MINDFULNESS | API 36 · U Ext 15 |
<uses-permission android:name="android.permission.health.READ_MINDFULNESS" />
<uses-permission android:name="android.permission.health.WRITE_MINDFULNESS" />import androidx.health.connect.client.permission.HealthPermission
import androidx.health.connect.client.records.MindfulnessSessionRecord
val permissions = setOf(
HealthPermission.getReadPermission(MindfulnessSessionRecord::class),
HealthPermission.getWritePermission(MindfulnessSessionRecord::class),
)The 8 fields of MindfulnessSessionRecord
Types and descriptions as Google’s reference prints them. The range column quotes Google’s own range annotation or sentence; a dash means Google states none, which is not the same as no validation.
| Field | Type | Allowed range | Google’s description |
|---|---|---|---|
endTimemandatory | Instant | — | End time of the record. |
endZoneOffset | ZoneOffset? | — | User experienced zone offset at endTime, or null if unknown. Providing these will help history aggregations results stay consistent should user travel. Queries with user experienced time filters will assume system current zone offset if the information is absent. |
metadatamandatory | Metadata | — | Set of common metadata associated with the written record. |
mindfulnessSessionTypemandatory | Int | — | Type of mindfulness session (e.g. meditation, breathing, including unknown type). |
notes= null | String? | — | Additional notes for the session. |
startTimemandatory | Instant | — | Start time of the record. |
startZoneOffset | ZoneOffset? | — | User experienced zone offset at startTime, or null if unknown. Providing these will help history aggregations results stay consistent should user travel. Queries with user experienced time filters will assume system current zone offset if the information is absent. |
title= null | String? | — | Title of the session. |
Aggregate metrics
The AggregateMetric constants Google defines on MindfulnessSessionRecord. The value type is the T in Google’s AggregateMetric<T> signature. Every aggregate metric across all records.
| Metric | Value type | Google’s description |
|---|---|---|
| MindfulnessSessionRecord.MINDFULNESS_DURATION_TOTAL | Duration | Metric identifier to retrieve the total mindfulness session duration from androidx.health.connect.client.aggregate.AggregationResult. To check if this metric is available, use HealthConnectFeatures.getFeatureStatus with HealthConnectFeatures.FEATURE_MINDFULNESS_SESSION as the argument. |
Google’s read-data guide: “For cumulative types like StepsRecord, use aggregate() instead of readRecords() to avoid double counting from multiple sources and improve accuracy.” and “The aggregation API also contains logic to handle duplicate records, and lessens the chances of rate limiting.”
Constants
The 6 const val values Google’s reference lists on MindfulnessSessionRecord, with the integer each maps to.
| Constant | Value | Google’s description |
|---|---|---|
MindfulnessSessionRecord.MINDFULNESS_SESSION_TYPE_BREATHING | 2 | Guided breathing mindfulness session. |
MindfulnessSessionRecord.MINDFULNESS_SESSION_TYPE_MEDITATION | 1 | Meditation mindfulness session. |
MindfulnessSessionRecord.MINDFULNESS_SESSION_TYPE_MOVEMENT | 4 | Stretches/movement mindfulness session. |
MindfulnessSessionRecord.MINDFULNESS_SESSION_TYPE_MUSIC | 3 | Music/soundscapes mindfulness session. |
MindfulnessSessionRecord.MINDFULNESS_SESSION_TYPE_UNGUIDED | 5 | Unguided mindfulness session. |
MindfulnessSessionRecord.MINDFULNESS_SESSION_TYPE_UNKNOWN | 0 | Can be used to represent any generic mindfulness session that does not fall into a specific category. Any unknown new value definition will also fall automatically into MINDFULNESS_SESSION_TYPE_UNKNOWN. Use this type if the mindfulness session type is unknown. |
Read MindfulnessSessionRecord in Kotlin
The shape of Google’s own read example, with MindfulnessSessionRecord and its names filled in. Get the client with HealthConnectClient.getOrCreate(context) after checking getSdkStatus.
import androidx.health.connect.client.HealthConnectClient
import androidx.health.connect.client.records.MindfulnessSessionRecord
import androidx.health.connect.client.request.ReadRecordsRequest
import androidx.health.connect.client.time.TimeRangeFilter
import java.time.Instant
suspend fun readMindfulnessSession(
client: HealthConnectClient,
startTime: Instant,
endTime: Instant,
): List<MindfulnessSessionRecord> {
val response = client.readRecords(
ReadRecordsRequest(
MindfulnessSessionRecord::class,
timeRangeFilter = TimeRangeFilter.between(startTime, endTime),
)
)
// One page of up to pageSize records (default 1000); follow
// response.pageToken for the rest.
return response.records
}import androidx.health.connect.client.HealthConnectClient
import androidx.health.connect.client.records.MindfulnessSessionRecord
import androidx.health.connect.client.request.AggregateRequest
import androidx.health.connect.client.time.TimeRangeFilter
import java.time.Instant
import java.time.Duration
suspend fun aggregateMindfulnessSession(
client: HealthConnectClient,
startTime: Instant,
endTime: Instant,
): Duration? {
val response = client.aggregate(
AggregateRequest(
metrics = setOf(MindfulnessSessionRecord.MINDFULNESS_DURATION_TOTAL),
timeRangeFilter = TimeRangeFilter.between(startTime, endTime),
)
)
// get() is declared as returning a nullable value.
return response[MindfulnessSessionRecord.MINDFULNESS_DURATION_TOTAL]
}Setting up the client, the permission flow and Play Console declaration: integrating Health Connect step by step.
HealthKit counterpart
No verified HealthKit counterpart. The cross-platform matrix only pairs metrics checked against both Apple’s and Google’s documentation, and MindfulnessSessionRecord is not among them yet. A similarly named Apple type may exist on the HealthKit reference, but a name match is not a verified mapping.
Questions
- What permission does MindfulnessSessionRecord need?
- Google's Health Connect data-types table (read 2026-10-03) declares android.permission.health.READ_MINDFULNESS for reading MindfulnessSessionRecord and android.permission.health.WRITE_MINDFULNESS for writing it, and says apps must declare permissions in the manifest before requesting them.
- Which aggregate metrics does MindfulnessSessionRecord support?
- Google's Jetpack reference defines 1 on MindfulnessSessionRecord: MINDFULNESS_DURATION_TOTAL (AggregateMetric<Duration>). Pass it in the metrics set of an AggregateRequest and read it back from the AggregationResult.
- Which constants does MindfulnessSessionRecord define?
- Google's reference lists 6 constants on MindfulnessSessionRecord, including MINDFULNESS_SESSION_TYPE_BREATHING = 2, MINDFULNESS_SESSION_TYPE_MEDITATION = 1, MINDFULNESS_SESSION_TYPE_MOVEMENT = 4, MINDFULNESS_SESSION_TYPE_MUSIC = 3, MINDFULNESS_SESSION_TYPE_UNGUIDED = 5 and MINDFULNESS_SESSION_TYPE_UNKNOWN = 0. Store the constant name or the value it maps to, and treat values you do not recognise as unknown.
- Is MindfulnessSessionRecord an interval, instantaneous or series record?
- Google's data-types table lists MindfulnessSessionRecord as Interval, and defines that column as indicating "whether the data is recorded at an instant in time or over an interval". Its mandatory fields are endTime, metadata, mindfulnessSessionType and startTime.
Sources checked
- Google — MindfulnessSessionRecord (Jetpack reference) — last updated 2026-06-24 · read 2026-10-03
- Google — Health Connect data types · read 2026-10-03
- Google — HealthPermissions (framework reference) · read 2026-10-03
- Google — Read raw data (Health Connect guide) · read 2026-10-03
Google’s descriptions are quoted for identification; the page layout, the capsule and the cross-platform pairing are AIFitnessAPI’s. Generated from Google’s pages by a script, not typed by hand — the same data is behind every page in the Health Connect reference.