Bonzai Business API
Welcome to the documentation for the Bonzai API, the programming interface for our content creator-focused platform.
Notice: API in Beta Version
Please be aware that the Bonzai API is currently in its beta version. We welcome your feedback and suggestions to improve its functionality and user experience. For any comments or useful remarks, feel free to reach out to us at contact@bonzai.pro. Your input is invaluable in helping us refine and enhance the API.
API access
Access to the Bonzai API is exclusively reserved for Bonzai Pro members.
Authentication System
The Bonzai API utilizes a bearer token authentication system to ensure secure access to its services. The token must be included in the Authorization header of every request made to the API.
Obtaining Your Token
To obtain your API token, simply visit: https://www.bonzai.pro/user/profile and then navigate to "Manage API Tokens".
Product Invitation
This route enables Pro members to grant their customers access to products without needing to go through the Bonzai checkout process.
Pro members can activate products seamlessly for promotional offers or when using external checkout systems, diversifying sales and marketing strategies beyond the Bonzai checkout process.
Grant access to a product
POST
https://www.bonzai.pro/api/v1/products/{product_uuid}/invite
This function grants access to a product by requiring an email. If the email matches a Bonzai user, it grants direct access. Otherwise, it sends an email invitation with a one-click link to create and activate the account.
You can find the product_uuid
in any product-related URL: https://www.bonzai.pro/products/xBgq3Z3J
Path Parameters
product_uuid
String
Can be found in any product-related URL.
Request Body
email*
String
Must be a valid email address.
name
String
Useful when the Bonzai user doesn't exist. If only an email is provided, we assume the name from the email's prefix (before the @)
code
String
Can be used to revoke specific access or a set of accesses. Multiple invitations can share the same code.
Understanding code
parameter
code
parameterThe code
parameter plays a crucial role in managing access to your products. This parameter empowers you to grant or revoke access efficiently.
Granting Access
When you use the Bonzai API to grant access to a product, you can include the code
parameter. This allows you to assign a code to the granted access, ensuring precise control.
Revoking Access
Conversely, when you need to revoke access to a product, you can provide the associated code
parameter. This action removes access not only for the individual who initiated it but for all individuals who share the same code.
Two Usage Scenarios
Individualized Codes: You have the option to assign a distinct code to each individual, enabling personalized access control, such as managing individual subscriptions. You might use a Stripe subscription ID, an email address any internal ID you have if your workflow.
Shared Codes: Alternatively, you can utilize the same code for multiple users. This is particularly useful when offering time-limited free promotions or other scenarios where several individuals should have access using the same code.
By grasping the significance of the code
parameter in the Bonzai API, you gain the flexibility to adapt your access control strategy to various use cases and business models seamlessly.
Product Revocation
This route enables Pro members to revoke their customers product access.
This functionality is particularly useful in scenarios such as when a subscription is no longer active, or when a limited-time offer concludes, allowing Pro members to manage their product offerings effectively and responsively.
Revoke access to a product
POST
https://www.bonzai.pro/api/v1/products/{product_uuid}/revoke
This function revokes access to a product.
You can revoke access using applicable filters such as access id, user_id, email, or code.
You must provide at least one valid filter.
Query Parameters
product_uuid*
String
Can be found in any product-related URL.
Request Body
user_id
String
As provided in the invite request response
String
Only search for invited members (not Bonzai user yet). Not recommended to use.
code
String
The same invite code you provided using the invite route.
In the next page, you will see a practical example illustrating how to automate Stripe subscription management using the Bonzai API and Zapier.
Last updated