{
  "openapi": "3.0.1",
  "info": {
    "title": "Multi-Location Review Exception & Reply Audit",
    "description": "Join reviews you already collected to your branches, then queue operational themes, unanswered serious reviews, and collection gaps. Does not scrape Google, Yelp, or Trustpilot.",
    "version": "0.1",
    "x-build-id": "wchdLbT6RlODV5icQ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/plusonets~multi-location-review-exception-audit/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-plusonets-multi-location-review-exception-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/plusonets~multi-location-review-exception-audit/runs": {
      "post": {
        "operationId": "runs-sync-plusonets-multi-location-review-exception-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/plusonets~multi-location-review-exception-audit/run-sync": {
      "post": {
        "operationId": "run-sync-plusonets-multi-location-review-exception-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",
        "properties": {
          "reviewSource": {
            "title": "Review source",
            "enum": [
              "sample",
              "dataset",
              "json",
              "csv",
              "url"
            ],
            "type": "string",
            "description": "Where the reviews come from. Sample is fictional and is what the default run uses.",
            "default": "sample"
          },
          "reviewsDatasetId": {
            "title": "Reviews dataset",
            "type": "string",
            "description": "Dataset from a review collection you already ran in this account. The actor only reads it. Select it here so a limited-permission run is allowed to read that dataset."
          },
          "reviewsJson": {
            "title": "Reviews JSON",
            "type": "string",
            "description": "A JSON array of review objects, or an object with an items, reviews, or data array. Used when Review source is JSON text."
          },
          "reviewsCsv": {
            "title": "Reviews CSV",
            "type": "string",
            "description": "CSV text with a header row. Used when Review source is CSV text."
          },
          "reviewsUrl": {
            "title": "Reviews URL",
            "type": "string",
            "description": "Public http(s) URL of a JSON or CSV review file. Private addresses and localhost are rejected."
          },
          "fieldMapping": {
            "title": "Field mapping overrides",
            "type": "object",
            "description": "Optional map from a canonical field to a source path. Canonical fields: placeId, placeName, address, reviewId, text, rating, reviewDate, ownerResponse, ownerResponseDate, reviewUrl, listingUrl. Example path: reply.message. When set, that path is used instead of the automatic aliases.",
            "default": {}
          },
          "branchRegistry": {
            "title": "Branch registry",
            "type": "string",
            "description": "Optional JSON array or CSV of branches: branchId, name, address, and placeIds (pipe-separated in CSV). A branch with no joined reviews is reported as unknown, not fine. Leave blank on the sample run."
          },
          "rules": {
            "title": "Business rules",
            "type": "object",
            "description": "Serious rating, theme minimum, window in days, slow-reply threshold, disabledThemes, and customThemes. A custom theme is {id, label, phrases, excludePhrases, minCount, severity}.",
            "default": {
              "seriousRatingAtOrBelow": 2,
              "themeMinCount": 2,
              "windowDays": 30,
              "unansweredMaxAgeDays": 90,
              "slowReplyAfterDays": 3,
              "disabledThemes": [],
              "customThemes": []
            }
          },
          "stateStoreName": {
            "title": "State store name",
            "type": "string",
            "description": "Named key-value store for this brand's baseline. Use a different name per brand. Sample runs ignore this and write review-exception-audit-sample-state instead.",
            "default": "review-exception-audit-state"
          },
          "alertOnlyOnChange": {
            "title": "Alert only when an exception changes",
            "type": "boolean",
            "description": "When on, the dataset contains only new or updated exceptions. The portfolio report still lists the full queue. Leave off to export the full queue every run.",
            "default": false
          },
          "maxReviews": {
            "title": "Maximum reviews",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Cap on reviews read from the source. A hit makes coverage partial.",
            "default": 5000
          },
          "enableLlm": {
            "title": "Use a model for unlabeled reviews",
            "type": "boolean",
            "description": "Optional. Phrase rules always run. A model is asked only about low-star reviews that matched no phrase, and only with your key. If the call fails, phrase results are kept.",
            "default": false
          },
          "llmApiKey": {
            "title": "Model API key",
            "type": "string",
            "description": "Secret key for an OpenAI-compatible chat endpoint. Stored encrypted. Leave empty to stay on phrase rules."
          },
          "llmBaseUrl": {
            "title": "Model base URL",
            "type": "string",
            "description": "HTTPS origin, usually https://api.openai.com/v1. Private and local addresses are rejected.",
            "default": "https://api.openai.com/v1"
          },
          "llmModel": {
            "title": "Model name",
            "type": "string",
            "description": "Model id sent to the chat completions endpoint.",
            "default": "gpt-4o-mini"
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}