The Google Health API provides data types for reading recorded mindfulness
sessions (`mindfulness-session`) and logging emotional states (`moods`).

Understand how to read mindfulness sessions, handle conditional heart rate
permissions, and log mood entries in your application.

## Supported data types

The API supports the following data types for mindfulness and emotional
wellbeing:

<br />

| Data type | Available operations | Scope |
|---|---|---|
| **[Mindfulness Session](https://developers.google.com/health/reference/rest/v4beta/users.dataTypes.dataPoints.md.txt#mindfulnesssession)** v4beta **dataType:** `mindfulness-session` **filter parameter:** `mindfulness_session` **Record type:**Session [Webhook support](https://developers.google.com/health/webhooks.md.txt) Identifier support [Mindfulness guide](https://developers.google.com/health/data-types/mindfulness.md.txt) | list, get, reconcile, rollup, dailyRollup | `.mindfulness.readonly` --- all fields except `heartRateSummary` `.mindfulness.readonly` + `.health_metrics_and_measurements.readonly` --- all fields |
| **[Moods](https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints.md.txt#moods)** **dataType:** `moods` **filter parameter:** `moods` **Record type:** [Sample](https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints.md.txt#ObservationSampleTime) Identifier support [Mindfulness guide](https://developers.google.com/health/data-types/mindfulness.md.txt) [Women's Health guide](https://developers.google.com/health/data-types/womens-health.md.txt) | create, update, batchDelete | `.mindfulness.writeonly` |
[*Table: Google Health API Mindfulness data types*]

<br />

## Mindfulness sessions

v4beta

The `mindfulness-session` data type is **read-only** (`list`, `get`,
`reconcile`, `rollUp`, and `dailyRollUp`) in the
[`v4beta` channel](https://developers.google.com/health/about.md.txt#beta-channel) and represents a continuous
mindfulness activity, such as a meditation or guided breathing exercise. Users
can view and delete sessions on the Mindfulness page in the Google Health
app.

Each `mindfulnessSession` data point includes the following fields:

- **Session Time (`interval`)** : Start and end timestamps (`startTime` and `endTime`), UTC offsets (`startUtcOffset` and `endUtcOffset`), and local civil times (see [`SessionTimeInterval`](https://developers.google.com/health/reference/rest/v4beta/users.dataTypes.dataPoints.md.txt#SessionTimeInterval)).
- **Pause Intervals (`pauseIntervals`)** : Optional intervals during which the user paused the session. `startTime` is always set, and `endTime` is unset if the session ended while paused.
- **Heart Rate Summary (`heartRateSummary`)** : Optional summary containing `averageBeatsPerMinute`, `startBeatsPerMinute`, and `endBeatsPerMinute` (serialized as 64-bit integer strings) when authorized by the secondary health metrics scope.
- **Session Rollup (`sessionCount`)** : When calling `rollUp` or `dailyRollUp`, `mindfulnessSession.sessionCount` returns the number of sessions in each window as a 64-bit integer string.

### Conditional scope for heart rate summaries

Reading `mindfulness-session` data points requires the
`https://www.googleapis.com/auth/googlehealth.mindfulness.readonly` scope.

If the user has also granted
`https://www.googleapis.com/auth/googlehealth.health_metrics_and_measurements.readonly`,
`list`, `get`, and `reconcile` responses include `heartRateSummary` when heart
rate data was recorded during the session. If the user hasn't granted
`.health_metrics_and_measurements.readonly`, the API omits the
`heartRateSummary` field from the response entirely and returns only the
remaining session fields. The response doesn't include `heartRateSummary` as
`null` or an empty object.

### REST representation example

To query mindfulness sessions, send a `GET` request to `list` or `reconcile`
using a `mindfulness_session.interval.civil_start_time` or
`mindfulness_session.interval.start_time` filter, or call `get` with the data
point resource name (note that `reconcile` returns `dataPointName` instead of
`name`):

<br />

**Important:** The format of data type identifiers differs when the data type has more than one word. In an endpoint, the data type name must be in kebab case, such as `body-fat`. In a filter parameter, however, the data type name must be in snake case, such as `body_fat`.

<br />

### Request

```
GET https://health.googleapis.com/v4beta/users/me/dataTypes/mindfulness-session/dataPoints?filter=mindfulness_session.interval.civil_start_time >= "2026-10-01T00:00:00"
Authorization: Bearer access-token
Accept: application/json
```

### Response (mindfulness scope only)

```
{
  "dataPoints": [
    {
      "name": "users/me/dataTypes/mindfulness-session/dataPoints/ms-987654321",
      "dataSource": {
        "recordingMethod": "ACTIVELY_MEASURED"
      },
      "mindfulnessSession": {
        "interval": {
          "startTime": "2026-10-01T14:00:00Z",
          "startUtcOffset": "-25200s",
          "endTime": "2026-10-01T14:15:00Z",
          "endUtcOffset": "-25200s"
        },
        "pauseIntervals": [
          {
            "startTime": "2026-10-01T14:05:00Z",
            "endTime": "2026-10-01T14:06:00Z"
          }
        ]
      }
    }
  ]
}
```

### Response (with health metrics scope)

```
{
  "dataPoints": [
    {
      "name": "users/me/dataTypes/mindfulness-session/dataPoints/ms-987654321",
      "dataSource": {
        "recordingMethod": "ACTIVELY_MEASURED"
      },
      "mindfulnessSession": {
        "interval": {
          "startTime": "2026-10-01T14:00:00Z",
          "startUtcOffset": "-25200s",
          "endTime": "2026-10-01T14:15:00Z",
          "endUtcOffset": "-25200s"
        },
        "heartRateSummary": {
          "averageBeatsPerMinute": "68",
          "startBeatsPerMinute": "74",
          "endBeatsPerMinute": "64"
        },
        "pauseIntervals": [
          {
            "startTime": "2026-10-01T14:05:00Z",
            "endTime": "2026-10-01T14:06:00Z"
          }
        ]
      }
    }
  ]
}
```

### Aggregate session counts

Use `rollUp` or `dailyRollUp` to count mindfulness sessions across physical time
windows or local calendar days:

### Request

```
POST https://health.googleapis.com/v4beta/users/me/dataTypes/mindfulness-session/dataPoints:dailyRollUp
Authorization: Bearer access-token
Accept: application/json

{
  "range": {
    "start": {
      "date": {
        "year": 2026,
        "month": 10,
        "day": 1
      },
      "time": {
        "hours": 0,
        "minutes": 0,
        "seconds": 0,
        "nanos": 0
      }
    },
    "end": {
      "date": {
        "year": 2026,
        "month": 10,
        "day": 3
      },
      "time": {
        "hours": 0,
        "minutes": 0,
        "seconds": 0,
        "nanos": 0
      }
    }
  },
  "windowSizeDays": 1
}
```

### Response

```
{
  "rollupDataPoints": [
    {
      "civilStartTime": {
        "date": {
          "year": 2026,
          "month": 10,
          "day": 1
        },
        "time": {}
      },
      "civilEndTime": {
        "date": {
          "year": 2026,
          "month": 10,
          "day": 1
        },
        "time": {
          "hours": 23,
          "minutes": 59,
          "seconds": 59
        }
      },
      "mindfulnessSession": {
        "sessionCount": "2"
      }
    }
  ]
}
```

## Moods

The `moods` data type logs emotional states and valences at a given timestamp
using the `https://www.googleapis.com/auth/googlehealth.mindfulness.writeonly`
scope (`create`, `update`, and `batchDelete`). For complete field definitions
and `batchDelete` examples, see
[`Moods`](https://developers.google.com/health/reference/rest/v4/users.dataTypes.dataPoints.md.txt#Moods) and the
[Women's Health guide](https://developers.google.com/health/data-types/womens-health.md.txt#moods).

### Create a mood log

### Request

```
POST https://health.googleapis.com/v4/users/me/dataTypes/moods/dataPoints
Authorization: Bearer access-token
Content-Type: application/json

{
  "moods": {
    "sampleTime": {
      "physicalTime": "2026-10-01T14:20:00Z"
    },
    "moods": [ "CALM", "CONTENT" ],
    "valences": [ "PLEASANT" ]
  }
}
```

### Response

```
{
  "done": true,
  "response": {
    "@type": "type.googleapis.com/google.devicesandservices.health.v4.DataPoint",
    "name": "users/user-id/dataTypes/moods/dataPoints/data-point-id",
    "moods": {
      "sampleTime": {
        "physicalTime": "2026-10-01T14:20:00Z",
        "utcOffset": "0s",
        "civilTime": {
          "date": { "year": 2026, "month": 10, "day": 1 },
          "time": { "hours": 14, "minutes": 20 }
        }
      },
      "moods": [ "CALM", "CONTENT" ],
      "valences": [ "PLEASANT" ]
    }
  }
}
```

## Guidelines

Use these guidelines when integrating mindfulness data into your app:

- **Handle partial consent** : Design your UI to work when `heartRateSummary` is absent, since users can grant `.mindfulness.readonly` without granting `.health_metrics_and_measurements.readonly`.
- **Calculate active duration** : Subtract any `pauseIntervals` from the overall session `interval` (if the final pause omits `endTime`, treat `interval.endTime` as the end of that pause).
- **Use reconciled streams** : Query the [`reconcile`
  endpoint](https://developers.google.com/health/reference/rest/v4beta/users.dataTypes.dataPoints/reconcile) when displaying mindfulness history so overlapping sessions across sources are deduplicated automatically.