API Tokens and Webhooks: How to Set Up Programmatic Access
The API and Webhooks section allows you to manage programmatic access to your B2B Dashboard and configure real-time event notifications to external systems.
Accessing API & Webhooks
Navigate to Admin > API in the sidebar. The page is organized into two tabs: API and Webhooks.
API Tab
API Tokens
API tokens allow external applications and scripts to authenticate with the B2B Dashboard API.
Creating a Token:
- Click the Create Token button
- Enter a name for the token to identify its purpose
- Select the permissions/scopes for the token
- Click Create
Important: The token secret is shown only once after creation. Copy it immediately and store it securely. You will not be able to see the full token again.
Managing Tokens:
- Each token in the list shows its name, permissions, creation date, and last used date
- Tokens can be deleted individually
- Use descriptive names to track which integration each token belongs to
Token Security Best Practices:
- Rotate tokens periodically
- Delete unused tokens
- Use the minimum permissions needed for each integration
- Never expose tokens in client-side code or version control
API Base URL
The API base URL is displayed at the top of the API tab. Use this as the root for all API requests. A View API Docs link provides documentation for available endpoints.
Webhooks Tab
Webhooks send HTTP notifications to external URLs when specific events occur in your B2B Dashboard.
Creating a Webhook
- Click the Add Webhook button
- Configure:
- Event — Select the event that triggers this webhook (see events below)
- URL — The endpoint that will receive the HTTP POST request
- Active — Toggle to enable immediately
- Click Save
Available Webhook Events
- User Created — A new user account is created
- User Deleted — A user account is deleted
- User Enrolled — A user is enrolled in a course
- User Unenrolled — A user is removed from a course
- Enrollment Completed — A user completes a course
- Team Created — A new team is created
- Team Deleted — A team is deleted
- Order Completed — An order is successfully processed
- Order Refunded — An order is refunded
- And more
Managing Webhooks
- Each webhook shows the event type, target URL, active status, and last sent timestamp
- Use the Active toggle to enable or disable individual webhooks
- Edit the URL or event type as needed
- Delete webhooks that are no longer needed
Webhook Delivery
- Webhooks are sent as HTTP POST requests with a JSON payload
- The payload includes event type, timestamp, and relevant data
- Failed deliveries are retried automatically
- The Last Sent timestamp helps monitor webhook health