Development: http://localhost:8000
Production: https://isc-codeconnect.ibm.com
The system uses IBM OIDC (OpenID Connect) authentication with session-based management:
After successful OIDC login, user sessions are managed via secure cookies. GitHub integration uses session-stored tokens.
System health check and configuration status.
Response:
{
"status": "healthy",
"message": "API is running",
"assistant_status": "initialized",
"frontend_url": "http://localhost:3000",
"heartbeat_enabled": true,
"heartbeat_type": "simple_comments",
"heartbeat_interval": "30 seconds",
"timeout_protection": "enabled",
"cirrus_compatible": true,
"model_support": {
"dynamic_model_selection": true,
"current_model": "ibm/granite-3-8b-instruct",
"model_source": "frontend_request_or_env_default"
}
}Get available LLM models for dynamic selection.
Response:
{
"status": "success",
"current_model": "ibm/granite-3-8b-instruct",
"available_models": [
"ibm/granite-3-2-8b-instruct",
"ibm/granite-3-8b-instruct",
"ibm/granite-3.3-8b-instruct",
"meta-llama/llama-3-70b-instruct",
"mistralai/mixtral-8x7b-instruct-v01"
],
"common_models": ["ibm/granite-3-8b-instruct"],
"message": "Use 'selectedModel' field in query requests to specify model"
}Send a message to the multi-agent Salesforce RAG system.
Request Body:
{
"query": "Create an Apex class for handling Account operations",
"user_info": {
"name": "john.doe@ibm.com",
"session_id": "uuid-session-id"
},
"selectedModel": "ibm/granite-3-8b-instruct"
}Response:
{
"response": "I'll help you create an Apex class for Account operations...",
"metrics": {
"cache_hits": 3,
"cache_misses": 1,
"parallel_operations": 5,
"average_processing_time": 2.3,
"execution_time": 2.3,
"start_time": "2025-07-03 10:00:00.123456",
"end_time": "2025-07-03 10:00:02.456789"
}
}Stream a query response with heartbeat protection for long-running queries.
Request Body: Same as /api/query
Response: Server-Sent Events (SSE) stream
Content-Type: text/event-stream
X-Heartbeat-Enabled: simple
data: {"content": "I'll help you create...", "done": false}
data: {"content": "an Apex class for Account operations", "done": false}
: heartbeat - keeping connection alive
data: {"content": "Final response content", "done": true}
Test endpoint for streaming with configurable heartbeat mechanism.
Query Parameters:
duration: Test duration in seconds (default: 240)interval: Time between messages (default: 45s)heartbeat_interval: Heartbeat interval (default: 30s)
Start a new chat session.
Request Body:
{
"username": "john.doe@ibm.com",
"session_id": "uuid-session-id"
}Response:
{
"status": "success",
"message": "New chat session started",
"session_id": "uuid-session-id"
}Reset the chat state and clear conversation history.
Request Body:
{
"username": "john.doe@ibm.com",
"session_id": "uuid-session-id"
}Response:
{
"status": "success",
"message": "Chat state reset successfully"
}Health check for GitHub integration with session-based token support.
Query Parameters:
github_token: Optional GitHub token (falls back to session or environment)
Response:
{
"status": "healthy",
"github_api_accessible": true,
"authentication_method": "session-based",
"rate_limit": {
"remaining": 4500,
"reset_time": "2025-07-03T11:00:00Z"
},
"repository_access": "verified"
}Query GitHub repositories with AI-powered analysis.
Request Body:
{
"query": "How does the authentication system work in this repository?",
"orgName": "IBM",
"repository": "salesforce-toolkit",
"user_info": {
"name": "john.doe@ibm.com",
"session_id": "uuid-session-id",
"email": "john.doe@ibm.com"
},
"github_token": "optional-token",
"messages": [
{
"role": "user",
"content": "Previous question"
},
{
"role": "assistant",
"content": "Previous answer"
}
],
"contextTypes": ["code", "documentation"]
}Response:
{
"answer": "The authentication system in this repository uses...",
"tools_used": ["github_file_reader", "github_search"],
"raw_data": {
"files_analyzed": ["src/auth/index.js", "README.md"],
"search_results": 15
},
"metrics": {
"cache_hits": 0,
"cache_misses": 1,
"parallel_operations": 1,
"average_processing_time": 3.2,
"execution_time": 3.2,
"start_time": "2025-07-03 10:00:00.123456",
"end_time": "2025-07-03 10:00:03.345678"
},
"messages": [
{
"role": "user",
"content": "How does the authentication system work?"
},
{
"role": "assistant",
"content": "The authentication system..."
}
]
}Stream GitHub repository analysis with heartbeat protection.
Request Body: Same as /api/github/query
Response: Server-Sent Events (SSE) stream with GitHub analysis progress.
Get a quick summary of a GitHub repository.
Path Parameters:
org_name: Organization namerepo_name: Repository name
Query Parameters:
github_token: Optional GitHub token
Response:
{
"org_name": "IBM",
"repo_name": "salesforce-toolkit",
"summary": {
"description": "A comprehensive toolkit for Salesforce development",
"primary_language": "JavaScript",
"languages": ["JavaScript", "Apex", "HTML"],
"file_count": 245,
"main_directories": ["src", "docs", "tests"],
"recent_activity": "Active development"
},
"timestamp": "2025-07-03T10:40:00Z",
"authentication": "session-based"
}Store GitHub token in user session for authentication.
Request Body:
{
"github_token": "ghp_xxxxxxxxxxxxxxxxxxxx"
}Response:
{
"status": "success",
"message": "GitHub token stored successfully in session",
"token_validation": "valid",
"authentication_method": "session-based"
}Remove GitHub token from user session.
Response:
{
"status": "success",
"message": "GitHub token removed from session"
}Reset GitHub chat history for a specific repository.
Request Body:
{
"username": "john.doe@ibm.com",
"session_id": "uuid-session-id",
"org_name": "IBM",
"repo_name": "salesforce-toolkit",
"github_token": "optional-token"
}Response:
{
"status": "success",
"message": "GitHub chat history reset successfully"
}{
"detail": {
"message": "Assistant not initialized",
"location": "process_query",
"details": null
}
}- 401 Unauthorized: User not authenticated or invalid GitHub token
- 403 Forbidden: User not authorized (not in required group or organization)
- 500 Internal Server Error: System error with detailed error response
- 503 Service Unavailable: Assistant not initialized
Initiate OIDC authentication flow.
Response: Redirects to IBM OIDC authorization server.
OAuth2 callback to process authorization code and fetch user information.
Query Parameters:
code: Authorization code from OIDC provider
Response:
- Success: Redirects to frontend with session established
- Error: JSON error response with 403 status for unauthorized users
Analyze software requirements and break them down into implementation tasks.
Request Body:
{
"requirement": "Create a customer management system with CRUD operations",
"supporting_docs": [
{
"content": "Additional requirements document content",
"name": "requirements.md"
}
],
"user_info": {
"name": "john.doe@ibm.com",
"session_id": "uuid-session-id"
}
}Response:
{
"analysis": {
"requirement_summary": "Build a customer management system with full CRUD capabilities",
"key_components": [
"Customer data model",
"CRUD API endpoints",
"User interface"
],
"tasks": [
{
"task_id": 1,
"title": "Create Customer Data Model",
"description": "Design and implement customer entity with required fields",
"affected_files": ["models/Customer.cls"],
"implementation_details": "Create Apex class with proper field definitions...",
"references": ["Salesforce Object Guidelines"],
"estimated_complexity": "Medium"
}
],
"missing_information": ["Specific field requirements for customer entity"],
"assumptions": ["Using Salesforce platform for implementation"]
},
"metrics": {
"processing_time": 1.8,
"tasks_generated": 5,
"complexity_distribution": {
"Low": 2,
"Medium": 2,
"High": 1
}
}
}Stream requirement analysis with real-time progress updates.
Request Body: Same as analyze endpoint
Response: Server-Sent Events stream with analysis progress.
All streaming endpoints use SSE format with heartbeat protection:
Content-Type: text/event-stream
Cache-Control: no-cache
Connection: keep-alive
X-Accel-Buffering: no
X-Heartbeat-Enabled: simple
data: {"content": "Response chunk", "done": false}
: heartbeat - keeping connection alive
data: {"content": "Final chunk", "done": true}
- Simple Comments: Sends
: heartbeatcomments every 30 seconds - No Frontend Changes Required: Compatible with standard SSE implementations
- Timeout Protection: Prevents proxy/load balancer timeouts during long processing
- OIDC authentication creates secure session cookies
- GitHub tokens stored in user sessions for repository access
- Thread IDs generated from
username_sessionIdfor conversation continuity - Chat history maintained per repository in GitHub integration
- Salesforce RAG:
{username}_{session_id} - GitHub Integration:
{username}_{session_id}_{org_name}_{repo_name} - Conversation history limited to last 20 messages for performance