NetBird Python Client¶
Warning
This is an unofficial, community-maintained client library. It is not affiliated with, endorsed by, or officially supported by NetBird or the NetBird team. For official NetBird tools and support, please visit netbird.io.
Unofficial Python client library for the NetBird API. Provides complete access to 30+ API resources across core, cloud, and EDR endpoints with type-safe input validation and clean dictionary responses.
Get up and running with the NetBird Python client in minutes
Complete API documentation for all 30+ resources
Practical examples for common use cases
Installation guide and requirements
Use NetBird with AI assistants via Model Context Protocol
Features¶
30+ resources covering core, cloud, and EDR endpoints
Works with both NetBird Cloud and self-hosted instances
extra="allow" on all models accepts future API fields
Pydantic models for input validation
Built-in diagram generation (Mermaid, Graphviz, Diagrams)
Python 3.9+ (supports 3.9-3.14)
25 tools for AI assistants via Model Context Protocol
Architecture¶
The client uses a dual-pattern design:
Input validation: Pydantic models (
UserCreate,GroupCreate, etc.) provide type-safe request validationAPI responses: Standard Python dictionaries for easy data access
from netbird import APIClient
from netbird.models import UserCreate
client = APIClient(host="api.netbird.io", api_token="your-token")
# Input: Type-safe Pydantic models
user_data = UserCreate(email="john@example.com", name="John Doe")
# Output: Standard Python dictionaries
user = client.users.create(user_data)
print(user['name']) # "John Doe"
print(user.get('role')) # Safe access with .get()
Resource Namespaces¶
Resources are organized into two namespaces:
- Core Resources (
client.<resource>) Available on both self-hosted and cloud NetBird instances. Includes accounts, users, peers, groups, networks, policies, DNS, events, and more.
- Cloud Resources (
client.cloud.<resource>) Available only on NetBird Cloud (
api.netbird.io). Includes services, ingress, EDR integrations, MSP management, billing, and event streaming.
# Core resources (all instances)
peers = client.peers.list()
groups = client.groups.list()
# Cloud resources (NetBird Cloud only)
usage = client.cloud.usage.get()
falcon = client.cloud.edr.falcon.get()
Core Resources¶
Resource |
Description |
Key Methods |
|---|---|---|
Accounts |
Account management and settings |
|
Users |
User lifecycle management |
|
Tokens |
API token management |
|
Peers |
Network peer management |
|
Setup Keys |
Peer setup key management |
|
Groups |
Peer group management |
|
Networks |
Network and resource management |
|
Policies |
Access control policies |
|
Routes |
Network routing (deprecated) |
|
DNS |
DNS nameserver groups |
|
DNS Zones |
Custom DNS zones and records |
Zone CRUD + Record CRUD |
Events |
Audit and traffic events |
|
Posture Checks |
Device compliance verification |
|
Geo Locations |
Geographic data queries |
|
Identity Providers |
OAuth2/OIDC providers |
|
Instance |
Instance management |
|
Cloud Resources¶
Resource |
Description |
Key Methods |
|---|---|---|
Services |
Reverse proxy services |
CRUD + Domain management |
Ingress |
Ingress port allocation |
Port + Peer management |
EDR Peers |
EDR peer bypass |
|
EDR Falcon |
CrowdStrike Falcon |
|
EDR Huntress |
Huntress integration |
|
EDR Intune |
Microsoft Intune |
|
EDR SentinelOne |
SentinelOne integration |
|
MSP |
Multi-tenant management |
Tenants CRUD + Users/Peers |
Invoices |
Billing invoices |
|
Usage |
Billing usage stats |
|
Event Streaming |
Event streaming integrations |
CRUD operations |
IDP/SCIM |
SCIM identity providers |
CRUD + Token + Logs |