# 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://mms.api.ed.ts.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

 - [GET /api/v2/accounts/{accountId}](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-account/retrieveaccount.md): Retrieve an account using accountId.
 - [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 /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, pro
 - [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.
 - [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 /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
 - [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 fa
 - [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.
 - [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
 - [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.
 - [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.
 - [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.
 - [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.
 - [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.
## Member 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
 - [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

 - [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.
 - [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 ass
 - [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.
 - [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.
 - [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
## Products booking

 - [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.
 - [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.
 - [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.
 - [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.
 - [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.
## Member Account NFC

 - [GET /api/v2/accounts/{accountId}/nfc](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-account-nfc/getaccountnfctoken.md)
 - [PUT /api/v2/accounts/{accountId}/nfc](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-account-nfc/assignaccountnfctoken.md)
 - [DELETE /api/v2/accounts/{accountId}/nfc](https://developer.egym.com/mms-api-v2/apis/mms-v2/member-account-nfc/deleteaccountnfctoken.md)
 - [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.
## Migrating members

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

 - [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.
 - [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.
 - [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 statu
 - [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 `
## Trainer Task

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

 - [GET /api/v2/webhooks/{id}](https://developer.egym.com/mms-api-v2/apis/mms-v2/webhooks/getwebhookbyid.md)
 - [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 /api/v2/webhooks/{id}](https://developer.egym.com/mms-api-v2/apis/mms-v2/webhooks/deletewebhook.md): Deletes webhook url
 - [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.
 - [POST /api/v2/webhooks](https://developer.egym.com/mms-api-v2/apis/mms-v2/webhooks/createwebhook.md): Creates webhook url entry
 - [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

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