Endpoints
Gyms
GET - List
This endpoint returns the list of gyms to which you have access. Each gym included in the response from this endpoint has requested integration with Wellhub, selecting you as their system.
{{integration-setup-api-url}}/v1/systems/gyms
Headers
Field | Description |
---|---|
accept | application/json |
Authorization | Bearer {{Wellhub Auth Token}} |
Request example
curl1curl -X GET "{{integration-setup-api-url}}/v1/systems/gyms" \2 -H "accept: application/json" \3 -H "Authorization: Bearer {{Wellhub Auth Token}}"
Response example
200 - OK
Field | Description |
---|---|
id | It is the identifier of the gym at Wellhub. |
enabled | Indicates whether the gym is active (can be accessed by our user) or not. |
Payload1{2 "partners": [3 {4 "id": 000000,5 "enabled": true6 },7 {8 "id": 000001,9 "enabled": false10 }11 ]12}
Webhooks
Wellhub webhooks notify you when specific events are triggered on our platform. The webhook endpoints allow you to add, update, and fetch which webhooks you have registered.
POST - Create
This endpoint is used to set up and subscribe to the webhooks.
{{integration-setup-api-url}}/v1/systems/gyms/:gym-id/webhooks
Expected webhooks
It is expected that subscribed webhooks fulfill the minimum requirements corresponding to the system integration type. For instance, if the system is configured with us for check-in only, it is expected that the check-in webhook is subscribed. The same is true for the integrations involving booking only, or both booking and check-in.
Path variables
Field | Description |
---|---|
gym-id | Provided by Wellhub, it is the unique identifier of the gym. |
Headers
Field | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer {{Wellhub Auth Token}} |
Request body parameters
Field | Description | Type | Required |
---|---|---|---|
event | Indicates the webhook event. The options are available on this page. | String | True |
URL | URL that Wellhub will use to notify you. | String | True |
secret | Secret that we will use to send a signature header that you can validate when you receive the webhook. | String | True |
additional_data | Indicates if the user's additional data is required to be sent. | Boolean | False |
internal_product | Indicates whether the sent event will contain product information. | Boolean | False |
Request example
curl1curl -X POST "{{integration-setup-api-url}}/v1/systems/gyms/000000/webhooks" \2 -H "Authorization: Bearer {{Wellhub Auth Token}}" \3 -H "Content-Type: application/json" \4 -d '{5 "webhooks": [6 {7 "event": "checkin",8 "url": "https://www.webhook-url-example.com",9 "secret": "string",10 "additional_data": true11 "internal_product": true12 },13 {14 "event": "booking-requested",15 "url": "https://www.webhook-url-example.com",16 "secret": "string"17 }18 ]19}'
Response example
204 - NO CONTENT
PUT - Update
This endpoint updates information for a previously subscribed webhook.
{{integration-setup-api-url}}/v1/systems/gyms/:gym-id/webhooks/:webhook-event
Path variables
Field | Description |
---|---|
gym-id | Provided by Wellhub, it is the unique identifier of the gym. |
webhook-event | Indicates the event of the webhook. The options are available on this page. |
Headers
Field | Description |
---|---|
Content-Type | application/json |
Authorization | Bearer {{Wellhub Auth Token}} |
Request body parameters
Field | Description | Type | Required |
---|---|---|---|
event | Indicates the webhook event. The options are available on this page. | String | True |
URL | URL that Wellhub will use to notify you. | String | True |
secret | Secret that we will use to send a signature header that you can validate when you receive the webhook. | String | True |
additional_data | Indicates if the user's additional data is required to be sent. | Boolean | False |
internal_product | Indicates whether the sent event will contain product information. | Boolean | False |
Request example
curl1curl -X PUT "{{integration-setup-api-url}}/v1/systems/gyms/000000/webhooks/booking-requested" \2 -H "Authorization: Bearer {{Wellhub Auth Token}}" \3 -H "Content-Type: application/json" \4 -d '{5 "webhook": {6 "event": "booking-requested",7 "url": "https://www.webhook-url-example-updated.com",8 "secret": "string",9 }10}'
Response example
204 - NO CONTENT
GET - List
This endpoint retrieves a list of all subscribed webhooks.
{{integration-setup-api-url}}/v1/systems/gyms/:gym-id/webhooks
Path variables
Field | Description |
---|---|
gym-id | Provided by Wellhub, it is the unique identifier of the gym. |
Headers
Field | Description |
---|---|
accept | application/json |
Authorization | Bearer {{Wellhub Auth Token}} |
Request example
200 - OK
curl1curl -X GET "{{integration-setup-api-url}}/v1/systems/gyms/000000/webhooks" \2 -H "accept: application/json" \3 -H "Authorization: Bearer {{Wellhub Auth Token}}"
Response example
Payload1{2 "webhooks": [3 {4 "event": "checkin",5 "url": "https://www.webhook-url-example.com",6 "secret": "string",7 "additional_data": true,8 "internal_product": true9 },10 {11 "event": "booking-requested",12 "url": "https://www.webhook-url-example-updated.com",13 "secret": "string",14 "internal_product": null15 }16 ]17}
GET - Get
This endpoint retrieves the webhook based on the associated webhook event.
{{integration-setup-api-url}}/v1/systems/gyms/:gym-id/webhooks/:webhook-event
Path variables
Field | Description |
---|---|
gym-id | Provided by Wellhub, it is the unique identifier of the gym. |
webhook-event | Indicates the event of the webhook. The options are available on this page. |
Headers
Field | Description |
---|---|
accept | application/json |
Authorization | Bearer {{Wellhub Auth Token}} |
Request example
curl1curl -X GET "{{integration-setup-api-url}}/v1/systems/gyms/000000/webhooks/checkin" \2 -H "accept: application/json" \3 -H "Authorization: Bearer {{Wellhub Auth Token}}"
Response example
Payload1{2 "webhook": {3 "event": "checkin",4 "url": "https://www.webhook-url-example.com",5 "secret": "string",6 "additional_data": true,7 "internal_product": true8 }9}