Skip to main content
botas logo

botas-fastapi

A lightweight, multi-language library for building Microsoft Teams bots — this is the FastAPI integration package.

Wraps botas with a FastAPI server for zero-boilerplate bot hosting.

Installation

pip install botas-fastapi

Quick start

from botas_fastapi import BotApp

app = BotApp()

@app.on("message")
async def on_message(ctx):
    await ctx.send(f"You said: {ctx.activity.text}")

app.start()

Manual FastAPI wiring

For full control over routes, middleware, and server lifecycle:

from botas import BotApplication
from botas_fastapi import bot_auth_dependency
from fastapi import Depends, FastAPI, Request

bot = BotApplication()

@bot.on("message")
async def on_message(ctx):
    await ctx.send(f"You said: {ctx.activity.text}")

app = FastAPI()

@app.post("/api/messages", dependencies=[Depends(bot_auth_dependency())])
async def messages(request: Request):
    body = await request.body()
    await bot.process_body(body.decode())
    return {}

API

BotApp

High-level wrapper that composes a BotApplication with a FastAPI + Uvicorn server.

Method Description
on(type, handler) Register a handler for an activity type (also works as a @decorator)
on_invoke(name, handler) Register a handler for an invoke activity by name (also works as a @decorator)
use(middleware) Add a middleware to the turn pipeline
start() Start the FastAPI/Uvicorn server

Options

BotApp accepts BotApplicationOptions plus these additional keyword arguments:

Option Default Description
port 3978 (or PORT env) HTTP listen port
path /api/messages Endpoint path for incoming activities
auth Auto (enabled when client_id is set) Enable/disable JWT auth middleware

Authentication options

Inherited from BotApplicationOptions — see the botas package README for the full list of authentication options and environment variables.

Documentation

License

MIT

Metadata

Release files for botas-fastapi 0.3.83

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for botas-fastapi 0.3.83
File Size Uploaded
botas_fastapi-0.3.83.tar.gz 6.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for botas-fastapi 0.3.83
File Interpreter ABI Platform
botas_fastapi-0.3.83-py3-none-any.whl Python 3 none any Details

Total release size: 12.2 kB

Release files / botas_fastapi-0.3.83.tar.gz

Download URL botas_fastapi-0.3.83.tar.gz
Size 6.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e9631c6add48b4e7c9b55fc2f0ec064247db393a52177265e4d952f87a143510
BLAKE2b-256 checksum
How to use checksums
85af02bf508b65ef8fb689fa4a4ba536534f5fc923dcd533f44fda3f43c6b1e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 2, 2026.

Transparency log

Release files / botas_fastapi-0.3.83-py3-none-any.whl

Download URL botas_fastapi-0.3.83-py3-none-any.whl
Size 5.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
032373eb823ccef24e2a0fdcc9108a3616430352360741c46f6f2691fb4e3f86
BLAKE2b-256 checksum
How to use checksums
600db3bbfb9980befe132b2e45811209f56911b1627244e83ade23ee7fa0dfc8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 2, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.83 This release

2 release files

0.3.61

2 release files

0.3.33

2 release files

0.3.31

2 release files

0.3.25

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page