Members
Manage your website's members.
The typical response contains the member object, or an array of member objects. The member object contains the following fields:
Key
Value
id
Unique identifier of user.
membership
Membership Object (below)
email
Email address of user
createdAt
Date when user signed up.
stripeInfo (Optional)
Gets returned if the user has a stripe account.
metaData (Optional)
Gets returned if user contains meta data.

Membership Object

Key
Value
oneTime
Boolean
testMode
Boolean
status
trialing| active| expired | past_due| canceled unpaid | incomplete| incomplete_expired
plan
String. Unique identifier of plan.
type
free | paid
cancel_at_period_end
Boolean
current_period_end
String. Unix Timestamp
amount
Integer. Cost of plan in cents.
Key
Value
customer
Unique identifier of Stripe's customer id.
card
payment_method: Unique identifier of Stripe's payment method.
source*: Unique identifier of Stripe's source method. brand: Card brand. American Express | Discover | MasterCard | Visa exp_month: Card's expiration month. exp_year: Card's expiration year. last4: Card's last four digits.
source has been deprecated in favor of payment_methodand is only available on older members.
get
https://api.memberstack.com
/v1/members
List Members
JavaScript
cURL
1
fetch('https://api.memberstack.com/v1/members', {
2
headers: {
3
'X-API-KEY': 'yourapikey'
4
}
5
}
Copied!
1
curl -i -H "X-API-KEY: yourapikey" -H "Content-Type: application/json" https://api.memberstack.com/v1/members
Copied!
get
https://api.memberstack.com
/v1/members/123
Get Member
JavaScript
cURL
1
fetch('https://api.memberstack.com/v1/members/123', {
2
headers: {
3
'X-API-KEY': 'yourapikey'
4
}
5
}
Copied!
1
curl -i -H "X-API-KEY: yourapikey" -H "Content-Type: application/json" https://api.memberstack.com/v1/members/123
Copied!
post
https://api.memberstack.com
/v1/members
Create Member
We currently only allow the creation of new members for free plans.
metaData can contain up to 50 values. Object keys cannot be longer than 50 characters, object values cannot be longer than 500 characters.
JavaScript
cURL
1
fetch('https://api.memberstack.com/v1/members', {
2
method: 'POST',
3
headers: {
4
'X-API-KEY': 'yourapikey'
5
},
6
body: JSON.stringify({
7
email: "...",
8
password: "...",
9
plan: "...",
10
customFields: {
11
userName: "...",
12
avatar: "..."
13
}
14
})
15
}
Copied!
1
curl -XPOST -H 'X-API-KEY: yourapikey' -d '{
2
email: "...",
3
password: "...",
4
plan: "...",
5
customFields: {
6
userName: "...",
7
avatar: "..."
8
}
9
}' 'https://api.memberstack.com/v1/members'
Copied!
You can get the id of a plan by going to memberships in the dashboard, and extracting the id from the signup link.
post
https://api.memberstack.com
/v1/members/:id
Update Member
metaData can contain up to 50 values. Object keys cannot be longer than 50 characters, object values cannot be longer than 500 characters.
JavaScript
cURL
1
fetch('https://api.memberstack.com/v1/members/123', {
2
method: 'POST',
3
headers: {
4
'X-API-KEY': 'yourapikey'
5
},
6
body: JSON.stringify({
7
email: "...",
8
password: "...",
9
})
10
}
Copied!
1
curl -XPOST -H 'X-API-KEY: yourapikey' -d '{
2
email: "...",
3
password: "..."
4
}' 'https://api.memberstack.com/v1/members/123'
Copied!
delete
https://api.memberstack.com
/v1/members/:id
Delete Member
JavaScript
cURL
1
fetch('https://api.memberstack.com/v1/members/123', {
2
method: 'DELETE',
3
headers: {
4
'X-API-KEY': 'yourapikey'
5
}
6
}
Copied!
1
curl -XDELETE -H 'X-API-KEY: yourapikey' https://api.memberstack.com/v1/members/123
Copied!

Live Example

Interact instantly with the API in this Codesandbox embed. In order to be able to use the API endpoints, you'll need to:
  • Update the value of API_KEY with the value of your API key.
  • Update the value of FREE_PLAN_ID with the id of a free plan of your website. You can get the id of a plan by going to memberships in the dashboard, and extracting the id from the signup link.
  • Update the values of the USER_ID_TO_FETCH for the user that will be queried, USER_ID_TO_UPDATE for the user that will be updated, and USER_ID_TO_DELETE for the user that will be deleted. ⚠️ These values can be the same id. Deleting the user with the id of USER_ID_TO_DELETE will be removed permanently. To open the code editor, drag the handle on the far left side of the embed.
Last modified 1yr ago