Assistant API

Overview

The Assistant API allows you to create, manage, and deploy AI assistants within your organization. Each assistant can be customized with specific preferences, integrations, and knowledge bases to provide tailored AI-powered experiences.

Key Features

  • Assistant Management: Create and manage multiple AI assistants for different use cases
  • Version Control: Track changes and maintain multiple versions of each assistant
  • Deployment System: Deploy specific versions to production with full audit trail
  • Customization: Extensive UI customization options including colors, typography, and branding
  • Integrations: Connect assistants with external services like WhatsApp
  • Knowledge Base: Link document folders to provide contextual information to assistants

Authentication

All Assistant API endpoints require authentication. Each request must include:

  • User authentication token
  • Active organization context

The API automatically tracks:

  • created_by: User who created the resource
  • deleted_by: User who deleted the resource
  • deployed_by: User who deployed a version

Base URL

All Assistant API endpoints are available under:

/api/ai-hub/assistant

Response Format

All API responses follow a consistent structure:

{
  "success": boolean,
  "message": "Operation result message",
  "data": {} // Response data varies by endpoint
}

Error Handling

The API uses standard HTTP status codes:

  • 200: Success
  • 201: Created
  • 400: Bad Request (validation errors)
  • 401: Unauthorized
  • 404: Not Found
  • 500: Internal Server Error

Validation errors include detailed field-level information:

{
  "success": false,
  "error": "Validation error message",
  "issues": [
    {
      "field": "field_name",
      "message": "Specific validation error"
    }
  ]
}