On this page
Sommatic Docs
Open portal

Human in the loop Beta

Tasks, transitions and the task stream.

View as Markdown
Open in

Create a new Task.

POST /work-management/task/

Returns the created task.

Authentication: Bearer token

Request body

Task object.

organization_id string Required

Identifier for the organization this task belongs to.

project_id string

Optional project ID (tenant scope) that owns the task.

title string Required

Short human-readable task title (the goal).

details string

Actionable instructions describing what the human must do and why.

type WorkManagementTaskType 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
id integer Required

Numeric type identifier.

name string Required

Machine-readable type name.

title string Required

Human-readable label.

color string

Optional UI color for the type badge.

priority WorkManagementTaskPriority Required

Task Priority object. Used for inbox ordering and escalation decisions.

Available Priorities (Phase 1):

  • low, medium, high, critical
id integer Required

Numeric priority identifier.

name string Required

Machine-readable priority name.

title string Required

Human-readable label.

color string

Optional UI color for the priority badge.

assignee WorkManagementTaskAssignee

Assignment information. Stores intended responsibility (user or group). Enforcement is outside the entity.

assignee_type string Required

Defines whether assignment targets a user or group.

Allowed values usergroup
user object

Assigned user reference when assignee_type is user.

id string

User id.

name string

Display name.

group object

Assigned group reference when assignee_type is group.

id string

Group id.

name string

Group name.

ownership WorkManagementTaskOwnership

Ownership (claim) information. Distinct from assignee: assignee is who should do it; ownership is who took it.

is_claimed boolean Required

Indicates whether the task is claimed.

claimed_by object

User reference who claimed the task.

id string

User id.

name string

Display name.

claimed_at string

Unix timestamp in string format when claimed.

sla WorkManagementTaskSLA

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_at string Required

Unix timestamp in string format indicating when the task is due.

sla_ms integer Required

SLA duration in milliseconds from task creation.

is_overdue boolean Required

Computed at read time. True if current time exceeds due_at.

required_output WorkManagementTaskRequiredOutput Required

Defines what the human must provide to complete the task. Stored as a JSON-schema-like object to enable deterministic validation.

schema object Required

JSON-schema-like description of required outputs.

ui_hint object

Optional UI hints for rendering a default completion form.

outputs object

Outputs provided by the human when completing the task. Must match required_output.schema when BaseModel.status becomes "completed".

payload WorkManagementTaskPayload

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).

summary string

Short summary describing what triggered the task.

evidence array<object>

Controlled evidence blocks (sanitized).

kind string

Evidence kind label.

payload object

Evidence payload content.

linked_entities array<object>

Soft references to related entities (not hard dependencies).

system_domain string

Related domain.

system_entity string

Related entity name.

system_entity_id string

Related entity id.

hitl object

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 by hitl.approval_type.name (binary_approval, tool_approval, plan_review, single_select_decision, multi_select_decision, review_edit_reject).

execution WorkManagementTaskExecution

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_slug string

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_id string

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_mode string

App Engine launch mode for the app.

input_payload object

Additional data passed to the app on launch. Merged with task.payload when opening the app.

Responses

  • 200 OK.
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
      }
    }
  }'
