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

# Subscribe



## OpenAPI

````yaml /openapi/mio-openapi.json post /api/v1/hubs/{hub_id}/web-push/subscriptions
openapi: 3.1.0
info:
  description: >-
    Production API reference for Membership.io. Use the authored guides for
    workflows and the generated endpoint pages for exact parameters and schemas.
  title: Membership.io API
  version: 0.1.0
servers:
  - description: Production
    url: https://api.member.dev
security:
  - bearerAuth: []
paths:
  /api/v1/hubs/{hub_id}/web-push/subscriptions:
    post:
      tags:
        - web-push
      summary: Subscribe
      operationId: web_push.post_web_push_post_hubs_by_hub_id_web_push_subscriptions
      parameters:
        - in: path
          name: hub_id
          required: true
          schema:
            title: Hub Id
            type: string
      requestBody:
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/WebPushSubscribeBody'
        required: true
      responses:
        '201':
          content:
            application/vnd.api+json:
              schema:
                $ref: >-
                  #/components/schemas/JsonApiResponse_WebPushSubscriptionAttributes_
          description: Successful Response
        '422':
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - HTTPBearer: []
components:
  schemas:
    WebPushSubscribeBody:
      properties:
        device:
          anyOf:
            - type: string
            - type: 'null'
          title: Device
        subscription:
          anyOf:
            - $ref: '#/components/schemas/SubscriptionPayload'
            - type: 'null'
      title: WebPushSubscribeBody
      type: object
    JsonApiResponse_WebPushSubscriptionAttributes_:
      properties:
        data:
          $ref: '#/components/schemas/JsonApiResource_WebPushSubscriptionAttributes_'
        included:
          anyOf:
            - items: {}
              type: array
            - type: 'null'
          title: Included
        links:
          anyOf:
            - $ref: '#/components/schemas/JsonApiLinks'
            - type: 'null'
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
      required:
        - data
      title: JsonApiResponse[WebPushSubscriptionAttributes]
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    SubscriptionPayload:
      description: The subscription object from the browser's PushManager.
      properties:
        endpoint:
          anyOf:
            - type: string
            - type: 'null'
          title: Endpoint
        keys:
          anyOf:
            - $ref: '#/components/schemas/SubscriptionKeys'
            - type: 'null'
      title: SubscriptionPayload
      type: object
    JsonApiResource_WebPushSubscriptionAttributes_:
      properties:
        attributes:
          $ref: '#/components/schemas/WebPushSubscriptionAttributes'
        id:
          title: Id
          type: string
        links:
          anyOf:
            - $ref: '#/components/schemas/JsonApiLinks'
            - type: 'null'
        meta:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Meta
        relationships:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Relationships
        type:
          title: Type
          type: string
      required:
        - id
        - type
        - attributes
      title: JsonApiResource[WebPushSubscriptionAttributes]
      type: object
    JsonApiLinks:
      properties:
        self:
          anyOf:
            - type: string
            - type: 'null'
          title: Self
      title: JsonApiLinks
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    SubscriptionKeys:
      properties:
        auth:
          anyOf:
            - type: string
            - type: 'null'
          title: Auth
        p256dh:
          anyOf:
            - type: string
            - type: 'null'
          title: P256Dh
      title: SubscriptionKeys
      type: object
    WebPushSubscriptionAttributes:
      properties: {}
      title: WebPushSubscriptionAttributes
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT or mio_sk API key
      description: >-
        Send platform JWTs, contact JWTs, or team API keys as `Authorization:
        Bearer <token>`.
      scheme: bearer
      type: http
    HTTPBearer:
      scheme: bearer
      type: http

````