{
  "openapi": "3.0.1",
  "info": {
    "title": "Zendesk AI Billing & Outcome Auditor - Reconcile",
    "description": "Audit Zendesk AI billing and Resolution Allowance outcomes against sanitized evidence and buyer rules. Reconcile separates supported charges, potential disputes, business-value variance, and unverifiable items for finance, CX, automation, and AI-agent workflows.",
    "version": "0.1",
    "x-build-id": "IUXi4ryeddhdBqT3b"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/factrelay~reconcile/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-factrelay-reconcile",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/factrelay~reconcile/runs": {
      "post": {
        "operationId": "runs-sync-factrelay-reconcile",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/factrelay~reconcile/run-sync": {
      "post": {
        "operationId": "run-sync-factrelay-reconcile",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "conversations",
          "billing",
          "policy"
        ],
        "properties": {
          "conversations": {
            "title": "Sanitized Zendesk conversations",
            "minItems": 1,
            "type": "array",
            "description": "JSON array of only the audit facts Reconcile needs. Use opaque Zendesk IDs; replace raw reasoning text with automated_resolution_reasoning_present true/false.",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "conversation_id": {
                  "type": "string",
                  "nullable": true,
                  "title": "Conversation ID",
                  "description": "Opaque Zendesk conversation ID used only to join sanitized facts to billing rows."
                },
                "platform_conversation_id": {
                  "type": "string",
                  "nullable": true,
                  "title": "Platform conversation ID",
                  "description": "Optional alternate Zendesk identifier used for deterministic matching."
                },
                "automated_resolution": {
                  "type": "boolean",
                  "nullable": true,
                  "title": "Automated resolution",
                  "description": "Whether Zendesk marked the conversation as automatically resolved."
                },
                "automated_resolution_reasoning_present": {
                  "type": "boolean",
                  "nullable": true,
                  "title": "Resolution reasoning present",
                  "description": "True when Zendesk supplied non-empty resolution reasoning; do not paste the reasoning text."
                },
                "last_resolution": {
                  "type": "string",
                  "enum": [
                    "VERIFIED",
                    "CONTAINED",
                    "ASSISTED_ESCALATION",
                    "UNKNOWN"
                  ],
                  "nullable": true,
                  "title": "Resolution tier",
                  "description": "Zendesk resolution tier observed for this conversation."
                },
                "test_mode": {
                  "type": "boolean",
                  "nullable": true,
                  "title": "Test mode",
                  "description": "Whether Zendesk marked this conversation as a test case."
                },
                "conversation_end_time": {
                  "type": "string",
                  "nullable": true,
                  "title": "Conversation end time",
                  "description": "Optional timezone-aware ISO 8601 timestamp used for event timing."
                }
              }
            }
          },
          "billing": {
            "title": "Billing rows",
            "minItems": 1,
            "type": "array",
            "description": "JSON array of billed outcome rows. Money must be decimal strings or null. Pricing model is fixed to the supported Zendesk 2026 resolution-allowance rule pack.",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "case_ref": {
                  "type": "string",
                  "nullable": true,
                  "title": "Case reference",
                  "description": "Opaque case reference used to join billing or buyer events to a sanitized conversation."
                },
                "billing_period": {
                  "type": "string",
                  "title": "Billing period",
                  "description": "Vendor billing period label, for example 2026-08."
                },
                "resolution_tier": {
                  "type": "string",
                  "enum": [
                    "VERIFIED",
                    "CONTAINED",
                    "ASSISTED_ESCALATION",
                    "UNKNOWN"
                  ],
                  "title": "Billed resolution tier",
                  "description": "Resolution tier claimed by the vendor billing row."
                },
                "billed_units": {
                  "type": "integer",
                  "minimum": 0,
                  "title": "Billed units",
                  "description": "Non-negative number of billed outcome units in this row."
                },
                "unit_rate": {
                  "type": "string",
                  "nullable": true,
                  "title": "Unit rate",
                  "description": "Optional exact decimal string for the price per billed unit."
                },
                "billed_amount": {
                  "type": "string",
                  "nullable": true,
                  "title": "Billed amount",
                  "description": "Optional exact decimal string for the billed amount of this row."
                },
                "currency": {
                  "type": "string",
                  "pattern": "^[A-Z]{3}$",
                  "title": "Currency",
                  "description": "Three-letter uppercase billing currency code, such as USD or TWD."
                }
              },
              "required": [
                "billing_period",
                "resolution_tier",
                "billed_units",
                "currency"
              ]
            }
          },
          "events": {
            "title": "Buyer-side events (optional)",
            "type": "array",
            "description": "Optional deterministic buyer events. Event evidence IDs are generated inside the Actor; do not include free-text evidence.",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "properties": {
                "case_ref": {
                  "type": "string",
                  "title": "Case reference",
                  "description": "Opaque case reference used to join billing or buyer events to a sanitized conversation."
                },
                "event_type": {
                  "type": "string",
                  "enum": [
                    "REOPENED",
                    "HUMAN_REWORK",
                    "NEGATIVE_FEEDBACK",
                    "DUPLICATE_LINK",
                    "EXPLICIT_UNRESOLVED"
                  ],
                  "title": "Event type",
                  "description": "Deterministic buyer-side event such as reopen, human rework, or negative feedback."
                },
                "event_at": {
                  "type": "string",
                  "title": "Event time",
                  "description": "Timezone-aware ISO 8601 time when the buyer-side event occurred."
                },
                "same_issue": {
                  "type": "boolean",
                  "nullable": true,
                  "title": "Same issue",
                  "description": "Optional determination of whether a reopen concerns the same issue; leave null when unknown."
                }
              },
              "required": [
                "case_ref",
                "event_type",
                "event_at"
              ]
            },
            "default": []
          },
          "policy": {
            "title": "Buyer acceptance policy",
            "required": [
              "reopen_window_days"
            ],
            "type": "object",
            "description": "Deterministic business acceptance rules. The policy version is generated by the Actor; no customer label is stored in output.",
            "properties": {
              "reopen_window_days": {
                "type": "integer",
                "minimum": 0,
                "default": 7,
                "title": "Reopen window (days)",
                "description": "Number of days in which a same-issue reopen can invalidate business acceptance."
              },
              "human_rework_invalidates": {
                "type": "boolean",
                "default": true,
                "title": "Human rework invalidates",
                "description": "Reject business acceptance when a human had to redo the resolved work."
              },
              "duplicate_invalidates": {
                "type": "boolean",
                "default": true,
                "title": "Duplicate invalidates",
                "description": "Reject business acceptance for a confirmed duplicate outcome."
              },
              "negative_feedback_invalidates": {
                "type": "boolean",
                "default": true,
                "title": "Negative feedback invalidates",
                "description": "Reject business acceptance when deterministic negative feedback is present."
              },
              "explicit_unresolved_invalidates": {
                "type": "boolean",
                "default": true,
                "title": "Explicit unresolved invalidates",
                "description": "Reject business acceptance when the case is explicitly marked unresolved."
              }
            },
            "additionalProperties": false
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}