Skip to content

Memberships API

The Memberships API provides a flexible system for managing user, organization, and project memberships. Memberships link your entities (User, Organization, or Project) to a Membership Tier and manage their access rights, auto-renewals, and feature entitlements.

These maps directly to your Products via the metadata.membership_type_id attribute, automatically granting access when a subscription is purchased.

Base URLs

All public endpoints are mounted under /bridge-payment/memberships.

https://your-instance.pubflow.com/bridge-payment/memberships

Admin routes are mounted under /bridge-payment/admin/memberships.

https://your-instance.pubflow.com/bridge-payment/admin/memberships

Important Routing Note

Do not use the /api/memberships prefix. The Bridge server uses /bridge-payment/memberships as its root for this module.

Core Concepts

Understanding these elements gives you full control over the Bridge Memberships system:

  • Membership Tier (membership_types): Determines the available plans (e.g., Free, Premium) along with their price, duration (recurring, fixed, lifetime), and the features included.
  • Entity Membership (user_memberships / project_memberships / organization_memberships): The active record showing a customer owns a specific tier. Includes expiration dates, cancellation reasons, and subscription linking.
  • Project Tier Resolution: Extremely useful for platforms like Pubflow Flowfull tracking per-project quotas (e.g., pubflow_free VS a1_starter).

Membership Tiers (Public)

Tiers are the base definitions of your subscription levels.

List active membership tiers

GET
/bridge-payment/memberships/tiers

Responses

Tier list

application/json
JSON
{
"additionalProperties": "string"
}

Playground

Samples

Powered by VitePress OpenAPI

Get membership tier

GET
/bridge-payment/memberships/tiers/{id}

Parameters

Path Parameters

id*
Typestring
Required

Responses

Tier

Playground

Server
Variables
Key
Value

Samples

Powered by VitePress OpenAPI

Current User Memberships (/me)

The /me shortcut routes allow the current authenticated flowless user to view and manage their subscriptions directly without providing a User ID.

List current user's memberships

GET
/bridge-payment/memberships/users/me

Authorizations

SessionAuth

Session ID from Flowless authentication

TypeAPI Key (header: X-Session-ID)

Responses

Memberships

application/json
JSON
{
"additionalProperties": "string"
}

Playground

Server
Authorization

Samples

Powered by VitePress OpenAPI

Get current user's membership

GET
/bridge-payment/memberships/users/me/{id}

Authorizations

SessionAuth

Session ID from Flowless authentication

TypeAPI Key (header: X-Session-ID)

Parameters

Path Parameters

id*
Typestring
Required

Responses

Membership

Playground

Server
Authorization
Variables
Key
Value

Samples

Powered by VitePress OpenAPI

Cancel current user membership

POST
/bridge-payment/memberships/users/me/{id}/cancel

Authorizations

SessionAuth

Session ID from Flowless authentication

TypeAPI Key (header: X-Session-ID)

Parameters

Path Parameters

id*
Typestring
Required

Request Body

application/json
JSON
{
"reason": "string"
}

Responses

Cancelled membership

application/json
JSON
{
"additionalProperties": "string"
}

Playground

Server
Authorization
Variables
Key
Value
Body

Samples

Powered by VitePress OpenAPI

User Memberships

For managing a specific user's memberships (requires ownership check).

List memberships for user (ownership enforced)

GET
/bridge-payment/memberships/users/{userId}

Authorizations

SessionAuth

Session ID from Flowless authentication

TypeAPI Key (header: X-Session-ID)

Parameters

Path Parameters

userId*
Typestring
Required

Responses

Memberships

application/json
JSON
{
"additionalProperties": "string"
}

Playground

Server
Authorization
Variables
Key
Value

Samples

Powered by VitePress OpenAPI

Get membership for user

GET
/bridge-payment/memberships/users/{userId}/{id}

Authorizations

SessionAuth

Session ID from Flowless authentication

TypeAPI Key (header: X-Session-ID)

Parameters

Path Parameters

userId*
Typestring
Required
id*
Typestring
Required

Responses

Membership

Playground

Server
Authorization
Variables
Key
Value

Samples

Powered by VitePress OpenAPI

Cancel membership for user

POST
/bridge-payment/memberships/users/{userId}/{id}/cancel

Authorizations

SessionAuth

Session ID from Flowless authentication

TypeAPI Key (header: X-Session-ID)

Parameters

Path Parameters

userId*
Typestring
Required
id*
Typestring
Required

