Members
Members are users within your application with specific roles and attributes. On this page, we'll dive into the different member endpoints you can use to manage members programmatically. We'll look at how to query, create, update, and delete members.
The member model
The member model extends from the profile model and includes detailed information about the member, including their status, activity logs, medical records, and membership details.
Properties
- Name
id- Type
- string
- Description
Unique identifier for the member.
- Name
firstName- Type
- string
- Description
The first name of the member.
- Name
lastName- Type
- string
- Description
The last name of the member.
- Name
email- Type
- string
- Description
The email address of the member.
- Name
role- Type
- enum
- Description
The role of the member, can be one of:
- root
- admin
- member
- employee
- Name
avatar- Type
- string
- Description
The avatar URL for the member.
- Name
createdAt- Type
- string
- Description
Timestamp of when the member was created.
- Name
updatedAt- Type
- string
- Description
Timestamp of when the member was last updated.
- Name
bornDate- Type
- string
- Description
The birthdate of the member.
- Name
document- Type
- string
- Description
The document identifier for the member.
- Name
address- Type
- string
- Description
The address of the member.
- Name
phoneNumber- Type
- string
- Description
The phone number of the member.
- Name
phoneCountry- Type
- string
- Description
The country code for the member's phone number.
- Name
onboardingStep- Type
- enum
- Description
The current onboarding step for the member, can be one of:
- PhoneVerification
- HasReprocann
- PersonalInformation
- Schedule
- Payment
- ReprocannSyncCode
- MedicalConsultation
- DocumentSigning
- ReprocannPending
- Contract
- MembershipSelection
- Done
- Name
medicalRecord- Type
- object
- Description
The medical record details for the member.
- Name
reprocannCode- Type
- string
- Description
The Reprocann code for the member.
- Name
reprocannExpiration- Type
- string
- Description
The expiration date of the Reprocann code.
- Name
emergencyContact- Type
- object
- Description
The emergency contact details.
- Name
name- Type
- string
- Description
The name of the emergency contact.
- Name
phoneNumber- Type
- string
- Description
The phone number of the emergency contact.
- Name
relationship- Type
- string
- Description
The relationship to the member.
- Name
allergies- Type
- array
- Description
List of allergies.
- Name
diseases- Type
- array
- Description
List of diseases.
- Name
medications- Type
- array
- Description
List of medications.
- Name
treatments- Type
- array
- Description
List of treatments.
- Name
diagnostic- Type
- array
- Description
List of diagnostics.
- Name
cannabisUses- Type
- array
- Description
List of cannabis uses.
- Name
membership- Type
- object
- Description
The membership details for the member.
- Name
id- Type
- string
- Description
Unique identifier for the membership.
- Name
name- Type
- string
- Description
The name of the membership.
- Name
dueDate- Type
- string
- Description
The due date for the membership payment.
- Name
expirationDate- Type
- string
- Description
The expiration date of the membership.
- Name
status- Type
- enum
- Description
The status of the membership, can be one of:
- PAID
- PENDING
- EXPIRED
- INACTIVE
- Name
paymentMethod- Type
- string
- Description
The payment method used for the membership.
- Name
price- Type
- number
- Description
The price of the membership.
- Name
status- Type
- enum
- Description
The status of the member.
- ACTIVE
- IN_REVIEW
- INACTIVE
- IN_PROGRESS
- INVITED
- DEBTOR
Example member
{
"id": "l7cGNIBKZiNJ6wqF",
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"role": "member",
"avatar": "https://assets.yourapp.com/avatars/johndoe.jpg",
"createdAt": "2023-05-13T12:00:00Z",
"updatedAt": "2023-06-13T12:00:00Z",
"bornDate": "1990-01-01",
"document": "123456789",
"address": "123 Main St",
"phoneNumber": "234567890",
"phoneCountry": "1",
"onboardingStep": "completed",
"medicalRecord": {
"reprocannCode": "ABC123",
"reprocannExpiration": "2024-05-13",
"emergencyContact": {
"name": "Jane Doe",
"phoneNumber": "+1234567891",
"relationship": "Spouse"
},
"allergies": ["Peanuts"],
"diseases": ["Hypertension"],
"medications": ["Amlodipine"],
"treatments": ["Blood pressure monitoring"],
"diagnostic": ["High blood pressure"],
"cannabisUses": ["Chronic pain"]
},
"membership": {
"id": "m1n2o3p4",
"name": "Premium",
"dueDate": "2023-12-31",
"expirationDate": "2024-05-13",
"status": "PAID",
"paymentMethod": "Credit Card",
"price": 99.99
},
"status": "ACTIVE",
}
List all members
This endpoint allows you to retrieve a paginated list of all your members. By default, a maximum of ten members are shown per page.
Optional attributes
- Name
limit- Type
- integer
- Description
Limit the number of members returned.
- Name
offset- Type
- integer
- Description
Start offset of members returned.
- Name
search- Type
- text
- Description
Search by name or email.
Request
curl -G https://api.yourapp.com/admin/members \
-H "Authorization: Bearer {token}" \
-d limit=10
Response
[
{
"id": "l7cGNIBKZiNJ6wqF",
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"role": "member",
"avatar": "https://assets.yourapp.com/avatars/johndoe.jpg",
"createdAt": "2023-05-13T12:00:00Z",
"updatedAt": "2023-06-13T12:00:00Z",
"bornDate": "1990-01-01",
"document": "123456789",
"address": "123 Main St",
"phoneNumber": "234567890",
"phoneCountry": "1",
"onboardingStep": "completed",
"medicalRecord": {
"reprocannCode": "ABC123",
"reprocannExpiration": "2024-05-13",
"emergencyContact": {
"name": "Jane Doe",
"phoneNumber": "+1234567891",
"relationship": "Spouse"
},
"allergies": ["Peanuts"],
"diseases": ["Hypertension"],
"medications": ["Amlodipine"],
"treatments": ["Blood pressure monitoring"],
"diagnostic": ["High blood pressure"],
"cannabisUses": ["Chronic pain"]
},
"membership": {
"id": "m1n2o3p4",
"name": "Premium",
"dueDate": "2023-12-31",
"expirationDate": "2024-05-13",
"status": "PAID",
"paymentMethod": "Credit Card",
"price": 99.99
},
"status": "ACTIVE",
}
]
Create a member
This endpoint allows you to create a new member in your application.
Medusa Reference
Required attributes
- Name
firstName- Type
- string
- Description
The first name of the member.
- Name
lastName- Type
- string
- Description
The last name of the member.
- Name
email- Type
- string
- Description
The email address of the member.
- Name
role- Type
- enum
- Description
The role of the member
Optional attributes
- Name
avatar- Type
- string
- Description
The avatar URL for the member.
- Name
bornDate- Type
- string
- Description
The birthdate of the member.
- Name
document- Type
- string
- Description
The document identifier for the member.
- Name
address- Type
- string
- Description
The address of the member.
- Name
phoneNumber- Type
- string
- Description
The phone number of the member.
- Name
phoneCountry- Type
- string
- Description
The country code for the member's phone number.
- Name
medicalRecord- Type
- object
- Description
The medical record details for the member.
- Name
reprocannCode- Type
- string
- Description
The Reprocann code for the member.
- Name
reprocannExpiration- Type
- string
- Description
The expiration date of the Reprocann code.
- Name
emergencyContact- Type
- object
- Description
The emergency contact details.
- Name
name- Type
- string
- Description
The name of the emergency contact.
- Name
phoneNumber- Type
- string
- Description
The phone number of the emergency contact.
- Name
relationship- Type
- string
- Description
The relationship to the member.
- Name
allergies- Type
- array
- Description
List of allergies.
- Name
diseases- Type
- array
- Description
List of diseases.
- Name
medications- Type
- array
- Description
List of medications.
- Name
treatments- Type
- array
- Description
List of treatments.
- Name
diagnostic- Type
- array
- Description
List of diagnostics.
- Name
cannabisUses- Type
- array
- Description
List of cannabis uses.
- Name
membership- Type
- object
- Description
The membership details for the member.
- Name
id- Type
- string
- Description
Unique identifier for the membership.
- Name
name- Type
- string
- Description
The name of the membership.
- Name
dueDate- Type
- string
- Description
The due date for the membership payment.
- Name
expirationDate- Type
- string
- Description
The expiration date of the membership.
- Name
status- Type
- enum
- Description
The status of the membership, can be one of:
- Name
paymentMethod- Type
- string
- Description
The payment method used for the membership.
- Name
price- Type
- number
- Description
The price of the membership.
- Name
status- Type
- enum
- Description
The status of the member.
Request
curl -X POST https://api.yourapp.com/admin/members \
-H "Authorization: Bearer {token}" \
-d '{
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
}'
Response
{
"id": "l7cGNIBKZiNJ6wqF",
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"role": "member",
"avatar": null,
"createdAt": "2023-05-13T12:00:00Z",
"updatedAt": "2023-06-13T12:00:00Z",
"bornDate": null,
"document": null,
"address": null,
"phoneNumber": null,
"phoneCountry": null,
"onboardingStep": null,
"medicalRecord": null,
"membership": null,
"status": "ACTIVE"
}
Update a member
This endpoint allows you to update an existing member in your application.
Medusa Reference
Optional attributes
- Name
firstName- Type
- string
- Description
The first name of the member.
- Name
lastName- Type
- string
- Description
The last name of the member.
- Name
email- Type
- string
- Description
The email address of the member.
- Name
avatar- Type
- string
- Description
The avatar URL for the member.
- Name
bornDate- Type
- string
- Description
The birthdate of the member.
- Name
document- Type
- string
- Description
The document identifier for the member.
- Name
address- Type
- string
- Description
The address of the member.
- Name
phoneNumber- Type
- string
- Description
The phone number of the member.
- Name
phoneCountry- Type
- string
- Description
The country code for the member's phone number.
- Name
medicalRecord- Type
- object
- Description
The medical record details for the member.
- Name
reprocannCode- Type
- string
- Description
The Reprocann code for the member.
- Name
reprocannExpiration- Type
- string
- Description
The expiration date of the Reprocann code.
- Name
emergencyContact- Type
- object
- Description
The emergency contact details.
- Name
name- Type
- string
- Description
The name of the emergency contact.
- Name
phoneNumber- Type
- string
- Description
The phone number of the emergency contact.
- Name
relationship- Type
- string
- Description
The relationship to the member.
- Name
allergies- Type
- array
- Description
List of allergies.
- Name
diseases- Type
- array
- Description
List of diseases.
- Name
medications- Type
- array
- Description
List of medications.
- Name
treatments- Type
- array
- Description
List of treatments.
- Name
diagnostic- Type
- array
- Description
List of diagnostics.
- Name
cannabisUses- Type
- array
- Description
List of cannabis uses.
- Name
membership- Type
- object
- Description
The membership details for the member.
- Name
id- Type
- string
- Description
Unique identifier for the membership.
- Name
name- Type
- string
- Description
The name of the membership.
- Name
dueDate- Type
- string
- Description
The due date for the membership payment.
- Name
expirationDate- Type
- string
- Description
The expiration date of the membership.
- Name
status- Type
- enum
- Description
The status of the membership
- Name
paymentMethod- Type
- string
- Description
The payment method used for the membership.
- Name
price- Type
- number
- Description
The price of the membership.
- Name
status- Type
- enum
- Description
The status of the member.
Request
curl -X PUT https://api.yourapp.com/admin/members/:id \
-H "Authorization: Bearer {token}" \
-d '{
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
}'
Response
{
"id": "l7cGNIBKZiNJ6wqF",
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"role": "member",
"avatar": "https://assets.yourapp.com/avatars/johndoe.jpg",
"createdAt": "2023-05-13T12:00:00Z",
"updatedAt": "2023-06-13T12:00:00Z",
"bornDate": "1990-01-01",
"document": "123456789",
"address": "123 Main St",
"phoneNumber": "+1234567890",
"phoneCountry": "1",
"onboardingStep": "completed",
"medicalRecord": {
"reprocannCode": "ABC123",
"reprocannExpiration": "2024-05-13",
"emergencyContact": {
"name": "Jane Doe",
"phoneNumber": "+1234567891",
"relationship": "Spouse"
},
"allergies": ["Peanuts"],
"diseases": ["Hypertension"],
"medications": ["Amlodipine"],
"treatments": ["Blood pressure monitoring"],
"diagnostic": ["High blood pressure"],
"cannabisUses": ["Chronic pain"]
},
"membership": {
"id": "m1n2o3p4",
"name": "Premium",
"dueDate": "2023-12-31",
"expirationDate": "2024-05-13",
"status": "PAID",
"paymentMethod": "Credit Card",
"price": 99.99
},
"status": "ACTIVE"
}
Update member status
This endpoint allows you to update the status of an existing member.
Required attributes
- Name
status- Type
- enum
- Description
The status of the member, can be one of:
- ACTIVE
- IN_REVIEW
- INACTIVE
- IN_PROGRESS
- INVITED
- DEBTOR
Request
curl -X PUT https://api.yourapp.com/admin/members/:id \
-H "Authorization: Bearer {token}" \
-d '{
"status": "ACTIVE"
}'
Response
{
"id": "l7cGNIBKZiNJ6wqF",
"status": "ACTIVE"
}