Member Actions
The Memberstack Admin REST API provides powerful endpoints for member management. This guide covers all member-related operations including listing, retrieving, creating, updating, and deleting members.
Before You Start
- Make sure you have your secret key ready (refer to the Quick Start guide for authentication details)
- All examples assume you've set up proper authentication headers
- Be mindful of the rate limit (25 requests per second)
List Members
Retrieve a paginated list of all members in your application.
Endpoint
URL Parameters
Parameter | Type | Description |
---|---|---|
after | number | The endCursor after which the querying should start |
order | string | The order in which members should be queried (ASC or DESC, default: ASC) |
limit | number | The maximum number of members to return (default: 50, max: 200) |
Examples
Using curl:
Using Axios:
Response
Tips for working with pagination:
- Use the
endCursor
value from the response as theafter
parameter in your next request - Check
hasNextPage
to determine if more results are available - Set appropriate
limit
values to balance request count and payload size
Get Member
Retrieve a specific member by ID or email.
Endpoint
URL Parameters
Replace :id_or_email
with either:
- Member ID (starts with "mem_")
- Member email address (URL-encoded)
Examples
Get member by ID:
Get member by email:
Using Axios:
Response
Create Member
Create a new member in your application.
Endpoint
Request Body
Parameter | Type | Required | Description |
---|---|---|---|
string | Yes | The member's email address | |
password | string | Yes | The member's password |
plans | array | No | Array of plan objects: [{'planId': 'pln_abc'}] |
customFields | object | No | Custom fields for the member |
metaData | object | No | Metadata for the member |
json | object | No | JSON data for the member |
loginRedirect | string | No | URL to redirect to after login |
Examples
Using curl:
Using Axios:
Response
Important notes when creating members:
- The
plans
array is only for free plans (those with IDs starting withpln_
) - For paid plans, members need to go through the Stripe checkout flow using the DOM package
- Passwords should be secure and meet your organization's requirements
- Email addresses must be unique within your Memberstack application
Update Member
Update an existing member's information.
Endpoint
URL Parameters
Replace :id
with the member's ID (starts with "mem_")
Request Body
You can update any of the following fields:
Parameter | Type | Description |
---|---|---|
string | Update the member's email address | |
customFields | object | Update custom fields |
metaData | object | Update metadata |
json | object | Update JSON data |
loginRedirect | string | Update login redirect URL |
Examples
Using curl:
Using Axios:
Response
Tips when updating members:
- Updates are partial - you only need to include the fields you want to change
- For
customFields
,metaData
, andjson
objects, the entire object will be replaced - If you only need to update specific fields within these objects, first get the current values, modify them, then update
Delete Member
Permanently remove a member from your application.
Endpoint
URL Parameters
Replace :id
with the member's ID (starts with "mem_")
Request Body (Optional)
Parameter | Type | Default | Description |
---|---|---|---|
deleteStripeCustomer | boolean | false | Delete the associated Stripe customer |
cancelStripeSubscriptions | boolean | false | Cancel the associated Stripe subscriptions |
Examples
Basic deletion with curl:
Advanced deletion with curl:
Using Axios:
Response
Warning: Deleting a member is permanent and cannot be undone.
- Consider implementing a soft-delete mechanism in your application if you need to preserve member data
- Use the
deleteStripeCustomer
andcancelStripeSubscriptions
options carefully - Make sure to handle any dependent resources in your own database
Plan Management
Add and remove free plans from members.
Add a Free Plan
Add a free plan to an existing member:
URL Parameters
Replace :id
with the member's ID (starts with "mem_")
Request Body
Parameter | Type | Required | Description |
---|---|---|---|
planId | string | Yes | The ID of the free plan to add (starts with "pln_") |
Examples
Using curl:
Using Axios:
Response
A successful request returns a 200 status code with no response body.
Remove a Free Plan
Remove a free plan from an existing member:
URL Parameters
Replace :id
with the member's ID (starts with "mem_")
Request Body
Parameter | Type | Required | Description |
---|---|---|---|
planId | string | Yes | The ID of the free plan to remove (starts with "pln_") |
Examples
Using curl:
Using Axios:
Response
A successful request returns a 200 status code with no response body.
Important notes about plan management:
- These endpoints only work with free plans (plan IDs starting with
pln_
) - For paid plans, use the DOM package's checkout flow or Stripe Customer Portal
- Removing a plan immediately revokes the member's access to that plan's features
- A member can have multiple plans simultaneously
Need Help?
Having trouble getting your login working? We're here to help!