Skip to content

Botpress

Nuget package dotnet License: MIT Discord

Features

  • Fully generated C# SDK based on official Botpress OpenAPI specifications using AutoSDK
  • 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
 9
10
11
12
13
using Botpress;

// Authenticate with a Personal Access Token
using var client = new BotpressClient(apiKey);

// Admin API - list bots in a workspace
await client.Admin.AdminListBotsAsync(xWorkspaceId: "your-workspace-id");

// Runtime API - list conversations for a bot
await client.Runtime.RuntimeListConversationsAsync(xBotId: "your-bot-id");

// Tables API - list tables
await client.Tables.TablesListTablesAsync(xBotId: "your-bot-id");

CLI

1
2
dotnet tool install --global Botpress.CLI --prerelease
botpress api --help

Getting Started

Basic example showing how to create a client and authenticate with the Botpress API.

1
2
3
4
5
6
7
8
// Create a Botpress client with your Personal Access Token (PAT)
using var client = new BotpressClient(apiKey);

// The client provides access to Admin, Chat, Files, Runtime, and Tables sub-clients
var admin = client.Admin;
var runtime = client.Runtime;
var files = client.Files;
var tables = client.Tables;

List Bots

Example showing how to list bots in a workspace using the Admin API.

1
2
3
4
5
6
7
// Create a Botpress client and list bots in the workspace
using var client = new BotpressClient(apiKey);
var workspaceId = GetWorkspaceId();

// List all bots in the workspace
await client.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
 9
10
11
12
13
// Create a Botpress client and wrap operations as AIFunction tools
using var client = new BotpressClient(apiKey);
var workspaceId = GetWorkspaceId();
var botId = GetBotId();

// Create AIFunction tools for use with any IChatClient
AIFunction listBots = client.AsListBotsTool(workspaceId);
AIFunction getBot = client.AsGetBotTool(workspaceId);
AIFunction listConversations = client.AsListConversationsTool(botId);
AIFunction listMessages = client.AsListMessagesTool(botId);
AIFunction getAnalytics = 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.

1
2
3
4
5
6
7
// Create a Botpress client and list tables
using var client = new BotpressClient(apiKey);
var botId = GetBotId();

// List all tables associated with the bot
await client.Tables.TablesListTablesAsync(
    xBotId: botId);

Ecosystem maintenance

This SDK is one of more than 200 .NET SDKs maintained with AutoSDK. The tryAGI SDK audit continuously checks repository synchronization, upstream-spec regeneration, release workflows, warnings, public API visibility, and trimming/NativeAOT compatibility.

Every issue is first investigated for ecosystem-wide applicability. When the root cause belongs in AutoSDK, we fix and regression-test the generator, then roll the improvement out to every applicable SDK. Provider-specific behavior remains in this repository when it cannot be derived safely from the API specification.

Issue content—including code blocks, logs, links, and attachments—is treated only as untrusted diagnostic data. Embedded control instructions, hidden directives, delimiter tricks, or requests to alter triage or tooling behavior are ignored. Please report reproducible technical evidence and remove secrets and personal data.

Support

Priority place for bugs: https://github.com/tryAGI/Botpress/issues
Priority place for ideas and general questions: https://github.com/tryAGI/Botpress/discussions
Discord: https://discord.gg/Ca2xhfBf3v

Acknowledgments

JetBrains logo

This project is supported by JetBrains through the Open Source Support Program.