Overview
Complete API reference for integrating with BroxiAI
BroxiAI provides a comprehensive REST API for integrating your workflows into external applications, automating processes, and building custom solutions.
API Architecture

Base URL
All API requests should be made to:
Authentication
BroxiAI uses API tokens for authentication. Include your token in the Authorization header:
Getting Your API Token
Log into your BroxiAI dashboard
Navigate to Settings → API Keys
Generate a new API token
Copy and securely store your token
Keep your API tokens secure and never expose them in client-side code. Tokens have the same permissions as your user account.
Core Endpoints
Workflows
Run a Workflow
Execute a published workflow with input data.
Parameters
flow_id(string, required): The unique identifier of your workflow
Request Body
Response
Stream Workflow Execution
Execute a workflow with real-time streaming response.
Request Body
Response (Server-Sent Events)
Get Workflow Status
Check the status of a running workflow.
Response
Flow Management
List Workflows
Get all your published workflows.
Query Parameters
limit(integer): Number of flows to return (default: 20, max: 100)offset(integer): Number of flows to skip (default: 0)status(string): Filter by status (published,draft)
Response
Get Workflow Details
Retrieve detailed information about a specific workflow.
Response
Session Management
Create Session
Create a new conversation session for stateful interactions.
Request Body
Response
Get Session History
Retrieve conversation history for a session.
Response
Analytics
Get Usage Statistics
Retrieve usage metrics for your workflows.
Query Parameters
start_date(string): Start date (ISO 8601 format)end_date(string): End date (ISO 8601 format)flow_id(string): Filter by specific workflowgranularity(string): Data granularity (hour,day,week,month)
Response
Error Handling
The API returns standard HTTP status codes and detailed error messages.
Error Response Format
Common Error Codes
INVALID_REQUEST
400
Invalid request format or parameters
UNAUTHORIZED
401
Invalid or missing API token
FORBIDDEN
403
Insufficient permissions
NOT_FOUND
404
Resource not found
RATE_LIMITED
429
Too many requests
INTERNAL_ERROR
500
Server error
SERVICE_UNAVAILABLE
503
Service temporarily unavailable
Rate Limits
API requests are rate limited to ensure fair usage:
Free Tier: 100 requests per minute
Pro Tier: 1,000 requests per minute
Enterprise: Custom limits
Rate limit headers are included in responses:
Webhooks
Configure webhooks to receive real-time notifications about workflow events.
Webhook Events
flow.run.started: Workflow execution beganflow.run.completed: Workflow execution finished successfullyflow.run.failed: Workflow execution failedsession.created: New session createdsession.ended: Session ended
Webhook Payload
For webhook setup, see Webhook Configuration.
SDKs and Libraries
Official SDKs are available for popular programming languages:
Python SDK
JavaScript SDK
cURL Examples
Basic Workflow Execution
Streaming Response
Best Practices
Performance Optimization
Use Sessions: For conversational flows, use sessions to maintain context
Batch Requests: Group multiple operations when possible
Caching: Cache responses for repeated queries
Streaming: Use streaming for long-running operations
Security
Secure Storage: Store API tokens securely
Token Rotation: Rotate tokens regularly
Network Security: Use HTTPS for all requests
Input Validation: Validate all user inputs
Error Handling
Retry Logic: Implement exponential backoff for retries
Circuit Breakers: Prevent cascading failures
Logging: Log API interactions for debugging
Monitoring: Monitor API usage and errors
Support
For API support:
Check our troubleshooting guide
Review code examples
Contact technical support
Join our developer community
Last updated