{
  "service": "botsonic",
  "displayName": "Botsonic",
  "categories": [
    "AI",
    "Communication"
  ],
  "authTypes": [
    "api_key"
  ],
  "auth": [
    {
      "type": "api_key",
      "label": "Bot API Token",
      "placeholder": "botsonic_bot_api_token",
      "description": "Botsonic bot API token sent with the X-BOT-KEY header. Open your Botsonic dashboard, select a bot, then copy the token from Integration Page > REST API as described at https://docs.botsonic.com/docs/rest-api."
    }
  ],
  "homepageUrl": "https://botsonic.com",
  "actions": [
    {
      "id": "botsonic.generate_response",
      "service": "botsonic",
      "name": "generate_response",
      "description": "Generate one synchronous response from the connected Botsonic bot.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {
          "input_text": {
            "type": "string",
            "minLength": 1,
            "description": "User question for the bot."
          },
          "chat_id": {
            "type": "string",
            "description": "The Botsonic chat identifier for this conversation.",
            "format": "uuid"
          },
          "source": {
            "type": "string",
            "minLength": 1,
            "description": "Optional source value for Botsonic to refer to."
          },
          "starter_question_id": {
            "type": "string",
            "description": "Optional Botsonic starter question identifier.",
            "format": "uuid"
          },
          "user_unique_identifier": {
            "type": "string",
            "minLength": 1,
            "description": "Optional unique user identifier stored by Botsonic in the inbox."
          },
          "chat_history": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Optional message identifier for this chat history item.",
                  "format": "uuid"
                },
                "message": {
                  "type": "string",
                  "minLength": 1,
                  "description": "The chat history message text."
                },
                "sent": {
                  "type": "boolean",
                  "description": "Whether this chat history item was sent by the end user."
                },
                "sources": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {},
                    "additionalProperties": true,
                    "description": "One source object returned by Botsonic."
                  },
                  "description": "Sources attached to this chat history item."
                },
                "generated_images": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "description": "One generated image URL or identifier."
                  },
                  "description": "Generated image URLs attached to this chat history item."
                }
              },
              "additionalProperties": true,
              "required": [
                "message",
                "sent"
              ],
              "description": "One previous chat history message sent to Botsonic."
            },
            "description": "Previous chat history for Botsonic to use as context."
          },
          "response_type": {
            "type": "string",
            "enum": [
              "text",
              "html",
              "markdown",
              "mrkdwn"
            ],
            "description": "The response format Botsonic should return."
          },
          "chat_user_id": {
            "type": "string",
            "minLength": 1,
            "description": "Existing Botsonic chat user identifier to link with old user data."
          },
          "extra_metadata": {
            "type": "object",
            "properties": {},
            "additionalProperties": true,
            "description": "Provider-specific metadata forwarded to Botsonic."
          },
          "full_history": {
            "type": "boolean",
            "description": "Whether Botsonic should return full chat history so far."
          },
          "message_id": {
            "type": "string",
            "description": "Existing message identifier used by Botsonic to resolve handoff.",
            "format": "uuid"
          },
          "timeout": {
            "type": "number",
            "exclusiveMinimum": 0,
            "description": "Maximum number of seconds Botsonic should keep the connection open before timing out."
          }
        },
        "additionalProperties": false,
        "required": [
          "input_text",
          "chat_id"
        ],
        "description": "The input payload for generating one synchronous Botsonic response."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "answer": {
            "type": "string",
            "description": "The generated answer returned by Botsonic."
          },
          "message_id": {
            "type": "string",
            "description": "The Botsonic message identifier for the generated answer.",
            "format": "uuid"
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {},
              "additionalProperties": true,
              "description": "One source object returned by Botsonic."
            },
            "description": "Sources returned by Botsonic for the answer."
          },
          "chat_history": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Optional Botsonic message identifier.",
                  "format": "uuid"
                },
                "message": {
                  "type": "string",
                  "description": "The chat history message text."
                },
                "sent": {
                  "type": "boolean",
                  "description": "Whether this chat history item was sent by the end user."
                },
                "sources": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {},
                    "additionalProperties": true,
                    "description": "One source object returned by Botsonic."
                  },
                  "description": "Sources attached to this history item."
                },
                "generated_images": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "description": "One generated image URL or identifier."
                  },
                  "description": "Generated image URLs attached to this history item."
                }
              },
              "additionalProperties": true,
              "required": [
                "message",
                "sent"
              ],
              "description": "One chat history message returned by Botsonic."
            },
            "description": "Chat history returned by Botsonic."
          },
          "generated_images": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "One generated image URL or identifier."
            },
            "description": "Generated image URLs returned by Botsonic."
          },
          "follow_up_questions": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "One follow-up question."
            },
            "description": "Follow-up questions suggested by Botsonic."
          },
          "human_handoff_status": {
            "type": "boolean",
            "description": "Whether Botsonic reports a human handoff status."
          },
          "user_options": {
            "type": "array",
            "items": {
              "description": "One user option."
            },
            "description": "User options returned by Botsonic."
          },
          "chat_ended": {
            "type": "boolean",
            "description": "Whether Botsonic reports the chat has ended."
          },
          "end_chat_feedback": {
            "type": "string",
            "description": "End-chat feedback returned by Botsonic."
          }
        },
        "additionalProperties": true,
        "required": [
          "answer"
        ],
        "description": "The synchronous Botsonic generation response."
      }
    },
    {
      "id": "botsonic.get_conversation",
      "service": "botsonic",
      "name": "get_conversation",
      "description": "Get one Botsonic conversation by chat identifier.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {
          "chat_id": {
            "type": "string",
            "description": "The Botsonic conversation chat identifier.",
            "format": "uuid"
          }
        },
        "additionalProperties": false,
        "description": "The input payload for fetching one Botsonic conversation."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "_id": {
            "type": "string",
            "description": "Optional internal Botsonic conversation document identifier."
          },
          "chat_id": {
            "type": "string",
            "description": "The Botsonic conversation chat identifier.",
            "format": "uuid"
          },
          "bot_id": {
            "type": "string",
            "description": "The Botsonic bot identifier attached to the conversation.",
            "format": "uuid"
          },
          "owner_id": {
            "type": "string",
            "description": "The Botsonic owner identifier for the conversation."
          },
          "ip_address": {
            "type": "string",
            "description": "The IP address associated with the conversation."
          },
          "num_messages": {
            "type": "integer",
            "description": "The number of messages in the conversation."
          },
          "source": {
            "type": "string",
            "description": "The conversation source returned by Botsonic."
          },
          "is_resolved": {
            "type": "boolean",
            "description": "Whether Botsonic reports the conversation as resolved."
          },
          "oai_thread_id": {
            "type": "string",
            "description": "The OpenAI thread identifier attached to the conversation."
          },
          "additional_feedback": {
            "type": "string",
            "description": "Additional feedback stored for this conversation."
          },
          "chat_ended": {
            "type": "boolean",
            "description": "Whether the conversation has ended."
          },
          "chat_data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "Optional Botsonic chat data identifier.",
                  "format": "uuid"
                },
                "message": {
                  "type": "string",
                  "description": "The message text returned for this chat data entry."
                },
                "messages": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {},
                    "additionalProperties": true,
                    "description": "One nested conversation message fragment."
                  },
                  "description": "Nested message fragments returned by Botsonic."
                },
                "sent": {
                  "type": "boolean",
                  "description": "Whether this message was sent by the end user."
                },
                "transcripted": {
                  "type": "boolean",
                  "description": "Whether this message has been transcripted by Botsonic."
                },
                "is_delivered": {
                  "type": "boolean",
                  "description": "Whether Botsonic reports the message was delivered."
                },
                "failed_reason": {
                  "type": "string",
                  "description": "Failure reason returned by Botsonic for this message."
                },
                "failed_data": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": true,
                  "description": "Failure details returned by Botsonic for this message."
                },
                "req_body": {
                  "type": "object",
                  "properties": {},
                  "additionalProperties": true,
                  "description": "Request body details stored by Botsonic for this message."
                },
                "run_id": {
                  "type": "string",
                  "description": "Run identifier attached to this Botsonic message.",
                  "format": "uuid"
                },
                "sources": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {},
                    "additionalProperties": true,
                    "description": "One source object returned by Botsonic."
                  },
                  "description": "Sources attached to this message."
                },
                "like_status": {
                  "type": "string",
                  "description": "Feedback status returned by Botsonic for this message."
                },
                "resolution_status": {
                  "type": "string",
                  "description": "Resolution status returned by Botsonic for this message."
                },
                "is_via_live_agent": {
                  "type": "boolean",
                  "description": "Whether this message was sent through a live agent."
                },
                "created_at": {
                  "type": "string",
                  "description": "The message creation timestamp returned by Botsonic.",
                  "format": "date-time"
                }
              },
              "additionalProperties": true,
              "required": [
                "message"
              ],
              "description": "One message object inside a Botsonic conversation."
            },
            "description": "Messages and events stored in this conversation."
          },
          "created_at": {
            "type": "string",
            "description": "The conversation creation timestamp returned by Botsonic.",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "description": "The conversation last update timestamp returned by Botsonic.",
            "format": "date-time"
          }
        },
        "additionalProperties": true,
        "required": [
          "chat_id",
          "bot_id",
          "owner_id",
          "num_messages",
          "chat_data",
          "created_at",
          "updated_at"
        ],
        "description": "One Botsonic conversation returned by the API."
      }
    },
    {
      "id": "botsonic.list_conversations",
      "service": "botsonic",
      "name": "list_conversations",
      "description": "List conversations for the connected Botsonic bot token.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {
          "search_query": {
            "type": "string",
            "minLength": 1,
            "description": "Search query used to match Botsonic conversations."
          },
          "sort_by": {
            "type": "string",
            "enum": [
              "recent",
              "negative",
              "positive"
            ],
            "description": "The conversation sorting mode."
          },
          "sort_order": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ],
            "description": "The conversation sorting order."
          },
          "updated_after": {
            "type": "string",
            "description": "Filter conversations updated after this ISO 8601 timestamp.",
            "format": "date-time"
          },
          "updated_before": {
            "type": "string",
            "description": "Filter conversations updated before this ISO 8601 timestamp.",
            "format": "date-time"
          },
          "page": {
            "type": "integer",
            "minimum": 1,
            "description": "The page number to request from Botsonic."
          },
          "size": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "description": "The number of conversations to request from Botsonic."
          }
        },
        "additionalProperties": false,
        "description": "The input payload for listing Botsonic conversations."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "_id": {
                  "type": "string",
                  "description": "Optional internal Botsonic conversation document identifier."
                },
                "chat_id": {
                  "type": "string",
                  "description": "The Botsonic conversation chat identifier.",
                  "format": "uuid"
                },
                "bot_id": {
                  "type": "string",
                  "description": "The Botsonic bot identifier attached to the conversation.",
                  "format": "uuid"
                },
                "owner_id": {
                  "type": "string",
                  "description": "The Botsonic owner identifier for the conversation."
                },
                "ip_address": {
                  "type": "string",
                  "description": "The IP address associated with the conversation."
                },
                "num_messages": {
                  "type": "integer",
                  "description": "The number of messages in the conversation."
                },
                "source": {
                  "type": "string",
                  "description": "The conversation source returned by Botsonic."
                },
                "is_resolved": {
                  "type": "boolean",
                  "description": "Whether Botsonic reports the conversation as resolved."
                },
                "oai_thread_id": {
                  "type": "string",
                  "description": "The OpenAI thread identifier attached to the conversation."
                },
                "additional_feedback": {
                  "type": "string",
                  "description": "Additional feedback stored for this conversation."
                },
                "chat_ended": {
                  "type": "boolean",
                  "description": "Whether the conversation has ended."
                },
                "chat_data": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "description": "Optional Botsonic chat data identifier.",
                        "format": "uuid"
                      },
                      "message": {
                        "type": "string",
                        "description": "The message text returned for this chat data entry."
                      },
                      "messages": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {},
                          "additionalProperties": true,
                          "description": "One nested conversation message fragment."
                        },
                        "description": "Nested message fragments returned by Botsonic."
                      },
                      "sent": {
                        "type": "boolean",
                        "description": "Whether this message was sent by the end user."
                      },
                      "transcripted": {
                        "type": "boolean",
                        "description": "Whether this message has been transcripted by Botsonic."
                      },
                      "is_delivered": {
                        "type": "boolean",
                        "description": "Whether Botsonic reports the message was delivered."
                      },
                      "failed_reason": {
                        "type": "string",
                        "description": "Failure reason returned by Botsonic for this message."
                      },
                      "failed_data": {
                        "type": "object",
                        "properties": {},
                        "additionalProperties": true,
                        "description": "Failure details returned by Botsonic for this message."
                      },
                      "req_body": {
                        "type": "object",
                        "properties": {},
                        "additionalProperties": true,
                        "description": "Request body details stored by Botsonic for this message."
                      },
                      "run_id": {
                        "type": "string",
                        "description": "Run identifier attached to this Botsonic message.",
                        "format": "uuid"
                      },
                      "sources": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {},
                          "additionalProperties": true,
                          "description": "One source object returned by Botsonic."
                        },
                        "description": "Sources attached to this message."
                      },
                      "like_status": {
                        "type": "string",
                        "description": "Feedback status returned by Botsonic for this message."
                      },
                      "resolution_status": {
                        "type": "string",
                        "description": "Resolution status returned by Botsonic for this message."
                      },
                      "is_via_live_agent": {
                        "type": "boolean",
                        "description": "Whether this message was sent through a live agent."
                      },
                      "created_at": {
                        "type": "string",
                        "description": "The message creation timestamp returned by Botsonic.",
                        "format": "date-time"
                      }
                    },
                    "additionalProperties": true,
                    "required": [
                      "message"
                    ],
                    "description": "One message object inside a Botsonic conversation."
                  },
                  "description": "Messages and events stored in this conversation."
                },
                "created_at": {
                  "type": "string",
                  "description": "The conversation creation timestamp returned by Botsonic.",
                  "format": "date-time"
                },
                "updated_at": {
                  "type": "string",
                  "description": "The conversation last update timestamp returned by Botsonic.",
                  "format": "date-time"
                }
              },
              "additionalProperties": true,
              "required": [
                "chat_id",
                "bot_id",
                "owner_id",
                "num_messages",
                "chat_data",
                "created_at",
                "updated_at"
              ],
              "description": "One Botsonic conversation returned by the API."
            },
            "description": "The conversations returned by Botsonic."
          },
          "total": {
            "type": "integer",
            "minimum": 0,
            "description": "The total number of matching records returned by Botsonic."
          },
          "page": {
            "type": "integer",
            "minimum": 1,
            "description": "The current page number returned by Botsonic."
          },
          "size": {
            "type": "integer",
            "minimum": 1,
            "description": "The current page size returned by Botsonic."
          },
          "pages": {
            "type": "integer",
            "minimum": 0,
            "description": "The total number of pages returned by Botsonic."
          }
        },
        "additionalProperties": true,
        "required": [
          "items"
        ],
        "description": "The paginated Botsonic conversation list response."
      }
    },
    {
      "id": "botsonic.list_faqs",
      "service": "botsonic",
      "name": "list_faqs",
      "description": "List FAQs attached to the connected Botsonic bot token.",
      "requiredScopes": [],
      "providerPermissions": [],
      "inputSchema": {
        "type": "object",
        "properties": {
          "search_query": {
            "type": "string",
            "minLength": 1,
            "description": "Search query used to match Botsonic FAQs."
          },
          "sort_by": {
            "type": "string",
            "enum": [
              "id",
              "bot_id",
              "question",
              "answer",
              "error_reason",
              "status",
              "characters",
              "migration_status",
              "created_at",
              "updated_at"
            ],
            "description": "The FAQ attribute to sort by."
          },
          "sort_order": {
            "type": "string",
            "enum": [
              "asc",
              "desc"
            ],
            "description": "The FAQ sorting order."
          },
          "page": {
            "type": "integer",
            "minimum": 1,
            "description": "The page number to request from Botsonic."
          },
          "size": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "description": "The number of FAQs to request from Botsonic."
          }
        },
        "additionalProperties": false,
        "description": "The input payload for listing Botsonic FAQs."
      },
      "outputSchema": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "The Botsonic FAQ identifier.",
                  "format": "uuid"
                },
                "bot_id": {
                  "type": "string",
                  "description": "The Botsonic bot identifier attached to the FAQ.",
                  "format": "uuid"
                },
                "question": {
                  "type": "string",
                  "description": "The FAQ question text."
                },
                "answer": {
                  "type": "string",
                  "description": "The FAQ answer text."
                },
                "error_reason": {
                  "type": "string",
                  "description": "The error reason returned by Botsonic for failed FAQ processing."
                },
                "status": {
                  "type": "string",
                  "description": "The Botsonic processing status for the FAQ."
                },
                "characters": {
                  "type": "integer",
                  "description": "The number of FAQ characters counted by Botsonic."
                },
                "migration_status": {
                  "type": "string",
                  "description": "The migration status returned by Botsonic for the FAQ."
                },
                "created_at": {
                  "type": "string",
                  "description": "The FAQ creation timestamp returned by Botsonic.",
                  "format": "date-time"
                },
                "updated_at": {
                  "type": "string",
                  "description": "The FAQ last update timestamp returned by Botsonic.",
                  "format": "date-time"
                }
              },
              "additionalProperties": true,
              "required": [
                "id",
                "bot_id",
                "question",
                "answer",
                "status",
                "characters",
                "created_at",
                "updated_at"
              ],
              "description": "One Botsonic FAQ returned by the API."
            },
            "description": "The FAQs returned by Botsonic."
          },
          "total": {
            "type": "integer",
            "minimum": 0,
            "description": "The total number of matching records returned by Botsonic."
          },
          "page": {
            "type": "integer",
            "minimum": 1,
            "description": "The current page number returned by Botsonic."
          },
          "size": {
            "type": "integer",
            "minimum": 1,
            "description": "The current page size returned by Botsonic."
          },
          "pages": {
            "type": "integer",
            "minimum": 0,
            "description": "The total number of pages returned by Botsonic."
          }
        },
        "additionalProperties": true,
        "required": [
          "items"
        ],
        "description": "The paginated Botsonic FAQ list response."
      }
    }
  ]
}
