Skip to main content

Sahha Platform v1 (v1)

Download OpenAPI specification:Download

Home

/Version

Authorizations:
Bearer

Responses

1. Profile

Amend Demographic Information

Updates the demographic information for a profile eg. Age, Gender.

Requires a valid Profile token in the authorization header.

Authorizations:
Bearer
Request Body schema:
occupation
string or null (Occupation)

Occupation of the user.

age
integer or null <int32> (Age)

Age of the user, must be 18 or more and 100 or less.

gender
string or null (Gender)

Gender of the user. Can be Male, Female or Gender Diverse.

country
string or null (Country)

Country of the user. In ISO 3166-2 format.

birthCountry
string or null (BirthCountry)

Birth Country of the user. In ISO 3166-2 format.

birthDate
string or null <date-time> (BirthDate)

Birth Date of the user. In ISO 8601 format.

ethnicity
string or null (Ethnicity)

Ethnicity of the user.

industry
string or null (Industry)

Industry of the user.

incomeRange
string or null (IncomeRange)

IncomeRange of the user.

education
string or null (Education)

Education of the user.

relationship
string or null (Relationship)

Relationship of the user. Can be Single, Partner, Spouse, Married.

locale
string or null (Locale)

Locale of the user. Can be Rural or Urban

livingArrangement
string or null (LivingArrangement)

Living Arrangement of the user. Can be Renting, HomeOwner, Homeless

Responses

Request samples

Content type
{
  • "occupation": "Project Manager",
  • "age": "35",
  • "gender": "Male",
  • "country": "NZ",
  • "birthCountry": "NZ",
  • "birthDate": "1990-01-01",
  • "ethnicity": "European",
  • "industry": "Environmental Services",
  • "incomeRange": "Upto100K",
  • "education": "Tertiary",
  • "relationship": "Single",
  • "locale": "Urban",
  • "livingArrangement": "Renting"
}

Get Profile Demographic Information

Returns the demographic information for a profile.

Requires a valid Profile token in the authorization header.

Authorizations:
Bearer

Responses

Response samples

Content type
application/json
{
  • "occupation": "Project Manager",
  • "age": "35",
  • "gender": "Male",
  • "country": "NZ",
  • "birthCountry": "NZ",
  • "birthDate": "1990-01-01",
  • "ethnicity": "European",
  • "industry": "Environmental Services",
  • "incomeRange": "Upto100K",
  • "education": "Tertiary",
  • "relationship": "Single",
  • "locale": "Urban",
  • "livingArrangement": "Renting"
}

Amend Device Information

Updates the device information for a profile, this is done automatically by the SDK if available.

Requires a valid Profile token in the authorization header.

Authorizations:
Bearer
Request Body schema:
sdkId
string (SDKId)

Sahha SDK identifier (based on customer integration). E.G. 'android_kotlin', 'ios_swift', 'react_native', 'flutter', 'capacitor', 'cordova'.

sdkVersion
string (SDKVersion)

Sahha SDK version string such as 3.4.1.

appId
string (AppId)

Sahha customer's App Bundle Id, e.g. com.sahha.app.

deviceType
string (DeviceType)

User device identifier such as 'Apple iPhone' or 'Samsung Galaxy'.

deviceModel
string (DeviceModel)

User device model identifier such as 'iPhone X' or 'Galaxy S10'.

system
string (System)

User device platform such as 'iOS', 'iPadOS', 'Android'.

systemVersion
string (SystemVersion)

User device platform version such as '15.1' on iOS or '21' on Android.

timeZone
string or null (TimeZone)

Time Zone of the profile holder. +12:00

Responses

Request samples

Content type
{
  • "sdkId": "ios_swift",
  • "sdkVersion": "3.4.1",
  • "appId": "com.sahha.app",
  • "deviceType": "iPhone",
  • "deviceModel": "iPhone X",
  • "system": "iOS",
  • "systemVersion": "15.1",
  • "timeZone": "+12:00"
}

Get Profile Device Information

Returns the device information for a profile.

Requires a valid Profile token in the authorization header.

Authorizations:
Bearer

Responses

Response samples

Content type
application/json
{
  • "deviceInformationId": "C85330AD-C691-453C-8CB6-353AB75FD611",
  • "sdkId": "ios_swift",
  • "sdkVersion": "3.4.1",
  • "appId": "com.sahha.app",
  • "deviceType": "iPhone",
  • "deviceModel": "iPhone X",
  • "system": "iOS",
  • "systemVersion": "15.1",
  • "timeZone": "+12:00"
}

Analyze Profile by ExternalId

Returns analysis inferences results for the ExternalId specified, filterable by date window.

Requires a valid Account token in the authorization header.

