CodingIT is an AI-powered software engineering platform that provides live code execution, file uploads, real-time chat capabilities, and workflow management. This comprehensive API documentation covers all 27 endpoints across 9 major functional areas.
# Import the collection
curl -o postman-collection.json https://raw.githubusercontent.com/Gerome-Elassaad/CodingIT/main/postman-collection.json
# Import the environment
curl -o postman-environment.json https://raw.githubusercontent.com/Gerome-Elassaad/CodingIT/main/postman-environment.jsonConfigure the following essential variables in Postman:
{
"BASE_URL": "http://localhost:3000",
"E2B_API_KEY": "your_e2b_api_key",
"SUPABASE_URL": "your_supabase_url",
"SUPABASE_ANON_KEY": "your_supabase_anon_key",
"anthropic_api_key": "your_anthropic_key"
}Most endpoints require Supabase authentication. Use the Bearer token format:
Authorization: Bearer {{supabase_access_token}}| Category | Endpoints | Description |
|---|---|---|
| 🔐 Authentication | 2 | GitHub OAuth integration |
| 💬 AI Generation | 2 | Code and workflow generation |
| ⚡ Code Execution | 1 | Sandbox code execution |
| 🔧 Sandbox Management | 2 | E2B sandbox operations |
| 📁 File Operations | 5 | File system management |
| 🐛 Debug & Analysis | 2 | Error analysis tools |
| 🚀 Deployments | 5 | Cloud deployment management |
| 🔗 GitHub Integration | 2 | Repository and webhook handling |
| ⚡ Workflows | 6 | Multi-step workflow management |
| 📊 Data & Import | 1 | Dataset import capabilities |
| 🎣 Webhooks | 1 | External webhook processing |
GET /api/auth/github?code={auth_code}&state={csrf_state}Description: Handles GitHub OAuth callback and automatically sets up webhooks for the first 3 repositories.
Parameters:
code(required): Authorization code from GitHubstate(required): CSRF protection state parametererror(optional): Error from GitHub OAuth
Response: Redirects to /settings/integrations with success or error parameters
Example:
GET /api/auth/github?code=abc123&state=xyz789
# Redirects to: /settings/integrations?success=github_connectedPOST /api/auth/github/revoke
Content-Type: application/json
{
"access_token": "github_access_token_here"
}Description: Revokes GitHub access token and disconnects the integration.
Response:
{
"success": true
}POST /api/chat
Content-Type: application/json
Authorization: Bearer {{supabase_access_token}}
{
"messages": [
{
"role": "user",
"content": "Create a Python script that analyzes data from a CSV file"
}
],
"userID": "user_123",
"teamID": "team_456",
"template": "code-interpreter-v1",
"model": "claude-3-sonnet-20240229",
"config": {
"model": "claude-3-sonnet-20240229",
"apiKey": "your_anthropic_key",
"temperature": 0.7,
"maxTokens": 4000
}
}Description: Generate AI-powered code fragments using various LLM models with structured output.
Supported Models:
claude-3-sonnet-20240229claude-3-haiku-20240307gpt-4gpt-3.5-turbo
Supported Templates:
code-interpreter-v1- Python data analysisnextjs-developer- Next.js applicationsvue-developer- Vue.js applicationsstreamlit-developer- Streamlit dashboardsgradio-developer- Gradio ML interfaces
Response: Streaming JSON with fragment schema
POST /api/chat/workflowDescription: Generates multi-step workflows with AI detection. The system automatically determines if a request should be a single fragment or broken into multiple workflow steps.
Key Features:
- Automatic workflow detection with confidence scoring
- Multi-step fragment breakdown
- Dependency management between steps
- Automatic workflow persistence
POST /api/code/execute
Content-Type: application/json
{
"sessionID": "session_12345",
"code": "import pandas as pd\ndf = pd.DataFrame({'x': [1,2,3], 'y': [4,5,6]})\nprint(df)"
}Description: Execute code in isolated E2B sandboxes with comprehensive result capture.
Response:
{
"results": [...],
"stdout": ["DataFrame output..."],
"stderr": [],
"error": null
}POST /api/sandbox
Content-Type: application/json
{
"fragment": {
"commentary": "Creating a data analysis script",
"template": "code-interpreter-v1",
"title": "Data Analysis",
"description": "Analyze CSV data with pandas",
"additional_dependencies": ["seaborn"],
"has_additional_dependencies": true,
"install_dependencies_command": "pip install seaborn",
"port": null,
"file_path": "analysis.py",
"code": "import pandas as pd\nimport matplotlib.pyplot as plt\n# Analysis code here"
},
"userID": "user_123",
"teamID": "team_456"
}Description: Creates new E2B sandbox instances, installs dependencies, and executes fragments.
Execution Flow:
- Create sandbox with specified template
- Install additional dependencies (if any)
- Write code files to sandbox
- Execute code and return results
POST /api/terminal
Content-Type: application/json
{
"command": "ls -la",
"sbxId": "sandbox_id_here",
"workingDirectory": "/home/user",
"teamID": "team_456"
}Description: Execute terminal commands in existing sandbox environments with 30-second timeout.
GET /api/files?sessionID=session_123&template=code-interpreter-v1Description: Returns complete file tree structure for sandbox.
Response:
[
{
"name": "home",
"isDirectory": true,
"children": [
{
"name": "user",
"isDirectory": true,
"children": [
{
"name": "main.py",
"isDirectory": false,
"path": "/home/user/main.py"
}
]
}
]
}
]GET /api/files/content?sessionID=session_123&path=/home/user/main.pyPOST /api/files/content
Content-Type: application/json
{
"sessionID": "session_123",
"path": "/home/user/new_file.py",
"content": "print('Hello, World!')\n",
"template": "code-interpreter-v1"
}GET/POST /api/files/sandbox- Connect to existing sandbox by IDGET /api/files/sandbox/list- List files in connected sandbox
POST /api/debug
Content-Type: application/json
Authorization: Bearer {{supabase_access_token}}
{
"error": "NameError: name 'pandas' is not defined",
"context": {
"template": "code-interpreter-v1",
"line_number": 5
},
"code": "import matplotlib.pyplot as plt\ndf = pandas.DataFrame({'x': [1,2,3]})"
}Description: AI-powered error analysis with debugging suggestions and severity assessment.
Response:
{
"analysis": "The error occurs because pandas is not imported...",
"suggestions": [
"Add 'import pandas as pd' at the top of your script",
"Use 'pd.DataFrame' instead of 'pandas.DataFrame'"
],
"severity": "medium",
"category": "import_error"
}GET /api/debug?session_id=debug_123
GET /api/debug # List all active sessionsPOST /api/deployments
Content-Type: application/json
Authorization: Bearer {{supabase_access_token}}
{
"fragment": {
"template": "nextjs-developer",
"title": "Portfolio Site",
"code": "export default function Home() { return <h1>Hello</h1> }",
"port": 3000
},
"config": {
"provider": "vercel",
"environment": "production",
"domain": "my-app.vercel.app"
}
}Supported Providers:
vercel- Vercel deploymentsnetlify- Netlify deploymentsaws- AWS deploymentsheroku- Heroku deployments
GET /api/deployments- List deployment historyGET /api/deployments/{id}- Get deployment statusDELETE /api/deployments/{id}- Cancel deploymentPOST /api/deployments/{id}/rollback- Rollback deployment
GET /api/integrations/github/repos?page=1&per_page=30&sort=updated&type=owner
Authorization: Bearer {{supabase_access_token}}Parameters:
page- Page number (default: 1)per_page- Results per page (default: 30)sort- Sort order:created,updated,pushed,full_nametype- Repository type:all,owner,member
GET /api/integrations/github/repos/octocat/Hello-World?path=README.md&ref=mainFeatures:
- Browse repository files and directories
- Support for different branches/refs
- Automatic token refresh handling
- Rate limit management
POST /api/workflows
Content-Type: application/json
Authorization: Bearer {{supabase_access_token}}
{
"name": "Data Processing Pipeline",
"description": "Complete data processing with validation and analysis",
"fragments": [
{
"id": "node_1",
"type": "fragment",
"position": { "x": 100, "y": 100 },
"data": {
"template": "code-interpreter-v1",
"title": "Data Ingestion",
"code": "import pandas as pd\ndf = pd.read_csv('data.csv')"
}
}
],
"connections": [
{
"id": "conn_1",
"source": { "nodeId": "node_1", "portId": "output_1" },
"target": { "nodeId": "node_2", "portId": "input_1" },
"dataType": "object"
}
],
"variables": [
{
"name": "input_file",
"type": "string",
"default": "data.csv"
}
],
"triggers": [
{
"id": "trigger_1",
"type": "manual",
"config": {}
}
]
}POST /api/workflows/{workflow_id}/execute
Content-Type: application/json
{
"inputData": {
"input_file": "sample_data.csv",
"output_format": "json"
},
"triggerType": "manual"
}Workflow Features:
- Visual node-based workflow designer
- Fragment dependency management
- Variable passing between steps
- Multiple trigger types (manual, scheduled, webhook)
- Execution tracking and logging
GET /api/workflows- List all workflowsGET /api/workflows/{id}- Get workflow detailsPUT /api/workflows/{id}- Update workflowDELETE /api/workflows/{id}- Delete workflowGET /api/workflows/{id}/execute- List executions
POST /api/import-dataset
Content-Type: application/json
{
"subset": "python"
}Description: Import code datasets from HuggingFace for embeddings and semantic search.
Supported Subsets:
python- Python code samplesjavascript- JavaScript code samplesjava- Java code samplescpp- C++ code samples
Process:
- Downloads dataset from HuggingFace
- Processes code into chunks
- Generates embeddings using Xenova/all-MiniLM-L6-v2
- Stores in Supabase vector database
POST /api/webhooks/github
Content-Type: application/json
X-GitHub-Event: push
X-GitHub-Delivery: 12345-abcdef
X-Hub-Signature-256: sha256=signature_here
{
"ref": "refs/heads/main",
"repository": {
"full_name": "user/repo",
"owner": { "login": "user" }
},
"commits": [...],
"pusher": { "name": "user" }
}Supported Events:
push- Repository push eventspull_request- Pull request eventsissues- Issue eventsping- Webhook test events
{
"error": "Error message",
"code": "ERROR_CODE",
"details": {
"field": "Additional error details"
}
}| Code | Description | Common Causes |
|---|---|---|
| 400 | Bad Request | Missing required parameters, invalid data |
| 401 | Unauthorized | Missing or invalid authentication token |
| 403 | Forbidden | Insufficient permissions, invalid API key |
| 404 | Not Found | Resource doesn't exist |
| 429 | Too Many Requests | Rate limit exceeded |
| 500 | Internal Server Error | Server-side processing error |
| 503 | Service Unavailable | External service unavailable |
Rate limits apply to endpoints without custom API keys:
- Default: 10 requests per day
- With API Key: No rate limits
- Headers:
X-RateLimit-Limit,X-RateLimit-Remaining,X-RateLimit-Reset
- E2B account and API key
- Supabase project setup
- GitHub OAuth app configured (optional)
- AI provider API keys (Anthropic, OpenAI, etc.)
- Postman installed
-
Generate a simple Python script:
POST /api/chat # Body: Request Python data analysis script
-
Execute the generated code:
POST /api/code/execute # Body: sessionID + generated code
-
List created files:
GET /api/files?sessionID={{session_id}}
-
Create a workflow:
POST /api/workflows # Body: Multi-step data processing workflow
-
Execute the workflow:
POST /api/workflows/{{workflow_id}}/execute
Generate code → Execute in sandbox → Iterate based on results
Import data → Process → Analyze → Visualize → Export
Generate Next.js app → Test locally → Deploy to Vercel
Connect GitHub → Import repository → Analyze code → Generate improvements
Create workflow → Set triggers → Execute automatically → Monitor results
The platform supports multiple sandbox templates optimized for different use cases:
- code-interpreter-v1: Data science and analysis
- nextjs-developer: React/Next.js development
- vue-developer: Vue.js development
- streamlit-developer: ML dashboard creation
- gradio-developer: ML interface development
Multiple AI providers and models are supported:
Anthropic:
- claude-3-sonnet-20240229
- claude-3-haiku-20240307
OpenAI:
- gpt-4
- gpt-3.5-turbo
Google:
- gemini-pro
- gemini-pro-vision
Automatic webhook setup for GitHub repositories enables:
- Real-time code change notifications
- Automated testing and deployment
- Issue and PR tracking
- Integration with external CI/CD systems
- Store sensitive keys in environment variables
- Use separate keys for development/production
- Rotate keys regularly
- Never commit keys to version control
- Use Supabase Row Level Security (RLS)
- Implement proper session management
- Validate all user inputs
- Use HTTPS in production
- E2B provides isolated execution environments
- Automatic cleanup after timeout
- Resource limits prevent abuse
- Network isolation for sensitive operations
Last Updated: December 2024
API Version: 1.0.0
Total Endpoints: 27