Skip to the main content.
Talk to sales Start for free
Talk to sales Start for free

1 min read

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

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

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

Subscribe to Paubox Weekly

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