Skip to content
AF
Health Connect reference

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

AccessPermission stringFramework reference
Readandroid.permission.health.READ_MINDFULNESSAPI 36 · U Ext 15
Writeandroid.permission.health.WRITE_MINDFULNESSAPI 36 · U Ext 15
AndroidManifest.xml
<uses-permission android:name="android.permission.health.READ_MINDFULNESS" />
<uses-permission android:name="android.permission.health.WRITE_MINDFULNESS" />
Kotlin — the same strings from the Jetpack helper
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.

FieldTypeAllowed rangeGoogle’s description
endTimemandatoryInstant—End time of the record.
endZoneOffsetZoneOffset?—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.
metadatamandatoryMetadata—Set of common metadata associated with the written record.
mindfulnessSessionTypemandatoryInt—Type of mindfulness session (e.g. meditation, breathing, including unknown type).
notes= nullString?—Additional notes for the session.
startTimemandatoryInstant—Start time of the record.
startZoneOffsetZoneOffset?—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= nullString?—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.

MetricValue typeGoogle’s description
MindfulnessSessionRecord.MINDFULNESS_DURATION_TOTALDurationMetric 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.

ConstantValueGoogle’s description
MindfulnessSessionRecord.MINDFULNESS_SESSION_TYPE_BREATHING2Guided breathing mindfulness session.
MindfulnessSessionRecord.MINDFULNESS_SESSION_TYPE_MEDITATION1Meditation mindfulness session.
MindfulnessSessionRecord.MINDFULNESS_SESSION_TYPE_MOVEMENT4Stretches/movement mindfulness session.
MindfulnessSessionRecord.MINDFULNESS_SESSION_TYPE_MUSIC3Music/soundscapes mindfulness session.
MindfulnessSessionRecord.MINDFULNESS_SESSION_TYPE_UNGUIDED5Unguided mindfulness session.
MindfulnessSessionRecord.MINDFULNESS_SESSION_TYPE_UNKNOWN0Can 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.

readRecords
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
}
aggregate
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’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.

← All Health Connect records · Every permission string