Request Body

application/json
JSON
{
"reason": "string"
}

Responses

Cancelled membership

application/json
JSON
{
"additionalProperties": "string"
}

Playground

Server
Authorization
Variables
Key
Value
Body

Samples

Powered by VitePress OpenAPI

Organization Memberships

Organization memberships assign tiers to an entire organization, unlocking features for all its active members.

List organization memberships

GET
/bridge-payment/memberships/organizations/{organizationId}

Requires org permission canManageSubscriptions (via organization access middleware).

Authorizations

SessionAuth

Session ID from Flowless authentication

TypeAPI Key (header: X-Session-ID)

Parameters

Path Parameters

organizationId*
Typestring
Required

Responses

Memberships

application/json
JSON
{
"additionalProperties": "string"
}

Playground

Server
Authorization
Variables
Key
Value

Samples

Powered by VitePress OpenAPI

Get organization membership

GET
/bridge-payment/memberships/organizations/{organizationId}/{id}

Authorizations

SessionAuth

Session ID from Flowless authentication

TypeAPI Key (header: X-Session-ID)

Parameters

Path Parameters

organizationId*
Typestring
Required
id*
Typestring
Required

Responses

Membership

Playground

Server
Authorization
Variables
Key
Value

Samples

Powered by VitePress OpenAPI

Cancel organization membership

POST
/bridge-payment/memberships/organizations/{organizationId}/{id}/cancel

Authorizations

SessionAuth

Session ID from Flowless authentication

TypeAPI Key (header: X-Session-ID)

Parameters

Path Parameters

organizationId*
Typestring
Required
id*
Typestring
Required

Request Body

application/json
JSON
{
"reason": "string"
}

Responses

Cancelled membership

application/json
JSON
{
"additionalProperties": "string"
}

Playground

Server
Authorization
Variables
Key
Value
Body

Samples

Powered by VitePress OpenAPI

Project Memberships

Project-level memberships bind subscription limits and quotas to a specific workspace project.

List memberships for project

GET
/bridge-payment/memberships/projects/{projectId}

Authorizations

SessionAuth

Session ID from Flowless authentication

TypeAPI Key (header: X-Session-ID)

Parameters

Path Parameters

projectId*
Typestring
Required

Responses

Memberships

application/json
JSON
{
"additionalProperties": "string"
}

Playground

Server
Authorization
Variables
Key
Value

Samples

Powered by VitePress OpenAPI

Get project membership

GET
/bridge-payment/memberships/projects/{projectId}/{id}

Authorizations

SessionAuth

Session ID from Flowless authentication

TypeAPI Key (header: X-Session-ID)

Parameters

Path Parameters

projectId*
Typestring
Required
id*
Typestring
Required

Responses

Membership

Playground

Server
Authorization
Variables
Key
Value

Samples

Powered by VitePress OpenAPI

Cancel project membership

POST
/bridge-payment/memberships/projects/{projectId}/{id}/cancel

Authorizations

SessionAuth

Session ID from Flowless authentication

TypeAPI Key (header: X-Session-ID)

Parameters

Path Parameters

projectId*
Typestring
Required
id*
Typestring
Required

Request Body

application/json
JSON
{
"reason": "string"
}

Responses

Cancelled membership

application/json
JSON
{
"additionalProperties": "string"
}

Playground

Server
Authorization
Variables
Key
Value
Body

Samples

Powered by VitePress OpenAPI

Feature Access Verification

The handiest route for frontends and microservices to ask: "Can this user do X?"

Verify feature access for current user

GET
/bridge-payment/memberships/access

Authorizations

SessionAuth

Session ID from Flowless authentication

TypeAPI Key (header: X-Session-ID)

Parameters

Query Parameters

feature*
Typestring
Required

Responses

Access result

application/json
JSON
{
"additionalProperties": "string"
}

Playground

Server
Authorization
Variables
Key
Value

Samples

Powered by VitePress OpenAPI

Admin Management

Administrative endpoints allow team members to create new tiers, issue compensatory memberships, analyze churn, and manually extend expiration dates.

Managing Tiers

Create membership tier

POST
/bridge-payment/admin/memberships/tiers

Authorizations

SessionAuth

Session ID from Flowless authentication

TypeAPI Key (header: X-Session-ID)

Request Body

application/json
JSON
{
"additionalProperties": "string"
}

Responses

Created

Playground

Server
Authorization
Body

Samples