Authorizations:
Bearer
path Parameters
externalId
required
string
Request Body schema:
startDateTime
string or null <date-time> (StartDateTime)

The start date for filtering inference results of a user profile. In ISO 8601 format with a timezone offset.

endDateTime
string or null <date-time> (EndDateTime)

The end date for filtering inference results of a user profile. In ISO 8601 format with a timezone offset.

Responses

Request samples

Content type
{
  • "startDateTime": "2022-01-01T00:00:00+12:00",
  • "endDateTime": "2022-01-01T00:00:00+12:00"
}

Response samples

Content type
application/json
{
  • "inferences": [
    ]
}

Analyze Profile

Returns analysis inferences results for the profile specified by the token in the authorization header, filterable by date window.

Requires a valid Profile token in the authorization header.

Authorizations:
Bearer
Request Body schema:
startDateTime
string or null <date-time> (StartDateTime)

The start date for filtering inference results of a user profile. In ISO 8601 format with a timezone offset.

endDateTime
string or null <date-time> (EndDateTime)

The end date for filtering inference results of a user profile. In ISO 8601 format with a timezone offset.

Responses

Request samples

Content type
{
  • "startDateTime": "2022-01-01T00:00:00+12:00",
  • "endDateTime": "2022-01-01T00:00:00+12:00"
}

Response samples

Content type
application/json
{
  • "inferences": [
    ]
}

2. Profile Authentication

Initialize Profile

Creates a new profile and returns a Profile Token. A profile represents your end user.

Requires a valid Account token in the authorization header.

Authorizations:
Bearer
Request Body schema:
externalId
string (ExternalId)

ExternalId used to reference the created Profile

Responses

Request samples

Content type
{
  • "externalId": "6980b34e-14f9-47ef-b6f8-80a18b206a8e"
}

Response samples

Content type
application/json
{
  • "profileToken": "hIw0LuHXHZKMD7bWV0DlGWyTAyHqO8EceLmJ5ez96QrXv3Lhf0qoDqrNDp7jx...",
  • "expiresIn": "86400",
  • "tokenType": "Profile",
  • "refreshToken": "hIw0LuHXHZKMD7bWV0DlGWyTAyHqO8EceLmJ5ez96QrXv3Lhf0qoDqrNDp7jx..."
}

Initialize Profile using AppId

Creates a new profile and returns a profile token. A profile represents your end user.

Required valid AppId and AppSecret in the headers.

Authorizations:
Bearer
header Parameters
AppId
string
AppSecret
string
Request Body schema:
externalId
string (ExternalId)

ExternalId used to reference the created Profile

Responses

Request samples

Content type
{
  • "externalId": "6980b34e-14f9-47ef-b6f8-80a18b206a8e"
}

Response samples

Content type
application/json
{
  • "profileToken": "hIw0LuHXHZKMD7bWV0DlGWyTAyHqO8EceLmJ5ez96QrXv3Lhf0qoDqrNDp7jx...",
  • "expiresIn": "86400",
  • "tokenType": "Profile",
  • "refreshToken": "hIw0LuHXHZKMD7bWV0DlGWyTAyHqO8EceLmJ5ez96QrXv3Lhf0qoDqrNDp7jx..."
}

Get Profile Token

Returns a profile token to be used in the authorization header as 'profile {token}'

Authorizations:
Bearer
Request Body schema:
externalId
string or null

Responses

Request samples

Content type
{
  • "externalId": "C85330AD-C691-453C-8CB6-353AB75FD611"
}

Response samples

Content type
application/json
{
  • "profileToken": "hIw0LuHXHZKMD7bWV0DlGWyTAyHqO8EceLmJ5ez96QrXv3Lhf0qoDqrNDp7jx...",
  • "expiresIn": "86400",
  • "tokenType": "Profile",
  • "refreshToken": "hIw0LuHXHZKMD7bWV0DlGWyTAyHqO8EceLmJ5ez96QrXv3Lhf0qoDqrNDp7jx..."
}

Refresh Token

Returns a refreshed profile token to be used in the authorization header as 'profile {token}'

Authorizations:
Bearer
Request Body schema:
refreshToken
string (RefreshToken)

Profile refresh token

Responses

Request samples

Content type
{
  • "refreshToken": "hIw0LuHXHZKMD7bWV0DlGWyTAyHqO8EceL"
}

Response samples

Content type
application/json
{
  • "profileToken": "hIw0LuHXHZKMD7bWV0DlGWyTAyHqO8EceLmJ5ez96QrXv3Lhf0qoDqrNDp7jx...",
  • "expiresIn": "86400",
  • "tokenType": "Profile",
  • "refreshToken": "hIw0LuHXHZKMD7bWV0DlGWyTAyHqO8EceLmJ5ez96QrXv3Lhf0qoDqrNDp7jx..."
}

