We just raised $735,000 to introduce the world to multi-tenant WordPress.

Creating tenants with Zapier

The WPCS API can be used as an action in Zapier zaps. In this article, we will create a Zapier action that creates a tenant.

This article assumes you already have a Zapier account and are able to use the premium action Webhooks. Let’s start creating tenants with Zapier!

Add a Webhooks by Zapier action to your zap

Firstly, add an action using the app Webhooks by Zapier.

Add action

Then, choose the Action Event called POST.

Pick post action event

Press continue.

Set up your action

To set up the action, we need to fill in some data.

  • Data
  • Wrap
  • Request
  • In Array
  • File
  • Unflatten
  • Basic Auth
  • Headers


Fill in the URL field with https://api.eu1.wpcs.io/v1/tenants.

Payload Type

In the Payload Type dropdown, choose the JSON option. Any other option will not work.


The data we will send to the WPCS API is the actual description of the tenant we want to create. You can read more about how you can define the tenant data here.

For now, let’s assume the following:

  1. Your own administrative system has given your customer the unique ID 9999. This will be the external ID

    The external ID must be unique. When a tenant with a certain external ID already exists, WPCS will respond with a 409 Conflict HTTP status code. The reason this value must remain unique is because actions like deleting a tenant can be based on this value, if you would have two tenants with the same external ID, WPCS would not be able to tell which tenant should be deleted.
  2. You want the tenant to be created under the name Doe Corp.
  3. Your customer’s username should be johndoe.
  4. Your customer’s E-mail is john@doecorp.com.
  5. Your customer filled in the password 123verystrong123 in your signup form.

This means the data you filled in for the action so far should look like this:

Static data example

Of course, we don’t want to create the same tenant over and over again. The static values you have filled in (9999Doe Corp or 123verystrong123 for example) should be replaced by fields from the Zapier Trigger that precedes the action. You can read more about how data passes through Zapier zaps at https://zapier.com/help. When you have configured your Trigger properly, Zapier will show you the available options.


If you allow your customers to specify a password, make sure it is never displayed or stored in plain text.

Wrap Request In Array

Pick the No option.


The File field should be left empty.


Pick the Yes option.

Basic Auth

We need to authenticate Zapier to allow it to call the WPCS API. To do this, we need WPCS API keys. You can read more about those here. For now, let’s assume you have created an API key for Zapier. The created API key has the value 12345678-1234-1234-1234-1234567890ab, and its secret has the value 11112222333344445555.

Fill in the Basic Auth field with the following value, note the pipe symbol (|) separating the two values:



This field can be left as-is. The WPCS API does not require additional headers.

Test your action

After setting up the action as described above, you can test your action. With the data above, the test section should look something like this:

Action test section

When you test the action, you should see a new tenant be created in the WPCS Console under the product you made your API key for.


Be sure to clean up your test tenants to avoid incurring unnecessary costs. Go to the tenant and click ‘Delete tenant’ under the ‘Actions’ dropdown.

Related articles

Migrate to WPCS with WPCS Migration Plugin

You can get your sites up and running on the WPCS platform using our free WordPress Migration plugin

Build a Shopify SaaS Clone using WordPress, WooCommerce, WPCS & Kubernetes

Build a WPCS Product in 5 Steps

Build a scalable WordPress SaaS or WaaS (Website as a Service

How to automate your Website as a Service (WaaS) - Storefront included!

How to automate the sale and launch of your websites using a storefront with the WPCS API, WooCommerce, and Uncanny Automator.

Webinar: Merge Sites, Automate, and the Versioning System

Merging your agency’s website portfolio in WPCS where each website has a different tech stack, automate your business with a storefront, and continuously develop your sites like a SaaS.

Getting started with the WPCS Intro Series

Launch your WordPress SaaS in 5 easy steps

Importing A Site Using the WPCS CLI

Using LocalWP to install and build our local WP installation and send it to WPCS with the CLI

Plugin name




The WPCS API can be used as an action in Zapier zaps. In this article, we will create a Zapier action that creates a tenant. This article assumes you already have a Zapier account and are able to use the premium action Webhooks.

Code Snippet