Automattic Memberships API

The memberships API from Automattic — 10 operation(s) for memberships.

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).

Operations 13

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /wpcom/v2/sites/{wpcom_site}/memberships/comp/{comp_id} Get a membership component · GET /wpcom/v2/sites/{wpcom_site}/memberships/comp/{comp_id} #
Ask an LLM
“What does a specific membership component on my site cover?”
“Can I look up one membership component by its id?”
Tell an agent
Get membership component {comp_id} on site {wpcom_site}.
Show the details of membership component {comp_id}.
DELETE /wpcom/v2/sites/{wpcom_site}/memberships/comp/{comp_id} Delete a membership component · DELETE /wpcom/v2/sites/{wpcom_site}/memberships/comp/{comp_id} #
Ask an LLM
“How do I remove a membership component from my site?”
“Can I delete a membership component by id?”
Tell an agent destructive · confirm first
Delete membership component {comp_id} on site {wpcom_site}.
Remove membership component {comp_id}.
GET /wpcom/v2/sites/{wpcom_site}/memberships/comps List a site's membership components · GET /wpcom/v2/sites/{wpcom_site}/memberships/comps #
Ask an LLM
“Which membership components are set up on my site?”
“Can I see every membership component at once?”
Tell an agent
List membership components on site {wpcom_site}.
Show all membership components for site {wpcom_site}.
POST /wpcom/v2/sites/{wpcom_site}/memberships/comps/{user_id}/{plan_id} Comp a user onto a membership plan · POST /wpcom/v2/sites/{wpcom_site}/memberships/comps/{user_id}/{plan_id} #
Ask an LLM
“How do I give a user a free comp on a membership plan?”
“Can a comp end on a set date instead of at the plan's renewal?”
Tell an agent
Comp user {user_id} onto plan {plan_id} on site {wpcom_site}.
Give user {user_id} a {duration} comp on plan {plan_id} for site {wpcom_site}.
PUT /wpcom/v2/sites/{wpcom_site}/memberships/coupon/{coupon_id} Update a membership coupon · PUT /wpcom/v2/sites/{wpcom_site}/memberships/coupon/{coupon_id} #
Ask an LLM
“How do I change an existing membership coupon?”
“Can I make a coupon apply only to certain plans?”
Tell an agent
Update coupon {coupon_id} on site {wpcom_site}.
Set coupon {coupon_id} on site {wpcom_site} to expire {end_date}.
DELETE /wpcom/v2/sites/{wpcom_site}/memberships/coupon/{coupon_id} Delete a membership coupon · DELETE /wpcom/v2/sites/{wpcom_site}/memberships/coupon/{coupon_id} #
Ask an LLM
“How do I delete a membership coupon?”
“Can I remove a coupon from a single currency?”
Tell an agent destructive · confirm first
Delete coupon {coupon_id} on site {wpcom_site}.
Remove coupon {coupon_id} from site {wpcom_site} in {currency}.
POST /wpcom/v2/sites/{wpcom_site}/memberships/coupons Create a membership coupon · POST /wpcom/v2/sites/{wpcom_site}/memberships/coupons #
Ask an LLM
“How do I create a discount coupon for my members?”
“Can I limit a coupon to certain plans and emails?”
Tell an agent
Create coupon {coupon_code} on site {wpcom_site} for plans {plan_ids_allow_list}.
Create a {discount_type} coupon {coupon_code} on site {wpcom_site} for {email_allow_list}.
GET /wpcom/v2/sites/{wpcom_site}/memberships/coupons List a site's membership coupons · GET /wpcom/v2/sites/{wpcom_site}/memberships/coupons #
Ask an LLM
“What membership coupons are set up on my site?”
“Can I see all the discount coupons for members?”
Tell an agent
List membership coupons on site {wpcom_site}.
Show every coupon for site {wpcom_site}.
POST /wpcom/v2/sites/{wpcom_site}/memberships/coupons/apply Apply membership coupons to a user · POST /wpcom/v2/sites/{wpcom_site}/memberships/coupons/apply #
Ask an LLM
“How do I apply several coupons to a user's subscription?”
“Can I test coupons against a specific plan and email?”
Tell an agent
Apply coupons {coupon_codes} to {user_email} on plan {plan_id} for site {wpcom_site}.
Test {coupon_codes} against plan {plan_id} for {user_email} on site {wpcom_site}.
GET /wpcom/v2/sites/{wpcom_site}/memberships/earnings Get a site's membership earnings · GET /wpcom/v2/sites/{wpcom_site}/memberships/earnings #
Ask an LLM
“How much have my members paid in total?”
“Can I see membership earnings in a specific currency?”
Tell an agent
Get membership earnings for site {wpcom_site}.
Show membership earnings for site {wpcom_site} in {currency}.
GET /wpcom/v2/sites/{wpcom_site}/memberships/subscriber-importer/get_subscriptions Get a member's subscriptions by import · GET /wpcom/v2/sites/{wpcom_site}/memberships/subscriber-importer/get_subscriptio… #
Ask an LLM
“How do I import a member's subscriptions into a site?”
“Can I transfer a member's existing subscriptions into new dashboard access?”
Tell an agent
Import the member's subscriptions into site {site}.
Set up a site-wide subscription transfer for a member.
POST /wpcom/v2/sites/{wpcom_site}/memberships/subscriber-importer/import Import a Stripe subscription as a member · POST /wpcom/v2/sites/{wpcom_site}/memberships/subscriber-importer/import #
Ask an LLM
“How do I add a Stripe subscription as a member?”
“Can I import a single subscription with its customer email?”
Tell an agent
Import Stripe subscription {subscription_id} for {customer_email} on plan {product_id} for site {wpcom_site}.
Add subscription {subscription_id} as a member of site {wpcom_site}.
GET /wpcom/v2/sites/{wpcom_site}/memberships/subscribers List a site's members · GET /wpcom/v2/sites/{wpcom_site}/memberships/subscribers #
Ask an LLM
“Who are the members of my site?”
“Can I search members by email or name?”
Tell an agent
List members of site {wpcom_site}.
Find members on site {wpcom_site} matching {search}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/automattic:automattic-memberships-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

