Table of Contents
How to enable Sotion’s outbound webhooks
- Email Sign Up
- Restricted Email List
- Paid Membership (Stripe, Lemon Squeezy, or Gumroad)
Sotion Membership Management Webhooks Documentation
Create a new webhook
- From the Manage Webhooks screen, click Add New Webhook
- Enter a name, secret, and URL for your webhook. Also select the events you want to receive
- Name: The display name to identify your webhook in Sotion
- Secret: A secret value to validate the event is coming from Sotion. You can enter your own value, or generate a random value. This value will be added as a
x-webhook-secret
header to every request. - URL: The URL of your webhook. Must be able to receive
POST
request withJSON
payload - Events: Select the Sotion events that will be sent to your wehbook
When will Sotion trigger the webhook?
- When a new member is added via the Sotion Dashboard → Settings → Members
- When a new member signs up via your Sotion site (applicable to sites configured with Email Signup, Restricted Email List, and Paid Membership options)
- When a new member is added via the Sotion Members API: CREATE MEMBER
- When a member is deleted via the Sotion Dashboard → Settings → Members
- When a member is deleted via the Sotion Members API: DELETE MEMBER
What information will be sent to the webhook?
// request method
method: 'POST'
// headers
headers: {
'X-Webhook-Secret': {webhook.secret},
'Content-Type': 'application/json',
}
// body payload
body: JSON.stringify({
eventType: {'member.created' | 'member.deleted'},
siteId: 'E2LSI6JG7CRB8',
status: 'active',
domain: 'your.custom.domain',
pageUrl: `https://your.notion.site/page-name`,
authType: {'email', 'whitelist', 'stripe', 'lemonsq', 'gumroad'},
member: {
email: 'member@email.com',
uuid: 'af566bb1-fdb2-46c5-ae28-edgc49abfo73',
externalId: 'some-external-id-you-can-choose',
registeredAt: '2024-04-29T14:08:21.094Z',
verified: {true | false},
blocked: {true | false},
paid: {true | false},
loginToken: '2024-05-02T11:19:58.018Z'
}
}