Metadata-Version: 2.5
Name: tap-asyntai-chatbot
Version: 1.0.0
Summary: Singer tap for Asyntai: load AI chatbot conversations, live chat messages, leads and support tickets into your data warehouse
Project-URL: Homepage, https://asyntai.com
Project-URL: Documentation, https://asyntai.com/documentation/integrations/meltano/
Project-URL: Repository, https://github.com/asyntai/tap-asyntai-chatbot
Author-email: Asyntai <hello@asyntai.com>
License: Apache-2.0
License-File: LICENSE
Keywords: ai-chatbot,asyntai,chatbot,conversations,customer-support,elt,etl,leads,live-chat,meltano,singer,singer-tap,tap,tickets
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.10
Requires-Dist: requests>=2.31
Requires-Dist: singer-sdk<1.0,>=0.49
Provides-Extra: dev
Requires-Dist: pytest>=7.4; extra == 'dev'
Requires-Dist: singer-sdk[testing]<1.0,>=0.49; extra == 'dev'
Description-Content-Type: text/markdown

# tap-asyntai-chatbot-chatbot

A [Singer](https://sdk.meltano.com) tap for [Asyntai](https://asyntai.com).

Asyntai is an AI chatbot that answers visitor questions on your website. This
tap loads what happens in those chats into your own warehouse, so the chat data
sits next to your sales and product data.

## Streams

| Stream | Grain | Replication |
| --- | --- | --- |
| `sessions` | One chat | Incremental on `last_message_at` |
| `messages` | One message of a chat | Full, per chat |
| `leads` | A chat where the visitor left an email address or phone number | Incremental on `started_at` |
| `tickets` | A support ticket, with handling times | Incremental on `created_at` |

`messages.session_id` joins to `sessions.session_id`, and so do `leads` and
`tickets`, so the four tables model one conversation together.

## Installation

```bash
pipx install tap-asyntai-chatbot
```

Or with Meltano:

```bash
meltano add extractor tap-asyntai-chatbot
```

## Configuration

| Setting | Required | Default | Description |
| --- | --- | --- | --- |
| `api_key` | yes | | Asyntai API key |
| `api_url` | no | `https://asyntai.com` | Base address of the API |
| `start_date` | no | | Earliest record to read on the first run |
| `website_id` | no | | Read one website only |
| `page_size` | no | `100` | Rows per request, 100 at most |

Get the API key in the Asyntai dashboard under **Settings**, then **API**. The
API needs the Starter plan or higher.

```bash
tap-asyntai-chatbot --config config.json
```

A minimal `config.json`:

```json
{
  "api_key": "your-asyntai-api-key",
  "start_date": "2026-01-01T00:00:00Z"
}
```

## Usage with Meltano

```yaml
plugins:
  extractors:
    - name: tap-asyntai-chatbot
      namespace: tap_asyntai_chatbot
      pip_url: tap-asyntai-chatbot
      capabilities: [catalog, state, discover, about, stream-maps]
      settings:
        - name: api_key
          kind: password
        - name: api_url
        - name: start_date
          kind: date_iso8601
        - name: website_id
        - name: page_size
          kind: integer
```

```bash
meltano config tap-asyntai-chatbot set api_key $ASYNTAI_API_KEY
meltano run tap-asyntai-chatbot target-postgres
```

## How paging works

Every list endpoint of the Asyntai API sorts newest first and filters on the
same field it sorts by. The tap sends the oldest value of one page as the
exclusive `before` bound of the next one, which is the paging scheme the API
documents. `since` carries the bookmark, so a second run reads only new rows.

## Developing

```bash
pip install -e ".[dev]"
pytest
tap-asyntai-chatbot --about
```

## License

Apache 2.0
