# Data push

Thryve can directly send new and updated end user data to your system through webhooks so that you don't have to do any API calls to receive the newest data.

The data will be sent as POST requests to a designated HTTPS URL (Port 443). The webhook content is compressed using zstd to reduce payload sizes and improve network time.&#x20;

Please ensure your endpoint accepts requests with `"CONTENT-TYPE": "application/json"` and `"CONTENT-ENCODING": "zstd"` . Data integrity and authenticity can be ensured by configuring an HMAC secret.

Respond to the request with a `200` or `204` within 2 seconds. Failed deliveries will be retried up to 3 times. Recurring failed deliveries within a certain timeframe will lead to the automatic disabling of webhooks.&#x20;

{% hint style="warning" %}
We recommend queuing received payloads by your endpoint before applying any further processing/data storage to ensure adequate response times.
{% endhint %}

## Configuration

Data push webhooks can be enabled or disabled for each data dimension (epoch/daily/measurement). To enable webhooks, you need a functioning public Webhook URL. You can also add custom authentication to secure your webhook endpoint using web authentication

In Thryve Dashboards, perform all configurations and trigger test webhook sending to your endpoint.

#### Content configuration

Webhooks can be sent using unix timestamps or timestamps following ISO 8601 depending on your preference. Optional parameters like dataSourceName and additional details can be enabled/disabled to optimize payload size for your needs and to only return the information you actually are interested in.

In Thryve Dashboards, perform all configurations and trigger test webhook sending to your endpoint.

## Epoch data push webhook

When enabled, this webhook will trigger whenever new data is stored for a data source or existing data is updated.&#x20;

{% tabs %}
{% tab title="ISO timestamp example" %}

```json
{
  "endUserId": "123accessToken",
  "endUserAlias": "YourEndUserAlias",
  "timestampType": "ISO",
  "type": "event.data.epoch.create", // or "event.data.epoch.update"
  "data": {
    "dataSourceId": 5,
    "dataSourceName": "Apple",
    "epochData": [
      {
        "startTimestamp": "2022-09-07T19:39:32Z",
        "endTimestamp": "2022-09-07T19:45:02Z",
        "timezoneOffset": 0,
        "dataTypeId": 1000,
        "value": "53.0",
        "additionalDetails": {
          "creationTimestamp": "2022-09-07T19:45:05Z",
          "dataTypeName": "Steps",
          "valueType": "DOUBLE",
          "thirdPartyDataSourceId": 1,
          "thirdPartyDataSourceName": "UNKNOWN",
          "measurementReference": 9007163812253719,
          "generationType": "MANUAL_ENTRY",
          "trustworthiness": "doubt_from_device_source",
          "medicalGrade": false,
          "chronologicalExactness": 15
        }
      }
    ]
  }
}
```

{% endtab %}

{% tab title="Unix timestamp example" %}

