Use this file to discover all available pages before exploring further.
The Platform SDK provides a complete async Python client for interacting with the PraisonAI Platform API, featuring connection pooling for optimal performance and comprehensive CRUD operations for all platform resources.
async with PlatformClient("http://localhost:8000") as client: user_data = await client.register( email="user@example.com", password="secure123", name="John Doe" # optional ) # Token automatically set for future requests
async with PlatformClient("http://localhost:8000") as client: auth_data = await client.login("user@example.com", "secure123") # Token automatically set for future requests
# Create workspaceworkspace = await client.create_workspace("Development Team", slug="dev-team")# List all workspacesworkspaces = await client.list_workspaces()# Get specific workspaceworkspace = await client.get_workspace("workspace-id")
# Add comment to issuecomment = await client.add_comment( workspace_id="ws-123", issue_id="issue-789", content="I'm investigating this bug now")# List all comments on issuecomments = await client.list_comments("ws-123", "issue-789")
# Create dependency between issuesdependency = await client.create_dependency( workspace_id="ws-123", blocker_id="issue-123", # Issue that blocks blocked_id="issue-456" # Issue that is blocked)# List dependencies for workspacedependencies = await client.list_dependencies("ws-123")
Always prefer the context manager pattern for multiple API calls to benefit from connection pooling:
# ✅ Good - Connection poolingasync with PlatformClient(base_url) as client: for workspace in await client.list_workspaces(): projects = await client.list_projects(workspace["id"])# ❌ Avoid - New connection per request client = PlatformClient(base_url)for workspace in await client.list_workspaces(): projects = await client.list_projects(workspace["id"])
Handle Token Management
The client automatically manages tokens after register() or login(). For existing tokens:
# Set token explicitlyclient = PlatformClient("http://localhost:8000", token="your-jwt-token")# Or let register/login set it automaticallyasync with PlatformClient("http://localhost:8000") as client: await client.login(email, password) # Token auto-set # All subsequent requests use this token
Batch Related Operations
Group related API calls within the same context manager for optimal performance: