Upsert (Create or Update) User - Endurancezone-com/API-docs GitHub Wiki
Upsert (Create or Update) User
A user can be created or updated (upsert operation) by POSTing the following JSON body to the endpoint:
HTTP Response Values
- 200 - Successful creation or update of a user
- 400 - The payload sent is not correct or valid (missing required field, invalid Level or Country)
An existing user is matched on PartnerMemberId (if supplied) and otherwise on EmailAddress.
[POST] /v2/users/upsert
{
"EmailAddress": "[email protected]",
"PartnerMemberId" : "your-identifier",
"FirstName" : "FirstName",
"LastName" : "LastName",
"Country" :"UK",
"Level" :"Basic",
"OrgUnitLevels" : [
"London Gymn",
"Bristol Gymn"
]
}
| Name | Description |
|---|---|
| FirstName | User first name - Required |
| LastName | User last name - Required |
| EmailAddress | User's email address - Required |
| PartnerMemberId | (Optional) Your unique identifier for this user |
| Country | Required - acceptable values are: USA, UK, Canada, Europe, Mexico, Australia, New Zealand, Africa, India, Dubai, Austria, Belgium, Bulgaria, Switzerland, Germany, Denmark, Spain, France, Ireland, Italy, Luxembourg, Monaco, Netherlands, Norway, Sweden, Singapore, South Africa, UAE - *additional countries can be enabled as part of the onboarding |
| Level | Required - acceptable values are: Basic, Basic Plus, Premium, Premium Plus |
| OrgUnitLevels | (Optional) list of strings, that break the members down into sub groups of your company (org unit names or Ids, see Org units), only needed if you are sub categorizing your members |
A successful response looks like:
HTTP/1.1 200 OK
{
"RenewalDate": "2027-05-26",
"API": "Members",
"JoinDate": "2026-05-27",
"LoginUrl": "https://rewards.client.com/preload/client?iframe=ffe2SLrm4qrvyulsci",
"HubLoginUrl": "https://landing.myezrewards.com/client/default/?iframe=ffe2SLrm4qrvyulsci",
"Level": "Basic",
"LastName": "LastName",
"Status": "Active",
"FirstName": "FirstName",
"EmailAddress": "[email protected]",
"Identifier": 15140131,
"ExternalMemberId": "your-identifier",
"OrgUnits": [
{ "Children": null, "Id": 101, "Name": "London Gymn" },
{ "Children": null, "Id": 102, "Name": "Bristol Gymn" }
],
"Action": "Update"
}
The "Action" field in the response indicates whether a new user was created ("New") or an existing user was updated ("Update").
When an existing user is updated, the first name, last name, email address, level, country, PartnerMemberId and org units are overwritten with the submitted values (existing org units are removed if OrgUnitLevels is empty or omitted) and the user's status is set to Active. The renewal date is not changed.