```json
{
  "endUserId": "123accessToken",
  "endUserAlias": "YourEndUserAlias",
  "timestampType": "UNIX",
  "type": "event.data.epoch.create", // or "event.data.epoch.update"
  "data": {
    "dataSourceId": 5,
    "dataSourceName": "Apple",
    "epochData": [
      {
        "startTimestamp": 1662579572000,
        "endTimestamp": 1662579902000,
        "timezoneOffset": 0,
        "dataTypeId": 1000,
        "value": "53.0",
        "additionalDetails": {
          "creationTimestamp": 1662579905000,
          "dataTypeName": "Steps",
          "valueType": "DOUBLE",
          "thirdPartyDataSourceId": 1,
          "thirdPartyDataSourceName": "UNKNOWN",
          "measurementReference": 9007163812253719,
          "generationType": "MANUAL_ENTRY",
          "trustworthiness": "doubt_from_device_source",
          "medicalGrade": false,
          "chronologicalExactness": 15
        }
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

### Epoch data push schema

#### Webhook object

<table><thead><tr><th width="160.32379150390625">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>endUserId</code></td><td>String containing the unique identifier of a user in Thryve's system. Auto-generated upon user creation. Formerly known as <code>accessToken</code>.</td></tr><tr><td><code>endUserAlias</code></td><td>Optional. String containing the optional alias set by you when creating a user. Formerly known as <code>partnerUserId</code>. Only returned if configured and not <code>null</code>.</td></tr><tr><td><code>timestampType</code></td><td>String specifying the timestamps to expect in the data object. <code>iso</code> or <code>unix</code>.</td></tr><tr><td><code>type</code></td><td>String specifying the payload structure to expect in the <code>data</code> object. <code>event.data.epoch.create</code> for new data <code>event.data.epoch.update</code> for updated data. </td></tr><tr><td><code>data</code></td><td>Object containing content according to <code>type</code>.</td></tr></tbody></table>

#### Data source object

<table><thead><tr><th width="160.32379150390625">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>dataSourceId</code></td><td>Integer specifying the data source new data has been stored for.</td></tr><tr><td><code>dataSourceName</code></td><td>Optional. String containing the name of the data source.</td></tr><tr><td><code>epochData</code></td><td>Array containing list of new or updated epoch data.</td></tr></tbody></table>

#### Epoch object

<table><thead><tr><th width="168.5833740234375">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>startTimestamp</code></td><td>String when ISO formatted timestamp, Integer when unix timestamp in milliseconds</td></tr><tr><td><code>endTimestamp</code></td><td>String when ISO formatted timestamp, Integer when unix timestamp in milliseconds. Not returned if null.</td></tr><tr><td><code>timezoneOffset</code></td><td>Integer describing the offset to UTC in minutes. Not returned if null.</td></tr><tr><td><code>dataTypeId</code></td><td>Integer specifying the data type.</td></tr><tr><td><code>value</code></td><td>String containing the value of the data point.</td></tr><tr><td><code>additionalDetails</code></td><td>Object containing optional additional information if configured.</td></tr></tbody></table>

#### Additional details object

<table><thead><tr><th width="234.85504150390625">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>creationTimestamp</code></td><td>Timestamp when data was received by Thryve. String when ISO formatted timestamp, Integer when unix timestamp in milliseconds</td></tr><tr><td><code>dataTypeName</code></td><td>String containing the name of the data type.</td></tr><tr><td><code>valueType</code></td><td>String containing what value to expect. </td></tr><tr><td><code>thirdPartyDataSourceId</code></td><td>Integer specifying the third party that recorded the data. Not returned if null</td></tr><tr><td><code>thirdPartyDataSourceName</code></td><td>String containing the name of the third party data source. Not returned if null.</td></tr><tr><td><code>measurementReference</code></td><td>Integer containing the reference of the measurement object this data point belongs to. Not returned if null</td></tr><tr><td><code>generationType</code></td><td>String containing information how data was recorded if available. Not returned if null</td></tr><tr><td><code>trustworthiness</code></td><td>String containing information on data quality if available. Not returned if null</td></tr><tr><td><code>medicalGrade</code></td><td>Boolean indicating if data was recorded by a medical grade sensor, e.g. an FDA-approved medical device. Not returned if null.</td></tr><tr><td><code>chronologicalExactness</code></td><td>Integer indicating potential deviations from timestamps, measured in minutes. Not returned if null.</td></tr></tbody></table>

## Daily data push webhook

When enabled, this webhook will trigger whenever new data is stored for a data source or existing data is updated.&#x20;

{% tabs %}
{% tab title="ISO timestamp example" %}

```json
{
  "endUserId": "123accessToken",
  "endUserAlias": "YourEndUserAlias",
  "timestampType": "ISO",
  "type": "event.data.daily.create", // or "event.data.daily.update"
  "data": {
    "dataSourceId": 5,
    "dataSourceName": "Apple",
    "epochData": [
      {
        "day": "2022-09-07",
        "timezoneOffset": 0,
        "dataTypeId": 1000,
        "value": "11203",
        "additionalDetails": {
          "creationTimestamp": "2022-09-07T19:45:05Z",
          "dataTypeName": "Steps",
          "valueType": "LONG",
          "trustworthiness": "doubt_from_device_source",
          "chronologicalExactness": 15
        }
      }
    ]
  }
}
```

{% endtab %}

{% tab title="Unix timestamp example" %}

```json
{
  "endUserId": "123accessToken",
  "endUserAlias": "YourEndUserAlias",
  "timestampType": "ISO",
  "type": "event.data.daily.create", // or "event.data.daily.update"
  "data": {
    "dataSourceId": 5,
    "dataSourceName": "Apple",
    "epochData": [
      {
        "day": 1662508800000,
        "timezoneOffset": 0,
        "dataTypeId": 1000,
        "value": "11203",
        "additionalDetails": {
          "creationTimestamp": 1662579905000,
          "dataTypeName": "Steps",
          "valueType": "LONG",
          "trustworthiness": "doubt_from_device_source",
          "chronologicalExactness": 15
        }
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

### Daily data push schema

#### Webhook object

<table><thead><tr><th width="160.32379150390625">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>endUserId</code></td><td>String containing the unique identifier of a user in Thryve's system. Auto-generated upon user creation. Formerly known as <code>accessToken</code>.</td></tr><tr><td><code>endUserAlias</code></td><td>Optional. String containing the optional alias set by you when creating a user. Formerly known as <code>partnerUserId</code>. Only returned if configured and not <code>null</code>.</td></tr><tr><td><code>timestampType</code></td><td>String specifying the timestamps to expect in the data object. <code>iso</code> or <code>unix</code>.</td></tr><tr><td><code>type</code></td><td>String specifying the payload structure to expect in the <code>data</code> object. <code>event.data.daily.create</code> for new data <code>event.data.daily.update</code> for updated data. </td></tr><tr><td><code>data</code></td><td>Object containing content according to <code>type</code>.</td></tr></tbody></table>

#### Data source object

<table><thead><tr><th width="160.32379150390625">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>dataSourceId</code></td><td>Integer specifying the data source new data has been stored for.</td></tr><tr><td><code>dataSourceName</code></td><td>Optional. String containing the name of the data source.</td></tr><tr><td><code>dailyData</code></td><td>Array containing list of new or updated daily data.</td></tr></tbody></table>

#### Daily object

<table><thead><tr><th width="168.5833740234375">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>day</code></td><td>String when ISO formatted timestamp, Integer when unix timestamp in milliseconds for midnight (day start) in UTC.</td></tr><tr><td><code>timezoneOffset</code></td><td>Integer describing the offset to UTC in minutes. Not returned if null.</td></tr><tr><td><code>dataTypeId</code></td><td>Integer specifying the data type.</td></tr><tr><td><code>value</code></td><td>String containing the value of the data point.</td></tr><tr><td><code>additionalDetails</code></td><td>Object containing optional additional information if configured.</td></tr></tbody></table>

#### Additional details object

<table><thead><tr><th width="234.85504150390625">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>creationTimestamp</code></td><td>Timestamp when data was received by Thryve. String when ISO formatted timestamp, Integer when unix timestamp in milliseconds</td></tr><tr><td><code>dataTypeName</code></td><td>String containing the name of the data type.</td></tr><tr><td><code>valueType</code></td><td>String containing what value to expect. </td></tr><tr><td><code>generationType</code></td><td>String containing information how data was recorded if available. Not returned if null</td></tr><tr><td><code>trustworthiness</code></td><td>String containing information on data quality if available. Not returned if null</td></tr><tr><td><code>chronologicalExactness</code></td><td>Integer indicating potential deviations from timestamps, measured in minutes. Not returned if null.</td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.thryve.health/receive-updates-via-webhooks/data-push.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