automattic-memberships-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: WordPress.com REST API — wpcom/v2 namespace Memberships API
  version: v2
  description: Derived by API Evangelist from the WordPress.com REST API route index published at https://public-api.wordpress.com/wpcom/v2/. Paths, HTTP methods, and parameter names/types/descriptions/defaults are taken verbatim from that index. Response schemas are not published in the route index, so successful responses are described but not schematised; the error envelope was observed live on public-api.wordpress.com.
  contact:
    name: Automattic
    url: https://developer.wordpress.com/docs/api/
  x-derived-from: https://public-api.wordpress.com/wpcom/v2/
  x-derived-by: API Evangelist enrichment pipeline
servers:
- url: https://public-api.wordpress.com
security:
- bearerAuth: []
tags:
- name: Memberships
paths:
  /wpcom/v2/sites/{wpcom_site}/memberships/comp/{comp_id}:
    get:
      operationId: getWpcomV2SitesbyWpcomSiteMembershipsCompbyCompId
      summary: GET /wpcom/v2/sites/{wpcom_site}/memberships/comp/{comp_id}
      tags:
      - Memberships
      responses:
        '200':
          description: OK
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPRestError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPRestError'
      parameters:
      - name: wpcom_site
        in: path
        required: true
        schema:
          type: string
      - name: comp_id
        in: path
        required: true
        schema:
          type: string
    delete:
      operationId: deleteWpcomV2SitesbyWpcomSiteMembershipsCompbyCompId
      summary: DELETE /wpcom/v2/sites/{wpcom_site}/memberships/comp/{comp_id}
      tags:
      - Memberships
      responses:
        '200':
          description: OK
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPRestError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPRestError'
      parameters:
      - name: wpcom_site
        in: path
        required: true
        schema:
          type: string
      - name: comp_id
        in: path
        required: true
        schema:
          type: string
  /wpcom/v2/sites/{wpcom_site}/memberships/comps:
    get:
      operationId: getWpcomV2SitesbyWpcomSiteMembershipsComps
      summary: GET /wpcom/v2/sites/{wpcom_site}/memberships/comps
      tags:
      - Memberships
      responses:
        '200':
          description: OK
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPRestError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPRestError'
      parameters:
      - name: wpcom_site
        in: path
        required: true
        schema:
          type: string
  /wpcom/v2/sites/{wpcom_site}/memberships/comps/{user_id}/{plan_id}:
    post:
      operationId: postWpcomV2SitesbyWpcomSiteMembershipsCompsbyUserIdbyPlanId
      summary: POST /wpcom/v2/sites/{wpcom_site}/memberships/comps/{user_id}/{plan_id}
      tags:
      - Memberships
      responses:
        '200':
          description: OK
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPRestError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPRestError'
      parameters:
      - name: wpcom_site
        in: path
        required: true
        schema:
          type: string
      - name: user_id
        in: path
        required: true
        schema:
          type: string
      - name: plan_id
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                no_expiration:
                  type: boolean
                  default: false
                  description: Set to true for an indefinite comp. Otherwise end_date is inferred from the plan renewal interval.
  /wpcom/v2/sites/{wpcom_site}/memberships/coupon/{coupon_id}:
    put:
      operationId: putWpcomV2SitesbyWpcomSiteMembershipsCouponbyCouponId
      summary: PUT /wpcom/v2/sites/{wpcom_site}/memberships/coupon/{coupon_id}
      tags:
      - Memberships
      responses:
        '200':
          description: OK
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPRestError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPRestError'
      parameters:
      - name: wpcom_site
        in: path
        required: true
        schema:
          type: string
      - name: coupon_id
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                coupon_code:
                  type: string
                  description: Coupon code for the coupon.
                can_be_combined:
                  type: string
                  description: If the coupon can be combined with other coupons.
                first_time_purchase_only:
                  type: string
                  description: If the coupon can only be used if the user is not yet subscribed.
                limit_per_user:
                  type: string
                  description: Limit of use of this coupon per user.
                start_date:
                  type: string
                  description: Coupon campaign start date (format yyyy-mm-dd).
                end_date:
                  type: string
                  description: Coupon campaign end date (format yyyy-mm-dd).
                plan_ids_allow_list:
                  type: array
                  items: {}
                  description: Array of plan ids the coupon can be applied to.
                duration:
                  type: string
                  description: Duration of the coupon once applied. In months. It can be a human-readable string, but it will always return a number of months (example "12 months").
                email_allow_list:
                  type: array
                  items: {}
                  description: List of white listed emails with potential wildcards.
                discount_type:
                  type: string
                  enum:
                  - amount
                  - percentage
                  description: Type of discount applied.
                discount_value:
                  type: string
                  description: Discount value (if discount_type set as "amount").
                discount_percentage:
                  type: string
                  description: Discount percentage (if discount_type set as "percentage").
              required:
              - coupon_code
              - can_be_combined
              - first_time_purchase_only
              - start_date
              - plan_ids_allow_list
              - email_allow_list
              - discount_type
    delete:
      operationId: deleteWpcomV2SitesbyWpcomSiteMembershipsCouponbyCouponId
      summary: DELETE /wpcom/v2/sites/{wpcom_site}/memberships/coupon/{coupon_id}
      tags:
      - Memberships
      responses:
        '200':
          description: OK
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPRestError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPRestError'
      parameters:
      - name: wpcom_site
        in: path
        required: true
        schema:
          type: string
      - name: coupon_id
        in: path
        required: true
        schema:
          type: string
      - name: currency
        in: query
        required: false
        schema:
          default: false
  /wpcom/v2/sites/{wpcom_site}/memberships/coupons:
    post:
      operationId: postWpcomV2SitesbyWpcomSiteMembershipsCoupons
      summary: POST /wpcom/v2/sites/{wpcom_site}/memberships/coupons
      tags:
      - Memberships
      responses:
        '200':
          description: OK
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPRestError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPRestError'
      parameters:
      - name: wpcom_site
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                coupon_code:
                  type: string
                  description: Coupon code for the coupon.
                can_be_combined:
                  type: string
                  description: If the coupon can be combined with other coupons.
                first_time_purchase_only:
                  type: string
                  description: If the coupon can only be used if the user is not yet subscribed.
                limit_per_user:
                  type: string
                  description: Limit of use of this coupon per user.
                start_date:
                  type: string
                  description: Coupon campaign start date (format yyyy-mm-dd).
                end_date:
                  type: string
                  description: Coupon campaign end date (format yyyy-mm-dd).
                plan_ids_allow_list:
                  type: array
                  items: {}
                  description: Array of plan ids the coupon can be applied to.
                duration:
                  type: string
                  description: Duration of the coupon once applied. In months. It can be a human-readable string, but it will always return a number of months (example "12 months").
                email_allow_list:
                  type: array
                  items: {}
                  description: List of white listed emails with potential wildcards.
                discount_type:
                  type: string
                  enum:
                  - amount
                  - percentage
                  description: Type of discount applied.
                discount_value:
                  type: string
                  description: Discount value (if discount_type set as "amount").
                discount_percentage:
                  type: string
                  description: Discount percentage (if discount_type set as "percentage").
              required:
              - coupon_code
              - can_be_combined
              - first_time_purchase_only
              - start_date
              - plan_ids_allow_list
              - email_allow_list
              - discount_type
    get:
      operationId: getWpcomV2SitesbyWpcomSiteMembershipsCoupons
      summary: GET /wpcom/v2/sites/{wpcom_site}/memberships/coupons
      tags:
      - Memberships
      responses:
        '200':
          description: OK
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPRestError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPRestError'
      parameters:
      - name: wpcom_site
        in: path
        required: true
        schema:
          type: string
  /wpcom/v2/sites/{wpcom_site}/memberships/coupons/apply:
    post:
      operationId: postWpcomV2SitesbyWpcomSiteMembershipsCouponsApply
      summary: POST /wpcom/v2/sites/{wpcom_site}/memberships/coupons/apply
      tags:
      - Memberships
      responses:
        '200':
          description: OK
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPRestError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPRestError'
      parameters:
      - name: wpcom_site
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                coupon_codes:
                  type: array
                  items: {}
                  description: List of coupon codes.
                plan_id:
                  type: string
                  description: Plan id.
                user_email:
                  type: string
                  description: User email.
              required:
              - coupon_codes
              - plan_id
              - user_email
  /wpcom/v2/sites/{wpcom_site}/memberships/earnings:
    get:
      operationId: getWpcomV2SitesbyWpcomSiteMembershipsEarnings
      summary: GET /wpcom/v2/sites/{wpcom_site}/memberships/earnings
      tags:
      - Memberships
      responses:
        '200':
          description: OK
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPRestError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPRestError'
      parameters:
      - name: wpcom_site
        in: path
        required: true
        schema:
          type: string
      - name: currency
        in: query
        required: false
        schema:
          default: false
  /wpcom/v2/sites/{wpcom_site}/memberships/subscriber-importer/get_subscriptions:
    get:
      operationId: getWpcomV2SitesbyWpcomSiteMembershipsSubscriberImporterGetSubscriptions
      summary: GET /wpcom/v2/sites/{wpcom_site}/memberships/subscriber-importer/get_subscriptio…
      tags:
      - Memberships
      responses:
        '200':
          description: OK
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPRestError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPRestError'
      parameters:
      - name: wpcom_site
        in: path
        required: true
        schema:
          type: string
  /wpcom/v2/sites/{wpcom_site}/memberships/subscriber-importer/import:
    post:
      operationId: postWpcomV2SitesbyWpcomSiteMembershipsSubscriberImporterImport
      summary: POST /wpcom/v2/sites/{wpcom_site}/memberships/subscriber-importer/import
      tags:
      - Memberships
      responses:
        '200':
          description: OK
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPRestError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPRestError'
      parameters:
      - name: wpcom_site
        in: path
        required: true
        schema:
          type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                product_id:
                  type: string
                  description: WPCOM Plan id.
                subscription_id:
                  type: string
                  description: Stripe Subscription id.
                customer_email:
                  type: string
                  description: User email.
                stripe_restricted_key:
                  type: string
                  description: Stripe restricted key with subscription_write scope.
              required:
              - product_id
              - subscription_id
              - customer_email
  /wpcom/v2/sites/{wpcom_site}/memberships/subscribers:
    get:
      operationId: getWpcomV2SitesbyWpcomSiteMembershipsSubscribers
      summary: GET /wpcom/v2/sites/{wpcom_site}/memberships/subscribers
      tags:
      - Memberships
      responses:
        '200':
          description: OK
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPRestError'
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/WPRestError'
      parameters:
      - name: wpcom_site
        in: path
        required: true
        schema:
          type: string
      - name: offset
        in: query
        required: false
        schema:
          default: 0
        description: Offset of the list.
      - name: single
        in: query
        required: false
        schema:
          type: boolean
          default: false
        description: Returns only one memberships.
      - name: search
        in: query
        required: false
        schema:
          type: string
        description: Allow to search a user either by email, login or name.
components:
  schemas:
    WPRestError:
      type: object
      description: WordPress REST API error envelope (observed on public-api.wordpress.com).
      properties:
        code:
          type: string
          example: rest_unauthorized
        message:
          type: string
          example: Authentication required.
        data:
          type: object
          properties:
            status:
              type: integer
              example: 401
  securitySchemes:
    oauth2:
      type: oauth2
      description: WordPress.com OAuth 2.1, per https://public-api.wordpress.com/.well-known/openid-configuration
      flows:
        authorizationCode:
          authorizationUrl: https://public-api.wordpress.com/oauth2-1/authorize
          tokenUrl: https://public-api.wordpress.com/oauth2-1/token
          refreshUrl: https://public-api.wordpress.com/oauth2-1/token
          scopes:
            global: ''
            auth: ''
            openid: ''
            profile: ''
            email: ''
            users: ''
            sites: ''
            posts: ''
            comments: ''
            taxonomy: ''
            follow: ''
            sharing: ''
            freshly-pressed: ''
            notifications: ''
            insights: ''
            read: ''
            stats: ''
            media: ''
            menus: ''
            batch: ''
            videos: ''
    bearerAuth:
      type: http
      scheme: bearer