Events API
The Events API is the way in which Wellhub will receive details of usage events by our users within your application, this will form the basis for payment calculations.
Wellhub Events API does not have rate limiting. We do limit the request body's size to up to 5MB.
POST - Create events
https://api.wellness.gympass.com/events
Note:
- The POST payload is an array of events. Multiple events can be sent in one request. If one event of the array has an issue, the entire payload will be invalidated.
- All events related to the previous month should be received by latest the 5th of the following month in order to be considered for payment purposes. Ex. Usages from September must be received by Wellhub by the 5th of October.
- It is strongly recommended that usage events are sent in chronological order. Ex. Send usages for days 1, 2, 3, 4 of the month in this order, and not 1, 4, 3, 2 of the month in the wrong order.
IMPORTANT || Usage events need to be sent to Wellhub as soon as the action has occurred. This must be the same day it occurred, or as close as possible to the action that has taken place by the user to guarantee they are correctly processed. If a user's usage is sent/received after they have canceled their subscription with Wellhub; This event will be ignored and it will not be considered for payment calculation.
(e.g. usage happened on Oct 20th and 10 days later - Oct 30th - The user cancels their subscriptions with Wellhub, but the usage events were sent on Nov 5th, these events will not be considered).
Request
Example1curl --location --request POST 'https://api.wellness.gympass.com/events' \2--header 'Content-Type: application/json' \3--header 'Authorization: Bearer <gpw-api-key>' \4--data-raw '[5 {6 "email": "email@wellhub.com",7 "event_type": "signin",8 "timestamp": "2020-05-04T09:44:40Z",9 "gpw_id": "gpw-fa1c0eab-8de3-4f35-9e79-85ae486a75d6",10 "user_id": "1234567890",11 "event_subcategory": "workout",12 "event_title": "video",13 "event_subtitle": "Training",14 "event_equipment": ["no equipment"],15 "timezone": "UTC-5",16 "event_duration": 30,17 "viewing_duration": 15,18 "geo_latitude": 38.722252,19 "geo_longitude": -9.139337,20 "device": "49c53afb-cdf4-49a9-bef7-73c399a913c9",21 "ip": "127.0.0.1"22 }23]'
The timezone field will not be considered or converted at all. Payment calculations will be made considering the timestamp as it is sent to Wellhub by the partner.
Headers
Field | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer gpw-api-key (this key is shared with you in the Welcome Email) |
Params
Field | Type | Required | Description | Validations |
---|---|---|---|---|
string | false | User email | Valid email format | |
event_type | string | true | The type of event the user participated in | List of valid event types below |
timestamp | string | true | Usage event timestamp | Should be a timestamp from the past Format RFC3339 (e.g 2025-04-11T10:20:30Z) NOTE: Old formats are deprecated and should not be used |
gpw_id | string | true | Wellhub Wellness user ID | Valid ID format gpw-<uuid> |
user_id | string | false | Partner user ID | - |
event_subcategory | string | false | Category of activity the user participated in | String size between 2 and 50 characters |
event_title | string | false | Title of the event the user participated in | String size between 2 and 50 characters |
event_subtitle | string | false | Subtitle of the event the user participated in | String size between 2 and 50 characters |
event_equipment | array of string | false | Equipment required for the event | String size of each entry between 2 and 50 characters NOTE: Size from 0 to 2 is currently supported BUT deprecated |
timezone | string | false | Timezone of the timestamp | - |
event_duration | integer | false | Total time, in minutes, of the event | Between 0 and 500 |
viewing_duration | integer | false | Number of minutes that the user actually participated in the event | Between 0 and 500 |
geo_latitude | float | false | Users device geolocation (latitude) | Between -90 and 90 |
geo_longitude | float | false | Users device geolocation (longitude) | Between -180 and 180 |
device | string | false | Device associated with the user's participation in the event | - |
ip | string | false | IP associated with the user's participation in the event | Valid IPv4 pattern |
Event Types
Event Type | Description |
---|---|
signup | Sign-up event |
signin | Sign-in / Log-in |
signout | Sign-out / Log-out |
audio | Listened to audio |
video | Watched a video (recorded or live) |
cancellation | User cancelled a session |
chat | Used chat function |
content_view | Viewed content (valid for any type of content) |
create_record | User created a record inside the app (input information) |
no_show | User did not take scheduled session |
1_on_1_session | User performed individual one-on-one session (ex. therapy) |
renew | Returning user signing up for the partner app again |
other | Miscellaneous category for anything else |
Response
Status Code | Body | Description |
---|---|---|
200 | empty | Request was successfully received and validated |
400 | description of payload error | Request payload has an error |
401 | empty | Unauthorized request, missing API key or wrong API key |
Only events that are accurately received will be taken into account in the payment calculation. Consequently, the partner must implement the appropriate retry policy for
5xx
status code. On the other hand, for4xx
status code, the partner must ensure that the request data is well-defined.