Skip to content

Operations

The POST /ops endpoint is the single write path into the Mentu ledger. Every state change — creating a memory, committing to a task, closing work — flows through this endpoint as an operation.

Base URL: https://mentu-proxy.affihub.workers.dev

Endpoint: POST /ops

All requests require the standard authentication headers.


OperationPurpose
captureCreate a memory (observation)
commitCreate a commitment (work item)
claimAssign a commitment to an owner
releaseUnassign a commitment from its owner
closeClose a commitment as passed or failed
annotateAdd a note to a commitment or memory
submitSubmit a commitment for review
approveApprove a submitted commitment
reopenReopen a closed commitment
linkLink a memory to a commitment
dismissDismiss a memory
triageTriage an untriaged memory

Create a memory (observation)

Captures a piece of information — a bug sighting, a design note, a metric snapshot — and stores it as a memory in the workspace. Memories are the raw observations that feed into commitments.

FieldTypeDescription
opstringMust be "capture"
bodystringThe content of the memory
FieldTypeDescription
kindstringCategory of memory (e.g., "bug-report", "observation", "metric", "note")
tagsstring[]Tags for filtering and organization
metaobjectArbitrary metadata to attach to the memory
Terminal window
curl -X POST https://mentu-proxy.affihub.workers.dev/ops \
-H "X-Proxy-Token: $MENTU_API_TOKEN" \
-H "X-Workspace-Id: $MENTU_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"op": "capture",
"body": "Found bug in auth flow: session token not refreshed after password change",
"kind": "bug-report",
"tags": ["auth", "critical"]
}'
{
"success": true,
"op_id": "op_12345678",
"record_id": "mem_abcdef12"
}

Create a commitment (work item)

Creates a new commitment in the open state. A commitment represents a unit of work that must be claimed, completed, and closed with evidence.

FieldTypeDescription
opstringMust be "commit"
titlestringShort title for the commitment
FieldTypeDescription
bodystringDetailed description of the work
tagsstring[]Tags for filtering and organization
prioritystringPriority level (e.g., "critical", "high", "medium", "low")
metaobjectArbitrary metadata
Terminal window
curl -X POST https://mentu-proxy.affihub.workers.dev/ops \
-H "X-Proxy-Token: $MENTU_API_TOKEN" \
-H "X-Workspace-Id: $MENTU_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"op": "commit",
"title": "Fix session token refresh after password change",
"body": "Session token is not refreshed when a user changes their password, leaving the old token valid.",
"tags": ["auth", "bug"],
"priority": "critical"
}'
{
"success": true,
"op_id": "op_23456789",
"record_id": "cmt_bcdef123"
}

Assign a commitment to an owner

Transitions a commitment from open to claimed. The owner field records who is responsible for completing the work.

FieldTypeDescription
opstringMust be "claim"
idstringThe commitment ID to claim
ownerstringIdentifier of the agent or person claiming the work
FieldTypeDescription
metaobjectArbitrary metadata (e.g., estimated duration)
Terminal window
curl -X POST https://mentu-proxy.affihub.workers.dev/ops \
-H "X-Proxy-Token: $MENTU_API_TOKEN" \
-H "X-Workspace-Id: $MENTU_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"op": "claim",
"id": "cmt_bcdef123",
"owner": "agent-ralph"
}'
{
"success": true,
"op_id": "op_34567890",
"record_id": "cmt_bcdef123"
}

Unassign a commitment from its owner

Transitions a commitment back from claimed to open, removing the current owner. Use this when an agent can no longer complete the work and it needs to be re-assigned.

FieldTypeDescription
opstringMust be "release"
idstringThe commitment ID to release
FieldTypeDescription
reasonstringWhy the commitment is being released
metaobjectArbitrary metadata
Terminal window
curl -X POST https://mentu-proxy.affihub.workers.dev/ops \
-H "X-Proxy-Token: $MENTU_API_TOKEN" \
-H "X-Workspace-Id: $MENTU_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"op": "release",
"id": "cmt_bcdef123",
"reason": "Blocked on upstream dependency, needs different expertise"
}'
{
"success": true,
"op_id": "op_45678901",
"record_id": "cmt_bcdef123"
}

