{
  "openapi": "3.0.1",
  "info": {
    "title": "WhatsApp Chat Analyzer: Unanswered Chats & Response Time",
    "description": "Analyze WhatsApp Business chat exports you own: response times, unanswered chats, cold leads to follow up, buying intent and repeated questions. Privacy-first: pseudonymous output, no AI API, never connects to WhatsApp or sends messages.",
    "version": "0.1",
    "x-build-id": "BZdCIykhULcoIYThK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/privatex~whatsapp-conversation-intelligence/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-privatex-whatsapp-conversation-intelligence",
        "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/privatex~whatsapp-conversation-intelligence/runs": {
      "post": {
        "operationId": "runs-sync-privatex-whatsapp-conversation-intelligence",
        "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/privatex~whatsapp-conversation-intelligence/run-sync": {
      "post": {
        "operationId": "run-sync-privatex-whatsapp-conversation-intelligence",
        "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": {
          "demoMode": {
            "title": "Demo mode (synthetic data)",
            "type": "boolean",
            "description": "Pre-ticked so the Actor works on first click with FABRICATED conversations (every output row is labelled SYNTHETIC DEMO and is never charged). It is ignored as soon as you provide chat exports or messages, so you can leave it ticked."
          },
          "chatExports": {
            "title": "Chat exports (text)",
            "type": "array",
            "description": "Each item: {\"name\": \"customer-1\", \"text\": \"<contents of the exported .txt>\"}. In the WhatsApp app: open a chat, Export chat, Without media. Only export chats of customers who contacted your business.",
            "default": []
          },
          "chatExportUrls": {
            "title": "Chat export URLs",
            "type": "array",
            "description": "Public or pre-signed URLs of exported .txt files (one chat per file), e.g. from your own storage.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "messages": {
            "title": "Structured messages",
            "type": "array",
            "description": "Alternative to exports, e.g. from your CRM or Cloud API logs. Each item: {\"conversationId\": \"abc\", \"direction\": \"in\" or \"out\", \"ts\": \"2026-10-28T09:15:00Z\", \"text\": \"...\", \"agent\": \"Ann\"}.",
            "default": []
          },
          "businessSenders": {
            "title": "Names that are YOUR side of the chat",
            "type": "array",
            "description": "Required for text exports. Your business name and agent names exactly as they appear in the export. Everyone else is treated as the customer.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "dateOrder": {
            "title": "Date order in exports",
            "enum": [
              "auto",
              "dmy",
              "mdy"
            ],
            "type": "string",
            "description": "auto detects day/month order from the file. Pick explicitly if all days are 12 or lower.",
            "default": "auto"
          },
          "timezoneOffsetMinutes": {
            "title": "Timezone offset of the exports (minutes from UTC)",
            "minimum": -840,
            "maximum": 840,
            "type": "integer",
            "description": "Example: UTC+3 = 180, UTC-5 = -300. Exports are written in the phone's local time.",
            "default": 0
          },
          "asOf": {
            "title": "Analyse as of (ISO date-time)",
            "type": "string",
            "description": "Reference time for waiting and follow-up calculations. Empty = now. Set it when analysing an older export."
          },
          "unansweredAfterHours": {
            "title": "Flag as unanswered after (hours)",
            "minimum": 0,
            "maximum": 720,
            "type": "integer",
            "description": "A conversation whose last message is from the customer and older than this is flagged.",
            "default": 2
          },
          "followUpAfterHours": {
            "title": "Flag follow-up after (hours)",
            "minimum": 1,
            "maximum": 720,
            "type": "integer",
            "description": "Quote or price conversations where you replied and the customer then went quiet for this long are flagged.",
            "default": 24
          },
          "includeSnippets": {
            "title": "Include masked last customer message",
            "type": "boolean",
            "description": "Off by default (privacy). When on, adds the last customer message with emails, links and numbers masked.",
            "default": false
          },
          "pseudonymSalt": {
            "title": "Pseudonym salt (optional)",
            "type": "string",
            "description": "Keeps customer pseudonyms identical across runs. Empty = random per run, so ids cannot be linked between runs."
          },
          "scrubInputAfterRead": {
            "title": "Scrub message content from stored input",
            "type": "boolean",
            "description": "Replaces the run's stored INPUT record with a version without message content as soon as it has been read.",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}