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

  1. Log into your BroxiAI dashboard

  2. Navigate to Settings → API Keys

  3. Generate a new API token

  4. Copy and securely store your token

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 workflow

  • granularity (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

Code
Status
Description

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 began

  • flow.run.completed: Workflow execution finished successfully

  • flow.run.failed: Workflow execution failed

  • session.created: New session created

  • session.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

  1. Use Sessions: For conversational flows, use sessions to maintain context

  2. Batch Requests: Group multiple operations when possible

  3. Caching: Cache responses for repeated queries

  4. Streaming: Use streaming for long-running operations

Security

  1. Secure Storage: Store API tokens securely

  2. Token Rotation: Rotate tokens regularly

  3. Network Security: Use HTTPS for all requests

  4. Input Validation: Validate all user inputs

Error Handling

  1. Retry Logic: Implement exponential backoff for retries

  2. Circuit Breakers: Prevent cascading failures

  3. Logging: Log API interactions for debugging

  4. Monitoring: Monitor API usage and errors

Support

For API support:

Last updated