Get ECG data (Beta)
Each electrocardiogram (ECG) recording is stored as a measurement: one recording session with its own start and end time, a unique reference, and the voltage waveform of the recording as a health document. The ECG REST-API allows for data retrieval per end user.
There are two endpoints:
POST /data/v6/electrocardiogram/list
Get all ECG recordings of a user within a time range
POST /data/v6/electrocardiogram
Get one specific ECG recording by its measurement reference
A typical flow is to call the list endpoint first to find a user's recordings, store each recording's measurement.reference, and use it later to fetch that specific recording again with the single ECG endpoint. Additional information, such as the derived heart rate or the recording device, can be added to the response with additionalDetails.
Supported data sources
Apple Health
✓
✓
✓
Google Health
✓
✓
✓
Withings
✓
✓
✓
Polar
✓
✓
–
Looks up the end user by endUserId (access token) and returns all of their measurements that start within the requested time range, each with its ECG waveform (electrocardiogramData). Related epochs (e.g. heart rate, AFib) and device data are only returned when requested via additionalDetails.
Rules:
startTimestampandendTimestampmust use the same format: both UNIX (epoch milliseconds) or both ISO-8601.The range may be at most 31 days and must not be in the future.
The lower bound is extended by 24 hours internally, so recordings that started up to one day before
startTimestampcan also be returned.Results are not ordered and not paginated. If none are found,
datais an empty list.
Basic Auth for your username:password. Required for all endpoints.
Basic Auth for your authID:authSecret. Required for all endpoints.
End user's access token.
Epoch milliseconds when timestampType is UNIX, ISO-8601 date-time when ISO.
Epoch milliseconds when timestampType is UNIX, ISO-8601 date-time when ISO.
Only return recordings from these Thryve data source IDs. All sources if omitted.
[8]ECG recordings found (may be an empty list)
Null fields are omitted.
End user's access token.
Only present when endUserAlias was requested.
Response type identifier (ResponseType.ECG_LIST).
Case-insensitive. UNIX returns epoch milliseconds plus timezoneOffset;
ISO returns ISO-8601 date-times with offset.
Invalid request: missing or invalid startTimestamp / endTimestamp (negative or in the future),
mixed UNIX and ISO formats, startTimestamp after endTimestamp, range longer than 31 days,
unknown dataSourceIds, or unreadable JSON.
AppAuthorization header missing or invalid (unknown authID or wrong authSecret).
endUserId is unknown or does not belong to the authenticated app.
Unsupported media type (body must be application/json).
ECG list rate limit for the app exceeded.
Unhandled error.
Data is in cold storage and could not be queried (ColdTierQueryException).
POST /data/v6/electrocardiogram/list HTTP/1.1
Host: api.thryve.de
Authorization: text
AppAuthorization: text
Content-Type: application/json
Accept: */*
Content-Length: 108
{
"endUserId": "3f1c2b0a9d8e4f7a8b6c5d4e3f2a1b0c",
"startTimestamp": 1704067200000,
"endTimestamp": 1704326400000
}{
"endUserId": "3f1c2b0a9d8e4f7a8b6c5d4e3f2a1b0c",
"type": "response.data.electrocardiogram.list",
"timestampType": "UNIX",
"data": [
{
"dataSourceId": 8,
"measurement": {
"reference": 1234567890,
"startTimestamp": 1704067200000,
"endTimestamp": 1704067230000,
"timezoneOffset": 60
},
"electrocardiogramData": {
"unit": "mV",
"samplingFrequencyHz": 500,
"leads": {
"I": [
0.12,
0.14,
0.16,
0.15,
0.13
]
}
}
},
{
"dataSourceId": 8,
"measurement": {
"reference": 1234567891,
"startTimestamp": 1704153600000,
"endTimestamp": 1704153630000,
"timezoneOffset": 60
},
"electrocardiogramData": {
"unit": "mV",
"samplingFrequencyHz": 500,
"leads": {
"I": [
0.11,
0.13,
0.15,
0.14,
0.12
]
}
}
}
]
}Looks up the end user by endUserId (access token), loads the measurement identified by measurementReference, and always includes its ECG waveform (electrocardiogramData).
Related epochs (e.g. heart rate, AFib) and device data are only returned when requested via additionalDetails.
Basic Auth for your username:password. Required for all endpoints.
Basic Auth for your authID:authSecret. Required for all endpoints.
End user's access token (mapped to accessToken in code).
Reference of the ECG measurement, as stored by the consumer service.
Case-insensitive. UNIX returns epoch milliseconds plus timezoneOffset;
ISO returns ISO-8601 date-times with offset.
ECG recording found
Null fields are omitted. Note: unlike the list endpoint, this single-recording response
does not set timestampType.
End user's access token.
Only present when endUserAlias was requested.
Response type identifier (ResponseType.ECG).
Invalid request: missing measurementReference ("missing mandatory measurementReference"),
unreadable JSON, invalid timestampType, or
measurement reference not found for this end user (MissingDataException).
AppAuthorization header missing or invalid (unknown authID or wrong authSecret).
endUserId is unknown or does not belong to the authenticated app.
Unsupported media type (body must be application/json).
ECG rate limit for the app exceeded.
Unhandled error.
Data is in cold storage and could not be queried (ColdTierQueryException).
POST /data/v6/electrocardiogram HTTP/1.1
Host: api.thryve.de
Authorization: text
AppAuthorization: text
Content-Type: application/json
Accept: */*
Content-Length: 105
{
"endUserId": "3f1c2b0a9d8e4f7a8b6c5d4e3f2a1b0c",
"measurementReference": 1234567890,
"timestampType": "UNIX"
}{
"endUserId": "3f1c2b0a9d8e4f7a8b6c5d4e3f2a1b0c",
"type": "response.data.electrocardiogram",
"data": [
{
"dataSourceId": 8,
"measurement": {
"reference": 1234567890,
"startTimestamp": 1704067200000,
"endTimestamp": 1704067230000,
"timezoneOffset": 60
},
"electrocardiogramData": {
"unit": "mV",
"samplingFrequencyHz": 500,
"leads": {
"I": [
0.12,
0.14,
0.16,
0.15,
0.13
]
}
}
}
]
}Last updated

