Data Flow

REST API

Overview

Sahha provides access to its platform via REST API for developers to authenticate user profiles, upload health data, and receive a variety of biomarkers and scores.


Version: v1

/api/v1/profile/integration

GET

Summary:

Get Profile Integrations

Description:

Returns integrations <br> <br>Requires a valid <b>Profile</b> token in the authorization header.

Responses
Code Description
200 Returns integrations.
204 Returned if there are no results for the query.
401 Returned if the authorization token is invalid.

/api/v1/profile/integration/{externalId}

GET

Summary:

Get Profile Integrations by ExternalId

Description:

Returns integrations for the ExternalId specified <br> <br>Requires a valid <b>Account</b> token in the authorization header.

Parameters
Name Located in Description Required Schema
externalId path Yes string
Responses
Code Description
200 Returns integrations for the profile ExternalId specified.
204 Returned if there are no results for the query.
401 Returned if the authorization token is invalid.

/api/v1/profile/integration/garmin/connect

GET

Parameters
Name Located in Description Required Schema
redirect query No boolean
Responses
Code Description
200 Success

/Version

GET

Responses
Code Description
200 Success

/api/v1/profile/data/log

POST

Parameters
Name Located in Description Required Schema
fireLogEvents query No boolean
Responses
Code Description
200 Success

/api/v1/oauth/profile/refreshToken

POST

Summary:

Refresh Token

Description:

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

Responses
Code Description
200 Returns a token response
401 Returned if the authorization token is invalid.

/api/v1/oauth/profile/register

POST

Summary:

Register a Profile using Account Token (For Server to Server Integration)

Description:

Creates a new profile a returns a Profile token. A profile represents your end user. <br> <br>Requires a valid <b>Account</b> token in the authorization header.

Responses
Code Description
201 Initialises a new profile and returns a Profile Token.
400 Returned if the provided external id is invalid or already in use.
401 Returned if the authorization token is invalid.

/api/v1/oauth/profile/register/appId

POST

Summary:

Register Profile using Application Credentials (For SDK Integration)

Description:

Creates a new profile and returns a profile token. A profile represents your end user. <br> <br> Required valid <b>AppId</b> and <b>AppSecret</b> in the headers.

Parameters
Name Located in Description Required Schema
appId header No string
appSecret header No string
Responses
Code Description
201 Initialises a new Profile and returns a profile token.
400 Returned if the external id provided is invalid.
401 Returned if the headers are invalid.

/api/v1/oauth/profile/token

POST

Summary:

Get Profile Token using Account Token

Description:

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

Responses
Code Description
200 Returns a token response.
400 Returned if the external ID provided is invalid.
401 Returned if the authorization token is invalid.

/api/v1/profile/analysis

POST

Summary:

Get Profile Analysis (Deprecation Date 01-02-2025)

Description:

Returns inference results for the profile specified by the token in the authorization header, filterable by date window. <br> <br>Requires a valid <b>Profile</b> token in the authorization header.

Responses
Code Description
200 Returns inference results for the profile specified by the token in the authorization header.
204 Returned if there are no results for the query.
401 Returned if the authorization token is invalid.

/api/v1/profile/analysis/{externalId}

POST

Summary:

Get Profile Analysis by ExternalId (Deprecation Date 01-02-2025)

Description:

Returns inference results for the ExternalId specified, filterable by date window. <br> <br>Requires a valid <b>Account</b> token in the authorization header.

Parameters
Name Located in Description Required Schema
externalId path Yes string
Responses
Code Description
200 Returns inference results for the profile ExternalId specified.
204 Returned if there are no results for the query.
401 Returned if the authorization token is invalid.

/api/v1/profile/analyze

POST

Summary:

Analyze Profile (Deprecation Date 01-02-2025)

Description:

Returns analysis inferences results for the profile specified by the token in the authorization header, filterable by date window. <br> <br>Requires a valid <b>Profile</b> token in the authorization header.

Responses
Code Description
200 Returns analysis inference results for the profile specified by the token in the authorization header.
204 Returned if there are no results for the query.
401 Returned if the authorization token is invalid.

/api/v1/profile/analyze/{externalId}

POST

Summary:

Analyze Profile by ExternalId (Deprecation Date 01-02-2025)

Description:

