log_decision
Log a signed decision event to the ledger. Managed Mode (default for MCP): omit signing fields and pass agent_name - Audifact securely manages an Ed25519 keypair and signs on behalf of the agent. Events are immutable once recorded; managed mode provides strong auditability after receipt. For maximum provenance, use client-side signing via the SDK (agent_private_key_b64, or agent_public_key + signature). Linked outcomes must use the same signing method as the decision (managed or client-signed with the same agent key). Organization is always taken from the API key (do not send organization_id). Scenario hash is computed server-side from scenario_name + scenario_definition (+ optional context_schema) via resolve_scenario - you usually do not pass scenario_hash.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ts | No | ISO-8601 timestamp | |
| signature | No | Client-side signing: base64 signature over the canonical JSON body. | |
| agent_name | No | Managed Mode: agent identity within your org (default: default-agent). Audifact provisions and uses a managed signing key automatically. | |
| context_json | No | ||
| decision_type | No | ||
| metadata_json | No | ||
| scenario_hash | No | Advanced optional: 64-char hex scenario hash when already known. Usually omit - server computes from scenario_name + scenario_definition. | |
| scenario_name | No | Scenario identifier. Server resolves scenario_hash from scenario_name + scenario_definition (+ optional context_schema). | |
| context_schema | No | Optional JSON schema used to validate context_json. | |
| decision_label | No | ||
| decision_value | No | ||
| agent_public_key | No | Client-side signing: base64 public key (required with signature). | |
| context_schema_json | No | Backward-compatible alias for context_schema. | |
| public_context_json | No | Optional public structured context (shown on proof pages). Stored gzip-compressed; event hash includes content hash only. | |
| scenario_definition | No | Scenario definition object. Required when scenario_name is provided. | |
| public_decision_type | No | Optional public mirror of decision_type (shown on proof pages). | |
| agent_private_key_b64 | No | Client-side signing: base64 Ed25519 private key. Overrides managed mode when provided. | |
| public_decision_label | No | Optional public decision summary (shown on proof pages). | |
| public_decision_value | No | Optional public mirror of decision_value (shown on proof pages). | |
| scenario_definition_json | No | Backward-compatible alias for scenario_definition. |