Response 200
{
  "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_id string Required

Identifier for the organization this task belongs to.

project_id string

Optional project ID (tenant scope) that owns the task.

title string Required

Short human-readable task title (the goal).

details string

Actionable instructions describing what the human must do and why.

type WorkManagementTaskType 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
id integer Required

Numeric type identifier.

name string Required

Machine-readable type name.

title string Required

Human-readable label.

color string

Optional UI color for the type badge.

priority WorkManagementTaskPriority Required

Task Priority object. Used for inbox ordering and escalation decisions.

Available Priorities (Phase 1):

  • low, medium, high, critical
id integer Required

Numeric priority identifier.

name string Required

Machine-readable priority name.

title string Required

Human-readable label.

color string

Optional UI color for the priority badge.

assignee WorkManagementTaskAssignee

Assignment information. Stores intended responsibility (user or group). Enforcement is outside the entity.

assignee_type string Required

Defines whether assignment targets a user or group.

Allowed values usergroup
user object

Assigned user reference when assignee_type is user.

id string

User id.

name string

Display name.

group object

Assigned group reference when assignee_type is group.

id string

Group id.

name string

Group name.

ownership WorkManagementTaskOwnership

Ownership (claim) information. Distinct from assignee: assignee is who should do it; ownership is who took it.

is_claimed boolean Required

Indicates whether the task is claimed.

claimed_by object

User reference who claimed the task.

id string

User id.

name string

Display name.

claimed_at string

Unix timestamp in string format when claimed.

sla WorkManagementTaskSLA

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_at string Required

Unix timestamp in string format indicating when the task is due.

sla_ms integer Required

SLA duration in milliseconds from task creation.

is_overdue boolean Required

Computed at read time. True if current time exceeds due_at.

required_output WorkManagementTaskRequiredOutput Required

Defines what the human must provide to complete the task. Stored as a JSON-schema-like object to enable deterministic validation.

schema object Required

JSON-schema-like description of required outputs.

ui_hint object

Optional UI hints for rendering a default completion form.

outputs object

Outputs provided by the human when completing the task. Must match required_output.schema when BaseModel.status becomes "completed".

payload WorkManagementTaskPayload

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).

summary string

Short summary describing what triggered the task.

evidence array<object>

Controlled evidence blocks (sanitized).

kind string

Evidence kind label.

payload object

Evidence payload content.

linked_entities array<object>

Soft references to related entities (not hard dependencies).

system_domain string

Related domain.

system_entity string

Related entity name.

system_entity_id string

Related entity id.

hitl object

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 by hitl.approval_type.name (binary_approval, tool_approval, plan_review, single_select_decision, multi_select_decision, review_edit_reject).

execution WorkManagementTaskExecution

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_slug string

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_id string

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_mode string

App Engine launch mode for the app.

input_payload object

Additional data passed to the app on launch. Merged with task.payload when opening the app.

Responses

  • 200 OK.
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
      }
    }
  }'
Response 200
{
  "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

id string

Responses

  • 200 OK.
curl -X DELETE https://api.sommatic.ai/work-management/task/ \
  -H "Authorization: Bearer $SOMMATIC_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "<id>"
  }'

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

queryselector enum path Required

Filter selector

idinboxlistallstatusestypesprioritiestransitions

search string query

Task ID when queryselector is `id`.

organization_id string query

Filter tasks by organization ID.

include_status string query

Comma-separated status names to include (e.g. queued,assigned,claimed).

exclude_status string query

Comma-separated status names to exclude (e.g. deleted).

page integer query

Page number for pagination (when queryselector is `all`).

pageSize integer query

Number of records per page (when queryselector is `all`).

Responses

  • 200 OK.
curl -X GET https://api.sommatic.ai/work-management/task/id \
  -H "Authorization: Bearer $SOMMATIC_TOKEN"

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

  • 200 SSE 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" \
  -N

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

id string Required

Task ID

transition_name string Required
Allowed values assignclaimstartcompleterejectinvalidateexpire
payload object

Extra data for the transition (e.g. assignee, outputs, claimed_by)

Responses

  • 200 OK.
  • 500 Something 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"
  }'
Response 200
{
  "status": 200,
  "success": true,
  "message": "Operation completed successfully",
  "result": {
    "id": "<id>",
    "transition_name": "assign"
  }
}

Install agent tools

Give your coding agent the official Sommatic AI docs: skills, the docs MCP server and Markdown pages, so it never has to scrape the site.

Skills only. They do not update by themselves; run it again to refresh.

npx skills add https://docs.sommatic.ai
How agents read these docs