# Use Case: Adding Users through Zapier

## Option 1: Using Zapier's Softr app

Let's see how you can use the API to add users via Zapier. In this example, we are going to sync a Softr App with Google Sheets using Zapier's Softr app (this is solely for demonstration purposes, and we don't recommend storing user data on Google Sheets or similar sources). Let's proceed.

{% hint style="info" %}
Zapier's Softr app is currently in beta stage, and you can access it via the following invite: <https://zapier.com/developer/public-invite/148391/e483570d289c54541baaa7850f794b63/>
{% endhint %}

### Step 1: Setting the Trigger

First of all, we're going to create a spreadsheets with **Name**, **Email**, and **Password** columns to store user data.

![Users sheet](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0NiyhsmXAcV5u1c6XK%2Fuploads%2FfkzthZGwenWwP0t7Ddd2%2Fusers-sheet-b.png?alt=media\&token=2a2eb226-0b99-4e81-b402-7db3284d886e)

Further on, we'll create a Zap on Zapier and set the **trigger** for each new row creation in our Google sheet. See below.

![Setting the trigger](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0NiyhsmXAcV5u1c6XK%2F-MhUG7q_9kjYam43Leh4%2F-MhUIo2WuGr6KBhnVsAS%2Fsetting-trigger.gif?alt=media\&token=2bfc1fd6-dfc9-4c3f-8df5-443c5d5fd5e3)

Next, we'll test the trigger and proceed to configuring the **Action** to define what's going to happen when the initial event is triggered.

### Step 2: Configuring the Action

In the Action search bar enter "softr" and select the Softr app.

![Locating the Softr app](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0NiyhsmXAcV5u1c6XK%2Fuploads%2FcnJ9i2hvTX351vEU32dN%2Fsoftr-app-b.png?alt=media\&token=1abc0860-05d2-4b34-a530-9773e9ed8f2a)

Next, we are going to select the **Action Event**. In our case, we need to choose "**Create a user**."

![Choosing the Create User action event](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0NiyhsmXAcV5u1c6XK%2Fuploads%2FR8RA7TypON9DLmYxcyrB%2Fcreate-user-event-b.png?alt=media\&token=48fd8b9d-75a1-4b08-9ebe-45bb6d53111d)

Further on, we need to link our Softr account (by entering the [API key](https://softr.gitbook.io/softr-documentation/my-account/api-settings/..#generating-an-api-key)), then add the Application domain, map the **Email**, **Name**, and **Password** fields. We can also set to generate a [Magic Link](https://docs.softr.io/memberships/data/adding-users#magic-link), but we are going to set it to **False** in our case. See below.

![Connecting account and domain and mapping fields](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0NiyhsmXAcV5u1c6XK%2Fuploads%2FCDEizMKCf51jyd1lBZyC%2FScreen%20Recording%202021-12-21%20at%2015.36.37.gif?alt=media\&token=2f679994-0148-457a-bacc-192ed8431ac9)

That's it. Now, as soon as you activate your Zap, all the new users added to your spreadsheet, will be added to your selected Softr app as well.

## Option 2: Using Custom Webhook

In this use case, we are going to add users to a Softr app using Zapier's **Custom Webhook** instead of the Zapier Softr app. So, the first step (**Setting the Trigger**) is going to be similar to that of the [previous use case](https://softr.gitbook.io/softr-documentation/my-account/api-settings/..#use-case-adding-users-through-zapier-via-softr-app).

![Users data](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M0NiyhsmXAcV5u1c6XK%2Fuploads%2F3TaCYV10ICZYIWq749fP%2Fspreadsheets-b.png?alt=media\&token=41181b62-fc23-4925-9d27-6e21b9c7fe7a)

So, let's start with **Step 2**, where we are going to set up the **Action**.

### Step 2: Configuring the Action

In the Action search bar enter "webhook" and select **Webhooks by Zapier** (please note that this is a **paid** feature).

![Selecting Webhooks by Zapier](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0NiyhsmXAcV5u1c6XK%2F-MhUG7q_9kjYam43Leh4%2F-MhUJikq2p8kDo9xfOfX%2Fwebhooks-selection-b.png?alt=media\&token=ee437f89-a1d9-4d11-abc6-490625c4cc65)

In the following screen, we need to select **POST** as the **Action event** since we need to create a user using the POST request as described above.

In the next screen, we need to fill in all the necessary details based on the [create user endpoint](https://softr.gitbook.io/softr-documentation/my-account/api-settings/..#create-user). Thus, we need to set the **URL** to "<https://studio-api.softr.io/v1/api/users>", set the **Payload Type** to "json", and map the **data** as shown below.

![URL, Payload Type, and Data Mapping](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0NiyhsmXAcV5u1c6XK%2F-MhUG7q_9kjYam43Leh4%2F-MhULuAr-abTFnNckdLg%2Fmappings-b.png?alt=media\&token=530442fa-1939-42c5-924e-f3c7823da48b)

The following configs can be left intact, and we just need to add the **headers** using our **API key** and **domain** as shown below.

![Headers configured](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0NiyhsmXAcV5u1c6XK%2F-MhUG7q_9kjYam43Leh4%2F-MhUMoYeO8-YnWvJOFkC%2Fheaders-b.png?alt=media\&token=9d9b62da-7719-42b0-9585-97886a717144)

### Step 3: Testing the Action

That's it. Now, we just need to hit Continue and test the action. As you can see below, as soon as we do the test, the user we had added earlier on Google Sheets is added to our Softr app. So, as soon as you make sure it's working correctly, you can turn on the Zap to start the automation.

![Testing the Action](https://3426011356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M0NiyhsmXAcV5u1c6XK%2F-MhUMtdfLNM17ybVIVTr%2F-MhUO32uWgK5ijUnu3DR%2Ftesting-action.gif?alt=media\&token=5070b273-7932-4d31-a8e3-b146cc4e0d3e)

### Deleting a User

The [delete request](https://softr.gitbook.io/softr-documentation/my-account/api-settings/..#delete-user) can be implemented in a similar way through a custom webhook.
