Human in the loop Beta
Tasks, transitions and the task stream.
Create a new Task.
POST /work-management/task/
Returns the created task.
Authentication: Bearer token
Request body
Task object.
-
organization_idstring Required -
Identifier for the organization this task belongs to.
-
project_idstring -
Optional project ID (tenant scope) that owns the task.
-
titlestring Required -
Short human-readable task title (the goal).
-
detailsstring -
Actionable instructions describing what the human must do and why.
-
typeWorkManagementTaskType Required -
Task Type object. Defines the category of human intervention required.
Available Types (Phase 1):
- approval: Human approval/rejection with reason
- data_completion: Fill missing structured data
- review: Human verification/review of something
- resolution: Human resolves a detected issue/blocker
- delegation: Human assigns/responsibilizes next steps
-
idinteger Required -
Numeric type identifier.
-
namestring Required -
Machine-readable type name.
-
titlestring Required -
Human-readable label.
-
colorstring -
Optional UI color for the type badge.
-
priorityWorkManagementTaskPriority Required -
Task Priority object. Used for inbox ordering and escalation decisions.
Available Priorities (Phase 1):
- low, medium, high, critical
-
idinteger Required -
Numeric priority identifier.
-
namestring Required -
Machine-readable priority name.
-
titlestring Required -
Human-readable label.
-
colorstring -
Optional UI color for the priority badge.
-
assigneeWorkManagementTaskAssignee -
Assignment information. Stores intended responsibility (user or group). Enforcement is outside the entity.
-
assignee_typestring Required -
Defines whether assignment targets a user or group.
Allowed valuesusergroup -
userobject -
Assigned user reference when assignee_type is user.
-
idstring -
User id.
-
namestring -
Display name.
-
-
groupobject -
Assigned group reference when assignee_type is group.
-
idstring -
Group id.
-
namestring -
Group name.
-
-
-
ownershipWorkManagementTaskOwnership -
Ownership (claim) information. Distinct from assignee: assignee is who should do it; ownership is who took it.
-
is_claimedboolean Required -
Indicates whether the task is claimed.
-
claimed_byobject -
User reference who claimed the task.
-
idstring -
User id.
-
namestring -
Display name.
-
-
claimed_atstring -
Unix timestamp in string format when claimed.
-
-
slaWorkManagementTaskSLA -
Task SLA object (NOT a type). This is a timing/constraint object that defines due dates and service expectations.
SLA is stored as an object because it is a set of time-related properties, not a categorical type.
-
due_atstring Required -
Unix timestamp in string format indicating when the task is due.
-
sla_msinteger Required -
SLA duration in milliseconds from task creation.
-
is_overdueboolean Required -
Computed at read time. True if current time exceeds due_at.
-
-
required_outputWorkManagementTaskRequiredOutput Required -
Defines what the human must provide to complete the task. Stored as a JSON-schema-like object to enable deterministic validation.
-
schemaobject Required -
JSON-schema-like description of required outputs.
-
ui_hintobject -
Optional UI hints for rendering a default completion form.
-
-
outputsobject -
Outputs provided by the human when completing the task. Must match required_output.schema when BaseModel.status becomes "completed".
-
payloadWorkManagementTaskPayload -
Task operational payload. Stores evidence blocks and soft references required by the human. This is the correct place for task context/evidence (NOT BaseModel.context).
-
summarystring -
Short summary describing what triggered the task.
-
evidencearray<object> -
Controlled evidence blocks (sanitized).
-
kindstring -
Evidence kind label.
-
payloadobject -
Evidence payload content.
-
-
linked_entitiesarray<object> -
Soft references to related entities (not hard dependencies).
-
system_domainstring -
Related domain.
-
system_entitystring -
Related entity name.
-
system_entity_idstring -
Related entity id.
-
-
hitlobject -
Human-in-the-Loop control payload. Free-form object consumed by the App Engine app declared in
task.execution.app_slug. The shape is determined byhitl.approval_type.name(binary_approval, tool_approval, plan_review, single_select_decision, multi_select_decision, review_edit_reject).
-
-
executionWorkManagementTaskExecution -
Task execution context for HITL (Human-in-the-Loop) integration. Defines how the task is completed: via an App Engine app or via the default output form.
When app_slug is provided, the task delegates output collection to an App Engine app. The app receives task context via input_payload and returns structured outputs via submitOutput().
When app_slug is null/absent, the task uses the auto-generated output form derived from required_output.schema.
App Engine sessions already support execution_context_type: "task" and task_id natively.
-
app_slugstring -
Slug of the App Engine app to open for HITL output collection. If null, the task uses the default output form (auto-generated from required_output.schema).
-
app_session_idstring -
Session ID created by App Engine when the app is opened. Populated at runtime when the user opens the app, not at task creation.
-
launch_modestring -
App Engine launch mode for the app.
-
input_payloadobject -
Additional data passed to the app on launch. Merged with task.payload when opening the app.
-
Responses
-
200OK.
curl -X POST https://api.sommatic.ai/work-management/task/ \
-H "Authorization: Bearer $SOMMATIC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"organization_id": "org-123",
"title": "Approve billing exception",
"type": {
"id": 10,
"name": "approval",
"title": "Approval",
"color": "#0288d1"
},
"priority": {
"id": 3,
"name": "high",
"title": "High",
"color": "#f57c00"
},
"required_output": {
"schema": {
"type": "object",
"required": [
"decision",
"reason"
],
"properties": {
"decision": {
"type": "string",
"enum": [
"approved",
"rejected"
]
},
"reason": {
"type": "string"
},
"notes": {
"type": "string"
}
}
},
"ui_hint": {
"layout": "approval",
"require_reason": true
}
}
}'const response = await fetch('https://api.sommatic.ai/work-management/task/', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"organization_id": "org-123",
"title": "Approve billing exception",
"type": {
"id": 10,
"name": "approval",
"title": "Approval",
"color": "#0288d1"
},
"priority": {
"id": 3,
"name": "high",
"title": "High",
"color": "#f57c00"
},
"required_output": {
"schema": {
"type": "object",
"required": [
"decision",
"reason"
],
"properties": {
"decision": {
"type": "string",
"enum": [
"approved",
"rejected"
]
},
"reason": {
"type": "string"
},
"notes": {
"type": "string"
}
}
},
"ui_hint": {
"layout": "approval",
"require_reason": true
}
}
}),
});
const { success, message, result } = await response.json();import os
import requests
response = requests.post(
"https://api.sommatic.ai/work-management/task/",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
json={
"organization_id": "org-123",
"title": "Approve billing exception",
"type": {
"id": 10,
"name": "approval",
"title": "Approval",
"color": "#0288d1"
},
"priority": {
"id": 3,
"name": "high",
"title": "High",
"color": "#f57c00"
},
"required_output": {
"schema": {
"type": "object",
"required": [
"decision",
"reason"
],
"properties": {
"decision": {
"type": "string",
"enum": [
"approved",
"rejected"
]
},
"reason": {
"type": "string"
},
"notes": {
"type": "string"
}
}
},
"ui_hint": {
"layout": "approval",
"require_reason": True
}
}
},
)
data = response.json(){
"status": 200,
"success": true,
"message": "Operation completed successfully",
"result": {
"organization_id": "org-123",
"title": "Approve billing exception",
"type": {
"id": 10,
"name": "approval",
"title": "Approval",
"color": "#0288d1"
},
"priority": {
"id": 3,
"name": "high",
"title": "High",
"color": "#f57c00"
},
"required_output": {
"schema": {
"type": "object",
"required": [
"decision",
"reason"
],
"properties": {
"decision": {
"type": "string",
"enum": [
"approved",
"rejected"
]
},
"reason": {
"type": "string"
},
"notes": {
"type": "string"
}
}
},
"ui_hint": {
"layout": "approval",
"require_reason": true
}
}
}
}Update a Task.
PATCH /work-management/task/
Updates task data.
Authentication: Bearer token
Request body
Task object update.
-
organization_idstring Required -
Identifier for the organization this task belongs to.
-
project_idstring -
Optional project ID (tenant scope) that owns the task.
-
titlestring Required -
Short human-readable task title (the goal).
-
detailsstring -
Actionable instructions describing what the human must do and why.
-
typeWorkManagementTaskType Required -
Task Type object. Defines the category of human intervention required.
Available Types (Phase 1):
- approval: Human approval/rejection with reason
- data_completion: Fill missing structured data
- review: Human verification/review of something
- resolution: Human resolves a detected issue/blocker
- delegation: Human assigns/responsibilizes next steps
-
idinteger Required -
Numeric type identifier.
-
namestring Required -
Machine-readable type name.
-
titlestring Required -
Human-readable label.
-
colorstring -
Optional UI color for the type badge.
-
priorityWorkManagementTaskPriority Required -
Task Priority object. Used for inbox ordering and escalation decisions.
Available Priorities (Phase 1):
- low, medium, high, critical
-
idinteger Required -
Numeric priority identifier.
-
namestring Required -
Machine-readable priority name.
-
titlestring Required -
Human-readable label.
-
colorstring -
Optional UI color for the priority badge.
-
assigneeWorkManagementTaskAssignee -
Assignment information. Stores intended responsibility (user or group). Enforcement is outside the entity.
-
assignee_typestring Required -
Defines whether assignment targets a user or group.
Allowed valuesusergroup -
userobject -
Assigned user reference when assignee_type is user.
-
idstring -
User id.
-
namestring -
Display name.
-
-
groupobject -
Assigned group reference when assignee_type is group.
-
idstring -
Group id.
-
namestring -
Group name.
-
-
-
ownershipWorkManagementTaskOwnership -
Ownership (claim) information. Distinct from assignee: assignee is who should do it; ownership is who took it.
-
is_claimedboolean Required -
Indicates whether the task is claimed.
-
claimed_byobject -
User reference who claimed the task.
-
idstring -
User id.
-
namestring -
Display name.
-
-
claimed_atstring -
Unix timestamp in string format when claimed.
-
-
slaWorkManagementTaskSLA -
Task SLA object (NOT a type). This is a timing/constraint object that defines due dates and service expectations.
SLA is stored as an object because it is a set of time-related properties, not a categorical type.
-
due_atstring Required -
Unix timestamp in string format indicating when the task is due.
-
sla_msinteger Required -
SLA duration in milliseconds from task creation.
-
is_overdueboolean Required -
Computed at read time. True if current time exceeds due_at.
-
-
required_outputWorkManagementTaskRequiredOutput Required -
Defines what the human must provide to complete the task. Stored as a JSON-schema-like object to enable deterministic validation.
-
schemaobject Required -
JSON-schema-like description of required outputs.
-
ui_hintobject -
Optional UI hints for rendering a default completion form.
-
-
outputsobject -
Outputs provided by the human when completing the task. Must match required_output.schema when BaseModel.status becomes "completed".
-
payloadWorkManagementTaskPayload -
Task operational payload. Stores evidence blocks and soft references required by the human. This is the correct place for task context/evidence (NOT BaseModel.context).
-
summarystring -
Short summary describing what triggered the task.
-
evidencearray<object> -
Controlled evidence blocks (sanitized).
-
kindstring -
Evidence kind label.
-
payloadobject -
Evidence payload content.
-
-
linked_entitiesarray<object> -
Soft references to related entities (not hard dependencies).
-
system_domainstring -
Related domain.
-
system_entitystring -
Related entity name.
-
system_entity_idstring -
Related entity id.
-
-
hitlobject -
Human-in-the-Loop control payload. Free-form object consumed by the App Engine app declared in
task.execution.app_slug. The shape is determined byhitl.approval_type.name(binary_approval, tool_approval, plan_review, single_select_decision, multi_select_decision, review_edit_reject).
-
-
executionWorkManagementTaskExecution -
Task execution context for HITL (Human-in-the-Loop) integration. Defines how the task is completed: via an App Engine app or via the default output form.
When app_slug is provided, the task delegates output collection to an App Engine app. The app receives task context via input_payload and returns structured outputs via submitOutput().
When app_slug is null/absent, the task uses the auto-generated output form derived from required_output.schema.
App Engine sessions already support execution_context_type: "task" and task_id natively.
-
app_slugstring -
Slug of the App Engine app to open for HITL output collection. If null, the task uses the default output form (auto-generated from required_output.schema).
-
app_session_idstring -
Session ID created by App Engine when the app is opened. Populated at runtime when the user opens the app, not at task creation.
-
launch_modestring -
App Engine launch mode for the app.
-
input_payloadobject -
Additional data passed to the app on launch. Merged with task.payload when opening the app.
-
Responses
-
200OK.
curl -X PATCH https://api.sommatic.ai/work-management/task/ \
-H "Authorization: Bearer $SOMMATIC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"organization_id": "org-123",
"title": "Approve billing exception",
"type": {
"id": 10,
"name": "approval",
"title": "Approval",
"color": "#0288d1"
},
"priority": {
"id": 3,
"name": "high",
"title": "High",
"color": "#f57c00"
},
"required_output": {
"schema": {
"type": "object",
"required": [
"decision",
"reason"
],
"properties": {
"decision": {
"type": "string",
"enum": [
"approved",
"rejected"
]
},
"reason": {
"type": "string"
},
"notes": {
"type": "string"
}
}
},
"ui_hint": {
"layout": "approval",
"require_reason": true
}
}
}'const response = await fetch('https://api.sommatic.ai/work-management/task/', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"organization_id": "org-123",
"title": "Approve billing exception",
"type": {
"id": 10,
"name": "approval",
"title": "Approval",
"color": "#0288d1"
},
"priority": {
"id": 3,
"name": "high",
"title": "High",
"color": "#f57c00"
},
"required_output": {
"schema": {
"type": "object",
"required": [
"decision",
"reason"
],
"properties": {
"decision": {
"type": "string",
"enum": [
"approved",
"rejected"
]
},
"reason": {
"type": "string"
},
"notes": {
"type": "string"
}
}
},
"ui_hint": {
"layout": "approval",
"require_reason": true
}
}
}),
});
const { success, message, result } = await response.json();import os
import requests
response = requests.patch(
"https://api.sommatic.ai/work-management/task/",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
json={
"organization_id": "org-123",
"title": "Approve billing exception",
"type": {
"id": 10,
"name": "approval",
"title": "Approval",
"color": "#0288d1"
},
"priority": {
"id": 3,
"name": "high",
"title": "High",
"color": "#f57c00"
},
"required_output": {
"schema": {
"type": "object",
"required": [
"decision",
"reason"
],
"properties": {
"decision": {
"type": "string",
"enum": [
"approved",
"rejected"
]
},
"reason": {
"type": "string"
},
"notes": {
"type": "string"
}
}
},
"ui_hint": {
"layout": "approval",
"require_reason": True
}
}
},
)
data = response.json(){
"status": 200,
"success": true,
"message": "Operation completed successfully",
"result": {
"organization_id": "org-123",
"title": "Approve billing exception",
"type": {
"id": 10,
"name": "approval",
"title": "Approval",
"color": "#0288d1"
},
"priority": {
"id": 3,
"name": "high",
"title": "High",
"color": "#f57c00"
},
"required_output": {
"schema": {
"type": "object",
"required": [
"decision",
"reason"
],
"properties": {
"decision": {
"type": "string",
"enum": [
"approved",
"rejected"
]
},
"reason": {
"type": "string"
},
"notes": {
"type": "string"
}
}
},
"ui_hint": {
"layout": "approval",
"require_reason": true
}
}
}
}Archive a Task.
DELETE /work-management/task/
Authentication: Bearer token
Request body
ID of the task to delete/archive
-
idstring
Responses
-
200OK.
curl -X DELETE https://api.sommatic.ai/work-management/task/ \
-H "Authorization: Bearer $SOMMATIC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "<id>"
}'const response = await fetch('https://api.sommatic.ai/work-management/task/', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"id": "<id>"
}),
});
const { success, message, result } = await response.json();import os
import requests
response = requests.delete(
"https://api.sommatic.ai/work-management/task/",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
json={
"id": "<id>"
},
)
data = response.json()Get tasks by query selector.
GET /work-management/task/{queryselector}
Returns task information. Use id with search for a single task, or all with pagination and status filters.
Authentication: Bearer token
Parameters
-
queryselectorenum path Required -
Filter selector
idinboxlistallstatusestypesprioritiestransitions -
searchstring query -
Task ID when queryselector is `id`.
-
organization_idstring query -
Filter tasks by organization ID.
-
include_statusstring query -
Comma-separated status names to include (e.g. queued,assigned,claimed).
-
exclude_statusstring query -
Comma-separated status names to exclude (e.g. deleted).
-
pageinteger query -
Page number for pagination (when queryselector is `all`).
-
pageSizeinteger query -
Number of records per page (when queryselector is `all`).
Responses
-
200OK.
curl -X GET https://api.sommatic.ai/work-management/task/id \
-H "Authorization: Bearer $SOMMATIC_TOKEN"const response = await fetch('https://api.sommatic.ai/work-management/task/id', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
},
});
const { success, message, result } = await response.json();import os
import requests
response = requests.get(
"https://api.sommatic.ai/work-management/task/id",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
)
data = response.json()SSE stream for real-time task notifications
GET /work-management/task/stream
Server-Sent Events stream filtered by user identity. Pushes task-assigned events when tasks are created for the connected user.
Authentication: Bearer token
Parameters
-
user[identity]string query Required -
User identity for filtering notifications
Responses
-
200SSE event stream (Content-Type text/event-stream)
curl -X GET https://api.sommatic.ai/work-management/task/stream?user[identity]=<user[identity]> \
-H "Authorization: Bearer $SOMMATIC_TOKEN" \
-Nconst response = await fetch('https://api.sommatic.ai/work-management/task/stream?user[identity]=<user[identity]>', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
},
});
const { success, message, result } = await response.json();import os
import requests
response = requests.get(
"https://api.sommatic.ai/work-management/task/stream?user[identity]=<user[identity]>",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
)
data = response.json()Apply a lifecycle transition to a Task.
PATCH /work-management/task/transition/
Transitions a task to a new status (assign, claim, start, complete, reject, invalidate, expire).
Authentication: Bearer token
Request body
-
idstring Required -
Task ID
-
transition_namestring Required - Allowed values
assignclaimstartcompleterejectinvalidateexpire -
payloadobject -
Extra data for the transition (e.g. assignee, outputs, claimed_by)
Responses
-
200OK. -
500Something was wrong while performing this action.
curl -X PATCH https://api.sommatic.ai/work-management/task/transition/ \
-H "Authorization: Bearer $SOMMATIC_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "<id>",
"transition_name": "assign"
}'const response = await fetch('https://api.sommatic.ai/work-management/task/transition/', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.SOMMATIC_TOKEN}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"id": "<id>",
"transition_name": "assign"
}),
});
const { success, message, result } = await response.json();import os
import requests
response = requests.patch(
"https://api.sommatic.ai/work-management/task/transition/",
headers={
"Authorization": f"Bearer {os.environ['SOMMATIC_TOKEN']}",
},
json={
"id": "<id>",
"transition_name": "assign"
},
)
data = response.json(){
"status": 200,
"success": true,
"message": "Operation completed successfully",
"result": {
"id": "<id>",
"transition_name": "assign"
}
}