{
  "openapi": "3.0.1",
  "info": {
    "title": "Website to AI Chatbot (Asyntai)",
    "description": "Turn any website into an AI chatbot that answers visitors 24/7 from your own content. Create the chatbot from a URL, feed it web pages or any Apify dataset, ask it questions, and get the widget code to paste into your site.",
    "version": "0.0",
    "x-build-id": "aPlQTlVDZBRZ9bzFi"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/asyntai~website-ai-chatbot/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-asyntai-website-ai-chatbot",
        "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/asyntai~website-ai-chatbot/runs": {
      "post": {
        "operationId": "runs-sync-asyntai-website-ai-chatbot",
        "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/asyntai~website-ai-chatbot/run-sync": {
      "post": {
        "operationId": "run-sync-asyntai-website-ai-chatbot",
        "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": [
          "action"
        ],
        "properties": {
          "apiKey": {
            "title": "Asyntai API key",
            "type": "string",
            "description": "Your Asyntai API key. Find it at https://asyntai.com/settings/api/ after you sign in."
          },
          "action": {
            "title": "What to do",
            "enum": [
              "create_chatbot",
              "add_urls",
              "import_dataset",
              "ask"
            ],
            "type": "string",
            "description": "Create a chatbot from a website, add pages or a dataset to a chatbot's knowledge base, or ask a chatbot a question.",
            "default": "create_chatbot"
          },
          "websiteUrl": {
            "title": "Website URL",
            "type": "string",
            "description": "Create a chatbot: the website the chatbot learns from and answers for."
          },
          "chatbotName": {
            "title": "Chatbot name",
            "type": "string",
            "description": "Create a chatbot: an optional name that you see in the Asyntai dashboard."
          },
          "reuseExisting": {
            "title": "Use the existing chatbot if the website is already on the account",
            "type": "boolean",
            "description": "Create a chatbot: when the account already has a chatbot for this website, return it instead of creating a second one.",
            "default": true
          },
          "waitUntilReady": {
            "title": "Wait until the chatbot is ready",
            "type": "boolean",
            "description": "Create a chatbot: wait until Asyntai has read the website and written the chatbot's instructions.",
            "default": true
          },
          "maxWaitMinutes": {
            "title": "Maximum wait (minutes)",
            "minimum": 1,
            "maximum": 60,
            "type": "integer",
            "description": "Create a chatbot: stop the wait after this many minutes. The chatbot continues to learn in the background.",
            "default": 10
          },
          "chatbotId": {
            "title": "Chatbot ID",
            "type": "string",
            "description": "The numeric ID of an existing chatbot (the 'websiteId' in this Actor's output). Leave empty to use the primary chatbot of the account."
          },
          "urls": {
            "title": "Page URLs",
            "type": "array",
            "description": "Add web pages: each page is fetched and added to the chatbot's knowledge base.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "datasetId": {
            "title": "Dataset ID",
            "type": "string",
            "description": "Import a dataset: the ID of an Apify dataset, for example the output of Website Content Crawler. Each item with text becomes one knowledge base entry. In an Actor integration, use {{resource.defaultDatasetId}}."
          },
          "textField": {
            "title": "Text field",
            "type": "string",
            "description": "Import a dataset: the item field that holds the text. Leave empty to use the first of: text, markdown, content, body, description."
          },
          "titleField": {
            "title": "Title field",
            "type": "string",
            "description": "Import a dataset: the item field that holds the title. Leave empty to use metadata.title, title, name, or the URL."
          },
          "maxItems": {
            "title": "Maximum items",
            "minimum": 1,
            "type": "integer",
            "description": "Import a dataset: the maximum number of items to import.",
            "default": 200
          },
          "question": {
            "title": "Question",
            "type": "string",
            "description": "Ask: the question to send to the chatbot."
          },
          "sessionId": {
            "title": "Conversation ID",
            "type": "string",
            "description": "Ask: send the same ID again to continue the same conversation."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}