Close a commitment as passed or failed

Terminates a commitment. Every close operation must include an evidence array, even if empty for a failure. This is a hard requirement — the API will reject close operations without the evidence field.

FieldTypeDescription
opstringMust be "close"
idstringThe commitment ID to close
resultstringEither "pass" or "fail"
evidencearrayArray of evidence objects documenting the outcome
FieldTypeDescription
summarystringHuman-readable summary of the outcome
metaobjectArbitrary metadata

Each item in the evidence array should contain:

FieldTypeDescription
typestringEvidence type (e.g., "build", "test", "pr", "screenshot", "log")
urlstringLink to the evidence (optional)
bodystringDescription or inline content (optional)
Terminal window
curl -X POST https://mentu-proxy.affihub.workers.dev/ops \
-H "X-Proxy-Token: $MENTU_API_TOKEN" \
-H "X-Workspace-Id: $MENTU_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"op": "close",
"id": "cmt_bcdef123",
"result": "pass",
"evidence": [
{
"type": "pr",
"url": "https://github.com/org/repo/pull/42",
"body": "PR merged, fixes session refresh logic"
},
{
"type": "build",
"url": "https://ci.example.com/builds/1234",
"body": "All tests passing"
}
],
"summary": "Session token now refreshes correctly after password change"
}'
Terminal window
curl -X POST https://mentu-proxy.affihub.workers.dev/ops \
-H "X-Proxy-Token: $MENTU_API_TOKEN" \
-H "X-Workspace-Id: $MENTU_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"op": "close",
"id": "cmt_bcdef123",
"result": "fail",
"evidence": [],
"summary": "Could not reproduce the issue in staging environment"
}'
{
"success": true,
"op_id": "op_56789012",
"record_id": "cmt_bcdef123"
}

Add a note to a commitment or memory

Appends a note to an existing record without changing its state. Use annotations to log progress, add context, or record observations during work.

FieldTypeDescription
opstringMust be "annotate"
idstringThe commitment or memory ID to annotate
bodystringThe annotation content
FieldTypeDescription
kindstringAnnotation category (e.g., "progress", "blocker", "question")
metaobjectArbitrary metadata
Terminal window
curl -X POST https://mentu-proxy.affihub.workers.dev/ops \
-H "X-Proxy-Token: $MENTU_API_TOKEN" \
-H "X-Workspace-Id: $MENTU_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"op": "annotate",
"id": "cmt_bcdef123",
"body": "Root cause identified: token cache not invalidated on password change event",
"kind": "progress"
}'
{
"success": true,
"op_id": "op_67890123",
"record_id": "cmt_bcdef123"
}

Submit a commitment for review

Transitions a commitment from claimed to in_review. Use this when work is complete and ready for approval.

FieldTypeDescription
opstringMust be "submit"
idstringThe commitment ID to submit
FieldTypeDescription
bodystringSubmission notes or summary of work done
evidencearrayArray of evidence objects supporting the submission
metaobjectArbitrary metadata
Terminal window
curl -X POST https://mentu-proxy.affihub.workers.dev/ops \
-H "X-Proxy-Token: $MENTU_API_TOKEN" \
-H "X-Workspace-Id: $MENTU_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"op": "submit",
"id": "cmt_bcdef123",
"body": "Fix implemented and tests added. Ready for review.",
"evidence": [
{
"type": "pr",
"url": "https://github.com/org/repo/pull/42"
}
]
}'
{
"success": true,
"op_id": "op_78901234",
"record_id": "cmt_bcdef123"
}

Approve a submitted commitment

Approves a commitment that is currently in_review. This is typically done by a human reviewer or a CI pipeline after verifying the work.

