This guide shows you how to push member data to EGYM using the MMS API v2. You'll learn how to create member accounts, update member information, manage profile pictures, assign roles, and perform other essential operations for keeping member data synchronized.
To create a new member account, send a POST request with the member's details:
- Testhttps://one-mms-service.ext-1.test.co.egym.coffee/api/v2/accounts
- Prodhttps://mms.api.egym.com/api/v2/accounts
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
https://one-mms-service.ext-1.test.co.egym.coffee/api/v2/accounts \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY_HERE' \
-d '{
"email": "john.wick@mailinator.com",
"firstName": "John",
"lastName": "Wick",
"gender": "MALE",
"membership": {
"membershipId": "string",
"membershipType": "BASIC",
"endOfContract": "2019-08-24",
"startOfContract": "2022-08-24"
}
}'Response:
A successful request returns a 201 Created status with the member account details. Save the accountId from the response - you'll need it for all subsequent operations.
Use PUT to replace all member account data. This is ideal when you have the complete, updated member record:
Method: PUT /api/v2/accounts/{accountId}
- Testhttps://one-mms-service.ext-1.test.co.egym.coffee/api/v2/accounts/{accountId}
- Prodhttps://mms.api.egym.com/api/v2/accounts/{accountId}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X PUT \
'https://one-mms-service.ext-1.test.co.egym.coffee/api/v2/accounts/{accountId}' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY_HERE' \
-d '{
"email": "john.wick@mailinator.com",
"firstName": "John",
"lastName": "Wick",
"gender": "MALE",
"membership": {
"membershipId": "string",
"membershipType": "PREMIUM",
"endOfContract": "2025-12-31",
"startOfContract": "2022-08-24"
}
}'When to use PUT:
- You have the complete member record available
- You want to ensure all fields are set to specific values
- You're performing a full synchronization
Important notes:
- Replace
{accountId}with the member's actualaccountId - PUT replaces the entire member account data - include all required fields
- Missing fields may be set to null or default values
- Returns
200 OKwith the updated member account
Use PATCH to update only specific fields without affecting other data. This is more efficient for small, incremental changes:
Method: PATCH /api/v2/accounts/{accountId}
- Testhttps://one-mms-service.ext-1.test.co.egym.coffee/api/v2/accounts/{accountId}
- Prodhttps://mms.api.egym.com/api/v2/accounts/{accountId}
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X PATCH \
'https://one-mms-service.ext-1.test.co.egym.coffee/api/v2/accounts/{accountId}' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY_HERE' \
-d '{
"membership": {
"membershipType": "PREMIUM",
"endOfContract": "2025-12-31"
}
}'When to use PATCH:
- You only need to update specific fields (e.g., just the contract end date)
- You want to avoid sending the entire member record
- You're making incremental changes (membership upgrade, email change, etc.)
Important notes:
- Only include the fields you want to update
- Null or missing fields in the request are ignored (existing values preserved)
- More efficient than PUT for small changes
- Returns
200 OKwith the complete updated member account
Example use cases:
- Extend membership contract: Send only
membership.endOfContract - Upgrade membership: Send only
membership.membershipType - Update email: Send only
email - Update phone: Send only
phoneNumber
Once you've created a member account, you can add a profile picture:
- Testhttps://one-mms-service.ext-1.test.co.egym.coffee/api/v2/accounts/{accountId}/images
- Prodhttps://mms.api.egym.com/api/v2/accounts/{accountId}/images
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X PUT \
'https://one-mms-service.ext-1.test.co.egym.coffee/api/v2/accounts/{accountId}/images' \
-H 'Content-Length: 0' \
-H 'Content-Type: multipart/form-data' \
-H 'x-api-key: YOUR_API_KEY_HERE'Replace {accountId} with the member's accountId.
To remove a member's profile picture:
- Testhttps://one-mms-service.ext-1.test.co.egym.coffee/api/v2/accounts/{accountId}/images
- Prodhttps://mms.api.egym.com/api/v2/accounts/{accountId}/images
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X DELETE \
'https://one-mms-service.ext-1.test.co.egym.coffee/api/v2/accounts/{accountId}/images' \
-H 'x-api-key: YOUR_API_KEY_HERE'Grant special permissions to member accounts for trainer or administrative access:
- Testhttps://one-mms-service.ext-1.test.co.egym.coffee/api/v2/accounts/{accountId}/roles
- Prodhttps://mms.api.egym.com/api/v2/accounts/{accountId}/roles
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
'https://one-mms-service.ext-1.test.co.egym.coffee/api/v2/accounts/{accountId}/roles' \
-H 'Content-Type: application/json' \
-H 'x-api-key: YOUR_API_KEY_HERE' \
-d '{
"trainer": true,
"gymOwner": false
}'Role options:
trainer: true- Grants trainer rights (access to Trainer App and trainer features)gymOwner: true- Grants gym owner/admin rights- Set to
falseto revoke permissions
When pushing data to EGYM, you MUST implement proper conflict resolution. This is not optional - conflicts will occur due to uniqueness constraints, and your integration must handle them automatically.
EGYM enforces strict uniqueness rules per gym chain:
- Email addresses must be unique
- Membership IDs must be unique
Conflicts commonly occur when:
- Creating a member with an email/membershipId that already exists
- Updating a member's email to one already in use
409 Membership conflict - Email already exists for a different member 409 MembershipId conflict - MembershipId already exists for a different member 409 Email conflict - Attempting to update to an email that's already in use
All conflict responses include:
- HTTP 409 status code
- Specific
errorCodeidentifying the conflict type - The conflicting
accountIdin the response metadata
- Detect 409 responses - Monitor for HTTP 409 status codes
- Parse the error - Extract
errorCodeandaccountIdfrom the response - Resolve automatically - Implement logic to handle each conflict type
- Retry - Automatically retry after resolution
Example conflict response:
{
"status": 409,
"errorCode": "membershipExists",
"message": "Membership conflicts with another account.",
"metadata": {
"accountId": "f756ae43-c932-5a02-b42b-b4752f73er12"
}
}See the Conflict Resolution guide for detailed resolution steps for each conflict type, including code examples and best practices.
Store the accountId - Always save the
accountIdreturned when creating a member. You'll need it for all future operations.Choose the right update method:
- Use PATCH for incremental changes (recommended for most updates)
- Use PUT only when you have the complete member record and need full replacement
- PATCH is more efficient and safer for partial updates
Validate before pushing - Check for duplicate emails and membershipIds in your MMS before sending to EGYM to prevent conflicts.
Implement conflict handlers - Build automated conflict resolution into your sync process (see Conflict Resolution guide).
Keep data synchronized - Push updates to EGYM whenever member information changes in your system.
Log all operations - Track all PUSH operations and conflicts for monitoring and debugging.
Now that you understand how to push member data to EGYM, you can explore additional operations:
- Book products - Associate EGYM products and services with member accounts
- Assign RFIDs - Link RFID cards for gym access control
- Sync check-ins - Record member check-in and check-out events For complete details on all available endpoints and operations, see the API Reference.
- Authentication - Learn how to authenticate your API requests
- Error Codes - Understand API error responses
- Rate Limits - API usage limits and best practices