Skip to main content

family

/v2/private/healthAndCare/family

Available Methods​

  • POST

POST /v2/private/healthAndCare/family​

Adds a family member to the user's healthAndCare.family array, and adds the user to the invited user's othersHealthAndCare.

The endpoint will first use the phone number to query the DB and see if the invited user is already existing, otherwise it will create a new shell user.

The endpoint will then add the current user to the invited user's othersHealthAndCare if they don't already exist on the array.

Afterwards the invited user will be added to the user's healthAndCare.family array, but if the invited user already exists in the array an error will be thrown.

Params​

ParamTypeDescriptionRequired?
nameStringThe name of the family member to be added✅
phoneNumberThe phone number of the family member to be added✅
emailStringThe email address of the family member to be added
Example request body
body: {
name: "Family Person",
phone: 8185550101,
email: "family@person.com"
}

Returns​

The entire user object, with healthAndCare.family updated.

Note

The inviteUrl is created during the response and is not saved in the DB.

Example return object of just user.healthAndCare
user: {
...,
healthAndCare: {
...,
family: [
{
_id: "62506066c3508643c5b4b418",
name: {
"first": "Family",
"last": "Person",
"middle": ""
},
image: "https://everdays-next.vercel.app/next-images/logos/everdays-square-logo-full.svg",
phone: 8185550101,
shellEmail: "family@person.com",
inviteUrl: "http://localhost:1350/shortlink/UZreGbBJdc?v=5m"
}
]
}
}
info

For more detailed information about each value in healthAndCare, please refer to the user model docs.