FieldTypeDescription
opstringMust be "approve"
idstringThe commitment ID to approve
FieldTypeDescription
bodystringApproval notes or feedback
metaobjectArbitrary metadata
Terminal window
curl -X POST https://mentu-proxy.affihub.workers.dev/ops \
-H "X-Proxy-Token: $MENTU_API_TOKEN" \
-H "X-Workspace-Id: $MENTU_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"op": "approve",
"id": "cmt_bcdef123",
"body": "LGTM. Tests pass, code is clean."
}'
{
"success": true,
"op_id": "op_89012345",
"record_id": "cmt_bcdef123"
}

Reopen a closed commitment

Transitions a closed commitment back to open. Use this when a previously closed item needs additional work — for example, when a bug resurfaces after being marked as fixed.

FieldTypeDescription
opstringMust be "reopen"
idstringThe commitment ID to reopen
FieldTypeDescription
reasonstringWhy the commitment is being reopened
metaobjectArbitrary metadata
Terminal window
curl -X POST https://mentu-proxy.affihub.workers.dev/ops \
-H "X-Proxy-Token: $MENTU_API_TOKEN" \
-H "X-Workspace-Id: $MENTU_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"op": "reopen",
"id": "cmt_bcdef123",
"reason": "Bug resurfaced in production after deploy v2.3.1"
}'
{
"success": true,
"op_id": "op_90123456",
"record_id": "cmt_bcdef123"
}

Link a memory to a commitment

Creates an association between a memory and a commitment. This connects raw observations to actionable work items, making it possible to trace why a commitment was created.

FieldTypeDescription
opstringMust be "link"
idstringThe memory ID to link
targetstringThe commitment ID to link to
FieldTypeDescription
metaobjectArbitrary metadata
Terminal window
curl -X POST https://mentu-proxy.affihub.workers.dev/ops \
-H "X-Proxy-Token: $MENTU_API_TOKEN" \
-H "X-Workspace-Id: $MENTU_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"op": "link",
"id": "mem_abcdef12",
"target": "cmt_bcdef123"
}'
{
"success": true,
"op_id": "op_01234567",
"record_id": "mem_abcdef12"
}

Dismiss a memory

Marks a memory as dismissed. Dismissed memories are excluded from triage views and default queries. Use this for noise, duplicates, or observations that do not require action.

FieldTypeDescription
opstringMust be "dismiss"
idstringThe memory ID to dismiss
FieldTypeDescription
reasonstringWhy the memory is being dismissed
metaobjectArbitrary metadata
Terminal window
curl -X POST https://mentu-proxy.affihub.workers.dev/ops \
-H "X-Proxy-Token: $MENTU_API_TOKEN" \
-H "X-Workspace-Id: $MENTU_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"op": "dismiss",
"id": "mem_abcdef12",
"reason": "Duplicate of mem_xyz789"
}'
{
"success": true,
"op_id": "op_11234567",
"record_id": "mem_abcdef12"
}

Triage an untriaged memory

Marks a memory as triaged, optionally assigning it a priority or kind. Use this as the first step in processing new observations before deciding whether to commit, link, or dismiss them.

FieldTypeDescription
opstringMust be "triage"
idstringThe memory ID to triage
FieldTypeDescription
prioritystringAssigned priority (e.g., "critical", "high", "medium", "low")
kindstringReclassify the memory kind
bodystringTriage notes
metaobjectArbitrary metadata
Terminal window
curl -X POST https://mentu-proxy.affihub.workers.dev/ops \
-H "X-Proxy-Token: $MENTU_API_TOKEN" \
-H "X-Workspace-Id: $MENTU_WORKSPACE_ID" \
-H "Content-Type: application/json" \
-d '{
"op": "triage",
"id": "mem_abcdef12",
"priority": "high",
"kind": "bug-report",
"body": "Confirmed reproducible. Needs a commitment."
}'
{
"success": true,
"op_id": "op_21234567",
"record_id": "mem_abcdef12"
}

Every successful operation returns:

FieldTypeDescription
successbooleanAlways true for successful operations
op_idstringUnique identifier for this ledger entry
record_idstringThe ID of the affected commitment or memory

For error responses, see Errors.