wldx-admin-cli 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +72 -2
- package/package.json +4 -3
- package/specs/kb.openapi.json +1 -0
- package/specs/tools.openapi.json +1 -0
- package/specs/voicebots.openapi.json +1 -0
- package/specs/wilma.openapi.json +1 -0
- package/src/cli.mjs +3 -0
- package/src/cloud/client.mjs +75 -0
- package/src/cloud/env.mjs +60 -0
- package/src/cloud/mask.mjs +39 -0
- package/src/cloud/specs.mjs +26 -0
- package/src/cloud/token.mjs +47 -0
- package/src/commands/cloud.mjs +122 -0
- package/src/commands/index.mjs +10 -1
- package/src/commands/kb.mjs +719 -0
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# wldx-admin-cli — `wx-admin`, an admin command line for the Wildix PBX
|
|
2
2
|
|
|
3
|
-
**Version 1.
|
|
3
|
+
**Version 1.3.0** · unofficial · MIT
|
|
4
4
|
|
|
5
5
|
`wx-admin` manages a Wildix PBX through its REST API (`https://<pbx>/api/v1`): the system and its settings, users,
|
|
6
6
|
ACL, queues, dialplans and the objects they use (timetables, IVR, switches, paging, the dialplan database), trunks,
|
|
7
|
-
devices, phonebooks, sounds, call history, recordings and voicemails; any other operation through `wx-admin api`. It works with several PBX at once. Its twin for the everyday user is
|
|
7
|
+
devices, phonebooks, sounds, call history, recordings and voicemails; any other operation through `wx-admin api`. It works with several PBX at once, and also manages the cloud services of the PBX's company (the knowledge base, voicebots, WIM tools, Wilma) with the cloud token the PBX gives its administrator. Its twin for the everyday user is
|
|
8
8
|
[`wx`](https://github.com/gorets/wildix-cli/tree/main/packages/wx) (npm `wldx-cli`); they share the x-bees login.
|
|
9
9
|
|
|
10
10
|
```sh
|
|
@@ -107,6 +107,33 @@ wx-admin config copy --from old --to new # the same without the fo
|
|
|
107
107
|
ones first, and a log file `wx-admin-import-<host>-<time>.log` (here, or `--log DIR`), written every time, also
|
|
108
108
|
with `--dry-run`. Without a terminal: `--all` or `--only`, and `--yes` to write.
|
|
109
109
|
|
|
110
|
+
## Cloud services
|
|
111
|
+
|
|
112
|
+
An administrator of a PBX also manages the cloud services of the PBX's company: the knowledge base (WIM),
|
|
113
|
+
voicebots, WIM tools and Wilma. The PBX gives its administrator its own cloud token, the CPA token (Cognito PBX
|
|
114
|
+
Auth: the PBX itself as a user of its company, valid 12 hours), and those services accept it. `wx-admin` takes it from
|
|
115
|
+
the PBX chosen as for every command (`--pbx`, the default PBX, the PBX of the x-bees login), keeps it in memory only
|
|
116
|
+
and sends it only to the service called. A PBX user without the Admin role is refused; whether a Company API Key may
|
|
117
|
+
take it is not checked yet.
|
|
118
|
+
|
|
119
|
+
The environment is the one of the PBX (its WIM console: production, stable or stage), or `--env prod|stable|stage`.
|
|
120
|
+
The knowledge base has no stable environment.
|
|
121
|
+
|
|
122
|
+
```sh
|
|
123
|
+
wx-admin kb list # knowledge bases and their data sources
|
|
124
|
+
wx-admin kb ask "How do I upgrade a phone?" --kb Support
|
|
125
|
+
wx-admin kb source sync "Public Confluence" --full
|
|
126
|
+
wx-admin kb doc upload Manuals ./guide.pdf
|
|
127
|
+
wx-admin cloud wilma # every operation of Wilma that takes the token
|
|
128
|
+
wx-admin cloud voicebots ListVoiceBots # any operation, checked against the bundled OpenAPI
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
`wx-admin kb` covers knowledge bases, search and answers, data sources (Confluence, websites, files; Google Drive
|
|
132
|
+
is connected in the WIM console with OAuth) and documents. Everything else goes through `wx-admin cloud <service>
|
|
133
|
+
<operation>` with `--param NAME=VALUE` and `--data`; a method other than GET needs `--yes`. Answers of the cloud can
|
|
134
|
+
hold secrets (e.g. the API token of a Confluence data source): they are masked unless `--show-secrets`, and the
|
|
135
|
+
Confluence token is typed hidden, never given as an option.
|
|
136
|
+
|
|
110
137
|
## Commands
|
|
111
138
|
|
|
112
139
|
Every command has `-h`, takes `--pbx HOST` and `--profile EMAIL`, and prints text or, with `--output json`, JSON.
|
|
@@ -367,6 +394,41 @@ The configuration as files: back up a PBX to a folder, compare a folder or anoth
|
|
|
367
394
|
| `wx-admin config export --to DIR [--all \| --only KIND:NAME,…] [--users] [--db-family FAMILY]...` | choose what to carry to another PBX and write it to a new folder, without anything bound to this PBX |
|
|
368
395
|
| `wx-admin config diff (<dir> \| --with PBX) [--only KIND,KIND…]` | what differs between a backup folder (or another PBX) and the PBX |
|
|
369
396
|
|
|
397
|
+
### wx-admin kb
|
|
398
|
+
|
|
399
|
+
The knowledge base of the cloud (WIM): knowledge bases, data sources, documents, search, answers.
|
|
400
|
+
|
|
401
|
+
| Command | What it does |
|
|
402
|
+
| --- | --- |
|
|
403
|
+
| `wx-admin kb list` | the knowledge bases of the company: name, data sources, last change |
|
|
404
|
+
| `wx-admin kb get <kb>` | one knowledge base with its data sources by name |
|
|
405
|
+
| `wx-admin kb create <name> --source DS... [--description TEXT]` | create a knowledge base from data sources |
|
|
406
|
+
| `wx-admin kb update <kb> [--name NAME] [--description TEXT] [--source DS]... [--yes]` | change a knowledge base: name, description, data sources (--source replaces them: needs --yes) |
|
|
407
|
+
| `wx-admin kb delete <kb>... --yes` | delete knowledge bases (needs --yes; their data sources stay) |
|
|
408
|
+
| `wx-admin kb search <kb> <query> [--limit N]` | search a knowledge base: the chunks found, with their document and score |
|
|
409
|
+
| `wx-admin kb ask <query> --kb KB... [--limit N] [--model MODEL]` | an answer from knowledge bases: search each, then generate the answer from what was found |
|
|
410
|
+
| `wx-admin kb history [--limit N]` | the search queries made on the knowledge bases |
|
|
411
|
+
| `wx-admin kb stats` | statistics of the searches on the knowledge bases |
|
|
412
|
+
| `wx-admin kb source list [--show-secrets]` | the data sources: type, schedule (keys masked) |
|
|
413
|
+
| `wx-admin kb source get <ds> [--show-secrets]` | one data source with its configuration and sync status (keys masked) |
|
|
414
|
+
| `wx-admin kb source create <name> --type confluence\|website\|files [--description TEXT]` | create a data source (then: kb source configure, kb source sync) |
|
|
415
|
+
| `wx-admin kb source configure <ds> [--url URL]... [--user EMAIL] [--space ID] [--page ID]... [--schedule SCHEDULE]` | configure a data source: Confluence (address, user, space, pages; the API token typed hidden), website, schedule |
|
|
416
|
+
| `wx-admin kb source browse <ds> [--space ID] [--url URL] [--folder ID]` | what a source can sync: Confluence spaces (or the pages of --space), website pages, Drive folders |
|
|
417
|
+
| `wx-admin kb source sync <ds> [--full]` | start a sync of a data source (incremental; --full syncs everything again) |
|
|
418
|
+
| `wx-admin kb source stop <ds>` | stop the sync of a data source |
|
|
419
|
+
| `wx-admin kb source status <ds> [--watch] [--every SECONDS]` | the sync status of a data source; --watch follows it until the sync ends |
|
|
420
|
+
| `wx-admin kb source logs <ds> [--level LEVEL] [--search TEXT] [--limit N]` | the sync logs of a data source |
|
|
421
|
+
| `wx-admin kb source stats <ds>` | the documents and chunks of a data source |
|
|
422
|
+
| `wx-admin kb source clone <ds>` | a copy of a data source (its configuration, not its documents) |
|
|
423
|
+
| `wx-admin kb source clean <ds> --yes` | remove the documents of a data source (needs --yes; the source and its configuration stay) |
|
|
424
|
+
| `wx-admin kb source delete <ds>... --yes` | delete data sources (needs --yes) |
|
|
425
|
+
| `wx-admin kb doc list <ds> [--search TEXT] [--status STATUS] [--limit N]` | the documents of a data source |
|
|
426
|
+
| `wx-admin kb doc get <ds> <doc>` | one document with its content and chunks |
|
|
427
|
+
| `wx-admin kb doc markdown <ds> <doc> [--to FILE]` | the text of a document as Markdown (to stdout, or to a new file) |
|
|
428
|
+
| `wx-admin kb doc upload <ds> <file> [--title TEXT]` | upload a file as a document of a data source |
|
|
429
|
+
| `wx-admin kb doc download <ds> <doc> --to FILE` | the original file of a document, to a new file |
|
|
430
|
+
| `wx-admin kb doc delete <ds> <doc>... --yes` | delete documents of a data source (needs --yes) |
|
|
431
|
+
|
|
370
432
|
### wx-admin pbx
|
|
371
433
|
|
|
372
434
|
The PBX to work on: saved access (API key, token, user), the default one, a check.
|
|
@@ -398,6 +460,7 @@ Your profiles (the e-mails you are logged in with) and the default one.
|
|
|
398
460
|
|
|
399
461
|
| Command | What it does |
|
|
400
462
|
| --- | --- |
|
|
463
|
+
| `wx-admin cloud [<service> [<operation>]] [--param NAME=VALUE]... [--data JSON \| --data-file FILE\|-] [--yes] [--show-secrets]` | any operation of the cloud services (knowledge base, voicebots, WIM tools, Wilma) with the token of the PBX |
|
|
401
464
|
| `wx-admin login [<e-mail>] [--send-code \| --code CODE]` | log in with a one-time code sent to your e-mail |
|
|
402
465
|
| `wx-admin logout [--profile EMAIL] [--everywhere]` | log out: revoke the session of this device, or of every device |
|
|
403
466
|
| `wx-admin status [--profile EMAIL] [--check]` | who you are logged in as, until when, and the version of wx-admin |
|
|
@@ -410,6 +473,13 @@ As in the internal Wildix CLI: text for people by default, `--output json` for s
|
|
|
410
473
|
PBX, `{"type":"result","result":X}` unwrapped to X), `--pretty`, `--no-color`; they may stand anywhere. Messages for
|
|
411
474
|
people (notes, prompts) go to stderr.
|
|
412
475
|
|
|
476
|
+
## Updates
|
|
477
|
+
|
|
478
|
+
Once a day, while a command runs in a terminal, `wx-admin` asks npm for its latest version (in the background, never
|
|
479
|
+
holding the command); when there is a newer one, a line after the output says so (`npm i -g wldx-admin-cli`).
|
|
480
|
+
Nothing is installed by itself. Off in CI, under `npx`, without a terminal, with `--output json`, or with
|
|
481
|
+
`WX_NO_UPDATE_CHECK=1`.
|
|
482
|
+
|
|
413
483
|
## Exit codes
|
|
414
484
|
|
|
415
485
|
`0` done · `1` error (network, the PBX refused the request) · `2` not logged in, or the PBX refused the access ·
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wldx-admin-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "Unofficial admin command line for the Wildix PBX (dialplans and the PBX REST API), with an x-bees login or a Company API Key",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"wildix",
|
|
@@ -25,13 +25,14 @@
|
|
|
25
25
|
},
|
|
26
26
|
"files": [
|
|
27
27
|
"bin/",
|
|
28
|
-
"src/"
|
|
28
|
+
"src/",
|
|
29
|
+
"specs/"
|
|
29
30
|
],
|
|
30
31
|
"engines": {
|
|
31
32
|
"node": ">=22"
|
|
32
33
|
},
|
|
33
34
|
"dependencies": {
|
|
34
|
-
"wldx-core": "1.
|
|
35
|
+
"wldx-core": "1.3.0"
|
|
35
36
|
},
|
|
36
37
|
"scripts": {
|
|
37
38
|
"test": "node --test test/*.test.mjs"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"openapi":"3.0.2","info":{"title":"kb","sources":["https://docs.wildix.com/codegen/api/wim-knowledge-base-client.openapi.json"]},"servers":[{"url":"https://kb.wim.wildix.com","description":"Production"},{"url":"https://kb.wim-stable.wildix.com","description":"Stable"},{"url":"https://kb.wim-stage.wildix.com","description":"Stage"}],"paths":{"/api/v1/data-sources":{"get":{"operationId":"ListDataSources","summary":"","description":"List all data sources for the current company\n\n### Allowed Auth Scopes\n\n- kb:ListDataSources\n- kb:read","parameters":[{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}]},"post":{"operationId":"CreateDataSource","summary":"","description":"Register a new data source with minimal configuration. All other parameters will be set in update operation.\n\n### Allowed Auth Scopes\n\n- kb:CreateDataSource","parameters":[{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}],"requestBody":{"required":true,"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":100,"minLength":2,"description":"Descriptive name for the data source. Used for identification and display in the UI. Examples: 'Product Confluence', 'Customer Service Docs', 'Engineering Wikis'. Length: 2-100 characters"},"description":{"type":"string","maxLength":1000,"description":"Optional detailed description of the data source content and purpose. Helps users understand what data is included. Examples: 'Contains product documentation and service guides from Confluence', 'Customer service articles synced from Zendesk'. Length: 0-1000 characters"},"type":{"type":"string","enum":["files","confluence","gdrive","website"]}},"required":["name","type"]}}}},"/api/v1/data-sources/{dataSourceId}":{"get":{"operationId":"GetDataSource","summary":"","description":"Get a data source by its ID\n\n### Allowed Auth Scopes\n\n- kb:GetDataSource\n- kb:read","parameters":[{"name":"dataSourceId","in":"path","required":true,"schema":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the data source"},"description":"Unique identifier of the data source"},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}]},"put":{"operationId":"UpdateDataSource","summary":"","description":"Update a data source by its ID\n\n### Allowed Auth Scopes\n\n- kb:UpdateDataSource","parameters":[{"name":"dataSourceId","in":"path","required":true,"schema":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the data source"},"description":"Unique identifier of the data source"},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}],"requestBody":{"required":true,"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":100,"minLength":2,"description":"Updated descriptive name for the data source. Used for identification and display in the UI. Length: 2-100 characters"},"description":{"type":"string","maxLength":1000,"description":"Updated detailed description of the data source content and purpose. Length: 0-1000 characters"}},"required":["name"]}}},"delete":{"operationId":"DeleteDataSource","summary":"","description":"Delete a data source by its ID\n\n### Allowed Auth Scopes\n\n- kb:DeleteDataSource","parameters":[{"name":"dataSourceId","in":"path","required":true,"schema":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the data source"},"description":"Unique identifier of the data source"},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}]}},"/api/v1/data-sources/{dataSourceId}/clean":{"post":{"operationId":"CleanDataSource","summary":"","description":"Clean the data source by its ID. It will clean all documents and sync logs. This operation is irreversible.\n\n### Allowed Auth Scopes\n\n- kb:CleanDataSource","parameters":[{"name":"dataSourceId","in":"path","required":true,"schema":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the data source"},"description":"Unique identifier of the data source"},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}]}},"/api/v1/data-sources/{dataSourceId}/clone":{"post":{"operationId":"CloneDataSource","summary":"","description":"Clone a data source by its ID. Only configuration will be cloned, not the data.\n\n### Allowed Auth Scopes\n\n- kb:CloneDataSource","parameters":[{"name":"dataSourceId","in":"path","required":true,"schema":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the data source"},"description":"Unique identifier of the data source"},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}]}},"/api/v1/data-sources/{dataSourceId}/configure":{"put":{"operationId":"ConfigureDataSource","summary":"","description":"Configure a data source by its ID\n\n### Allowed Auth Scopes\n\n- kb:ConfigureDataSource","parameters":[{"name":"dataSourceId","in":"path","required":true,"schema":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the data source"},"description":"Unique identifier of the data source"},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}],"requestBody":{"required":true,"schema":{"type":"object","properties":{"config":{"oneOf":[{"type":"object","title":"confluence","properties":{"confluence":{"type":"object","properties":{"baseUrl":{"type":"string","description":"The base URL of your Confluence Cloud or Server instance. Must be a valid HTTPS URL. Example: https://your-company.atlassian.net"},"username":{"type":"string","description":"The email address or username associated with the Confluence account used for authentication"},"apiKey":{"type":"string","description":"The API token or password for Confluence authentication. For Cloud instances, use an API token; for Server instances, use the account password"},"spaceId":{"type":"string","description":"The Confluence space key or ID to synchronize. All pages within this space will be included unless explicitly excluded"},"pages":{"type":"object","properties":{"enabled":{"type":"array","items":{"type":"string"},"description":"List of Confluence page IDs that should be included in the synchronization"},"disabled":{"type":"array","items":{"type":"string"},"description":"List of Confluence page IDs that should be explicitly excluded from the synchronization"}},"required":["disabled","enabled"]}},"required":["apiKey","baseUrl","spaceId","username"]}},"required":["confluence"]},{"type":"object","title":"gdrive","properties":{"gdrive":{"type":"object","properties":{"nangoConnectionId":{"type":"string","description":"The Nango integration connection ID for Google Drive. This establishes the OAuth connection to access the Drive account"},"folders":{"type":"object","properties":{"enabled":{"type":"array","items":{"type":"string"},"description":"List of Google Drive folder IDs that should be included in the synchronization"},"disabled":{"type":"array","items":{"type":"string"},"description":"List of Google Drive folder IDs that should be explicitly excluded from the synchronization"}},"required":["disabled","enabled"]}},"required":["folders","nangoConnectionId"]}},"required":["gdrive"]},{"type":"object","title":"website","properties":{"website":{"type":"object","properties":{"urls":{"type":"array","items":{"type":"string"},"description":"Starting page URLs of the website to index. Must be https and resolve to a public address. The v1 console configures exactly one, but the field is a list so additional starting points can be added without a breaking change"},"maxPages":{"type":"number","maximum":2000,"minimum":1,"description":"Upper bound on how many pages may be selected for indexing. Server-side limits still apply and take precedence"},"pages":{"type":"object","properties":{"enabled":{"type":"array","items":{"type":"string"},"description":"Absolute page URLs that should be fetched and indexed. These are the pages the user selected from the discovery result, and the complete set: anything absent is not indexed"}},"required":["enabled"]}},"required":["urls"]}},"required":["website"]},{"type":"object","title":"files","properties":{"files":{}},"required":["files"]}]},"syncSchedule":{"allOf":[{"type":"string","enum":["DISABLED","EVERY_SIX_HOURS","EVERY_TWELVE_HOURS","EVERY_DAY","EVERY_WEEK"]},{"default":"EVERY_DAY"}]}},"required":["config"]}}}},"/api/v1/data-sources/{dataSourceId}/describe":{"post":{"operationId":"DescribeDataSource","summary":"","description":"Describe the data source by its ID. It will return additional information about the data source based on the parameters provided.\n\n### Allowed Auth Scopes\n\n- kb:DescribeDataSource\n- kb:read","parameters":[{"name":"dataSourceId","in":"path","required":true,"schema":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the data source"},"description":"Unique identifier of the data source"},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}],"requestBody":{"required":true,"schema":{"type":"object","properties":{"parameters":{"type":"object","properties":{"confluence":{"type":"object","properties":{"spaces":{"type":"object","properties":{"type":{"type":"string","enum":["global","collaboration","knowledge_base","personal","system","onboarding"]}}},"pages":{"type":"object","properties":{"spaceId":{"type":"string","maxLength":50,"minLength":1,"description":"Confluence space ID to list pages from. Required when requesting page information"},"parentId":{"type":"string","maxLength":50,"minLength":1,"description":"Optional parent page ID to retrieve only child pages under this page. If not specified, retrieves all pages in the space"},"enabled":{"type":"array","items":{"type":"string"},"description":"Optional list of specific page IDs to include in the result. If provided, only these pages are returned"}},"required":["spaceId"]}}},"gdrive":{"type":"object","properties":{"session":{"type":"object","properties":{"userId":{"type":"string","default":"admin","description":"User ID for the Google Drive session. Used to identify which user's drive context to use. Defaults to 'admin' for admin user context"}},"required":["userId"]},"folders":{"type":"object","properties":{"parentId":{"type":"string","default":"root","description":"Parent folder ID to list folders from. Use 'root' to start from the Google Drive root directory. Any valid folder ID can be specified to browse subfolders"},"enabled":{"type":"array","items":{"type":"string"},"description":"Optional list of specific folder IDs to include in the result. If provided, only these folders are returned"}},"required":["parentId"]}}},"website":{"type":"object","properties":{"discover":{"type":"object","properties":{"url":{"type":"string","maxLength":2048,"minLength":1,"description":"Starting page URL of the website. Must be https and resolve to a public address"}},"required":["url"]}}},"proxy":{"description":"Parameters for describing proxy data source (type-specific, implementation varies)"},"files":{"description":"Parameters for describing file-based data source (type-specific, implementation varies)"}}}},"required":["parameters"]}}}},"/api/v1/data-sources/{dataSourceId}/documents":{"get":{"operationId":"ListDocuments","summary":"","description":"List all documents for a data source by its ID\n\n### Allowed Auth Scopes\n\n- kb:ListDocuments\n- kb:read","parameters":[{"name":"dataSourceId","in":"path","required":true,"schema":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the data source"},"description":"Unique identifier of the data source"},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."},{"name":"limit","in":"query","required":false,"schema":{"type":"number","default":50,"maximum":500,"minimum":1}},{"name":"offset","in":"query","required":false,"schema":{"type":"number","default":0,"minimum":0}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","default":"-createdAt","pattern":"^-?[a-zA-Z0-9_]{1,32}$","description":"Sort order of the results. If there is a '-' prefix, the results will be sorted in descending order. Otherwise, the results will be sorted in ascending order. Example: '-createdAt' will sort the results by createdAt in descending order. 'createdAt' will sort the results by createdAt in ascending order."},"description":"Sort order of the results. If there is a '-' prefix, the results will be sorted in descending order. Otherwise, the results will be sorted in ascending order. Example: '-createdAt' will sort the results by createdAt in descending order. 'createdAt' will sort the results by createdAt in ascending order."},{"name":"search","in":"query","required":false,"schema":{"type":"string","pattern":"^[\\p{L}0-9 \\-_]{3,32}$","description":"The search query string for filtering the documents results."},"description":"The search query string for filtering the documents results."},{"name":"originalId","in":"query","required":false,"schema":{"type":"string","maxLength":255,"minLength":1,"description":"Filter documents by original ID from the source system."},"description":"Filter documents by original ID from the source system."},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["draft","pending","processing","completed","failed"]},"description":"Filter documents by status."}]},"post":{"operationId":"CreateDocument","summary":"","description":"Create a new document for a data source by its ID\n\n### Allowed Auth Scopes\n\n- kb:CreateDocument","parameters":[{"name":"dataSourceId","in":"path","required":true,"schema":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the data source"},"description":"Unique identifier of the data source"},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}],"requestBody":{"required":true,"schema":{"type":"object","properties":{"title":{"type":"string","maxLength":100,"minLength":2,"description":"Display title of the document used in search results and UI. Can differ from originalName. Examples: 'Product Installation Guide', 'API Documentation'. Length: 2-100 characters"},"url":{"type":"string","maxLength":1024,"description":"Optional URL where the document can be accessed or viewed. Used for providing direct links to the source. Example: https://confluence.company.com/wiki/Product_Documentation"},"content":{"type":"string","description":"Optional document content in plain text or markdown format. For file uploads, can be the document content."},"description":{"type":"string","maxLength":2048,"description":"Optional detailed description of the document content and purpose. Helps users understand what the document is about."},"originalFormat":{"type":"string","maxLength":10,"minLength":1,"description":"File format/extension of the original document for reference. Examples: 'pdf', 'docx', 'md', 'html', 'txt'. Helps identify source document type"},"originalName":{"type":"string","maxLength":255,"minLength":1,"description":"Original filename or identifier of the source document. Preserves the source document name. Examples: 'product-knowledge-base.pdf', 'installation-guide.docx'"},"originalId":{"type":"string","maxLength":255,"minLength":1,"description":"Original ID from the source system, preserving the reference to the source document. Examples: 'confluence-page-1234567890' (for Confluence), 'gdrive-file-abc123' (for Google Drive), sha1(original-file-content) (for file uploads)"},"metadata":{"description":"Additional metadata of the document. Example: `{ 'createdAt': '2025-01-01T00:00:00Z', 'updatedAt': '2025-05-01T00:00:00Z', 'createdBy': 'user@example.com' }`"}},"required":["originalFormat","originalName","title"]}}}},"/api/v1/data-sources/{dataSourceId}/documents/{documentId}":{"get":{"operationId":"GetDocument","summary":"","description":"Get a document by its ID\n\n### Allowed Auth Scopes\n\n- kb:GetDocument\n- kb:read","parameters":[{"name":"dataSourceId","in":"path","required":true,"schema":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the data source"},"description":"Unique identifier of the data source"},{"name":"documentId","in":"path","required":true,"schema":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the document"},"description":"Unique identifier of the document"},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}]},"put":{"operationId":"UpdateDocument","summary":"","description":"Update a document by its ID\n\n### Allowed Auth Scopes\n\n- kb:UpdateDocument","parameters":[{"name":"dataSourceId","in":"path","required":true,"schema":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the data source"},"description":"Unique identifier of the data source"},{"name":"documentId","in":"path","required":true,"schema":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the document"},"description":"Unique identifier of the document"},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}],"requestBody":{"required":false,"schema":{"type":"object","properties":{"title":{"type":"string","maxLength":100,"minLength":2,"description":"Display title of the document used in search results and UI. Can differ from originalName. Examples: 'Product Installation Guide', 'API Documentation'. Length: 2-100 characters"},"url":{"type":"string","maxLength":1024,"description":"Optional URL where the document can be accessed or viewed. Used for providing direct links to the source. Example: https://confluence.company.com/wiki/Product_Documentation"},"description":{"type":"string","maxLength":2048,"description":"Optional detailed description of the document content and purpose. Helps users understand what the document is about."},"content":{"type":"string","description":"Optional document content in plain text or markdown format. For file uploads, can be the document content."},"updatedAt":{"type":"string","description":"Timestamp when the document was last updated (ISO 8601 format). Example: 2021-01-01T00:00:00Z"}}}}},"delete":{"operationId":"DeleteDocument","summary":"","description":"Delete a document by its ID\n\n### Allowed Auth Scopes\n\n- kb:DeleteDocument","parameters":[{"name":"dataSourceId","in":"path","required":true,"schema":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the data source"},"description":"Unique identifier of the data source"},{"name":"documentId","in":"path","required":true,"schema":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the document"},"description":"Unique identifier of the document"},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}]}},"/api/v1/data-sources/{dataSourceId}/documents/{documentId}/chunks":{"get":{"operationId":"GetDocumentChunks","summary":"","description":"Get the chunks of a document by its ID\n\n### Allowed Auth Scopes\n\n- kb:GetDocumentChunks\n- kb:read","parameters":[{"name":"dataSourceId","in":"path","required":true,"schema":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the data source"},"description":"Unique identifier of the data source"},{"name":"documentId","in":"path","required":true,"schema":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the document"},"description":"Unique identifier of the document"},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}]}},"/api/v1/data-sources/{dataSourceId}/documents/{documentId}/download-url":{"get":{"operationId":"GetDocumentDownloadUrl","summary":"","description":"Get a presigned URL for downloading the original file of the document\n\n### Allowed Auth Scopes\n\n- kb:GetDocumentDownloadUrl\n- kb:read","parameters":[{"name":"dataSourceId","in":"path","required":true,"schema":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the data source"},"description":"Unique identifier of the data source"},{"name":"documentId","in":"path","required":true,"schema":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the document"},"description":"Unique identifier of the document"},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}]}},"/api/v1/data-sources/{dataSourceId}/documents/{documentId}/markdown":{"get":{"operationId":"GetDocumentMarkdown","summary":"","description":"Get the markdown content of a document by its ID\n\n### Allowed Auth Scopes\n\n- kb:GetDocumentMarkdown\n- kb:read","parameters":[{"name":"dataSourceId","in":"path","required":true,"schema":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the data source"},"description":"Unique identifier of the data source"},{"name":"documentId","in":"path","required":true,"schema":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the document"},"description":"Unique identifier of the document"},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}]}},"/api/v1/data-sources/{dataSourceId}/documents/{documentId}/upload-url":{"get":{"operationId":"GetDocumentUploadUrl","summary":"","description":"Get a presigned URL for uploading the original file of the document. You must upload the file to this URL using the PUT method.\n\n### Allowed Auth Scopes\n\n- kb:GetDocumentUploadUrl","parameters":[{"name":"dataSourceId","in":"path","required":true,"schema":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the data source"},"description":"Unique identifier of the data source"},{"name":"documentId","in":"path","required":true,"schema":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the document"},"description":"Unique identifier of the document"},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}]}},"/api/v1/data-sources/{dataSourceId}/documents/{documentId}/with-content-and-chunks":{"get":{"operationId":"GetDocumentWithContentAndChunks","summary":"","description":"Get a document by its ID with its content and chunks\n\n### Allowed Auth Scopes\n\n- kb:GetDocumentWithContentAndChunks\n- kb:read","parameters":[{"name":"dataSourceId","in":"path","required":true,"schema":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the data source"},"description":"Unique identifier of the data source"},{"name":"documentId","in":"path","required":true,"schema":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the document"},"description":"Unique identifier of the document"},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}]}},"/api/v1/data-sources/{dataSourceId}/start-sync":{"post":{"operationId":"StartSyncDataSource","summary":"","description":"Start the sync of a data source by its ID\n\n### Allowed Auth Scopes\n\n- kb:StartSyncDataSource","parameters":[{"name":"dataSourceId","in":"path","required":true,"schema":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the data source"},"description":"Unique identifier of the data source"},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."},{"name":"syncType","in":"query","required":false,"schema":{"type":"string","enum":["full","incremental"]},"description":"The synchronization mode to use. 'full' performs a complete re-sync of all data, 'incremental' syncs only new or modified data since the last sync. Defaults to 'full' if not specified"}]}},"/api/v1/data-sources/{dataSourceId}/statistics":{"get":{"operationId":"ListDataSourceStatistics","summary":"","description":"List the statistics of a data source by its ID\n\n### Allowed Auth Scopes\n\n- kb:ListDataSourceStatistics\n- kb:read","parameters":[{"name":"dataSourceId","in":"path","required":true,"schema":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the data source"},"description":"Unique identifier of the data source"},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}]}},"/api/v1/data-sources/{dataSourceId}/stop-sync":{"post":{"operationId":"StopSyncDataSource","summary":"","description":"Stop the sync of a data source by its ID\n\n### Allowed Auth Scopes\n\n- kb:StopSyncDataSource","parameters":[{"name":"dataSourceId","in":"path","required":true,"schema":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the data source"},"description":"Unique identifier of the data source"},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}]}},"/api/v1/data-sources/{dataSourceId}/sync-logs":{"get":{"operationId":"ListDataSourceSynchronizationLogs","summary":"","description":"Get the sync logs of a data source by its ID\n\n### Allowed Auth Scopes\n\n- kb:ListDataSourceSynchronizationLogs\n- kb:read","parameters":[{"name":"dataSourceId","in":"path","required":true,"schema":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the data source"},"description":"Unique identifier of the data source"},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."},{"name":"limit","in":"query","required":false,"schema":{"type":"number","default":50,"maximum":500,"minimum":1}},{"name":"offset","in":"query","required":false,"schema":{"type":"number","default":0,"minimum":0}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","default":"-createdAt","pattern":"^-?[a-zA-Z0-9_]{1,32}$","description":"Sort order of the results. If there is a '-' prefix, the results will be sorted in descending order. Otherwise, the results will be sorted in ascending order. Example: '-createdAt' will sort the results by createdAt in descending order. 'createdAt' will sort the results by createdAt in ascending order."},"description":"Sort order of the results. If there is a '-' prefix, the results will be sorted in descending order. Otherwise, the results will be sorted in ascending order. Example: '-createdAt' will sort the results by createdAt in descending order. 'createdAt' will sort the results by createdAt in ascending order."},{"name":"logLevel","in":"query","required":false,"schema":{"type":"string","enum":["debug","info","warn","error"]},"description":"The log level to filter the sync logs by. Possible values: 'debug', 'info', 'warn', 'error'."},{"name":"search","in":"query","required":false,"schema":{"type":"string","pattern":"^[\\p{L}0-9 \\-_]{3,32}$","description":"The search query string for filtering the history results."},"description":"The search query string for filtering the history results."}]}},"/api/v1/data-sources/{dataSourceId}/sync-status":{"get":{"operationId":"GetDataSourceSyncStatus","summary":"","description":"Get the sync status of a data source by its ID\n\n### Allowed Auth Scopes\n\n- kb:GetDataSourceSyncStatus\n- kb:read","parameters":[{"name":"dataSourceId","in":"path","required":true,"schema":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the data source"},"description":"Unique identifier of the data source"},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}]}},"/api/v1/knowledge-bases":{"get":{"operationId":"ListKnowledgeBases","summary":"","description":"List all knowledge bases for the current company\n\n### Allowed Auth Scopes\n\n- kb:ListKnowledgeBases\n- kb:read","parameters":[{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}]},"post":{"operationId":"CreateKnowledgeBase","summary":"","description":"Create a new knowledge base\n\n### Allowed Auth Scopes\n\n- kb:CreateKnowledgeBase","parameters":[{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}],"requestBody":{"required":true,"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":100,"minLength":2,"description":"Descriptive name for the knowledge base. Used for identification in the UI and APIs. Examples: 'Product Knowledge Base', 'Support Documentation'. Length: 2-100 characters"},"description":{"type":"string","maxLength":1000,"description":"Optional detailed description of the knowledge base content and purpose. Helps users understand what topics are covered. Examples: 'Comprehensive product documentation and service guides', 'Internal technical documentation'. Length: 0-1000 characters"},"dataSources":{"type":"array","items":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the data source"},"description":"List of data source IDs that provide content for this knowledge base. Can include Confluence, Google Drive, file uploads, and proxy sources. Empty list results in no searchable content"}},"required":["dataSources","name"]}}}},"/api/v1/knowledge-bases/generate-answer":{"post":{"operationId":"GenerateSearchAnswer","summary":"","description":"Query a knowledge base by its ID and return the answer from the LLM\n\n### Allowed Auth Scopes\n\n- kb:GenerateSearchAnswer\n- kb:read","parameters":[{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}],"requestBody":{"required":true,"schema":{"type":"object","properties":{"searchQuery":{"type":"string","description":"The question or query to be answered using the knowledge base. The LLM will search the knowledge base and generate an answer based on found results. Example: 'What is the product knowledge base?'"},"searchResults":{"type":"array","items":{"type":"object","properties":{"chunkId":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"The ID of the chunk. Example: 123e4567-e89b-12d3-a456-426614174000"},"documentId":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the document"},"documentTitle":{"type":"string"},"documentUrl":{"type":"string"},"dataSourceId":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the data source"},"dataSourceType":{"type":"string","enum":["files","confluence","gdrive","website"]},"score":{"type":"number","description":"The total score of the result, calculated from the semantic search score and the full-text search score.","format":"double"},"fullTextScore":{"type":"number","description":"The score of the result, calculated from the full-text bm25 search score.","format":"double"},"semanticScore":{"type":"number","description":"The score of the result, calculated from the semantic vector search score.","format":"double"},"documentHierarchy":{"type":"array","items":{"type":"string"},"description":"The hierarchy of the document. The hierarchy is a list of document IDs that are the parents of the current document. The hierarchy is used to build the document hierarchy in the search results."},"content":{"type":"string"},"metadata":{"description":"The metadata of the document."}},"required":["chunkId","content","dataSourceId","dataSourceType","documentId","documentTitle","documentUrl","score"]},"description":"The search results to be used to generate the answer. The LLM will use the search results to generate an answer based on the found results."},"model":{"type":"string","description":"The specific provider and model identifier. Examples: 'openai://gpt-4o' or 'openai://gpt-4o-mini' for OpenAI, 'mistral://mistral-small-2506' for Mistral. Check provider documentation for available models"},"temperature":{"type":"number","default":0.3,"maximum":1,"minimum":0,"description":"Controls answer randomness and creativity (0.0-1.0). Low values (0.0-0.3) produce consistent, deterministic answers. High values (0.7-1.0) produce more diverse and creative responses. Defaults to 0.3 for factual consistency","format":"double"},"maxOutputTokens":{"type":"number","default":1000,"maximum":10000,"minimum":1,"description":"Maximum number of tokens in the generated answer (1-10000). Higher values allow longer, more detailed answers. Lower values force concise responses. Defaults to 1000 tokens. Note: higher values increase latency and cost"},"systemPrompt":{"type":"string","description":"Optional system prompt to customize LLM behavior and context. Sets instructions for how the LLM should answer questions. Example: 'You are a helpful technical support assistant. Answer only based on the provided knowledge base. If information is not found, say \"I don't have this information in the knowledge base.\"'"}},"required":["searchQuery","searchResults"]}}}},"/api/v1/knowledge-bases/history/search-queries":{"post":{"operationId":"ListSearchQueriesHistory","summary":"","description":"You can use this endpoint to retrieve the search history.\n\n### Allowed Auth Scopes\n\n- kb:ListSearchQueriesHistory\n- kb:read","parameters":[{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."},{"name":"limit","in":"query","required":false,"schema":{"type":"number","default":50,"maximum":500,"minimum":1}},{"name":"offset","in":"query","required":false,"schema":{"type":"number","default":0,"minimum":0}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","default":"-createdAt","pattern":"^-?[a-zA-Z0-9_]{1,32}$","description":"Sort order of the results. If there is a '-' prefix, the results will be sorted in descending order. Otherwise, the results will be sorted in ascending order. Example: '-createdAt' will sort the results by createdAt in descending order. 'createdAt' will sort the results by createdAt in ascending order."},"description":"Sort order of the results. If there is a '-' prefix, the results will be sorted in descending order. Otherwise, the results will be sorted in ascending order. Example: '-createdAt' will sort the results by createdAt in descending order. 'createdAt' will sort the results by createdAt in ascending order."}],"requestBody":{"required":true,"schema":{"type":"object","properties":{"filter":{"type":"object","properties":{"knowledgeBaseId":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Filter history by the knowledge base ID."},"dataSourceId":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Filter history by the data source ID."},"sessionId":{"type":"string","maxLength":255,"minLength":1,"description":"Filter history by the internal session ID."},"sessionUri":{"type":"string","maxLength":255,"minLength":1,"description":"Filter history by the session URI. Used for tracking and analytics purposes. Example: `chatbots://{agentId}/id-of-chat-session/id-of-message`"},"sessionUser":{"type":"string","maxLength":100,"minLength":1,"description":"Filter history by the user who performs the search in the knowledge base. Example: user@example.com"},"withEmptyResults":{"type":"boolean","default":false,"description":"Whether to include the history results with empty results."}}},"search":{"type":"string","pattern":"^[\\p{L}0-9 \\-_]{3,32}$","description":"The search query string for filtering the history results."},"withContent":{"type":"boolean","default":false,"description":"Whether to include the content of the chunks in the history results."}},"required":["filter"]}}}},"/api/v1/knowledge-bases/history/statistics":{"post":{"operationId":"ListHistoryStatistics","summary":"","description":"You can use this endpoint to retrieve the search history statistics.\n\n### Allowed Auth Scopes\n\n- kb:ListHistoryStatistics\n- kb:read","parameters":[{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}],"requestBody":{"required":true,"schema":{"type":"object","properties":{"filter":{"type":"object","properties":{"knowledgeBaseIds":{"type":"array","items":{"type":"string"},"description":"Filter history by the knowledge base IDs."},"dataSourceIds":{"type":"array","items":{"type":"string"},"description":"Filter history by the data source IDs."},"daysBack":{"type":"number","default":7,"maximum":30,"minimum":1,"description":"Number of days to look back for recent statistics. If not specified, defaults to 7 days."}}}},"required":["filter"]}}}},"/api/v1/knowledge-bases/{knowledgeBaseId}":{"get":{"operationId":"GetKnowledgeBase","summary":"","description":"Get a knowledge base by its ID\n\n### Allowed Auth Scopes\n\n- kb:GetKnowledgeBase\n- kb:read","parameters":[{"name":"knowledgeBaseId","in":"path","required":true,"schema":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the knowledge base"},"description":"Unique identifier of the knowledge base"},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}]},"put":{"operationId":"UpdateKnowledgeBase","summary":"","description":"Update a knowledge base by its ID\n\n### Allowed Auth Scopes\n\n- kb:UpdateKnowledgeBase","parameters":[{"name":"knowledgeBaseId","in":"path","required":true,"schema":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the knowledge base"},"description":"Unique identifier of the knowledge base"},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}],"requestBody":{"required":true,"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":100,"minLength":2,"description":"Descriptive name for the knowledge base. Used for identification in the UI and APIs. Examples: 'Product Knowledge Base', 'Support Documentation'. Length: 2-100 characters"},"description":{"type":"string","maxLength":1000,"description":"Optional detailed description of the knowledge base content and purpose. Helps users understand what topics are covered. Examples: 'Comprehensive product documentation and service guides', 'Internal technical documentation'. Length: 0-1000 characters"},"dataSources":{"type":"array","items":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the data source"},"description":"List of data source IDs that provide content for this knowledge base. Can include Confluence, Google Drive, file uploads, and proxy sources. Empty list results in no searchable content"}},"required":["dataSources","name"]}}},"delete":{"operationId":"DeleteKnowledgeBase","summary":"","description":"Delete a knowledge base by its ID\n\n### Allowed Auth Scopes\n\n- kb:DeleteKnowledgeBase","parameters":[{"name":"knowledgeBaseId","in":"path","required":true,"schema":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the knowledge base"},"description":"Unique identifier of the knowledge base"},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}]}},"/api/v1/knowledge-bases/{knowledgeBaseId}/search":{"post":{"operationId":"SearchKnowledgeBase","summary":"","description":"Search a knowledge base by its ID and return the chunks that match the query with its score\n\n### Allowed Auth Scopes\n\n- kb:SearchKnowledgeBase\n- kb:read","parameters":[{"name":"knowledgeBaseId","in":"path","required":true,"schema":{"type":"string","maxLength":36,"minLength":36,"pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$","description":"Unique identifier of the knowledge base"},"description":"Unique identifier of the knowledge base"},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}],"requestBody":{"required":true,"schema":{"type":"object","properties":{"query":{"type":"string","description":"The search query string. Can be a single keyword or a natural language question. Example: 'What is the product knowledge base?'"},"searchStrategy":{"allOf":[{"type":"string","enum":["bm25","vector","hybrid"]},{"default":"hybrid"}]},"searchLimit":{"type":"number","default":10,"maximum":50,"minimum":1,"description":"Maximum number of search results to return. Controls the size of the result set. Valid range: 1-50. Defaults to 10 if not specified. Higher values return more results but may include less relevant matches"},"searchThreshold":{"allOf":[{"type":"string","enum":["low","medium","high"]},{"default":"medium"}]},"useQueryOptimization":{"type":"boolean","default":false,"description":"Whether to optimize and transform the input query using advanced NLP techniques before searching. Improves search quality for complex or poorly phrased queries. Defaults to false. Set to true for better results with natural language questions"},"sessionUser":{"type":"string","default":"unknown","maxLength":100,"minLength":1,"description":"The user who performs the search in the knowledge base. Example: user@example.com or Jon Doe"},"sessionUri":{"type":"string","default":"unknown","maxLength":255,"minLength":1,"description":"The session URI. Used for tracking and analytics purposes. Example: `chatbots://{agentId}/id-of-chat-session/id-of-message`"}},"required":["query"]}}}}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"openapi":"3.0.2","info":{"title":"tools","sources":["https://docs.wildix.com/codegen/api/wim-tools-client.openapi.json"]},"servers":[{"url":"https://tools.wim.wildix.com","description":"Production"},{"url":"https://tools.wim-stable.wildix.com","description":"Stable"},{"url":"https://tools.wim-stage.wildix.com","description":"Stage"}],"paths":{"/v1/tools":{"get":{"operationId":"ListTools","summary":"","description":"List all tools for the current company.\n\n### Allowed Auth Scopes\n\n- tools:ListTools\n- tools:read","parameters":[{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}]},"post":{"operationId":"CreateTool","summary":"","description":"Create a new tool.\n\n### Allowed Auth Scopes\n\n- tools:CreateTool","parameters":[{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}],"requestBody":{"required":true,"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[a-zA-Z0-9_-]+$","description":"Name of the tool, e.g.: 'send_email'"},"category":{"type":"string","maxLength":128,"minLength":1,"description":"Category of the tool, e.g.: 'Support'"},"description":{"type":"string","maxLength":4096,"minLength":1,"description":"Description of the tool, used by AI to understand the purpose of the tool."},"input":{"type":"object","properties":{"variables":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[a-zA-Z0-9_]+$","description":"Name of the tool variable, e.g.: 'myvar'"},"type":{"type":"string","enum":["string","number","boolean","string_array","number_array","schema"]},"optional":{"type":"boolean","description":"Whether the variable is optional"},"description":{"type":"string","description":"Original description from MCP tool schema (preserved)"},"schema":{"description":"JSON Schema in case if type is schema"}},"required":["name","optional","type"]},"description":"List of tool variables, used to pass data to the tool"}},"required":["variables"]},"handler":{"oneOf":[{"type":"object","title":"email","properties":{"email":{"oneOf":[{"type":"object","title":"wns","properties":{"wns":{"type":"object","properties":{"to":{"type":"string","description":"To email address, e.g.: 'jane.doe@example.com'."},"subject":{"type":"string","description":"Subject of the email."},"text":{"type":"string","description":"Text of the email."}},"required":["subject","text","to"]}},"required":["wns"]},{"type":"object","title":"custom","properties":{"custom":{"type":"object","properties":{"smtp":{"type":"object","properties":{"host":{"type":"string","description":"SMTP server host, e.g.: 'smtp.gmail.com'"},"port":{"type":"number","maximum":65535,"minimum":1,"description":"SMTP server port, e.g.: 587"},"username":{"type":"string","description":"SMTP server username for authentication, e.g.: 'john.doe@gmail.com'"},"password":{"type":"string","description":"SMTP server password"},"secure":{"type":"boolean","description":"SMTP server secure connection"}},"required":["host","password","port","secure","username"]},"from":{"type":"string","description":"From email address associated with the SMTP server, e.g.: 'john.doe@gmail.com'"},"to":{"type":"string","description":"To email address, e.g.: 'jane.doe@example.com'"},"subject":{"type":"string","description":"Subject of the email."},"text":{"type":"string","description":"Text of the email."},"html":{"type":"string","description":"HTML content of the email"},"cc":{"type":"string","description":"CC email addresses"},"bcc":{"type":"string","description":"BCC email addresses"},"replyTo":{"type":"string","description":"Reply-to email address"}},"required":["from","smtp","subject","text","to"]}},"required":["custom"]}]}},"required":["email"]},{"type":"object","title":"webhook","properties":{"webhook":{"type":"object","properties":{"method":{"type":"string","enum":["GET","POST","PUT","DELETE","PATCH"]},"url":{"type":"string","description":"URL endpoint for the webhook, supports variables in path and query parameters using {{variable_name}}, e.g.: 'https://api.example.com/users/{{userId}}?filter={{filter}}&page={{page}}'"},"headers":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Header name, e.g.: 'X-Custom-Header'"},"value":{"type":"string","description":"Header value, supports static, variable, or template syntax"}},"required":["name","value"]},"description":"HTTP headers for the webhook request. For custom authentication headers (e.g., X-API-Key), add them here instead of using auth.customHeader"},"body":{"type":"string","description":"Request body for POST, PUT, or PATCH requests"},"auth":{"oneOf":[{"type":"object","title":"basic","properties":{"basic":{"type":"object","properties":{"username":{"type":"string","description":"Username for basic authentication"},"password":{"type":"string","description":"Password for basic authentication"}},"required":["password","username"]}},"required":["basic"]},{"type":"object","title":"bearer","properties":{"bearer":{"type":"object","properties":{"token":{"type":"string","description":"Bearer token value, supports static, variable, or template syntax"}},"required":["token"]}},"required":["bearer"]},{"type":"object","title":"oauth","properties":{"oauth":{"type":"object","properties":{"clientId":{"type":"string","description":"OAuth client ID"},"clientSecret":{"type":"string","description":"OAuth client secret"},"endpointUrl":{"type":"string","description":"OAuth token endpoint URL"},"scope":{"type":"string","description":"OAuth scope"}},"required":["clientId","clientSecret","endpointUrl"]}},"required":["oauth"]}]},"timeout":{"type":"number","maximum":120000,"minimum":5000,"description":"Time before webhook execution is stopped"}},"required":["method","url"]}},"required":["webhook"]},{"type":"object","title":"search","properties":{"search":{"type":"object","description":"Search handler configuration. API key comes from AppConfig; query comes from tool input. Optionally refine results using Tavily include_domains and/or exclude_domains (see Tavily domain filtering).","properties":{"includeDomains":{"type":"array","items":{"type":"string"},"maxItems":300,"description":"When non-empty, only return results from these domains or hosts. Customers may enter plain hostnames (example.com) or full URLs (https://example.com/path) — URLs are normalized to hostnames before calling the search API."},"excludeDomains":{"type":"array","items":{"type":"string"},"maxItems":150,"description":"When non-empty, omit results from these domains or hosts. Same hostname rules as includeDomains. Can be combined with includeDomains per Tavily API."}}}},"required":["search"]},{"type":"object","title":"chat","properties":{"chat":{"type":"object","properties":{"config":{"type":"object","properties":{"recipient":{"oneOf":[{"type":"object","title":"channelId","properties":{"channelId":{"type":"string","description":"Channel ID for group channels."}},"required":["channelId"]},{"type":"object","title":"userId","properties":{"userId":{"type":"string","description":"User email address for direct messages."}},"required":["userId"]}]},"text":{"type":"string","description":"Message text to send."},"botName":{"type":"string","description":"Name of the system bot that will send the message."}},"required":["botName","recipient","text"]}},"required":["config"]}},"required":["chat"]},{"type":"object","title":"sms","properties":{"sms":{"type":"object","properties":{"config":{"type":"object","properties":{"from":{"type":"string","description":"Sender phone number in E.164 format (e.g., +1234567890). This is the phone number that will appear as the sender of the SMS. Supports template syntax with variables."},"to":{"type":"string","description":"Recipient phone number in E.164 format (e.g., +1234567890). Supports template syntax with variables."},"message":{"type":"string","description":"SMS message text to send. Supports template syntax with variables. Maximum length depends on carrier limits (typically 160 characters for single SMS, 1600 for concatenated)."}},"required":["from","message","to"]}},"required":["config"]}},"required":["sms"]},{"type":"object","title":"calendar","properties":{"calendar":{"type":"object","properties":{"operation":{"type":"string","enum":["get_slots","schedule","reschedule","cancel","list_resource_events"]}},"required":["operation"]}},"required":["calendar"]},{"type":"object","title":"mcp","properties":{"mcp":{"type":"object","properties":{"serverUrl":{"type":"string","description":"MCP server endpoint URL"},"authorization":{"oneOf":[{"type":"object","title":"bearer","properties":{"bearer":{"type":"object","properties":{"token":{"type":"string","description":"Bearer token value, supports static, variable, or template syntax"}},"required":["token"]}},"required":["bearer"]},{"type":"object","title":"customHeaders","properties":{"customHeaders":{"type":"object","additionalProperties":{"type":"string","description":"Header value"},"propertyNames":{"type":"string","description":"Header name"}}},"required":["customHeaders"]}]},"tools":{"type":"array","items":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[a-zA-Z0-9_-]+$","description":"List of enabled MCP tool IDs"},"description":"List of tools enabled for this MCP server."}},"required":["serverUrl","tools"]}},"required":["mcp"]},{"type":"object","title":"mcpTool","properties":{"mcpTool":{"type":"object","properties":{"mcpToolId":{"type":"string","maxLength":12,"minLength":12,"pattern":"^[0-9A-Za-z]{12}$","description":"ID of the Tool that represents the MCP server connection (the Tool with handler.mcp containing serverUrl and authorization)"},"mcpToolName":{"type":"string","description":"Name of the tool on the MCP server. This matches the tool name returned from DiscoverTools operation."}},"required":["mcpToolId","mcpToolName"]}},"required":["mcpTool"]}]}},"required":["category","description","handler","input","name"]}}}},"/v1/tools/describe":{"post":{"operationId":"DescribeTools","summary":"","description":"Describe multiple tools by their IDs.\n\n### Allowed Auth Scopes\n\n- tools:DescribeTools\n- tools:read","parameters":[{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}],"requestBody":{"required":true,"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string","maxLength":12,"minLength":12,"pattern":"^[0-9A-Za-z]{12}$","description":"Unique identifier of the tool using nanoid format"},"description":"List of tool IDs."}},"required":["ids"]}}}},"/v1/tools/discover":{"post":{"operationId":"DiscoverTools","summary":"","description":"Discover tools from an MCP server.\n\n### Allowed Auth Scopes\n\n- tools:DiscoverTools\n- tools:read","parameters":[{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}],"requestBody":{"required":true,"schema":{"type":"object","properties":{"serverUrl":{"type":"string","description":"MCP server endpoint URL"},"authorization":{"oneOf":[{"type":"object","title":"bearer","properties":{"bearer":{"type":"object","properties":{"token":{"type":"string","description":"Bearer token value, supports static, variable, or template syntax"}},"required":["token"]}},"required":["bearer"]},{"type":"object","title":"customHeaders","properties":{"customHeaders":{"type":"object","additionalProperties":{"type":"string","description":"Header value"},"propertyNames":{"type":"string","description":"Header name"}}},"required":["customHeaders"]}]}},"required":["serverUrl"]}}}},"/v1/tools/execute":{"post":{"operationId":"ExecuteTool","summary":"","description":"Execute a tool with the provided input.\n\n### Allowed Auth Scopes\n\n- tools:ExecuteTool","parameters":[{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}],"requestBody":{"required":true,"schema":{"type":"object","properties":{"id":{"type":"string","maxLength":12,"minLength":12,"pattern":"^[0-9A-Za-z]{12}$","description":"Unique identifier of the tool."},"input":{"description":"Input of the tool, used to pass data to the tool."},"service":{"type":"string","maxLength":256,"minLength":1,"description":"Optional parameter, by which service the tool is executed, e.g. chatbots."},"user":{"type":"string","maxLength":256,"minLength":1,"description":"Optional parameter, for which user the tool is executed, e.g. john.doe@example.com."}},"required":["id","input"]}}}},"/v1/tools/{toolId}":{"get":{"operationId":"GetTool","summary":"","description":"Get a tool by its ID.\n\n### Allowed Auth Scopes\n\n- tools:GetTool\n- tools:read","parameters":[{"name":"toolId","in":"path","required":true,"schema":{"type":"string","maxLength":12,"minLength":12,"pattern":"^[0-9A-Za-z]{12}$","description":"Unique identifier of the tool."},"description":"Unique identifier of the tool."},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}]},"put":{"operationId":"UpdateTool","summary":"","description":"Update a tool by its ID.\n\n### Allowed Auth Scopes\n\n- tools:UpdateTool","parameters":[{"name":"toolId","in":"path","required":true,"schema":{"type":"string","maxLength":12,"minLength":12,"pattern":"^[0-9A-Za-z]{12}$","description":"Unique identifier of the tool."},"description":"Unique identifier of the tool."},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}],"requestBody":{"required":true,"schema":{"type":"object","properties":{"name":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[a-zA-Z0-9_-]+$","description":"Name of the tool, e.g.: 'send_email'"},"category":{"type":"string","maxLength":128,"minLength":1,"description":"Category of the tool, e.g.: 'Support'"},"description":{"type":"string","maxLength":4096,"minLength":1,"description":"Description of the tool, used by AI to understand the purpose of the tool."},"input":{"type":"object","properties":{"variables":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[a-zA-Z0-9_]+$","description":"Name of the tool variable, e.g.: 'myvar'"},"type":{"type":"string","enum":["string","number","boolean","string_array","number_array","schema"]},"optional":{"type":"boolean","description":"Whether the variable is optional"},"description":{"type":"string","description":"Original description from MCP tool schema (preserved)"},"schema":{"description":"JSON Schema in case if type is schema"}},"required":["name","optional","type"]},"description":"List of tool variables, used to pass data to the tool"}},"required":["variables"]},"handler":{"oneOf":[{"type":"object","title":"email","properties":{"email":{"oneOf":[{"type":"object","title":"wns","properties":{"wns":{"type":"object","properties":{"to":{"type":"string","description":"To email address, e.g.: 'jane.doe@example.com'."},"subject":{"type":"string","description":"Subject of the email."},"text":{"type":"string","description":"Text of the email."}},"required":["subject","text","to"]}},"required":["wns"]},{"type":"object","title":"custom","properties":{"custom":{"type":"object","properties":{"smtp":{"type":"object","properties":{"host":{"type":"string","description":"SMTP server host, e.g.: 'smtp.gmail.com'"},"port":{"type":"number","maximum":65535,"minimum":1,"description":"SMTP server port, e.g.: 587"},"username":{"type":"string","description":"SMTP server username for authentication, e.g.: 'john.doe@gmail.com'"},"password":{"type":"string","description":"SMTP server password"},"secure":{"type":"boolean","description":"SMTP server secure connection"}},"required":["host","password","port","secure","username"]},"from":{"type":"string","description":"From email address associated with the SMTP server, e.g.: 'john.doe@gmail.com'"},"to":{"type":"string","description":"To email address, e.g.: 'jane.doe@example.com'"},"subject":{"type":"string","description":"Subject of the email."},"text":{"type":"string","description":"Text of the email."},"html":{"type":"string","description":"HTML content of the email"},"cc":{"type":"string","description":"CC email addresses"},"bcc":{"type":"string","description":"BCC email addresses"},"replyTo":{"type":"string","description":"Reply-to email address"}},"required":["from","smtp","subject","text","to"]}},"required":["custom"]}]}},"required":["email"]},{"type":"object","title":"webhook","properties":{"webhook":{"type":"object","properties":{"method":{"type":"string","enum":["GET","POST","PUT","DELETE","PATCH"]},"url":{"type":"string","description":"URL endpoint for the webhook, supports variables in path and query parameters using {{variable_name}}, e.g.: 'https://api.example.com/users/{{userId}}?filter={{filter}}&page={{page}}'"},"headers":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"Header name, e.g.: 'X-Custom-Header'"},"value":{"type":"string","description":"Header value, supports static, variable, or template syntax"}},"required":["name","value"]},"description":"HTTP headers for the webhook request. For custom authentication headers (e.g., X-API-Key), add them here instead of using auth.customHeader"},"body":{"type":"string","description":"Request body for POST, PUT, or PATCH requests"},"auth":{"oneOf":[{"type":"object","title":"basic","properties":{"basic":{"type":"object","properties":{"username":{"type":"string","description":"Username for basic authentication"},"password":{"type":"string","description":"Password for basic authentication"}},"required":["password","username"]}},"required":["basic"]},{"type":"object","title":"bearer","properties":{"bearer":{"type":"object","properties":{"token":{"type":"string","description":"Bearer token value, supports static, variable, or template syntax"}},"required":["token"]}},"required":["bearer"]},{"type":"object","title":"oauth","properties":{"oauth":{"type":"object","properties":{"clientId":{"type":"string","description":"OAuth client ID"},"clientSecret":{"type":"string","description":"OAuth client secret"},"endpointUrl":{"type":"string","description":"OAuth token endpoint URL"},"scope":{"type":"string","description":"OAuth scope"}},"required":["clientId","clientSecret","endpointUrl"]}},"required":["oauth"]}]},"timeout":{"type":"number","maximum":120000,"minimum":5000,"description":"Time before webhook execution is stopped"}},"required":["method","url"]}},"required":["webhook"]},{"type":"object","title":"search","properties":{"search":{"type":"object","description":"Search handler configuration. API key comes from AppConfig; query comes from tool input. Optionally refine results using Tavily include_domains and/or exclude_domains (see Tavily domain filtering).","properties":{"includeDomains":{"type":"array","items":{"type":"string"},"maxItems":300,"description":"When non-empty, only return results from these domains or hosts. Customers may enter plain hostnames (example.com) or full URLs (https://example.com/path) — URLs are normalized to hostnames before calling the search API."},"excludeDomains":{"type":"array","items":{"type":"string"},"maxItems":150,"description":"When non-empty, omit results from these domains or hosts. Same hostname rules as includeDomains. Can be combined with includeDomains per Tavily API."}}}},"required":["search"]},{"type":"object","title":"chat","properties":{"chat":{"type":"object","properties":{"config":{"type":"object","properties":{"recipient":{"oneOf":[{"type":"object","title":"channelId","properties":{"channelId":{"type":"string","description":"Channel ID for group channels."}},"required":["channelId"]},{"type":"object","title":"userId","properties":{"userId":{"type":"string","description":"User email address for direct messages."}},"required":["userId"]}]},"text":{"type":"string","description":"Message text to send."},"botName":{"type":"string","description":"Name of the system bot that will send the message."}},"required":["botName","recipient","text"]}},"required":["config"]}},"required":["chat"]},{"type":"object","title":"sms","properties":{"sms":{"type":"object","properties":{"config":{"type":"object","properties":{"from":{"type":"string","description":"Sender phone number in E.164 format (e.g., +1234567890). This is the phone number that will appear as the sender of the SMS. Supports template syntax with variables."},"to":{"type":"string","description":"Recipient phone number in E.164 format (e.g., +1234567890). Supports template syntax with variables."},"message":{"type":"string","description":"SMS message text to send. Supports template syntax with variables. Maximum length depends on carrier limits (typically 160 characters for single SMS, 1600 for concatenated)."}},"required":["from","message","to"]}},"required":["config"]}},"required":["sms"]},{"type":"object","title":"calendar","properties":{"calendar":{"type":"object","properties":{"operation":{"type":"string","enum":["get_slots","schedule","reschedule","cancel","list_resource_events"]}},"required":["operation"]}},"required":["calendar"]},{"type":"object","title":"mcp","properties":{"mcp":{"type":"object","properties":{"serverUrl":{"type":"string","description":"MCP server endpoint URL"},"authorization":{"oneOf":[{"type":"object","title":"bearer","properties":{"bearer":{"type":"object","properties":{"token":{"type":"string","description":"Bearer token value, supports static, variable, or template syntax"}},"required":["token"]}},"required":["bearer"]},{"type":"object","title":"customHeaders","properties":{"customHeaders":{"type":"object","additionalProperties":{"type":"string","description":"Header value"},"propertyNames":{"type":"string","description":"Header name"}}},"required":["customHeaders"]}]},"tools":{"type":"array","items":{"type":"string","maxLength":128,"minLength":1,"pattern":"^[a-zA-Z0-9_-]+$","description":"List of enabled MCP tool IDs"},"description":"List of tools enabled for this MCP server."}},"required":["serverUrl","tools"]}},"required":["mcp"]},{"type":"object","title":"mcpTool","properties":{"mcpTool":{"type":"object","properties":{"mcpToolId":{"type":"string","maxLength":12,"minLength":12,"pattern":"^[0-9A-Za-z]{12}$","description":"ID of the Tool that represents the MCP server connection (the Tool with handler.mcp containing serverUrl and authorization)"},"mcpToolName":{"type":"string","description":"Name of the tool on the MCP server. This matches the tool name returned from DiscoverTools operation."}},"required":["mcpToolId","mcpToolName"]}},"required":["mcpTool"]}]}},"required":["category","description","handler","input","name"]}}},"delete":{"operationId":"DeleteTool","summary":"","description":"Delete a tool by its ID.\n\n### Allowed Auth Scopes\n\n- tools:DeleteTool","parameters":[{"name":"toolId","in":"path","required":true,"schema":{"type":"string","maxLength":12,"minLength":12,"pattern":"^[0-9A-Za-z]{12}$","description":"Unique identifier of the tool."},"description":"Unique identifier of the tool."},{"name":"company","in":"query","required":false,"schema":{"type":"string","maxLength":30,"minLength":3,"description":"The unique identifier of the tenant when a service token is used."},"description":"The unique identifier of the tenant when a service token is used."}]}}}}
|