Socio
The Partner API (a.k.a sub-accounts) is a unique feature provided by ChatBotKit to facilitate the development of Software as a Service (SaaS) solutions built on top of ChatBotKit versatile AI platforms. It allows the creation separate user accounts with unique configurations and restrictions, offering a customizable and controlled environment for each of your customers. Each sub-account operates independently, hosting its own bots, integrations, conversations, analytics and settings.
Características principales
- Effortless SaaS Development: Simplify your SaaS solutions with ChatBotKit Partner API. Create separate sub-accounts with unique limits, restrictions, and configurations.
- Unique Account Management: Each sub-account operates independently, hosting its own conversations and settings, providing greater customization and control.
- Comprehensive SDK Implementation: Fully implemented within our SDK, the Partner API offers a seamless and efficient integration experience.
- Integration with Popular Frameworks: We support direct integrations with popular frameworks such as NextAuth.js, making it even easier to incorporate our Partner API into your projects.
Primeros pasos
You can create sub-accounts from the Dashboard or the API. In the dashboard simply navigate to the Partner section of the website. Click “Create Sub-account” button to create a new account. You can now switch to the account and use it as would normally use your ChatBotKit master account.
Remember that the sub-account shares limits with the master account. You may require higher or even custom tier plans to accommodate your growing user-base.
To get started with the ChatBotKit Partner API, first you will need to generate and provide an Authorization Bearer token. See the documentation for more information about how API authentication and authorization works. This token will be used in the header of your requests to authenticate your account.
Here's an example of how to create a new sub-account under a partner account:
POST /v1/partner/user/create HTTP/1.1 Host: api.chatbotkit.com Authorization: Bearer {your_token_here} Content-Type: application/json { "name": "New SaaS Customer" }
The API will return the ID of the sub-account after it has been successfully created:
HTTP/1.1 200 OK Content-Type: application/json { "id": "sub_account_user_id" }
When interacting with these sub-accounts, you will need to add an extra header to your request. Here's an example of how to complete a specific conversation within the context of a sub-account:
POST /v1/conversation/{conversation_id}/complete HTTP/1.1 Host: api.chatbotkit.com Authorization: Bearer {your_token_here} X-RunAs-UserId: {sub_account_user_id} Content-Type: application/json { "text": "Hi there!" }
Notice the X-RunAs-UserId
header. The header contains the ID of your sub-account that you want to interact with.
All other APIs are fully compatible with the partner account setup. Partner API configuration is also possible through the ChatBotKit SDKs.
See the ChatBotKit Whitelabel code repository for an example how the partner API is utilised to build a fully-working micro SaaS no top of ChatBotKit platform.
Further Reading
Are you ready to start building your SaaS solution with conversational AI? Our comprehensive Partner API documentation provides everything you need to get started. Dive deeper into our Partner API documentation and visit our OpenAPI specification page for the full experience.
Únase a nosotros en la era del desarrollo SaaS. Dé rienda suelta a la potencia de ChatBotKit Partner API, porque cuando se trata de crear soluciones SaaS, creemos en hacer las cosas más fáciles, no más difíciles.
Contact Us
We invite you to reach out to our dedicated support team to get early access to the partner program. We are here to help you with any questions or issues you may have as you navigate through the Partner API and build your SaaS solution. We look forward to embarking on this journey with you!