3. Device Activity

Receive Device Logs

Receives a range of device logs as an array from an end users mobile device.

Requires a valid Profile token in the authorization header.

Authorizations:
Bearer
Request Body schema:
Array
isLocked
boolean (IsLocked)

Denotes whether the users device is locked or unlocked at the time specified.

isScreenOn
boolean (IsScreenOn)

Denotes whether the users device screen is on at the time specified. This distinguishes between a user waking a phone or fully unlocking it.

eventTimestamp
string <date-time> (EventTimeStamp)

Date and time the event occurred. In ISO 8601 format with a timezone offset.

Responses

Request samples

Content type
[
  • {
    }
]

Retrieve Device Activity

Returns an array of device activity for a profile within the given date window.

Requires a valid Profile token in the authorization header.

Authorizations:
Bearer
query Parameters
startDate
string <date-time>
endDate
string <date-time>

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Receive Device Lock Activity Deprecated

Receives a range of device lock activity as an array from an end users mobile device.

Requires a valid Profile token in the authorization header.

Authorizations:
Bearer
Request Body schema:
Array
isLocked
boolean (IsLocked)

Denotes whether the users device is locked or unlocked at the time specified.

isScreenOn
boolean (IsScreenOn)

Denotes whether the users device screen is on at the time specified. This distinguishes between a user waking a phone or fully unlocking it.

eventTimestamp
string <date-time> (EventTimeStamp)

Date and time the event occurred. In ISO 8601 format with a timezone offset.

Responses

Request samples

Content type
[
  • {
    }
]

Retrieve Device Activity Deprecated

Returns an array of device activity for a profile within the given date window.

Requires a valid Profile token in the authorization header.

Authorizations:
Bearer
query Parameters
startDate
string <date-time>
endDate
string <date-time>

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Retrieve Device Logs Using Profile ExternalId

Returns an array of device activity for a profile within the given date window.

Requires a valid Account token in the authorization header.

Authorizations:
Bearer
path Parameters
externalId
required
string
query Parameters
startDate
string <date-time>
endDate
string <date-time>

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Retrieve Device Logs Using Profile ExternalId Deprecated

Returns an array of device activity for a profile within the given date window.

Requires a valid Account token in the authorization header.

Authorizations:
Bearer
path Parameters
externalId
required
string
query Parameters
startDate
string <date-time>
endDate
string <date-time>

Responses

Response samples

Content type
application/json
[
  • {
    }
]

4. Movement Activity

Receive Movement Logs

Receives a range of movement logs as an array from an end users mobile device.

Requires a valid Profile token in the authorization header.

Authorizations:
Bearer
Request Body schema:
Array
dataType
string (DataType)

The type of movement being logged. Can be 'StepCount', 'FloorsDescended', 'FloorsAscended', 'Pace'

count
number <double> (Count)

The amount of times the data type occurred within the time period.

source
string (Source)

Source of this data log. e.g. 'Iphone X', 'Walking Buddy'

manuallyEntered
boolean (ManuallyEntered)

Whether the information was manually entered, or captured from a viable source'

startDateTime
string <date-time> (StartDateTime)

Denotes the start date and time for the movement log period. In ISO 8601 format with a timezone offset.

endDateTime
string <date-time> (EndDateTime)

Denotes the end date and time for the movement log period. In ISO 8601 format with a timezone offset.

Responses

Request samples

Content type
[
  • {
    }
]

Retrieve Movement Logs

Returns an array of movement logs for a profile within the given date window.

Requires a valid Profile token in the authorization header.

Authorizations:
Bearer
query Parameters
startDate
string <date-time>
endDate
string <date-time>

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Retrieve Movement Logs Using Profile ExternalId

Returns an array of movement logs for a profile within the given date window.

Requires a valid Account token in the authorization header.

Authorizations:
Bearer
path Parameters
externalId
required
string
query Parameters
startDate
string <date-time>
endDate
string <date-time>

Responses

Response samples

Content type
application/json
[
  • {
    }
]

5. Sleep Activity

Receive Sleep Logs

Receives a range of sleep logs as an array from an end users mobile device.

Requires a valid Profile token in the authorization header.

Authorizations:
Bearer
Request Body schema:
Array
durationInMinutes
number <double> (DurationInMinutes)

The Length of time in minutes the user was asleep for the given period.

sleepStage
string (SleepStage)

The stage of sleep the user was in. Can be one of 'in bed', 'asleep', 'awake'.

source
string (Source)

Source of this data log. e.g. 'Iphone X', 'Walking Buddy'

manuallyEntered
boolean (ManuallyEntered)

