Memberstack Admin Package (REST)

Article author
Josh Lopez
  • Updated

The Memberstack REST Admin API allows you to perform full CRUD (create, read, update, delete) operations on members as well as verify webhooks and JWT tokens programmatically in your JavaScript application. This enables you to build custom admin panels, sync members with external databases, integrate with third-party services, and more. The Admin API uses standard REST conventions with JSON request and response bodies, making it easy to use with any JavaScript HTTP client like axios or the native fetch API.

View the full Admin Package Guide for more additional guidance. 

Getting Started


The Admin REST Package uses secret API keys to authenticate requests. You can find your API keys in your Memberstack app on the Dev Tools page.

Use your sk_sb_... key for development and sk_... in production.

Here's an example using axios to authenticate requests:

const apiKey = process.env.MEMBERSTACK_API_KEY; 
const headers = { "X-API-KEY": apiKey }; 
const axios = require('axios'); 
axios.get('', {headers});

Rate Limits - 25 requests per second. Contact support if you need this increased.

Security - Keep your secret keys secure and use only in server-side code, not client-side.

Base URL

The base URL for all requests is: 


List Members

Get a paginated list of members:

const url = ''; 
axios.get(url, {headers}).then(res => { 

Optional parameters:

  • after - Pagination cursor
  • order - ASC or DESC
  • limit - Max number to return (default 50)

Get a Member

Get a member by id:

const memberId = 'mem_1234'; 
const url = `${memberId}`; 
axios.get(url, {headers}).then(res => { 

Or by email:

const email = ''; 
const encodedEmail = encodeURIComponent(email); 
const url = `${encodedEmail}`; 
axios.get(url, {headers}).then(res => { 

Create a Member

const url = ''; 
const data = { 
  email: '', 
  password: 'password123', 
  plans: [{planId: 'pln_1234'}], 
};, data, {headers}).then(res => { 
  // Created member 

Required parameters:

  • email - The member's email
  • password - The member's password

Optional parameters:

  • plans - Free plans only. Array of planId objects. [{"planId": "pln_abc"}]
  • customFields - Object of custom fields.
  • metaData - Metadata object.
  • json - JSON object.
  • loginRedirect - loginRedirect string.

Update a Member

const memberId = 'mem_1234'; 
const url = `${memberId}`; 
const data = { 
  customFields: { 
    country: 'Sweden' 
axios.patch(url, data, {headers}).then(res => { 
  // Updated member 

Delete a Member

const memberId = 'mem_1234'; 
const url = `${memberId}`; 
axios.delete(url, {headers}).then(res => { 
  // Deleted member ID 

Add/Remove Free Plans

const memberId = 'mem_1234'; 

// Add plan 
const url = `${memberId}/add-plan`;, {planId: 'pln_4567'}, {headers}); 

// Remove plan 
const url = `${memberId}/remove-plan`;, {planId: 'pln_4567'}, {headers});

Verify a Token

const url = '';, {token: 'jwt_token'}, {headers}).then(res => { 
  // Verified member 

Was this article helpful?



Please sign in to leave a comment.