Adding Members Automatically With Zapier
Set up two Zaps that add each new customer to your App's Access Groups and remove them when they cancel, using Webhooks by Zapier and the Snippet Generator.
Add and Remove Members From Zapier
Zapier connects your App to thousands of other tools, such as your sales platform, payment tool, membership platform or forms. Two Zaps can manage access for you: one adds each new customer to your App's Access Groups when they buy or join, and the other takes a group away when they cancel or are refunded. This page sets up both, start to finish.
The same method, URL, headers and body also work in Make's HTTP request module.
For how automatic adds and removals work in general, see Adding and Removing Members Automatically. For every field and response, see the Member Management API Reference.
Before You Start
- You're an App Admin in your ThoughtFlow App. Only App Admins can create API keys.
- Your Access Groups exist. See Access Groups.
- You can build Zaps in Zapier.
Create an API Key
Generate a key
In your App, go to App Settings > API Keys and click Generate Key. Name it so you'll know where it's used, such as Zapier. Leave Access Management checked and click Generate Key.
Copy it
Click Copy Key and keep the key somewhere safe until you paste it into Zapier. It's shown only once. Check "I have copied this key. I understand it will not be shown again." and click Done.
Your API key works like a password. Use this key only in Zapier, so you can revoke it without breaking your other tools. See API Keys.
Build the Add Request in ThoughtFlow
On the API Keys page, scroll to Snippet Generator:
- In Action, choose Add to Access Group.
- In Platform, choose Zapier.
- Leave Role on Member, and Reference By on Group ID.
- Under Access Groups, check the groups each new customer should get.
The card shows the Method, URL, Header 1, Header 2 and Data, each with Copy. Zapier calls the request body Data. Under the card, two notes apply to Zapier:
- "In Zapier, delete this placeholder and choose the email from your trigger."
- "In Zapier's Custom Request action, set Data Pass-Through to No, or Zapier ignores Data and the request fails."
Keep this page open while you build the Zap.
Build the Add Zap
Create the Zap
In Zapier, create a new Zap. The trigger can be any app that knows about your buyers, such as your sales platform, payment tool, membership platform or a form.
Add the Custom Request action
Add an action: Webhooks by Zapier, then the Custom Request event.
Paste the method, URL and headers
Copy each value from the Snippet Generator card into the action:
Method: POST
URL: https://app.thoughtflow.ai/api/v1/access/grant
Header name: Authorization
Header value: Bearer YOUR_API_KEY
Header name: Content-Type
Header value: application/json
Replace YOUR_API_KEY with the key you copied. Keep the word Bearer and the space after it.
Paste the data
Paste the Data from the card. It looks like this, with your own group's ID:
{
"email": "PERSON_EMAIL",
"access_group_id": "7b1c9a52-0000-4000-8000-000000000000"
}
Delete PERSON_EMAIL, keeping the quote marks, and choose the buyer's email from your trigger in its place.
If your other tool sends its own welcome message, add "send_invitation": false so your App doesn't send an invitation email too.
Turn off Data Pass-Through
Set Data Pass-Through to No. If it's left on, Zapier ignores Data and the request fails with "email is required."
Test and turn it on
Test the step, then turn the Zap on.
Build the Removal Zap
Build a second Zap the same way, with these changes:
Build the removal request
In the Snippet Generator, choose Remove from Access Group in Action, keep Zapier in Platform, and check the groups to take away. You get one card for each group, because each request removes one group.
Use an ending trigger
In Zapier, create a new Zap with a trigger for a cancellation or a refund.
Add one Custom Request action for each card
Add a Webhooks by Zapier Custom Request action for each card, and paste its values the same way. The URL is the remove address:
URL: https://app.thoughtflow.ai/api/v1/access/revoke
In each one, replace YOUR_API_KEY, choose the email from your trigger in place of PERSON_EMAIL, and set Data Pass-Through to No.
Test and turn it on
Test each step, then turn the Zap on.
Removing a group doesn't remove the person from your App. They keep your Open tools and anything their other groups give them.
Test Both Zaps
Run the add
Trigger the add Zap with your own email address, using a test Access Group.
Check your App
In your App, click Members in the top navigation. Find yourself and click your name to see your Access Groups.
Run the removal
Trigger the removal Zap with the same email, then check that the group is gone.
If nothing changed, look at Last Used for the key on the API Keys page. If it still says Never Used, no request with that key has reached your App. For error codes, see Troubleshooting.