Safe AI Workbench Developer DocsAI-powered workspace with PHI protectionHIPAA-compliant API
AI Tasks API
List available AI tasks and retrieve task definitions with variable schemas
GET /api/ai/tasks
Retrieve a list of all AI tasks available to the authenticated user. Includes both system-default tasks and custom tasks shared with the user's groups.
Authentication Required
Include your API key or JWT token as a Bearer token in the Authorization header.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
category | string | No | Filter by category: "hr-comms", "ops-finance", or custom category |
includeInactive | boolean | No | Include disabled tasks. Default: false |
Example Request
GET /api/ai/tasks?category=hr-comms
Authorization: Bearer YOUR_API_KEYResponse (200 OK)
{
"tasks": [
{
"id": "policy-translator",
"name": "Translate Policy to Plain Language",
"description": "Convert legal/HR policy text into simple, employee-friendly language",
"category": "hr-comms",
"icon": "📋",
"requiresFile": true,
"maxTokens": 1500,
"temperature": 0.7,
"isSystemDefault": true,
"isActive": true,
"variablesSchema": [
{
"name": "content",
"type": "string",
"required": false,
"description": "Policy text to translate (optional if using file upload)"
}
]
},
{
"id": "memo-drafter",
"name": "Draft Internal Memo",
"description": "Write professional internal communications and announcements",
"category": "hr-comms",
"icon": "✍️",
"requiresFile": false,
"maxTokens": 800,
"temperature": 0.7,
"isSystemDefault": true,
"isActive": true,
"variablesSchema": [
{
"name": "topic",
"type": "string",
"required": true,
"description": "Subject of the memo"
},
{
"name": "audience",
"type": "string",
"required": true,
"description": "Target audience (e.g., 'all employees', 'HR team')"
},
{
"name": "tone",
"type": "string",
"required": true,
"description": "Desired tone (e.g., 'professional', 'casual', 'urgent')"
}
]
}
],
"total": 20,
"category": "hr-comms"
}Task Object Fields
| Field | Type | Description |
|---|---|---|
id | string | Unique task identifier (use in /api/ai/chat requests) |
name | string | Display name for the task |
description | string | Brief explanation of what the task does |
category | string | Task category (hr-comms, ops-finance, or custom) |
icon | string | Emoji icon for visual representation |
requiresFile | boolean | Whether this task requires file upload (PDF, DOCX, XLSX) |
maxTokens | number | Maximum output tokens for this task |
temperature | number | Default temperature (0.0-1.0) for this task |
isSystemDefault | boolean | Whether this is a built-in task (true) or custom (false) |
isActive | boolean | Whether this task is currently enabled |
variablesSchema | array | Definition of required and optional variables for this task |
Variable Schema Object
| Field | Type | Description |
|---|---|---|
name | string | Variable key name (use in chat request variables object) |
type | string | Data type: "string", "number", "boolean" |
required | boolean | Whether this variable must be provided |
description | string | Human-readable description of what this variable does |
Default Tasks by Category
HR & Communications (10 tasks)
• policy-translator
• memo-drafter
• job-description
• tone-improver
• meeting-summarizer
• faq-builder
• resume-parser
• email-responder
• performance-review
• onboarding-guide
Operations & Finance (10 tasks)
• contract-summarizer
• excel-helper
• invoice-extractor
• budget-analyzer
• expense-summarizer
• vendor-comparison
• rfp-generator
• compliance-checker
• report-generator
• document-classifier
Error Responses
401 Unauthorized
Missing or invalid authentication token
429 Too Many Requests
Rate limit exceeded (1000 requests/minute for this endpoint)