REST API - Members Route

The members route allows you to interact with the Restrict Content Pro members database to retrieve members, add new ones, update existing members, and delete members.

Get members

GET /wp-json/rcp/{version}/members/

Required parameters:

  • None.

Optional parameters:

  • status (string) - Retrieve only members with the specified status
    • active, pending, cancelled, expired
  • subscription (int) - The subscription level ID from which to retrieve members
  • recurring (int) - Whether to include recurring or non-recurring members only
    • 1, 0
  • number (int) - The total of members to retrieve per page
  • offset (int) - The number of members to skip (for pagination purposes)
  • orderby (string) - The field on which to order the members returned
  • order (string) - The direction which to sort members
    • ASC, DESC
  • s (string) - Search value, such as the name, email, or user log in of the member

Get specific member

GET /wp-json/rcp/{version}/members/{member_id}

Required parameters:

  • id - The member ID to retrieve. Can be passed in the URL or as part of the body.

Optional parameters:

  • None.

New member

POST /wp-json/rcp/{version}/members/new

Required parameters:

  • login (string) - The log in name to assign to the newly created member account.

Optional parameters:

  • status (string) - The subscription status to assign to the member.
  • expiration (string) - The expiration date to assign to the member in MySQL format.
  • subscription (int) - The subscription level ID to assign to the member.
  • profile_id (string) - The payment profile ID of the member.
  • recurring (int) - Boolean flag that indicates if the subscription is recurring or one-time only.
    • 1 or 0
  • Any parameter supported by wp_insert_user().

Update member

POST /wp-json/rcp/{version}/members/update/{member_id}

Required parameters:

  • id (int) - The ID of the member account to update. Can be passed in the URL or as part of the body.

Optional parameters:

  • status (string) - The subscription status to assign to the member.
  • expiration (string) - The expiration date to assign to the member in MySQL format.
  • subscription (int) - The subscription level ID to assign to the member.
  • profile_id (string) - The payment profile ID of the member.
  • recurring (int) - Boolean flag that indicates if the subscription is recurring or one-time only.
    • 1 or 0
  • Any parameter supported by wp_insert_user().

Delete member

DELETE /wp-json/rcp/{version}/members/delete

Required parameters:

  • id (int) - The ID of the member account to delete

Optional parameters:

  • None.