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. Requires a valid Profile 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
Requires a valid Account 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/callback

GET

Parameters
Name Located in Description Required Schema
oauth_token query No string
oauth_verifier query No string
state query No string
Responses
Code Description
200 Success

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

GET

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

/api/v1/account/profile/{externalId}

GET

Parameters
Name Located in Description Required Schema
externalId path Yes string
Responses
Code Description
200 Returns a profile.

GET

Parameters
Name Located in Description Required Schema
searchParameter query No string
currentPage query No integer
pageSize query No integer
Responses
Code Description
200 Returns a paged list that match the search parameter.

/api/v1/profile/data/log

POST

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.
Requires a valid Account 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.
Required valid AppId and AppSecret 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

DELETE

Summary:

Delete profiles (Account authorization)

Description:

Deletes profiles from the user account based on the provided list of external ids.

Responses
Code Description
200 Returned if the delete operation is successful.
401 Returned if the authorization token is invalid.

/api/v1/profile/archetypes

GET

Summary:

Get profile archetypes (Profile Authorization)

Description:

Gets archetypes for a given time window for a profile with profile authorization. Can be filtered by archetype name and periodicity.

Parameters
Name Located in Description Required Schema
startDateTime query No dateTime
endDateTime query No dateTime
name query No string
periodicity query No string
Responses
Code Description
200 Success
400 Bad Request
401 Unauthorized

/api/v1/profile/archetypes/{externalId}

GET

Summary:

Get profile archetypes (Account Authorization)

Description:

Gets archetypes for a given time window for a profile with account authorization. Can be filtered by archetype name and periodicity.

Parameters
Name Located in Description Required Schema
externalId path Yes string
startDateTime query No dateTime
endDateTime query No dateTime
name query No string
periodicity query No string
Responses
Code Description
200 Success
400 Bad Request
401 Unauthorized

/api/v1/profile/biomarker

GET

Summary:

Get profile 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. Date of birth, Gender.
Requires a valid Profile 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. Date of birth, Gender.
Requires a valid Profile 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.
Requires a valid Profile 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.
Requires a valid Profile 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.
Requires a valid Profile 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/insight/comparison

GET

Summary:

Get profile comparisons (Profile Authorization)

Description:

Gets comparison data for a profile with profile authorization. Can be filtered by name, category, and date range.

Parameters
Name Located in Description Required Schema
startDateTime query No dateTime
endDateTime query No dateTime
name query No string
category query No string
periodicity query No string
version query No float
Responses
Code Description
200 Success
400 Bad Request
401 Unauthorized

/api/v1/profile/insight/comparison/{externalId}

GET

Summary:

Get profile comparisons (Account Authorization)

Description:

Gets comparison data for a profile with account authorization. Can be filtered by name, category, and date range.

Parameters
Name Located in Description Required Schema
externalId path Yes string
startDateTime query No dateTime
endDateTime query No dateTime
name query No string
category query No string
periodicity query No string
version query No float
Responses
Code Description
200 Success
400 Bad Request
401 Unauthorized

/api/v1/profile/insight/trend

GET

Summary:

Get profile trends (Profile Authorization)

Description:

Gets trend data for a profile with profile authorization. Can be filtered by name, category, and date range.

Parameters
Name Located in Description Required Schema
startDateTime query No dateTime
endDateTime query No dateTime
name query No string
category query No string
periodicity query No string
version query No float
Responses
Code Description
200 Success
400 Bad Request
401 Unauthorized

/api/v1/profile/insight/trend/{externalId}

GET

Summary:

Get profile trends (Account Authorization)

Description:

Gets trend data for a profile with account authorization. Can be filtered by name, category, and date range.

Parameters
Name Located in Description Required Schema
externalId path Yes string
startDateTime query No dateTime
endDateTime query No dateTime
name query No string
category query No string
periodicity query No string
version query No float
Responses
Code Description
200 Success
400 Bad Request
401 Unauthorized

/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
Get Started