# Data Hub API

APIs for exporting analytics, Smart Strength workouts, and measurement data for the authenticated gym location. Daily data exports should be fetched at or after 09:00 AM UTC once overnight processing completes. Callers must store externalAccountId returned in user event exports so that member records can be mapped and deleted when members appear in the opted-out-users endpoint. Data Hub is in pilot and available exclusively to EGYM Enterprise Pack customers; functionality and API contracts may change.

Version: Pilot

## Servers

Production
```
https://analytics.api.egym.com
```

## Security

### apiKeyAuth

API key generated by EGYM for a gym location.

Type: apiKey
In: header
Name: x-api-key

## Download OpenAPI description

 - [Data Hub API](https://developer.egym.com/_bundle/data-hub/api.yaml)

## Synchronous exports

 - [GET /api/v1/data/analytics](https://developer.egym.com/data-hub/api/synchronous-exports/getanalyticsexport.md): Returns weekly analytics metrics for the gym location associated with the API key. The maximum date range is 365 days.
 - [GET /api/v1/data/smart-strength-workouts](https://developer.egym.com/data-hub/api/synchronous-exports/getsmartstrengthworkoutsexport.md): Returns recent Smart Strength workout data for the gym location associated with the API key. The maximum date range is 30 days and startDate must be within the last month.
 - [GET /api/v1/data/smart-strength-assessments](https://developer.egym.com/data-hub/api/synchronous-exports/getsmartstrengthassessmentsexport.md): Returns recent Smart Strength assessment data for the gym location associated with the API key. The maximum date range is 30 days and startDate must be within the last month.
 - [GET /api/v1/data/flexibility-measurements](https://developer.egym.com/data-hub/api/synchronous-exports/getflexibilitymeasurementsexport.md): Returns recent flexibility measurement data for the gym location associated with the API key. The maximum date range is 30 days and startDate must be within the last month.
 - [GET /api/v1/data/body-measurements](https://developer.egym.com/data-hub/api/synchronous-exports/getbodymeasurementsexport.md): Returns recent body measurement data for the gym location associated with the API key. The maximum date range is 30 days and startDate must be within the last month.
 - [GET /api/v1/data/opted-out-users](https://developer.egym.com/data-hub/api/synchronous-exports/getoptedoutusersexport.md): Returns members at the gym location who have opted out of health data and consumer-to-business (C2B) sharing. The response contains only externalAccountId and lastSeenAt; names and emails are omitted.
## Asynchronous exports

 - [POST /api/v1/data/async](https://developer.egym.com/data-hub/api/asynchronous-exports/createasyncexportjob.md): Creates a background export job for a file-based event data export. Async exports can go back up to one year. Requests cannot include event data older than one year, and each export job can cover at m
 - [GET /api/v1/data/async/jobs/{jobId}](https://developer.egym.com/data-hub/api/asynchronous-exports/getasyncexportjobstatus.md): Returns the current status of an async export job. A downloadURL is returned only when the job status is DONE.
