Complete reference for all available API endpoints in the Kasal platform.
All API endpoints use the following base URL structure:
https://<your-app>.databricksapps.com/api/v1
Example:
https://<your-app>.aws.databricksapps.com/api/v1/executions
Local Development:
http://localhost:8000/api/v1
- Authentication
- Crews (workflows)
- Agents
- Tasks
- Tools
- Executions
- Models
- API keys
- Power BI integration
- Health and status
| Method | Endpoint | Description |
|---|---|---|
POST |
/auth/login |
User login with credentials |
POST |
/auth/logout |
User logout |
GET |
/auth/me |
Get current user information |
POST |
/auth/refresh |
Refresh JWT token |
Authentication Header:
Authorization: Bearer <JWT_TOKEN>
| Method | Endpoint | Description |
|---|---|---|
GET |
/crews |
List all crews in the teamspace |
POST |
/crews |
Create a new crew |
GET |
/crews/{id} |
Get crew details by ID |
PUT |
/crews/{id} |
Update crew configuration |
DELETE |
/crews/{id} |
Delete crew |
POST |
/crews/{id}/duplicate |
Duplicate crew with new name |
| Method | Endpoint | Description |
|---|---|---|
POST |
/crews/{id}/kickoff |
Start crew execution |
POST |
/crews/{id}/kickoff-async |
Start async crew execution |
GET |
/crews/{id}/status |
Get crew execution status |
POST |
/crews/{id}/stop |
Stop running crew |
| Method | Endpoint | Description |
|---|---|---|
GET |
/crews/{id}/export |
Export crew configuration as JSON |
POST |
/crews/import |
Import crew from JSON |
| Method | Endpoint | Description |
|---|---|---|
GET |
/agents |
List all agents |
POST |
/agents |
Create a new agent |
GET |
/agents/{id} |
Get agent details by ID |
PUT |
/agents/{id} |
Update agent configuration |
DELETE |
/agents/{id} |
Delete agent |
Agent Configuration Fields:
name: Agent namerole: Agent role descriptiongoal: Agent's objectivebackstory: Agent's background contexttools: Array of tool IDstool_configs: Tool-specific configurationsllm_config: LLM model and parameters
| Method | Endpoint | Description |
|---|---|---|
GET |
/tasks |
List all tasks |
POST |
/tasks |
Create a new task |
GET |
/tasks/{id} |
Get task details by ID |
PUT |
/tasks/{id} |
Update task configuration |
DELETE |
/tasks/{id} |
Delete task |
Task Configuration Fields:
name: Task namedescription: Task descriptionexpected_output: Expected output formatagent_id: Assigned agent IDcontext: Context task IDs (dependencies)tool_configs: Task-level tool configurations
| Method | Endpoint | Description |
|---|---|---|
GET |
/tools |
List all available tools |
GET |
/tools/{id} |
Get tool details by ID |
PUT |
/tools/{id} |
Update tool configuration |
POST |
/tools/{id}/enable |
Enable tool for the teamspace |
POST |
/tools/{id}/disable |
Disable tool for the teamspace |
Available Tool Types:
ai: AI-powered tools (Dall-E, Perplexity)database: Database tools (Genie, Databricks, Power BI)search: Search tools (Serper, Knowledge Search)web: Web tools (Scrape Website)integration: Integration tools (MCP)development: Development tools
| Method | Endpoint | Description |
|---|---|---|
GET |
/executions |
List all executions |
GET |
/executions/{id} |
Get execution details |
GET |
/executions/{id}/status |
Get execution status |
GET |
/executions/{id}/logs |
Get execution logs |
POST |
/executions/{id}/stop |
Stop running execution |
POST |
/executions/{id}/force-stop |
Force-stop a running execution |
DELETE |
/executions/{id} |
Delete execution record |
pending: Execution queuedrunning: Execution in progresscompleted: Execution finished successfullyfailed: Execution failed with errorstopped: Execution manually stopped
Trace records capture per-agent / per-task events for a run.
| Method | Endpoint | Description |
|---|---|---|
GET |
/traces |
List execution traces |
GET |
/traces/{trace_id} |
Get a single trace item |
GET |
/traces/execution/{run_id} |
Traces for a run (by run id) |
GET |
/traces/job/{job_id} |
Traces for a job (by job id) |
GET |
/traces/job/{job_id}/crew-node-states |
Crew node states for a job |
GET |
/traces/job/{job_id}/task-states |
Task states for a job |
POST |
/traces |
Create a trace record |
DELETE |
/traces/{trace_id} |
Delete a trace item |
DELETE |
/traces/execution/{run_id} |
Delete traces for a run |
DELETE |
/traces/job/{job_id} |
Delete traces for a job |
| Method | Endpoint | Description |
|---|---|---|
GET |
/models |
List available LLM models |
GET |
/models/{id} |
Get model configuration |
PUT |
/models/{id} |
Update model parameters |
POST |
/models/test |
Test model connection |
Supported Model Providers:
- Databricks (Foundation Models)
- OpenAI (GPT-3.5, GPT-4)
- Anthropic (Claude)
- Google (Gemini)
- Azure OpenAI
- Ollama (Local models)
| Method | Endpoint | Description |
|---|---|---|
GET |
/api-keys |
List all API keys (encrypted) |
POST |
/api-keys |
Create new API key |
GET |
/api-keys/{id} |
Get API key details |
PUT |
/api-keys/{id} |
Update API key value |
DELETE |
/api-keys/{id} |
Delete API key |
Common API Keys:
OPENAI_API_KEY: OpenAI authenticationANTHROPIC_API_KEY: Anthropic Claude authenticationSERPER_API_KEY: Serper search toolPERPLEXITY_API_KEY: Perplexity AI toolDATABRICKS_TOKEN: Databricks API accessPOWERBI_CLIENT_SECRET: Power BI service principalPOWERBI_USERNAME: Power BI device code authPOWERBI_PASSWORD: Power BI device code auth
Security:
- All API keys are encrypted at rest
- Keys are never returned in plain text via API
- Multi-tenant isolation by group_id
| Method | Endpoint | Description |
|---|---|---|
POST |
/powerbi/config |
Configure Power BI connection |
GET |
/powerbi/config |
Get Power BI configuration |
Power BI Tool Configuration (Task-Level):
{
"tenant_id": "Azure AD Tenant ID",
"client_id": "Azure AD Application ID",
"semantic_model_id": "Power BI Dataset ID",
"workspace_id": "Power BI Workspace ID (optional)",
"auth_method": "service_principal or device_code",
"databricks_job_id": "Databricks Job ID (optional)"
}Required API Keys:
POWERBI_CLIENT_SECRETPOWERBI_USERNAME(for device_code)POWERBI_PASSWORD(for device_code)DATABRICKS_API_KEYorDATABRICKS_TOKEN
| Method | Endpoint | Description |
|---|---|---|
GET |
/health |
API health check |
GET |
/health/db |
Database connection status |
GET |
/health/services |
External services status |
GET |
/version |
API version information |
{
"status": "success",
"data": { ... },
"message": "Operation completed successfully"
}{
"status": "error",
"error": {
"code": "ERROR_CODE",
"message": "Human-readable error message",
"details": { ... }
}
}For list endpoints that support pagination:
GET /crews?page=1&limit=50&sort=created_at&order=desc
Query Parameters:
page: Page number (default: 1)limit: Items per page (default: 50, max: 100)sort: Sort fieldorder: Sort order (ascordesc)
Default Limits:
- Anonymous: 100 requests/hour
- Authenticated: 1000 requests/hour
- Enterprise: 10,000 requests/hour
Rate Limit Headers:
X-RateLimit-Limit: 1000
X-RateLimit-Remaining: 999
X-RateLimit-Reset: 1609459200
Get crew memory (short-term and long-term)
Response: 200 OK
{
"short_term": [
{
"timestamp": "2024-01-15T10:00:00Z",
"content": "Customer prefers email communication"
}
],
"long_term": [
{
"category": "preferences",
"insights": ["Email preferred", "Weekly reports"]
}
]
}Clear crew memory
Request:
{
"type": "short_term" // Options: "short_term", "long_term", or "all"
}
Response: 204 No Contentws://localhost:8000/ws/executions/{execution_id}
Message Format:
{
"type": "status_update",
"execution_id": "abc123",
"status": "running",
"progress": 45,
"message": "Processing task 2 of 5..."
}# 1. Create a crew
curl -X POST http://localhost:8000/api/v1/crews \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Sales Analysis Crew",
"agents": [...],
"tasks": [...]
}'
# Response: {"id": "crew_123", ...}
# 2. Start execution
curl -X POST http://localhost:8000/api/v1/crews/crew_123/kickoff \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"inputs": {"query": "Analyze Q4 sales"}}'
# Response: {"execution_id": "exec_456", ...}
# 3. Monitor execution
curl -X GET http://localhost:8000/api/v1/executions/exec_456/status \
-H "Authorization: Bearer $TOKEN"# Create task with PowerBI configuration
curl -X POST http://localhost:8000/api/v1/tasks \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Analyze Sales Data",
"description": "Analyze sales trends using Power BI",
"agent_id": "agent_123",
"tools": [71],
"tool_configs": {
"PowerBIAnalysisTool": {
"tenant_id": "<tenant-id>",
"client_id": "<client-id>",
"semantic_model_id": "<semantic-model-id>",
"workspace_id": "<workspace-id>",
"auth_method": "service_principal",
"databricks_job_id": "<databricks-job-id>"
}
}
}'| Code | Description |
|---|---|
AUTH_001 |
Invalid or expired token |
AUTH_002 |
Insufficient permissions |
CREW_001 |
Crew not found |
CREW_002 |
Invalid crew configuration |
EXEC_001 |
Execution failed |
EXEC_002 |
Execution timeout |
TOOL_001 |
Tool not available |
TOOL_002 |
Tool configuration error |
DB_001 |
Database connection error |
EXT_001 |
External service unavailable |
from kasal import KasalClient
# Initialize client
client = KasalClient(
base_url="http://localhost:8000",
token="your-jwt-token"
)
# Create and execute crew
crew = client.crews.create(
name="Data Analysis Crew",
agents=[...],
tasks=[...]
)
execution = crew.kickoff(inputs={"query": "Analyze data"})
result = execution.wait() # Blocks until complete
print(result.output)import { KasalClient } from '@kasal/sdk';
const client = new KasalClient({
baseUrl: 'http://localhost:8000',
token: 'your-jwt-token'
});
// Create and execute crew
const crew = await client.crews.create({
name: 'Data Analysis Crew',
agents: [...],
tasks: [...]
});
const execution = await crew.kickoff({
inputs: { query: 'Analyze data' }
});
// Stream results
execution.on('status', (status) => {
console.log('Status:', status);
});
const result = await execution.wait();
console.log('Result:', result.output);- API Playground:
/api/playground - OpenAPI Schema:
/api/openapi.json - Swagger UI:
/api/docs - ReDoc:
/api/redoc
- Power BI tools reference
- Power BI comprehensive analysis tool
- Crew export and deployment guide
- Developer guide
- Architecture guide
Back to the documentation hub.