Powered by VitePress OpenAPI

Update membership tier

PUT
/bridge-payment/admin/memberships/tiers/{id}

Authorizations

SessionAuth

Session ID from Flowless authentication

TypeAPI Key (header: X-Session-ID)

Parameters

Path Parameters

id*
Typestring
Required

Request Body

application/json
JSON
{
"additionalProperties": "string"
}

Responses

Updated

Playground

Server
Authorization
Variables
Key
Value
Body

Samples

Powered by VitePress OpenAPI

Deactivate membership tier

DELETE
/bridge-payment/admin/memberships/tiers/{id}

Authorizations

SessionAuth

Session ID from Flowless authentication

TypeAPI Key (header: X-Session-ID)

Parameters

Path Parameters

id*
Typestring
Required

Responses

Deactivated

Playground

Server
Authorization
Variables
Key
Value

Samples

Powered by VitePress OpenAPI

Managing Entity Memberships (Admin)

List all memberships (paginated)

GET
/bridge-payment/admin/memberships

Authorizations

SessionAuth

Session ID from Flowless authentication

TypeAPI Key (header: X-Session-ID)

Parameters

Query Parameters

page
Typeinteger
Default1
limit
Typeinteger
Default50

Responses

Paged memberships

application/json
JSON
{
"additionalProperties": "string"
}

Playground

Server
Authorization
Variables
Key
Value

Samples

Powered by VitePress OpenAPI

List memberships for user (admin)

GET
/bridge-payment/admin/memberships/users/{userId}

Authorizations

SessionAuth

Session ID from Flowless authentication

TypeAPI Key (header: X-Session-ID)

Parameters

Path Parameters

userId*
Typestring
Required

Responses

Memberships

application/json
JSON
{
"additionalProperties": "string"
}

Playground

Server
Authorization
Variables
Key
Value

Samples

Powered by VitePress OpenAPI

Create user membership (admin)

POST
/bridge-payment/admin/memberships/users/{userId}

Authorizations

SessionAuth

Session ID from Flowless authentication

TypeAPI Key (header: X-Session-ID)

Parameters

Path Parameters

userId*
Typestring
Required

Request Body

application/json
JSON
{
"additionalProperties": "string"
}

Responses

Created

Playground

Server
Authorization
Variables
Key
Value
Body

Samples

Powered by VitePress OpenAPI

Update membership record

PUT
/bridge-payment/admin/memberships/{id}

Authorizations

SessionAuth

Session ID from Flowless authentication

TypeAPI Key (header: X-Session-ID)

Parameters

Path Parameters

id*
Typestring
Required

Request Body

application/json
JSON
{
"additionalProperties": "string"
}

Responses

Updated

Playground

Server
Authorization
Variables
Key
Value
Body

Samples

Powered by VitePress OpenAPI

Extend membership by days

POST
/bridge-payment/admin/memberships/{id}/extend

Authorizations

SessionAuth

Session ID from Flowless authentication

TypeAPI Key (header: X-Session-ID)

Parameters

Path Parameters

id*
Typestring
Required

Request Body

application/json
JSON
{
"days": 0
}

Responses

Extended

Playground

Server
Authorization
Variables
Key
Value
Body

Samples

Powered by VitePress OpenAPI

Analytics

Gain insights into how your memberships are performing.

Membership analytics overview

GET
/bridge-payment/admin/memberships/analytics/overview

Authorizations

SessionAuth

Session ID from Flowless authentication

TypeAPI Key (header: X-Session-ID)

Responses

Overview stats

application/json
JSON
{
"additionalProperties": "string"
}

Playground

Server
Authorization

Samples

Powered by VitePress OpenAPI

Membership churn analytics

GET
/bridge-payment/admin/memberships/analytics/churn

Authorizations

SessionAuth

Session ID from Flowless authentication

TypeAPI Key (header: X-Session-ID)

Responses

Churn stats

application/json
JSON
{
"additionalProperties": "string"
}

Playground

Server
Authorization

Samples

Powered by VitePress OpenAPI

Integrating Subscriptions & Memberships

Memberships seamlessly integrate with Subscriptions:

  1. Admin creates a Product with metadata: { "membership_type_id": "premium_monthly" }.
  2. A customer subscribes to the Product.
  3. Bridge Payment's webhooks detect the successful payment and automatically generate (or extend) the membership.
  4. Your application runs GET /bridge-payment/memberships/access?feature=hd_video to verify access.