> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pocketsflow.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Memberships API

> Create memberships, publish members-only posts, moderate the community and list members.

Memberships (Pro plan and above) give your subscribers members-only posts, a
community and included products. All routes take an API key (`Authorization:
Bearer <key>`). The full reference is in the
[interactive API explorer](https://api.pocketsflow.com/docs) under
**Memberships**; the summary is in [Endpoints](/api-reference/endpoints#memberships).

## Plan rules

| Action | Needs Pro |
| - | - |
| List, read, members list | No |
| Create a membership, edit it | Yes (`403` `FEATURE_LOCKED`) |
| Archive / reopen, switch community or post emails off | No |
| Write, edit or publish a post | Yes |
| Pin / unpin, move a post back to draft, delete | No |
| Start a thread or reply as the creator | Yes |
| Hide, lock, pin, delete threads and replies, ban / unban | No |

## Create a membership and publish a post

```bash theme={"system"}
curl -X POST https://api.pocketsflow.com/memberships \
  -H "Authorization: Bearer $POCKETSFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "The Studio",
    "offerIds": ["665f1c2a9b3e4a0012ab34ce"],
    "productIds": ["665f1c2a9b3e4a0012ab34cd"]
  }'

curl -X POST https://api.pocketsflow.com/memberships/6711a0c4e1b2c3d4e5f60a01/posts \
  -H "Authorization: Bearer $POCKETSFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "October teardown",
    "html": "<p>Three pricing pages that doubled conversion.</p>",
    "status": "published",
    "notify": true
  }'
```

The post's `notifyState` goes `pending` → `sending` → `sent`; `notifiedCount`
says how many members were emailed. Each member is emailed at most once per
post.

## Moderate

```bash theme={"system"}
# Hide a thread (members stop seeing it; you still do)
curl -X PATCH https://api.pocketsflow.com/memberships/6711a0c4e1b2c3d4e5f60a01/threads/6711a0c4e1b2c3d4e5f60c01 \
  -H "Authorization: Bearer $POCKETSFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "hidden": true }'

# Ban the author from your communities and hide everything they wrote
curl -X POST https://api.pocketsflow.com/memberships/members/ban \
  -H "Authorization: Bearer $POCKETSFLOW_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "email": "spam@example.com", "hideContent": true }'
```

Threads and replies include the author's `email` here (never on the
storefront). `replyCount` counts visible replies only.

## Members

`GET /memberships/{id}/members?status=active&q=ana&page=1` lists everyone who
subscribed to the membership's offers, one row per email. `status` is
`active` while a subscription is live, `ended` after. `counts` gives the
totals per filter.

## Webhooks

| Event | When | Data |
| - | - | - |
| `member.joined` | A subscription to one of the offers went live (or the membership was created / its offers changed) | `membership` (`id`, `name`, `slug`), `member` (`email`, `name`), `joinedAt` |
| `member.left` | The person no longer has a live subscription, or the membership changed / was archived / deleted | the same, plus `leftAt` and `reason`: `subscription_ended`, `membership_changed` or `membership_closed` |

Each transition fires once, even when the payment events arrive more than
once.

## MCP

The MCP server exposes `list_memberships`, `create_membership`,
`get_membership`, `update_membership`, `list_membership_members`,
`ban_member`, `unban_member`, `list_member_posts`, `create_member_post`,
`update_member_post`, `delete_member_post`, `list_community_threads`,
`get_community_thread`, `moderate_community_thread`,
`delete_community_thread`, `moderate_community_reply` and
`delete_community_reply`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.