Automating Sub-Account Creation via Zapier
This guide explains how to use Zapier to automatically create new sub-accounts (locations) within your CRM agency. This process utilizes the CRM's public API and requires a Pro subscription. It is intended for advanced integration purposes and involves using Zapier's premium webhook feature.
Important Notes:
- This method is for informational purposes and involves custom API integration. The standard support team does not provide assistance for API or custom Zapier integrations.
- For API-related help, you can join the developer community or attend monthly developer calls. The developer website contains full API documentation.
- The automated "Add Account" action within the native Zapier integration is no longer available. This guide uses a custom webhook approach.
- Zapier webhooks are a premium feature and require a paid Zapier plan.
Prerequisites
Before you begin, ensure you have the following:
- A Pro subscription for your CRM agency.
- A paid Zapier account with access to webhooks.
- Your Agency API Key, which you can find in your agency settings under API Keys.
Step 1: Set Up the Zapier Trigger
The first step is to create a Zap that will initiate the sub-account creation process.
- Log in to your Zapier account and create a new Zap.
- For the trigger, select the "Capture Hook" action from Zapier's webhook app. This will generate a unique webhook URL.
- Copy this webhook URL, as you will need it for the next step.
Step 2: Create a Workflow in Your CRM
Next, you need to set up a workflow within your CRM that will send data to the Zapier webhook.
- Inside your CRM, create a new workflow.
- Add a starting point, such as a form submission.
- Add a workflow action and select the "Webhook" action.
- Paste the Zapier webhook URL you copied in the previous step into the webhook action.
- Save the workflow and test it by submitting the form with sample data. This step is critical, as Zapier needs sample data to map fields in the subsequent steps.
Step 3: Configure the Location Creation in Zapier
Return to Zapier to configure the action that will create the sub-account.
- In your Zap, add a new action. Select the webhooks app again, but this time choose the "Custom Request" action.
- Set the action event to POST.
- In the URL field, enter the API endpoint for creating locations:
. - In the data section, you will construct the payload. Use the sample data from your workflow test to map the necessary fields. A typical payload includes details for the new location, such as:
- Business name, address, and contact information.
- Settings for the new account.
- Optionally, a snapshot ID to pre-load a template.
- For authentication, you will need to use your Agency API Key. Zapier will prompt you to set up authentication for this step; select API Key authentication and enter your key.
Step 4: Test the Integration
After configuring the action, test the Zap to ensure it works correctly.
- In Zapier, continue to the testing step and run a test.
- Zapier will use the sample data from your workflow test to send a request to the CRM API.
- If successful, a new location will be created under your agency.
Step 5: Create a User for the New Location
The final step is to create a user account for the new location. This requires a separate API call.
- Add another "Custom Request" action to your Zap.
- Use the POST method and the appropriate API endpoint for creating users.
- Construct a payload that includes the user's email, name, and assigns them to the newly created location ID (which should be returned from the previous step).
- Run a final test to create the user.
Troubleshooting
I don't see data to map in Zapier.
This usually means the initial workflow test was not completed. Return to your CRM workflow and submit the form at least once to send sample data to Zapier.
The webhook is not firing from the workflow.
Double-check that the webhook URL in your CRM workflow action is correct and that the workflow is published and active. Ensure the trigger condition (e.g., form submission) is being met.