Hang Memberships API

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

Operations 10

POST /v2/program-memberships Creates a new membership with a given wallet_address, external_user_id, or both. #
POST /membership/{program_membership_id}/social-media-credentials updates membership with social media credentials #
GET /membership/{program_membership_id} gets membership with social media credentials #
GET /membership/wallets/{wallet_address} gets membership with social media credentials from wallet address #
POST /v2/program-memberships/{program_membership_id}/add-trait Endpoint to add a trait to a program membership #
POST /v2/program-memberships/{program_membership_id}/remove-trait Endpoint to remove a trait from a program membership #
POST /v2/program-memberships/{program_membership_id}/set-image Endpoint to set an image for a program membership #
PATCH /v2/program-memberships/{program_membership_id} Endpoint to update a program membership with a wallet_address, on_chain_token_id, and/or external_user_id #
GET /v2/program-memberships/{program_membership_id}/level Retrieve the current level or tier, as well as earned points (XP) for a program membership. #

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/hang-memberships-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no email required.

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

OpenAPI Specification

hang-memberships-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Hang Partner API (params in:formData) Activities Memberships API
  description: '

    <p>The Partner API allows you to request various resources that can power your loyalty program.</p>

    &copy Hang 2023'
  version: 2023.09.07
  x-copyright: '&copy Hang 2023'
