# MMS API V2 RESTful API specification for integrating gym management systems with the EGYM platform. This OpenAPI document defines all available endpoints, request/response schemas, authentication requirements, and error codes. **Key Features:** - Member account and membership management - RFID assignment and management - Real-time gym visit tracking (check-in/check-out) - EGYM product booking (Smart Strength, EGYM+) - Trainer task creation and tracking - Webhook subscriptions for event notifications - Push notifications to EGYM mobile apps - Member migration from V1 API Version: 2.0.0 ## Servers Test ``` https://one-mms-service.ext-1.test.co.egym.coffee ``` Prod ``` https://mms.api.egym.com ``` ## Security ### mms Authentication is validated via an API key that is generated by EGYM for each gym location. This API key will not be identical with the access token used in the EGYM Gym API v1 Type: apiKey In: header Name: x-api-key ## Download OpenAPI description [MMS API V2](https://developer.egym.com/_bundle/mms-api-v2/apis/mms-v2.yaml) ## Member Account These operations are needed to create and update member accounts and their membership information. ### Retrieve an account - [GET /api/v2/accounts/{accountId}](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-account/retrieveaccount.md): Retrieve an account using accountId. ### Update an account - [PUT /api/v2/accounts/{accountId}](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-account/updateaccount.md): Update an account using accountId. ### Delete an account - [DELETE /api/v2/accounts/{accountId}](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-account/eraseaccountmembershipdata.md): Delete an account using accountId. eraseMemberData parameter is optional and defaults to false. If set to true it removes all member data that belongs to a gym (personal data, contract data, rfid, product bookings). If set to false it deletes only membershipId and contract data. ### Partially update an account - [PATCH /api/v2/accounts/{accountId}](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-account/partialupdate.md): Partially update an account using accountId. Only non-null fields in the request will be updated. This is optimized for small, incremental changes. ### Upload account image - [PUT /api/v2/accounts/{accountId}/images](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-account/uploadimage.md): This endpoint allows to upload a profile picture to the specified user using accountId (Supported formats: JPG, JPEG, PNG. Max file size: 16MB) ### Delete account image - [DELETE /api/v2/accounts/{accountId}/images](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-account/deleteimage.md): This endpoint allows to delete a profile picture of the specified user using accountId ### List member accounts - [GET /api/v2/accounts](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-account/listaccounts.md): Request all member accounts with paginated response. Result is always ordered by update timestamp (DESC). By default only accounts of the current gym are returned, otherwise set currentGymOnly to false. ### Create an account - [POST /api/v2/accounts](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-account/publishaccount.md): Create an account in the EGYM System. ### Retrieve an account roles - [GET /api/v2/accounts/{accountId}/roles](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-account/getroles.md): Retrieve an account roles in the current gym for given accountId ### Set an account roles - [POST /api/v2/accounts/{accountId}/roles](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-account/assignroles.md): Update an account roles using accountId. ### Retrieve an account by RFID - [GET /api/v2/accounts/rfid/{rfid}](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-account/getbyrfid.md): Retrieve an account using RFID. ### Retrieve an account by NFC - [GET /api/v2/accounts/nfc/{nfc}](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-account/getbynfc.md): Retrieve an account using NFC. ### Retrieve an account by membership ID - [GET /api/v2/accounts/membership/{membershipId}](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-account/retrieveaccountbymembershipid.md): Retrieve an account using membershipId. ### Retrieve an account by email - [GET /api/v2/accounts/email/{email}](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-account/getbyemail.md): Retrieve an account using email. ### Retrieve an account roles - [GET /api/v2/accounts/{accountId}/roles](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-account-roles/getroles.md): Retrieve an account roles in the current gym for given accountId ### Set an account roles - [POST /api/v2/accounts/{accountId}/roles](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-account-roles/assignroles.md): Update an account roles using accountId. ### Retrieve an account by RFID - [GET /api/v2/accounts/rfid/{rfid}](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-rfids/getbyrfid.md): Retrieve an account using RFID. ### Retrieve an account by NFC - [GET /api/v2/accounts/nfc/{nfc}](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-account-nfc/getbynfc.md): Retrieve an account using NFC. ## Member Account Roles These operation are needed to assign and retrieve member account roles ### Retrieve an account roles - [GET /api/v2/accounts/{accountId}/roles](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-account/getroles.md): Retrieve an account roles in the current gym for given accountId ### Set an account roles - [POST /api/v2/accounts/{accountId}/roles](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-account/assignroles.md): Update an account roles using accountId. ### Retrieve an account roles - [GET /api/v2/accounts/{accountId}/roles](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-account-roles/getroles.md): Retrieve an account roles in the current gym for given accountId ### Set an account roles - [POST /api/v2/accounts/{accountId}/roles](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-account-roles/assignroles.md): Update an account roles using accountId. ## Member RFIDs Operations with RFIDs ### Retrieve an account by RFID - [GET /api/v2/accounts/rfid/{rfid}](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-account/getbyrfid.md): Retrieve an account using RFID. ### Retrieve user RFIDs - [GET /api/v2/accounts/{accountId}/rfids](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-rfids/getuserrfids.md): Returns a list of RFIDs of the user. ### Update RFIDs of a user - [PUT /api/v2/accounts/{accountId}/rfids](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-rfids/updateusersrfids.md): Note: If this field is sent we will replace the RFID list of this user with the info sent (for an empty list, we will delete all RFID connections of this user). The operation does not affect RFIDs assigned from other sources like EGYM machines, Fitness Hub etc. ### Add RFID - [POST /api/v2/accounts/{accountId}/rfids](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-rfids/addrfidtouser.md): Add RFID to specified user. ### Retrieve an account by RFID - [GET /api/v2/accounts/rfid/{rfid}](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-rfids/getbyrfid.md): Retrieve an account using RFID. ### Remove RFID - [DELETE /api/v2/accounts/{accountId}/rfids/{rfid}](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-rfids/deleterfid.md): Delete specified RFID from user ## Member Account NFC Note that NFC API endpoints are in beta as we've been tuning setup processes on both EGYM and partner sides. ### Retrieve an account by NFC - [GET /api/v2/accounts/nfc/{nfc}](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-account/getbynfc.md): Retrieve an account using NFC. ### Retrieve a member account NFC token - [GET /api/v2/accounts/{accountId}/nfc](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-account-nfc/getaccountnfctoken.md) ### Assign an NFC token to a member account - [PUT /api/v2/accounts/{accountId}/nfc](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-account-nfc/assignaccountnfctoken.md) ### Delete a member account NFC token - [DELETE /api/v2/accounts/{accountId}/nfc](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-account-nfc/deleteaccountnfctoken.md) ### Retrieve an account by NFC - [GET /api/v2/accounts/nfc/{nfc}](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-account-nfc/getbynfc.md): Retrieve an account using NFC. ## Products booking Operations on EGYM products. Currently available products are EGYM Smart Strength (Machine Admission) and EGYM+ ### Retrieve user activated products - [GET /api/v2/accounts/{accountId}/products](https://developer.egym.com/mms-api-v2/apis/mms-v2/products-booking/userproducts.md): Returns a list of products that are activated for the specified user and gym and are active now or in the future. ### Activate a product or update product booking - [PUT /api/v2/accounts/{accountId}/products](https://developer.egym.com/mms-api-v2/apis/mms-v2/products-booking/productbooking.md): This endpoint activates or updates a product for a user in a gym. The product is active starting from the specified start date to the end date in Timezone of the club. ### Retrieve gym products - [GET /api/v2/products](https://developer.egym.com/mms-api-v2/apis/mms-v2/products-booking/listgymproducts.md): Returns a list of products that are available in the gym and can be activated for a user. ### Product details - [GET /api/v2/products/{productId}](https://developer.egym.com/mms-api-v2/apis/mms-v2/products-booking/productdetails.md): Returns the details of a specific product. ### Deactivate a product - [DELETE /api/v2/accounts/{accountId}/products/{productId}](https://developer.egym.com/mms-api-v2/apis/mms-v2/products-booking/deactivateuserproduct.md): This endpoint deactivates a product for a user in a gym. ## Migrating members These operations are needed to migrate members from V1 API to V2 API. ### Migrate an account - [POST /api/v2/migrate](https://developer.egym.com/mms-api-v2/apis/mms-v2/migrating-members/migrate.md): Migrate membership from V1 API using old EGYM user id (if already migrated then just returns membership). ## Gym Visit These operations are needed to transmit the information to EGYM, that a specific member is currently in the gym. Based on that information several business logics are built, to provide a seamless training floor experience to the members of that gym. For example the trainer on the Training Floor is informed that this member is here and that he should complete some tasks. ### Member Gym Check Out - [POST /api/v2/accounts/{accountId}/checkouts](https://developer.egym.com/mms-api-v2/apis/mms-v2/gym-visit/checkout.md): This endpoint informs the EGYM system that the member has left the gym. ### Member Gym Check In - [POST /api/v2/accounts/{accountId}/checkins](https://developer.egym.com/mms-api-v2/apis/mms-v2/gym-visit/checkin.md): This endpoint informs the EGYM system that the member has entered the gym. ### Member Admission - [POST /api/v2/accounts/{accountId}/admissions](https://developer.egym.com/mms-api-v2/apis/mms-v2/gym-visit/checkadmission.md): This endpoint is currently used only for members with membership type “CORPORATE_FITNESS”. It verifies if the specified member can have access to the desired gym. The MMS should use the response status to allow or block the member from entering the gym. As a side-effect this access is logged in the EGYM Corporate Fitness system if the admission was granted. ### List Corporate Fitness member accounts - [GET /api/v2/accounts/corporate-fitness](https://developer.egym.com/mms-api-v2/apis/mms-v2/gym-visit/getcorporatefitnessmemberaccounts.md): Request Corporate Fitness member accounts for the current gym whose corporate membership cancellation date falls into specified date range. The type of membership is always CORPORATE_FITNESS, both endDateFrom and endDateTo parameters are mandatory and apply to corporateFitness.endTimestamp. ## Trainer Task These operations are needed to create and update trainer tasks. ### Retrieve task details - [GET /api/v2/tasks/{taskId}](https://developer.egym.com/mms-api-v2/apis/mms-v2/trainer-task/gettask.md): This endpoint returns the details of a specific trainer task. ### Update a task - [PUT /api/v2/tasks/{taskId}](https://developer.egym.com/mms-api-v2/apis/mms-v2/trainer-task/updatetask.md): This endpoint updates trainer task in a gym. ### Retrieve all tasks - [GET /api/v2/tasks](https://developer.egym.com/mms-api-v2/apis/mms-v2/trainer-task/gettasks.md): This endpoint returns a list of trainer tasks that are available in the gym. Can be filtered by modified date time. ### Create a task - [POST /api/v2/tasks](https://developer.egym.com/mms-api-v2/apis/mms-v2/trainer-task/createtask.md): This endpoint create trainer task in a gym. The trainer task is active until it is completed. ## Webhooks Operations with webhooks ### Retrieve webhook entry by id - [GET /api/v2/webhooks/{id}](https://developer.egym.com/mms-api-v2/apis/mms-v2/webhooks/getwebhookbyid.md) ### Update webhook entry - [PUT /api/v2/webhooks/{id}](https://developer.egym.com/mms-api-v2/apis/mms-v2/webhooks/updatewebhook.md): Updates webhook url or/and secret by given webhook id ### Delete webhook - [DELETE /api/v2/webhooks/{id}](https://developer.egym.com/mms-api-v2/apis/mms-v2/webhooks/deletewebhook.md): Deletes webhook url ### Retrieve existing webhooks - [GET /api/v2/webhooks](https://developer.egym.com/mms-api-v2/apis/mms-v2/webhooks/getallwebhooks.md): Returns a list of webhooks of the related gym. ### Create webhook url - [POST /api/v2/webhooks](https://developer.egym.com/mms-api-v2/apis/mms-v2/webhooks/createwebhook.md): Creates webhook url entry ### Trigger webhook - [POST /api/v2/webhooks/{id}/trigger](https://developer.egym.com/mms-api-v2/apis/mms-v2/webhooks/triggerwebhook.md): Trigger webhook with type TEST ## Push notifications Send push notifications to EGYM mobile apps ### Sent notification using accountId - [POST /api/v2/accounts/{accountId}/notifications](https://developer.egym.com/mms-api-v2/apis/mms-v2/push-notifications/sendpushnotificationbyaccountid.md): Simple fire and forget operation to sent notification ### Sent notification using membershipId - [POST /api/v2/accounts/membership/{membershipId}/notifications](https://developer.egym.com/mms-api-v2/apis/mms-v2/push-notifications/sendpushnotificationbymembershipid.md): Simple fire and forget operation to sent notification