# Data Hub API

APIs for exporting analytics, Smart Strength workouts, and measurement data for the authenticated gym location. 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

Immediate paginated JSON exports for weekly analytics and recent event data.

### Export weekly analytics

 - [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.

### Export recent Smart Strength workouts

 - [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.

### Export recent Smart Strength assessments

 - [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.

### Export recent flexibility measurements

 - [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.

### Export recent body measurements

 - [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.

### Export opted-out users

 - [GET /api/v1/data/opted-out-users](https://developer.egym.com/data-hub/api/synchronous-exports/getoptedoutusersexport.md): Returns the members at the gym location who have not opted in to health data and consumer-to-business (C2B) sharing. These members are excluded from all event exports, so use this endpoint to identify accounts whose previously exported data must be deleted to comply with GDPR and other data-protection requirements. The endpoint takes no query parameters and is not paginated; it returns all opted-out users for the gym location in a single response.

## Asynchronous exports

Background export jobs that produce downloadable JSON, JSONL, or CSV files.

### Create async export job

 - [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 most 365 days.

### Get async export job status

 - [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.

