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

FieldDescription
acceptapplication/json
AuthorizationBearer {{Wellhub Auth Token}}

Request example

curl
1curl -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

FieldDescription
idIt is the identifier of the gym at Wellhub.
enabledIndicates whether the gym is active (can be accessed by our user) or not.
Payload
1{
2 "partners": [
3 {
4 "id": 000000,
5 "enabled": true
6 },
7 {
8 "id": 000001,
9 "enabled": false
10 }
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

FieldDescription
gym-idProvided by Wellhub, it is the unique identifier of the gym.

Headers

FieldDescription
Content-Typeapplication/json
AuthorizationBearer {{Wellhub Auth Token}}

Request body parameters

FieldDescriptionTypeRequired
eventIndicates the webhook event. The options are available on this page.StringTrue
URLURL that Wellhub will use to notify you.StringTrue
secretSecret that we will use to send a signature header that you can validate when you receive the webhook.StringTrue
additional_dataIndicates if the user's additional data is required to be sent.BooleanFalse
internal_productIndicates whether the sent event will contain product information.BooleanFalse

Request example

curl
1curl -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": true
11 "internal_product": true
12 },
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

FieldDescription
gym-idProvided by Wellhub, it is the unique identifier of the gym.
webhook-eventIndicates the event of the webhook. The options are available on this page.

Headers

FieldDescription
Content-Typeapplication/json
AuthorizationBearer {{Wellhub Auth Token}}

Request body parameters

FieldDescriptionTypeRequired
eventIndicates the webhook event. The options are available on this page.StringTrue
URLURL that Wellhub will use to notify you.StringTrue
secretSecret that we will use to send a signature header that you can validate when you receive the webhook.StringTrue
additional_dataIndicates if the user's additional data is required to be sent.BooleanFalse
internal_productIndicates whether the sent event will contain product information.BooleanFalse

Request example

curl
1curl -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

FieldDescription
gym-idProvided by Wellhub, it is the unique identifier of the gym.

Headers

FieldDescription
acceptapplication/json
AuthorizationBearer {{Wellhub Auth Token}}

Request example

200 - OK

curl
1curl -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

Payload
1{
2 "webhooks": [
3 {
4 "event": "checkin",
5 "url": "https://www.webhook-url-example.com",
6 "secret": "string",
7 "additional_data": true,
8 "internal_product": true
9 },
10 {
11 "event": "booking-requested",
12 "url": "https://www.webhook-url-example-updated.com",
13 "secret": "string",
14 "internal_product": null
15 }
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

FieldDescription
gym-idProvided by Wellhub, it is the unique identifier of the gym.
webhook-eventIndicates the event of the webhook. The options are available on this page.

Headers

FieldDescription
acceptapplication/json
AuthorizationBearer {{Wellhub Auth Token}}

Request example

curl
1curl -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

Payload
1{
2 "webhook": {
3 "event": "checkin",
4 "url": "https://www.webhook-url-example.com",
5 "secret": "string",
6 "additional_data": true,
7 "internal_product": true
8 }
9}