Code

Owner/admin update of a live Mnemom Agent session's goal contract

Writes a NEW contract version under the SAME goal id into the gateway's sealed-contract record for conversationId (POST /internal/goal/contract), returning the new version and both hashes. Applies from the conversation's next turn — the request already in flight was judged against the version it read at its own start — and the session is notified once on that next turn. Never infers an update from conversation content; the caller supplies the full new contract. Resolves the org and confirms agent_id ownership exactly like GET /v1/agent/sessions/{conversationId} (same 404 agent_not_found collapse for a missing or cross-org agent), but requires the owner/admin role (a write), not any member role. A caller's own SESSION credential (a gateway-only-scoped API key, or one minted with kind: 'session') is refused with 403 session_credential_forbidden before the gateway is ever reached — a session must never update its own contract.

post/agent/sessions/{conversationId}/contract

Request

  • Base URL: https://api.mnemom.ai/v1
  • URL: https://api.mnemom.ai/v1/agent/sessions/{conversationId}/contract
  • Auth: one of:
    • HTTP bearer
    • API key in header X-Mnemom-Api-Key
    • API key in cookie mnemom_session

Path parameters

conversationIdstring required

The conversation id the CLI launched the session with.

Query parameters

agent_idstring required

The agent record id (agents.id) the session ran as.

org_idstring

Target organization (defaults to the caller's primary org).

Request body

expected_hashstring

Optimistic-concurrency guard: the hash the caller last read. A live contract that has moved past it is a 409 version_conflict.

expected_versionnumber

Optimistic-concurrency guard: the version the caller last read (alternative to expected_hash).

Response

The contract was updated. Returns the new version and both hashes.

conversation_idstring required
org_idstring required
contractunknown required
versioninteger required

The new contract version.

hashstring required

The new contract's hash.

previous_hashstring nullable required

The prior version's hash (updated_from).

sealed_atstring date-time required

Changes

No recorded changes to this operation across all 1 revision of this API.