Returns analysis inferences results for the ExternalId specified, filterable by date window. <br> <br>Requires a valid <b>Account</b> token in the authorization header.

Parameters
Name Located in Description Required Schema
externalId path Yes string
Responses
Code Description
200 Returns analysis inference results for the profile ExternalId specified.
204 Returned if there are no results for the query.
401 Returned if the authorization token is invalid.

/api/v1/profile/biomarker

GET

Summary:

Get biomarkers, (Profile Authorization).

Description:

Gets biomarkers for a given time window for a profile with profile authorization.

Parameters
Name Located in Description Required Schema
categories query No [ string ]
types query No [ string ]
startDateTime query No dateTime
endDateTime query No dateTime
Responses
Code Description
200 Success
400 Returned if the profile id claim in the token is invalid.
401 Returned if the authorization token is invalid.

/api/v1/profile/biomarker/{externalId}

GET

Summary:

Get profile biomarkers (Account Authorization).

Description:

Gets biomarkers for a given time window for a profile with account authorization.

Parameters
Name Located in Description Required Schema
externalId path Yes string
categories query No [ string ]
types query No [ string ]
startDateTime query No dateTime
endDateTime query No dateTime
Responses
Code Description
200 Success
400 Returned if the provided profile id is invalid.
401 Returned if the authorization token is invalid.

/api/v1/profile/demographic

PUT

Summary:

Amend Demographic Information

Description:

Replaces the demographic information for a profile eg. Age, Gender. <br> <br>Requires a valid <b>Profile</b> token in the authorization header.

Responses
Code Description
200 Updates the demographic information for the profile.
400 Returned if the request data is invalid or empty.
401 Returned if the authorization token is invalid.

PATCH

Summary:

Amend Demographic Information

Description:

Patches the demographic information for a profile eg. Age, Gender. <br> <br>Requires a valid <b>Profile</b> token in the authorization header.

Responses
Code Description
200 Updates the demographic information for the profile.
400 Returned if the request data is invalid or empty.
401 Returned if the authorization token is invalid.

GET

Summary:

Get Profile Demographic Information

Description:

Returns the demographic information for a profile. <br> <br>Requires a valid <b>Profile</b> token in the authorization header.

Responses
Code Description
200 Returns demographic information for the profile specified by the token in the authorization header.
204 Returned if there are no results for the query.
401 Returned if the authorization token is invalid.

/api/v1/profile/deviceInformation

PUT

Summary:

Amend Device Information

Description:

Updates the device information for a profile, this is done automatically by the SDK if available. <br> <br>Requires a valid <b>Profile</b> token in the authorization header.

Responses
Code Description
200 Updates device information.
400 Returned if the request data is invalid or empty.
401 Returned if the authorization token is invalid.

GET

Summary:

Get Profile Device Information

Description:

Returns the device information for a profile. <br> <br>Requires a valid <b>Profile</b> token in the authorization header.

Responses
Code Description
200 Returns device information for the profile specified by the token in the authorization header.
204 Returned if there are no results for the query.
401 Returned if the authorization token is invalid.

/api/v1/profile/score

GET

Summary:

Get profile scores (Profile Authorization).

Description:

Gets scores for a given time window for a profile.

Parameters
Name Located in Description Required Schema
types query No [ string ]
startDateTime query No dateTime
endDateTime query No dateTime
version query No float
Responses
Code Description
200 Success
400 Returned if the profile id claim in the token is invalid.
401 Returned if the authorization token is invalid.

/api/v1/profile/score/{externalId}

GET

Summary:

Get profile scores (Account Authorization).

Description:

Gets scores for a given time window for a profile.

Parameters
Name Located in Description Required Schema
externalId path Yes string
types query No [ string ]
startDateTime query No dateTime
endDateTime query No dateTime
version query No float
Responses
Code Description
200 Success
400 Returned if the provided profile id is invalid.
401 Returned if the authorization token is invalid.

/api/v1/oauth/account/token

POST

Summary:

Get Account Token

Description:

Returns an Account access token when provided with a valid ClientId and ClientSecret. This token is used to perform administrative tasks like creating / modifying end user profiles and reporting.

Responses
Code Description
200 Returns a token response
400 Returned if the ClientId or ClientSecret is invalid.
Previous
Quickstart