Covers all 5 Botpress APIs: Admin, Chat, Files, Runtime, and Tables (144 endpoints)
MEAI AIFunction tools for use with any IChatClient
Same day update to support new features
Updated and supported automatically if there are no breaking changes
All modern .NET features - nullability, trimming, NativeAOT, etc.
Usage
1 2 3 4 5 6 7 8 910111213
usingBotpress;// Authenticate with a Personal Access Tokenusingvarclient=newBotpressClient(apiKey);// Admin API - list bots in a workspaceawaitclient.Admin.AdminListBotsAsync(xWorkspaceId:"your-workspace-id");// Runtime API - list conversations for a botawaitclient.Runtime.RuntimeListConversationsAsync(xBotId:"your-bot-id");// Tables API - list tablesawaitclient.Tables.TablesListTablesAsync(xBotId:"your-bot-id");
Getting Started
Basic example showing how to create a client and authenticate with the Botpress API.
12345678
// Create a Botpress client with your Personal Access Token (PAT)usingvarclient=newBotpressClient(apiKey);// The client provides access to Admin, Chat, Files, Runtime, and Tables sub-clientsvaradmin=client.Admin;varruntime=client.Runtime;varfiles=client.Files;vartables=client.Tables;
List Bots
Example showing how to list bots in a workspace using the Admin API.
1234567
// Create a Botpress client and list bots in the workspaceusingvarclient=newBotpressClient(apiKey);varworkspaceId=GetWorkspaceId();// List all bots in the workspaceawaitclient.Admin.AdminListBotsAsync(xWorkspaceId:workspaceId);
AIFunction Tools
Example showing how to use Botpress operations as MEAI AIFunction tools with any IChatClient.
1 2 3 4 5 6 7 8 910111213
// Create a Botpress client and wrap operations as AIFunction toolsusingvarclient=newBotpressClient(apiKey);varworkspaceId=GetWorkspaceId();varbotId=GetBotId();// Create AIFunction tools for use with any IChatClientAIFunctionlistBots=client.AsListBotsTool(workspaceId);AIFunctiongetBot=client.AsGetBotTool(workspaceId);AIFunctionlistConversations=client.AsListConversationsTool(botId);AIFunctionlistMessages=client.AsListMessagesTool(botId);AIFunctiongetAnalytics=client.AsGetBotAnalyticsTool(workspaceId);// Tools can be added to ChatOptions.Tools for use with any IChatClient
Tables
Example showing how to work with tables for structured data storage.
1234567
// Create a Botpress client and list tablesusingvarclient=newBotpressClient(apiKey);varbotId=GetBotId();// List all tables associated with the botawaitclient.Tables.TablesListTablesAsync(xBotId:botId);