{
  "openapi": "3.0.1",
  "info": {
    "title": "CRM & Notion Data Audit — Diff Your Records Against a Dataset",
    "description": "Compare Notion, HubSpot, Supabase or any MCP-connected app against an Apify dataset. Reports what never made it in, what's gone stale, and which fields have drifted apart. Read-only — it never writes to your app.",
    "version": "1.0",
    "x-build-id": "kgx5IafMNtErOtZvd"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/deadwood_data_solutions~connector-diff-audit/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-deadwood_data_solutions-connector-diff-audit",
        "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/deadwood_data_solutions~connector-diff-audit/runs": {
      "post": {
        "operationId": "runs-sync-deadwood_data_solutions-connector-diff-audit",
        "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/deadwood_data_solutions~connector-diff-audit/run-sync": {
      "post": {
        "operationId": "run-sync-deadwood_data_solutions-connector-diff-audit",
        "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": [
          "destination"
        ],
        "properties": {
          "destination": {
            "title": "Connector to audit",
            "type": "string",
            "description": "The MCP connector holding the records to check. Connect the app under Integrations in Apify Console first. This Actor only reads — it never writes. Credentials stay in Apify's proxy."
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "audit",
              "list-tools"
            ],
            "type": "string",
            "description": "Use 'list-tools' first to discover the connector's tool names, then 'audit'.",
            "default": "audit"
          },
          "datasetId": {
            "title": "Source dataset ID",
            "type": "string",
            "description": "Apify dataset treated as the source of truth. Required when mode is 'audit'."
          },
          "readTool": {
            "title": "Tool that lists the app's records",
            "type": "string",
            "description": "MCP tool returning the records to audit, e.g. 'query_database' for Notion, 'select' for Supabase."
          },
          "readToolArgs": {
            "title": "Arguments for the read tool",
            "type": "object",
            "description": "JSON arguments the read tool needs, e.g. {\"database_id\": \"abc123\"}."
          },
          "cursorArgName": {
            "title": "Pagination: cursor argument name",
            "type": "string",
            "description": "The argument the read tool accepts for paging, e.g. 'start_cursor'. Leave blank to read a single page. An audit against a partial read will wrongly report records as missing, so set this if your app pages."
          },
          "cursorPath": {
            "title": "Pagination: where the next cursor appears",
            "type": "string",
            "description": "Path to the next cursor in the response, e.g. 'next_cursor' or 'paging.next'. Dot paths supported."
          },
          "maxPages": {
            "title": "Maximum pages to fetch",
            "minimum": 1,
            "type": "integer",
            "description": "Hard stop on pagination. A repeated cursor also ends paging early.",
            "default": 10
          },
          "matchKey": {
            "title": "Field that joins the two sides",
            "type": "string",
            "description": "Field identifying a record on the source side, e.g. 'email', 'domain', 'licenseNumber'. Matching ignores case and surrounding spaces."
          },
          "destMatchKey": {
            "title": "Join field name in the app (if different)",
            "type": "string",
            "description": "Only needed when the connected app names the join field differently, e.g. 'workEmail' vs 'email'."
          },
          "compareFields": {
            "title": "Fields to compare",
            "type": "array",
            "description": "Source field names to check for drift, e.g. phone, status, owner. Leave empty to check only whether records exist on both sides.",
            "items": {
              "type": "string"
            }
          },
          "fieldMap": {
            "title": "Field mapping",
            "type": "object",
            "description": "Only needed when a compared field is named differently in the app, e.g. {\"phone\": \"contact.tel\"}."
          },
          "reportMissingAtDestination": {
            "title": "Report records missing from the app",
            "type": "boolean",
            "description": "Source rows that never made it into the connected app.",
            "default": true
          },
          "reportMissingInSource": {
            "title": "Report records the source no longer has",
            "type": "boolean",
            "description": "Records in the app with no matching row in the dataset — stale entries, or rows added by someone else.",
            "default": true
          },
          "reportChanged": {
            "title": "Report records whose values disagree",
            "type": "boolean",
            "description": "Records present on both sides where a compared field no longer matches.",
            "default": true
          },
          "includeIdentical": {
            "title": "Also report records that agree",
            "type": "boolean",
            "description": "Off by default — an audit is more useful when it lists only what needs attention.",
            "default": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}