servers:
- url: /partner-api
security:
- ApiKeyAuth: []
tags:
- name: Memberships
paths:
  /v2/program-memberships:
    post:
      tags:
      - Memberships
      operationId: post_v2_program-memberships
      summary: Creates a new membership with a given wallet_address, external_user_id, or both.
      responses:
        '200':
          description: Membership was created successfully, or an existing membership was found
          content:
            application/json:
              schema:
                type: object
                properties:
                  membership:
                    type: object
                    properties:
                      id:
                        type: string
                        description: The ID of the membership
                      external_user_id:
                        type: string
                        description: The external user id for the membership
                      wallet_address:
                        type: string
                        description: The wallet address for the membership
                      on_chain_token_id:
                        type: string
                        description: The on chain token id for the membership
                      created_at:
                        type: number
                        description: When the membership was created, in epoch seconds.
                      social_media_credentials:
                        type: object
                        properties:
                          twitter_username:
                            type: string
                            description: The instagram handle for the membership
                          instagram_username:
                            type: string
                            description: The instagram handle for the membership
                          tiktok_username:
                            type: string
                            description: The tiktok username associated with the membership
                        additionalProperties: false
                        required:
                        - twitter_username
                        - instagram_username
                        - tiktok_username
                    additionalProperties: false
                    required:
                    - id
                    - external_user_id
                    - wallet_address
                    - on_chain_token_id
                    - created_at
                additionalProperties: false
                required:
                - membership
        '400':
          description: Missing required parameters.
      description: Invoke this endpoint to add a new membership to your loyalty program.
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                external_user_id:
                  type: string
                  description: the user's external_user_id (must be provided if wallet_address is blank)
                wallet_address:
                  type: string
                  description: the user's wallet_address (must be provided if external_user_id is blank)
                email:
                  type: string
                  description: the user's email address
          multipart/form-data:
            schema:
              type: object
              properties:
                external_user_id:
                  type: string
                  description: the user's external_user_id (must be provided if wallet_address is blank)
                wallet_address:
                  type: string
                  description: the user's wallet_address (must be provided if external_user_id is blank)
                email:
                  type: string
                  description: the user's email address
  /membership/{program_membership_id}/social-media-credentials:
    post:
      tags:
      - Memberships
      operationId: post_membership_program_membership_id_social-media-credentials
      summary: updates membership with social media credentials
      parameters:
      - name: program_membership_id
        in: path
        required: true
        description: program membership id
        schema:
          type: string
      responses:
        '200':
          description: Membership was updated with social media credentials
          content:
            application/json:
              schema:
                type: object
                properties:
                  membership:
                    type: object
                    properties:
                      id:
                        type: string
                        description: The ID of the membership
                      external_user_id:
                        type: string
                        description: The external user id for the membership
                      wallet_address:
                        type: string
                        description: The wallet address for the membership
                      on_chain_token_id:
                        type: string
                        description: The on chain token id for the membership
                      created_at:
                        type: number
                        description: When the membership was created, in epoch seconds.
                      social_media_credentials:
                        type: object
                        properties:
                          twitter_username:
                            type: string
                            description: The instagram handle for the membership
                          instagram_username:
                            type: string
                            description: The instagram handle for the membership
                          tiktok_username:
                            type: string
                            description: The tiktok username associated with the membership
                        additionalProperties: false
                        required:
                        - twitter_username
                        - instagram_username
                        - tiktok_username
                    additionalProperties: false
                    required:
                    - id
                    - external_user_id
                    - wallet_address
                    - on_chain_token_id
                    - created_at
                additionalProperties: false
                required:
                - membership
      description: ''
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                twitter_username:
                  type: string
                  description: twitter handle associated with the program membership
                instagram_username:
                  type: string
                  description: instagram username associated with the program membership
          multipart/form-data:
            schema:
              type: object
              properties:
                twitter_username:
                  type: string
                  description: twitter handle associated with the program membership
                instagram_username:
                  type: string
                  description: instagram username associated with the program membership
  /membership/{program_membership_id}:
    get:
      tags:
      - Memberships
      operationId: get_membership_program_membership_id
      summary: gets membership with social media credentials
      parameters:
      - name: program_membership_id
        in: path
        required: true
        description: program membership id
        schema:
          type: string
      responses:
        '200':
          description: Membership was retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  membership:
                    type: object
                    properties:
                      id:
                        type: string
                        description: The ID of the membership
                      external_user_id:
                        type: string
                        description: The external user id for the membership
                      wallet_address:
                        type: string
                        description: The wallet address for the membership
                      on_chain_token_id:
                        type: string
                        description: The on chain token id for the membership
                      created_at:
                        type: number
                        description: When the membership was created, in epoch seconds.
                      social_media_credentials:
                        type: object
                        properties:
                          twitter_username:
                            type: string
                            description: The instagram handle for the membership
                          instagram_username:
                            type: string
                            description: The instagram handle for the membership
                          tiktok_username:
                            type: string
                            description: The tiktok username associated with the membership
                        additionalProperties: false
                        required:
                        - twitter_username
                        - instagram_username
                        - tiktok_username
                    additionalProperties: false
                    required:
                    - id
                    - external_user_id
                    - wallet_address
                    - on_chain_token_id
                    - created_at
                additionalProperties: false
                required:
                - membership
      description: ''
  /membership/wallets/{wallet_address}:
    get:
      tags:
      - Memberships
      operationId: get_membership_wallets_wallet_address
      summary: gets membership with social media credentials from wallet address
      parameters:
      - name: wallet_address
        in: path
        required: true
        description: user's wallet address
        schema:
          type: string
      responses:
        '200':
          description: Membership was retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  membership:
                    type: object
                    properties:
                      id:
                        type: string
                        description: The ID of the membership
                      external_user_id:
                        type: string
                        description: The external user id for the membership
                      wallet_address:
                        type: string
                        description: The wallet address for the membership
                      on_chain_token_id:
                        type: string
                        description: The on chain token id for the membership
                      created_at:
                        type: number
                        description: When the membership was created, in epoch seconds.
                      social_media_credentials:
                        type: object
                        properties:
                          twitter_username:
                            type: string
                            description: The instagram handle for the membership
                          instagram_username:
                            type: string
                            description: The instagram handle for the membership
                          tiktok_username:
                            type: string
                            description: The tiktok username associated with the membership
                        additionalProperties: false
                        required:
                        - twitter_username
                        - instagram_username
                        - tiktok_username
                    additionalProperties: false
                    required:
                    - id
                    - external_user_id
                    - wallet_address
                    - on_chain_token_id
                    - created_at
                additionalProperties: false
                required:
                - membership
      description: ''
  /v2/program-memberships/{program_membership_id}/add-trait:
    post:
      tags:
      - Memberships
      operationId: post_v2_program-memberships_program_membership_id_add-trait
      summary: Endpoint to add a trait to a program membership
      parameters:
      - name: program_membership_id
        in: path
        required: true
        description: the program membership id
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  traits:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                          description: trait name
                        value:
                          type: string
                          description: trait value
                      additionalProperties: false
                      required:
                      - name
                      - value
                additionalProperties: false
                required:
                - traits
      description: ''
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                trait_value:
                  type: string
                  description: value of the trait
                trait_name:
                  type: string
                  description: name of the trait
              required:
              - trait_value
              - trait_name
          multipart/form-data:
            schema:
              type: object
              properties:
                trait_value:
                  type: string
                  description: value of the trait
                trait_name:
                  type: string
                  description: name of the trait
              required:
              - trait_value
              - trait_name
  /v2/program-memberships/{program_membership_id}/remove-trait:
    post:
      tags:
      - Memberships
      operationId: post_v2_program-memberships_program_membership_id_remove-trait
      summary: Endpoint to remove a trait from a program membership
      parameters:
      - name: program_membership_id
        in: path
        required: true
        description: the program membership id
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  traits:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                          description: trait name
                        value:
                          type: string
                          description: trait value
                      additionalProperties: false
                      required:
                      - name
                      - value
                additionalProperties: false
                required:
                - traits
      description: ''
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                trait_value:
                  type: string
                  description: value of the trait
                trait_name:
                  type: string
                  description: name of the trait
              required:
              - trait_value
              - trait_name
          multipart/form-data:
            schema:
              type: object
              properties:
                trait_value:
                  type: string
                  description: value of the trait
                trait_name:
                  type: string
                  description: name of the trait
              required:
              - trait_value
              - trait_name
  /v2/program-memberships/{program_membership_id}/set-image:
    post:
      tags:
      - Memberships
      operationId: post_v2_program-memberships_program_membership_id_set-image
      summary: Endpoint to set an image for a program membership
      parameters:
      - name: program_membership_id
        in: path
        required: true
        description: the program membership id
        schema:
          type: string
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  membership:
                    type: object
                    properties:
                      id:
                        type: string
                        description: The ID of the membership
                      external_user_id:
                        type: string
                        description: The external user id for the membership
                      wallet_address:
                        type: string
                        description: The wallet address for the membership
                      on_chain_token_id:
                        type: string
                        description: The on chain token id for the membership
                      created_at:
                        type: number
                        description: When the membership was created, in epoch seconds.
                      social_media_credentials:
                        type: object
                        properties:
                          twitter_username:
                            type: string
                            description: The instagram handle for the membership
                          instagram_username:
                            type: string
                            description: The instagram handle for the membership
                          tiktok_username:
                            type: string
                            description: The tiktok username associated with the membership
                        additionalProperties: false
                        required:
                        - twitter_username
                        - instagram_username
                        - tiktok_username
                    additionalProperties: false
                    required:
                    - id
                    - external_user_id
                    - wallet_address
                    - on_chain_token_id
                    - created_at
                additionalProperties: false
                required:
                - membership
      description: ''
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                image_url:
                  type: string
                  description: url of the image
              required:
              - image_url
          multipart/form-data:
            schema:
              type: object
              properties:
                image_url:
                  type: string
                  description: url of the image
              required:
              - image_url
  /v2/program-memberships/{program_membership_id}:
    patch:
      tags:
      - Memberships
      operationId: patch_v2_program-memberships_program_membership_id
      summary: Endpoint to update a program membership with a wallet_address, on_chain_token_id, and/or external_user_id
      parameters:
      - name: program_membership_id
        in: path
        required: true
        schema:
          type: number
      responses:
        '200':
          description: Membership was updated with provided wallet_address, on_chain_token_id, and/or external_user_id
          content:
            application/json:
              schema:
                type: object
                properties:
                  membership:
                    type: object
                    properties:
                      id:
                        type: string
                        description: The ID of the membership
                      external_user_id:
                        type: string
                        description: The external user id for the membership
                      wallet_address:
                        type: string
                        description: The wallet address for the membership
                      on_chain_token_id:
                        type: string
                        description: The on chain token id for the membership
                      created_at:
                        type: number
                        description: When the membership was created, in epoch seconds.
                      social_media_credentials:
                        type: object
                        properties:
                          twitter_username:
                            type: string
                            description: The instagram handle for the membership
                          instagram_username:
                            type: string
                            description: The instagram handle for the membership
                          tiktok_username:
                            type: string
                            description: The tiktok username associated with the membership
                        additionalProperties: false
                        required:
                        - twitter_username
                        - instagram_username
                        - tiktok_username
                    additionalProperties: false
                    required:
                    - id
                    - external_user_id
                    - wallet_address
                    - on_chain_token_id
                    - created_at
                additionalProperties: false
                required:
                - membership
      description: Sets a wallet_address, on_chain_token_id, and/or external_user_id on the specified program_membership.
      requestBody:
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                wallet_address:
                  type: string
                  description: the wallet address to update the program membership with
                on_chain_token_id:
                  type: string
                  description: the on chain token id to update the program membership with
                external_user_id:
                  type: string
                  description: the external user id to update the program membership with
          multipart/form-data:
            schema:
              type: object
              properties:
                wallet_address:
                  type: string
                  description: the wallet address to update the program membership with
                on_chain_token_id:
                  type: string
                  description: the on chain token id to update the program membership with
                external_user_id:
                  type: string
                  description: the external user id to update the program membership with
  /v2/program-memberships/search:
    get:
      tags:
      - Memberships
      operationId: get_v2_program-memberships_search
      summary: Endpoint to find a program membership by external_user_id
      parameters:
      - name: external_user_id
        in: query
        description: the external user id to update the program membership with
        schema:
          type: string
      responses:
        '200':
          description: Membership was found with provided wallet_address, on_chain_token_id, and/or external_user_id
          content:
            application/json:
              schema:
                type: object
                properties:
                  membership:
                    type: object
                    properties:
                      id:
                        type: string
                        description: The ID of the membership
                      external_user_id:
                        type: string
                        description: The external user id for the membership
                      wallet_address:
                        type: string
                        description: The wallet address for the membership
                      on_chain_token_id:
                        type: string
                        description: The on chain token id for the membership
                      created_at:
                        type: number
                        description: When the membership was created, in epoch seconds.
                      social_media_credentials:
                        type: object
                        properties:
                          twitter_username:
                            type: string
                            description: The instagram handle for the membership
                          instagram_username:
                            type: string
                            description: The instagram handle for the membership
                          tiktok_username:
                            type: string
                            description: The tiktok username associated with the membership
                        additionalProperties: false
                        required:
                        - twitter_username
                        - instagram_username
                        - tiktok_username
                    additionalProperties: false
                    required:
                    - id
                    - external_user_id
                    - wallet_address
                    - on_chain_token_id
                    - created_at
                additionalProperties: false
                required:
                - membership
      description: Finds a program membership by external_user_id.
  /v2/program-memberships/{program_membership_id}/level:
    get:
      tags:
      - Memberships
      operationId: get_v2_program-memberships_program_membership_id_level
      summary: Retrieve the current level or tier, as well as earned points (XP) for a program membership.
      parameters:
      - name: program_membership_id
        in: path
        required: true
        description: the program membership id
        schema:
          type: string
      responses:
        '200':
          description: Returns details successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  level:
                    type: object
                    properties:
                      tier:
                        type: string
                        description: Tier name
                      balance:
                        type: number
                        description: XP balance
                    additionalProperties: false
                    required:
                    - tier
                    - balance
                additionalProperties: false
                required:
                - level
        '404':
          description: Could not find the program membership provided.
      description: Invoke this endpoint to return the tier and earned points (XP) for a given program membership id.
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key