Whether the information was manually entered, or captured from a viable source'

startDateTime
string <date-time> (StartDateTime)

Denotes the start date and time for the sleep period. In ISO 8601 format with a timezone offset.

endDateTime
string <date-time> (EndDateTime)

Denotes the end date and time for the sleep period. In ISO 8601 format with a timezone offset.

Responses

Request samples

Content type
[
  • {
    }
]

Retrieve Sleep Logs

Returns an array of sleep logs for a profile within the given date window.

Requires a valid Profile token in the authorization header.

Authorizations:
Bearer
query Parameters
startDate
string <date-time>
endDate
string <date-time>
includeOverlappingResults
boolean

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Retrieve Sleep Logs Using Profile ExternalId

Returns an array of sleep logs for a profile within the given date window.

Requires a valid Account token in the authorization header.

Authorizations:
Bearer
path Parameters
externalId
required
string
query Parameters
startDate
string <date-time>
endDate
string <date-time>
includeOverlappingResults
boolean

Responses

Response samples

Content type
application/json
[
  • {
    }
]

6. Blood Activity

Receive Blood Logs

Receives a range of blood logs as an array from an end users mobile device.

Requires a valid Profile token in the authorization header.

Authorizations:
Bearer
Request Body schema:
Array
dataType
string (DataType)

The type of data being logged. Can be 'BloodGlucose', 'BloodPressureDiastolic', 'BloodPressureSystolic'

count
number <double> (Count)

The value corresponding to the data type.

unit
string or null (Unit)

Unit the data is in, eg mg/dL (milligrams per deciliter) or mmol/L (millimoles per liter)

relationToMeal
string or null (RelationToMeal)

Relationship to when the last or next meal is.

bodyPosition
string or null (BodyPosition)

The position the body was in at time of measurement. E.g. sitting_down

measurementLocation
string or null (MeasurementLocation)

Where the blood pressure was measured from. E.g. left_upper_arm

specimenSource
string or null (SpecimenSource)

Where the specimen was collected.

mealType
string or null (MealType)

The type of meal had prior to sampling.

source
string (Source)

Source of this data log. e.g. 'Iphone X'

manuallyEntered
boolean (ManuallyEntered)

Whether the information was manually entered, or captured from a viable source'

startDateTime
string <date-time> (StartDateTime)

Denotes the start date and time for the blood log period. In ISO 8601 format with a timezone offset.

endDateTime
string <date-time> (EndDateTime)

Denotes the end date and time for the blood log period. In ISO 8601 format with a timezone offset.

Responses

Request samples

Content type
[
  • {
    }
]

Retrieve Blood Logs

Returns an array of blood logs for a profile within the given date window.

Requires a valid Profile token in the authorization header.

Authorizations:
Bearer
query Parameters
startDate
string <date-time>
endDate
string <date-time>

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Retrieve Blood Logs Using Profile ExternalId

Returns an array of blood logs for a profile within the given date window.

Requires a valid Account token in the authorization header.

Authorizations:
Bearer
path Parameters
externalId
required
string
query Parameters
startDate
string <date-time>
endDate
string <date-time>

Responses

Response samples

Content type
application/json
[
  • {
    }
]

7. Heart Activity

Receive Heart Logs

Receives a range of heart logs as an array from an end users mobile device.

Requires a valid Profile token in the authorization header.

Authorizations:
Bearer
Request Body schema:
Array
dataType
string (DataType)

The type of data being logged. Can be 'HeartRate', 'RestingHeartRate', 'HeartRateVariablity'

count
number <double> (Count)

The value corresponding to the data type.

source
string (Source)

Source of this data log. e.g. 'Iphone X'

manuallyEntered
boolean (ManuallyEntered)

Whether the information was manually entered, or captured from a viable source'

startDateTime
string <date-time> (StartDateTime)

Denotes the start date and time for the heart log period. In ISO 8601 format with a timezone offset.

endDateTime
string <date-time> (EndDateTime)

Denotes the end date and time for the heart log period. In ISO 8601 format with a timezone offset.

Responses

Request samples

Content type
[
  • {
    }
]

Retrieve Heart Logs

Returns an array of heart logs for a profile within the given date window.

Requires a valid Profile token in the authorization header.

Authorizations:
Bearer
query Parameters
startDate
string <date-time>
endDate
string <date-time>

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Retrieve Heart Logs Using Profile ExternalId

Returns an array of heart logs for a profile within the given date window.

Requires a valid Account token in the authorization header.

Authorizations:
Bearer
path Parameters
externalId
required
string
query Parameters
startDate
string <date-time>
endDate
string <date-time>

Responses

Response samples

Content type
application/json
[
  • {
    }
]