> ## Documentation Index
> Fetch the complete documentation index at: https://vital-mintlify-7fa68d0b.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Deprecations

> Deprecated features in the Junction Wearables API, including the hypnogram timeseries type and redefined Source/Provider terminology.

### Non-grouped timeseries endpoints

<Warning>The deprecation cycle ends on **14 September 2026**. The API endpoints will be removed afterwards.</Warning>

We have introduced [Get Grouped Timeseries](/changelog/wearables/api#grouped-timeseries-feb-2024) endpoints since February 2024.
Check out the [Get Heartrate](/api-reference/data/timeseries/heartrate) endpoint for an example. It has been supported by all Junction API
SDKs (backend), as well as all relevant Junction Mobile SDKs (Native iOS, Native Android, Flutter) since 2024 as well.

The [Get Grouped Timeseries](/changelog/wearables/api#grouped-timeseries-feb-2024) endpoints have several advantages:

1. They use cursor-based pagination, allowing you to fetch and process data incrementally.
2. They expose the [data source attributions](/wearables/providers/data-attributions), which are absent from the legacy endpoints.

| Category                | Status        | API endpoint path                             | API SDKs                    |
| ----------------------- | ------------- | --------------------------------------------- | --------------------------- |
| Get Grouped Timeseries  | 🟢 Supported  | `/v2/timeseries/{user_id}/{resource}/grouped` | `vitals.{resource}_grouped` |
| Get Timeseries (Legacy) | ⚠️ Deprecated | `/v2/timeseries/{user_id}/{resource}`         | `vitals.{resource}`         |

<Card title="Recommended Action" icon="lightbulb-exclamation-on">
  For Junction API SDKs, the client methods for the Get Timeseries (Legacy) endpoints have been marked as deprecated since 2024. Make sure you use the
  latest Junction API SDK releases, and take action on all the deprecations.

  For relevant Junction Mobile SDKs (Native iOS, Native Android, Flutter), there is no action for you to take assuming you use the latest SDK releases.

  For direct API calls, make sure your request URL paths include `/grouped`, your logic expects the grouped timeseries response schema, and that you handle pagination.
</Card>

### The `hypnogram` timeseries type

<Warning>The deprecation cycle ends on ~~31 January 2025~~ **14 September 2026**. The resource will be removed afterwards.</Warning>

We have introduced a new Sleep Cycle summary type (`sleep_cycle`) which captures the detailed hypnogram of a sleep session.
It replaces the existing `hypnogram` timeseries type. More details can be found here: [Sleep Cycle Summary](/api-reference/data/sleep-cycle/get-summary)

<Card title="Recommended Action" icon="lightbulb-exclamation-on">
  Start processing the new `historical.data.sleep_cycle.created`, `daily.data.sleep_cycle.created` and `daily.data.sleep_cycle.updated` events.
  Stop processing the `historical.timeseries.hypnogram.created`, `daily.timeseries.hypnogram.created` and `daily.timeseries.hypnogram.updated` events.
</Card>

### Redefining Source and Provider

<Warning>The deprecation cycle ends on ~~31 July 2024~~ **14 September 2026**. The deprecated fields will be removed afterwards.</Warning>

Junction has redefined what *Source* and *Provider* mean across our API and event schemas:

<Accordion title="The new definitions of Provider and Source" defaultOpen>
  | Entity   | Definition                                                                                            |
  | -------- | ----------------------------------------------------------------------------------------------------- |
  | Source   | The source context of a specific piece of data (summary or timeseries resources).                     |
  | Provider | Static metadata of a wearable data provider (an app, a platform, a service, or Junction Mobile SDKs). |

  A *Source* context comprises:

  * the Provider (slug only)
  * the [Source Type](/wearables/providers/data-attributions#source-type)
  * the [App ID](/wearables/providers/data-attributions#app-id) (*optional*)

  We also have plans for the *Source* context to include source device metadata where available.

  A *Provider* object is a short description of a wearable data provider. It comprises the familiar
  `name`, `logo` and `slug` trio you have been receiving in many data events.
</Accordion>

To migrate to the new definitions, Junction is announcing the following deprecations:

<Steps>
  <Step title="All Data Events (daily.data.*)" stepNumber="1" titleSize="p">
    Inside the Source context located at `$.data.source`, the `name`, `logo`, and `slug` fields are
    now deprecated.

    Junction no longer embeds these *Provider* object fields in every data event, except for the provider
    slug.

    Using the [Steps data event](/event-catalog/daily.data.steps.created) as an illustration, originally
    the `source` field described the wearable data provider. As part of this redefinition, the `source` field is
    reappropriated to track the *Source* context of the `steps` timeseries value group. So we have added a few
    new *Source* context fields, and marked several *Provider* fields as deprecated:

    ```json daily.data.steps.created (Current) theme={null}
    {
        "event_type": "daily.data.steps.created",
        "data": {
            "data": [...],
            "source": {
                /** 🟢 BEGIN: New source fields **/
                "provider": "oura",
                "type": "ring",
                "app_id": null,
                /** 🟢 END: New source fields **/

                /** ⚠️ BEGIN: Deprecated provider fields, to be removed **/
                "name": "Oura",
                "slug": "oura",
                "logo": "https://example.com/oura.svg"
                /** ⚠️ END: Deprecated provider fields, to be removed **/
            }
        },
        "user_id": "fb58770e-8b7b-4416-a5bd-8433786d10dc"
    }
    ```

    Once the deprecation cycle ends, Junction will remove the deprecated fields:

    ```json daily.data.steps.created (Future) theme={null}
    {
        "event_type": "daily.data.steps.created",
        "data": {
            "data": [...],
            "source": {
                /** 🟢 BEGIN: New source fields **/
                "provider": "oura",
                "type": "ring",
                "app_id": null
                /** 🟢 END: New source fields **/
            }
        },
        "user_id": "fb58770e-8b7b-4416-a5bd-8433786d10dc"
    }
    ```

    <Card title="Recommended Action" icon="lightbulb-exclamation-on">
      Stop parsing `name`, `logo` and `slug` when processing the `$.data.source` field in
      **all Data Events** (daily.data.\*).
    </Card>

    <Info>
      If you need the Provider information, you can obtain it through the [Get Providers](/api-reference/providers)
      endpoint.
    </Info>
  </Step>

  <Step title="Get Summary endpoints" stepNumber="2" titleSize="p">
    <Note>
      This applies to:

      * Get Activity: `GET /v2/summary/activity/*`
      * Get Body: `GET /v2/summary/body/*`
      * Get Meal: `GET /v2/summary/meal/*`
      * Get Profile: `GET /v2/summary/profile/*`
      * Get Sleep: `GET /v2/summary/sleep/*`
      * Get Workouts: `GET /v2/summary/workouts/*`
    </Note>

    Similar to changes to the Data Events, the `name`, `logo`, and `slug` sub-fields under the `source` field
    in each and every summary are now deprecated.

    Junction no longer embeds these *Provider* object fields in every summary, except for the provider
    slug.

    Using the [Get Profile endpoint](/api-reference/data/profile/get-summary) as an illustration, the `source` object has
    been reappropriated as the *Source* context of this Profile summary. So we have added a few new *Source* context fields,
    and marked several *Provider* fields as deprecated:

    ```json Profile (Current) theme={null}
    {
        "id": "eadba0c7-4e81-4d17-962c-9ebe0629c08f",
        "date": "2022-08-04",
        "height": 183,
        "source": {
            /** 🟢 BEGIN: New source fields **/
            "provider": "oura",
            "type": "app",
            "app_id": null,
            /** 🟢 END: New source fields **/

            /** ⚠️ BEGIN: Deprecated provider fields, to be removed **/
            "name": "Oura",
            "slug": "oura",
            "logo": "https://example.com/oura.svg"
            /** ⚠️ END: Deprecated provider fields, to be removed **/
        },
        "user_id": "71937dd3-aebe-46b7-ab64-c287bd75b2a6"
    }
    ```

    Once the deprecation cycle ends, Junction will remove the deprecated fields:

    ```json Profile (Future) theme={null}
    {
        "id": "eadba0c7-4e81-4d17-962c-9ebe0629c08f",
        "date": "2022-08-04",
        "height": 183,
        "source": {
            /** 🟢 BEGIN: New source fields **/
            "provider": "oura",
            "type": "app",
            "app_id": null
            /** 🟢 END: New fields **/
        },
        "user_id": "71937dd3-aebe-46b7-ab64-c287bd75b2a6"
    }
    ```

    <Card title="Recommended Action" icon="lightbulb-exclamation-on">
      Stop parsing `name`, `logo` and `slug` fields in **all Get Summary endpoint** responses.
    </Card>

    <Info>
      If you need the Provider information, you can obtain it through the [Get Providers](/api-reference/providers)
      endpoint.
    </Info>
  </Step>

  <Step title="Provider Connection events" stepNumber="3" titleSize="p">
    <Note>
      This applies to:

      * Provider Connection Created: `provider.connection.created`.
    </Note>

    Junction has renamed the `source` field in this event to `provider`, aligning with the redefinition of *Source*
    and *Provider*.

    To illustrate the change, originally the `source` field described the wearable data provider. As part of this
    redefinition, `source` no longer applies in this context. Junction has introduced an identical
    `provider` field as its replacement:

    ```json provider.connection.created (Current) theme={null}
    {
        "event_type": "provider.connection.created",
        "data": {
            "user_id": "71937dd3-aebe-46b7-ab64-c287bd75b2a6",
            "resource_availability": {...},

            /** 🟢 BEGIN: New field **/
            "provider": {
                "name": "Oura",
                "slug": "oura",
                "logo": "https://logo_url.com"
            },

            /** ⚠️ BEGIN: Deprecated field, to be removed **/
            "source": {
                "name": "Oura",
                "slug": "oura",
                "logo": "https://logo_url.com"
            }
            /** ⚠️ END: Deprecated field, to be removed **/
        }
    }
    ```

    Once the deprecation cycle ends, Junction will remove the deprecated `source` field:

    ```json provider.connection.created (Future) theme={null}
    {
        "event_type": "provider.connection.created",
        "data": {
            "user_id": "71937dd3-aebe-46b7-ab64-c287bd75b2a6",
            "resource_availability": {...}

            /** 🟢 BEGIN: New field **/
            "provider": {
                "name": "Oura",
                "slug": "oura",
                "logo": "https://logo_url.com"
            },
            /** 🟢 END: New field **/
        }
    }
    ```

    <Card title="Recommended Action" icon="lightbulb-exclamation-on">
      Update your `provider.connection.created` event parsing logic to parse the `provider` field,
      and stop parsing the `source` field.
    </Card>
  </Step>
</Steps>

### The `is_final` flag in `historical.data.*.created` events

<Warning>The deprecation cycle ends on ~~30 June 2024~~ **14 September 2026**. The deprecated fields will be removed afterwards.</Warning>

We are removing the `is_final` flag from the Historical Pull Completed (`historical.data.*.created`) events.

For each resource, Junction now signals one Historical Pull Completed event, only after we have finished fetching
all data chunks. This means `is_final` no longer has a meaning, since the event itself is *final*.

<Card title="Recommended Action" icon="lightbulb-exclamation-on">
  Stop parsing `is_final` as a required field when processing `historical.data.*.created` events.
</Card>
