{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://docs.sectigoaxiom.com/contract/schemas/ActionStatus.json",
  "type": "object",
  "properties": {
    "action_id": { "type": "string" },
    "root_action_id": { "type": "string" },
    "parent_action_id": { "type": "string" },
    "state": { "$ref": "ActionState.json" },
    "reason_code": { "$ref": "ReasonCode.json" },
    "progress": {
      "type": "string",
      "enum": ["delivery_pending", "waiting_on_person", "decision_readback_unavailable", "awaiting_agent_resume", "reconciling"]
    },
    "operation": { "type": "string" },
    "operation_key": { "type": "string" },
    "tenant": { "type": "string" },
    "service": { "type": "string" },
    "grant_id": { "type": "string" },
    "request_digest": { "type": "string", "description": "sha-256 digest of the canonical action the approver saw" },
    "summary": { "type": "string" },
    "status_url": { "type": "string" },
    "resume_url": { "type": "string" },
    "receipt_url": { "type": "string" },
    "decision_deadline": { "description": "Deadline to receive a verified decision", "type": "string" },
    "resume_deadline": { "description": "Last time to resume an approved action", "type": "string" },
    "expires_at": { "type": "string", "description": "RFC 3339 timestamp" },
    "retry_after_seconds": { "description": "Poll no sooner than this", "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
    "supported_modes": { "type": "array", "items": { "type": "string", "enum": ["poll", "webhook", "mcp_task", "sse"] } },
    "resume_actor": { "type": "string", "const": "original_agent" },
    "approvals": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "required": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 },
          "received": { "type": "integer", "minimum": -9007199254740991, "maximum": 9007199254740991 },
          "role": { "type": "string" },
          "system": { "type": "string" },
          "next_party": { "type": "string" }
        },
        "required": ["required", "received", "role", "system"]
      }
    },
    "outcome": {
      "type": "object",
      "properties": {
        "state": { "type": "string", "enum": ["succeeded", "failed", "outcome_unknown"] },
        "target_ref": { "type": "string" },
        "recorded_at": { "type": "string", "description": "RFC 3339 timestamp" },
        "result": { "$ref": "Json.json" }
      },
      "required": ["state", "recorded_at"]
    },
    "created_at": { "type": "string", "description": "RFC 3339 timestamp" },
    "updated_at": { "type": "string", "description": "RFC 3339 timestamp" }
  },
  "required": [
    "action_id",
    "root_action_id",
    "state",
    "reason_code",
    "operation",
    "operation_key",
    "tenant",
    "service",
    "request_digest",
    "summary",
    "status_url",
    "resume_url",
    "supported_modes",
    "resume_actor",
    "created_at",
    "updated_at"
  ],
  "description": "Authoritative action status"
}
