1 min read

How to add and delete contacts in bulk using the Paubox Marketing API

Snow-capped mountain range across calm ocean water

Last week we wrote about how we extended the functionality of the Paubox Marketing API by adding campaign mailings as an API endpoint.

This week we're going to cover how to add and delete contacts in bulk using the Paubox Marketing API.

 

Paubox Marketing API

In a nutshell, the Paubox Marketing API is a growing collection of API endpoints we've exposed to allow customers greater flexibility. The goal here is to make Paubox Marketing, our HIPAA compliant email marketing platform, easier to use.

 

Adding Contacts in Bulk with Paubox Marketing API

Using Ruby as an example, here's how you can add contacts in bulk via Paubox Marketing API. First, let's start with a few parameters:
{
    "subscriber_ids" : "[string]", //required - will delete from default subscription list
    "subscription_list" : "string" //optional - populate to delete id's from specific list
}
Now let's see some Ruby:
    
    def bulk_create
      unless params[:subscribers]&.present?
        render json: {}
        return
      end

      subs = SubscribersCreator.call(
        api_customer: @api_customer,
        subscribers_data: params[:subscribers],
        subscription_list_id: params[:subscription_list_id],
        email: params[:email]
      )

      num_subscribers_added = subs[:created_count]
      render json: {
        data: {
          num_subscribers_added: num_subscribers_added,
          errors: subs[:errors]
        }
      }
    end

Deleting Contacts in Bulk with Paubox Marketing API

Sticking with Ruby as an example, here's how you can delete contacts in bulk via Paubox Marketing API.
    def bulk_delete
      unless params[:subscriber_ids]
        render json: {}
        return
      end

      SubscribersDeleter.call(
        api_customer: @api_customer,
        subscriber_ids: params[:subscriber_ids],
        subscription_list_id: params[:subscription_list_id]
      )

      render json: {}
    end

Paubox Marketing

Prior to its launch, healthcare providers were stuck with generic messaging because it was impossible to personalize email with patient information without violating HIPAA regulations. Now you can send your patients personalized messages that include PHI using our HIPAA compliant email marketing service, Paubox Marketing.
  • Grow your business. Send targeted, personalized messages that resonate with your audience.
  • Increase patient engagement. Drive engagement by including PHI in your HIPAA compliant email campaigns to create personalized and relevant messaging.
  • Track results. Access real-time analytics to track marketing campaign performance.
  • Improve patient outcomes. Ensure that patients don't miss vital treatment by sending email reminders and recommendations for additional services.

 

Paubox Marketing is HITRUST CSF certified and is free to use for up to 100 contacts. The free plan also includes a business associate agreement.

 

Kickstart your HIPAA compliant email marketing with Paubox Marketing
Marina with sailboats docked at a waterfront with snow-capped mountains in the background

Campaign mailings added as an API endpoint to Paubox Marketing

A few weeks ago, we wrote aboutthree things you didn’t know you could do with Paubox Marketing API. In a nutshell, the Paubox Marketing API is a...

Read More
Night street scene with illuminated buildings and green-tinted atmosphere

How to fetch Paubox Marketing analytics via API

The Paubox Marketing API is a growing collection of API endpoints we’ve exposed to allow customers greater flexibility to Paubox Marketing, our HIPAA...

Read More
Wooden boardwalk overlooking a river lined with evergreen trees

How to "export" your analytics with the Paubox Marketing API

Earlier this month, we shared our API first approach to HIPAA compliant marketing automation. In essence, we outlined how we're building API...

Read More

Subscribe to Paubox Weekly

Every Friday we bring you the most important news from Paubox. Our aim is to make you smarter, faster.