chatbase 0.2.0 → 0.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/spec/openapi.json CHANGED
@@ -3376,7 +3376,7 @@
3376
3376
  "items": {
3377
3377
  "$ref": "#/components/schemas/ExportMessage"
3378
3378
  },
3379
- "description": "Conversation messages"
3379
+ "description": "Conversation messages. Present unless `include=summary` was requested."
3380
3380
  }
3381
3381
  },
3382
3382
  "required": [
@@ -3386,8 +3386,7 @@
3386
3386
  "updatedAt",
3387
3387
  "userId",
3388
3388
  "source",
3389
- "status",
3390
- "messages"
3389
+ "status"
3391
3390
  ]
3392
3391
  },
3393
3392
  "ExportMessage": {
@@ -5582,6 +5581,7 @@
5582
5581
  "paths": {
5583
5582
  "/health": {
5584
5583
  "get": {
5584
+ "operationId": "getHealth",
5585
5585
  "tags": [
5586
5586
  "Health"
5587
5587
  ],
@@ -5622,6 +5622,33 @@
5622
5622
  },
5623
5623
  "/agents": {
5624
5624
  "get": {
5625
+ "operationId": "listAgents",
5626
+ "x-mcp": {
5627
+ "tool": "chatbase_list_agents",
5628
+ "scopes": [
5629
+ "agents:read"
5630
+ ],
5631
+ "annotations": {
5632
+ "readOnly": true,
5633
+ "idempotent": true
5634
+ },
5635
+ "fields": [
5636
+ "id",
5637
+ "name",
5638
+ "status",
5639
+ "createdAt",
5640
+ "model",
5641
+ "autoRetrain",
5642
+ "lastTrainedAt",
5643
+ "lastMessageAt",
5644
+ "size",
5645
+ "visibility",
5646
+ "temp",
5647
+ "creditLimit",
5648
+ "creditsUsed"
5649
+ ],
5650
+ "maxItems": 25
5651
+ },
5625
5652
  "tags": [
5626
5653
  "Agents"
5627
5654
  ],
@@ -5769,11 +5796,19 @@
5769
5796
  }
5770
5797
  },
5771
5798
  "post": {
5799
+ "operationId": "createAgent",
5800
+ "x-mcp": {
5801
+ "tool": "chatbase_create_agent",
5802
+ "scopes": [
5803
+ "agents:write"
5804
+ ],
5805
+ "annotations": {}
5806
+ },
5772
5807
  "tags": [
5773
5808
  "Agents"
5774
5809
  ],
5775
5810
  "summary": "Create agent",
5776
- "description": "Creates a new agent. If `url` is provided, a link source is created from that URL and training is queued automatically — this may take several seconds.",
5811
+ "description": "Creates a new agent. If `url` is provided, a link source is created from that URL and training is queued automatically.\n\nThe agent is always created even if source setup or training fails `id` is always returned. Check `pendingSteps` in the response to see which steps need to be retried:\n- `ADD_SOURCE` — the URL could not be added as a source. Add sources manually via the Sources API.\n- `TRAIN_AGENT` — training could not be started. Trigger it manually via `POST /agents/{agentId}/train`.\n\nWhen `pendingSteps` is absent, all steps succeeded.\n\nSubject to plan agent limits — returns `AGENT_LIMIT_REACHED` (403) when the account has reached its maximum number of agents.",
5777
5812
  "security": [
5778
5813
  {
5779
5814
  "bearerAuth": []
@@ -5901,6 +5936,17 @@
5901
5936
  },
5902
5937
  "/agents/{agentId}": {
5903
5938
  "get": {
5939
+ "operationId": "getAgent",
5940
+ "x-mcp": {
5941
+ "tool": "chatbase_get_agent",
5942
+ "scopes": [
5943
+ "agents:read"
5944
+ ],
5945
+ "annotations": {
5946
+ "readOnly": true,
5947
+ "idempotent": true
5948
+ }
5949
+ },
5904
5950
  "tags": [
5905
5951
  "Agents"
5906
5952
  ],
@@ -6035,6 +6081,16 @@
6035
6081
  }
6036
6082
  },
6037
6083
  "put": {
6084
+ "operationId": "updateAgent",
6085
+ "x-mcp": {
6086
+ "tool": "chatbase_update_agent",
6087
+ "scopes": [
6088
+ "agents:write"
6089
+ ],
6090
+ "annotations": {
6091
+ "idempotent": true
6092
+ }
6093
+ },
6038
6094
  "tags": [
6039
6095
  "Agents"
6040
6096
  ],
@@ -6195,6 +6251,16 @@
6195
6251
  }
6196
6252
  },
6197
6253
  "delete": {
6254
+ "operationId": "deleteAgent",
6255
+ "x-mcp": {
6256
+ "tool": "chatbase_delete_agent",
6257
+ "scopes": [
6258
+ "agents:delete"
6259
+ ],
6260
+ "annotations": {
6261
+ "destructive": true
6262
+ }
6263
+ },
6198
6264
  "tags": [
6199
6265
  "Agents"
6200
6266
  ],
@@ -6331,6 +6397,7 @@
6331
6397
  },
6332
6398
  "/agents/{agentId}/styles": {
6333
6399
  "put": {
6400
+ "operationId": "updateAgentStyles",
6334
6401
  "tags": [
6335
6402
  "Agents"
6336
6403
  ],
@@ -6493,11 +6560,21 @@
6493
6560
  },
6494
6561
  "/agents/{agentId}/auto-retrain": {
6495
6562
  "put": {
6563
+ "operationId": "updateAgentAutoRetrain",
6564
+ "x-mcp": {
6565
+ "tool": "chatbase_update_agent_auto_retrain",
6566
+ "scopes": [
6567
+ "sources:write"
6568
+ ],
6569
+ "annotations": {
6570
+ "idempotent": true
6571
+ }
6572
+ },
6496
6573
  "tags": [
6497
6574
  "Agents"
6498
6575
  ],
6499
6576
  "summary": "Toggle auto-retrain",
6500
- "description": "Enables or disables automatic retraining. When enabled, the agent automatically retrains every 7 days and checks for the latest updates.",
6577
+ "description": "Enables or disables automatic retraining. When enabled, the agent retrains every 7 days to reflect any source changes.\n\nRequirements:\n- The agent must have been trained at least once — returns `AGENT_NOT_TRAINED` (409) otherwise.\n- Requires the Standard plan or higher — returns `PLAN_FEATURE_NOT_AVAILABLE` (403) on unsupported plans.",
6501
6578
  "security": [
6502
6579
  {
6503
6580
  "bearerAuth": []
@@ -6671,11 +6748,19 @@
6671
6748
  },
6672
6749
  "/agents/{agentId}/clone": {
6673
6750
  "post": {
6751
+ "operationId": "cloneAgent",
6752
+ "x-mcp": {
6753
+ "tool": "chatbase_clone_agent",
6754
+ "scopes": [
6755
+ "agents:write"
6756
+ ],
6757
+ "annotations": {}
6758
+ },
6674
6759
  "tags": [
6675
6760
  "Agents"
6676
6761
  ],
6677
6762
  "summary": "Clone agent",
6678
- "description": "Creates a full deep-clone of an agent, including all its sources (excluding Notion). Returns the new agent ID.",
6763
+ "description": "Creates a full deep-clone of an agent, including all its sources (excluding Notion). Returns the new agent ID.\n\nSame response shape as Create Agent — `pendingSteps` indicates if training could not start automatically. The clone is a new, independent agent; changes to the original do not affect it.\n\nSubject to plan agent limits — returns `AGENT_LIMIT_REACHED` (403) when the account has reached its maximum number of agents.",
6679
6764
  "security": [
6680
6765
  {
6681
6766
  "bearerAuth": []
@@ -6807,6 +6892,16 @@
6807
6892
  },
6808
6893
  "/agents/{agentId}/train": {
6809
6894
  "post": {
6895
+ "operationId": "trainAgent",
6896
+ "x-mcp": {
6897
+ "tool": "chatbase_train_agent",
6898
+ "scopes": [
6899
+ "sources:write"
6900
+ ],
6901
+ "annotations": {
6902
+ "destructive": true
6903
+ }
6904
+ },
6810
6905
  "tags": [
6811
6906
  "Agents"
6812
6907
  ],
@@ -6959,6 +7054,16 @@
6959
7054
  },
6960
7055
  "/agents/{agentId}/chat": {
6961
7056
  "post": {
7057
+ "operationId": "chatWithAgent",
7058
+ "x-mcp": {
7059
+ "tool": "chatbase_chat",
7060
+ "scopes": [
7061
+ "chatlogs:write"
7062
+ ],
7063
+ "annotations": {
7064
+ "openWorld": true
7065
+ }
7066
+ },
6962
7067
  "tags": [
6963
7068
  "Agents"
6964
7069
  ],
@@ -7150,6 +7255,7 @@
7150
7255
  },
7151
7256
  "/agents/{agentId}/conversations/{conversationId}/retry": {
7152
7257
  "post": {
7258
+ "operationId": "retryMessage",
7153
7259
  "tags": [
7154
7260
  "Agents"
7155
7261
  ],
@@ -7354,11 +7460,12 @@
7354
7460
  },
7355
7461
  "/agents/{agentId}/conversations": {
7356
7462
  "get": {
7463
+ "operationId": "listConversations",
7357
7464
  "tags": [
7358
7465
  "Conversations"
7359
7466
  ],
7360
7467
  "summary": "List conversations",
7361
- "description": "List conversations for an agent, ordered by createdAt date. Supports cursor-based pagination.",
7468
+ "description": "List conversations for an agent, ordered by createdAt date. Supports cursor-based pagination. Pass `startDate` and/or `endDate` to restrict the results to a createdAt window.",
7362
7469
  "security": [
7363
7470
  {
7364
7471
  "bearerAuth": []
@@ -7401,6 +7508,28 @@
7401
7508
  "description": "Number of items per page (1 to 100, default 20)",
7402
7509
  "name": "limit",
7403
7510
  "in": "query"
7511
+ },
7512
+ {
7513
+ "schema": {
7514
+ "type": "string",
7515
+ "description": "Only return conversations created at or after this point. Accepts a calendar date (`YYYY-MM-DD`, interpreted as the start of that day in UTC) or an ISO 8601 date-time.",
7516
+ "example": "2024-01-01"
7517
+ },
7518
+ "required": false,
7519
+ "description": "Only return conversations created at or after this point. Accepts a calendar date (`YYYY-MM-DD`, interpreted as the start of that day in UTC) or an ISO 8601 date-time.",
7520
+ "name": "startDate",
7521
+ "in": "query"
7522
+ },
7523
+ {
7524
+ "schema": {
7525
+ "type": "string",
7526
+ "description": "Only return conversations created at or before this point. Accepts a calendar date (`YYYY-MM-DD`, interpreted as the *end* of that day in UTC, so the day itself is included) or an ISO 8601 date-time.",
7527
+ "example": "2024-01-31"
7528
+ },
7529
+ "required": false,
7530
+ "description": "Only return conversations created at or before this point. Accepts a calendar date (`YYYY-MM-DD`, interpreted as the *end* of that day in UTC, so the day itself is included) or an ISO 8601 date-time.",
7531
+ "name": "endDate",
7532
+ "in": "query"
7404
7533
  }
7405
7534
  ],
7406
7535
  "responses": {
@@ -7415,16 +7544,30 @@
7415
7544
  }
7416
7545
  },
7417
7546
  "400": {
7418
- "description": "The request body failed schema validation. Inspect the `details` object in the error response for field-level errors.",
7547
+ "description": "Invalid request",
7419
7548
  "content": {
7420
7549
  "application/json": {
7421
7550
  "schema": {
7422
7551
  "$ref": "#/components/schemas/ErrorResponse"
7423
7552
  },
7424
- "example": {
7425
- "error": {
7426
- "code": "VALIDATION_INVALID_BODY",
7427
- "message": "Invalid request"
7553
+ "examples": {
7554
+ "VALIDATION_INVALID_BODY": {
7555
+ "summary": "The request body failed schema validation. Inspect the `details` object in the error response for field-level errors.",
7556
+ "value": {
7557
+ "error": {
7558
+ "code": "VALIDATION_INVALID_BODY",
7559
+ "message": "Invalid request"
7560
+ }
7561
+ }
7562
+ },
7563
+ "VALIDATION_INVALID_DATE_RANGE": {
7564
+ "summary": "The requested `createdAt` window is inverted. An inverted window can never match a row, so it is rejected rather than silently returning an empty page.",
7565
+ "value": {
7566
+ "error": {
7567
+ "code": "VALIDATION_INVALID_DATE_RANGE",
7568
+ "message": "startDate must not be after endDate"
7569
+ }
7570
+ }
7428
7571
  }
7429
7572
  }
7430
7573
  }
@@ -7515,11 +7658,33 @@
7515
7658
  },
7516
7659
  "/agents/{agentId}/conversations/export": {
7517
7660
  "get": {
7661
+ "operationId": "exportConversations",
7662
+ "x-mcp": {
7663
+ "tool": "chatbase_export_conversations",
7664
+ "scopes": [
7665
+ "chatlogs:export"
7666
+ ],
7667
+ "annotations": {
7668
+ "readOnly": true,
7669
+ "idempotent": true
7670
+ },
7671
+ "fields": [
7672
+ "id",
7673
+ "title",
7674
+ "source",
7675
+ "status",
7676
+ "userId",
7677
+ "createdAt",
7678
+ "updatedAt",
7679
+ "messages"
7680
+ ],
7681
+ "maxItems": 10
7682
+ },
7518
7683
  "tags": [
7519
7684
  "Conversations"
7520
7685
  ],
7521
7686
  "summary": "Export conversations",
7522
- "description": "Export all conversations with full message history for an agent. Includes conversations from all sources. Tool results are sanitized to remove internal data. Supports cursor-based pagination. Pass `conversationId` to fetch a single conversation from any source (widget, API, WhatsApp, etc.).",
7687
+ "description": "Export all conversations with full message history for an agent. Includes conversations from all sources. Tool results are sanitized to remove internal data. Supports cursor-based pagination. Pass `conversationId` to fetch a single conversation from any source (widget, API, WhatsApp, etc.). Pass `include=summary` to omit message bodies for a cheaper triage pass, `source` to restrict to one or more conversation sources, and `startDate` / `endDate` to restrict to a createdAt window.",
7523
7688
  "security": [
7524
7689
  {
7525
7690
  "bearerAuth": []
@@ -7563,6 +7728,28 @@
7563
7728
  "name": "limit",
7564
7729
  "in": "query"
7565
7730
  },
7731
+ {
7732
+ "schema": {
7733
+ "type": "string",
7734
+ "description": "Only return conversations created at or after this point. Accepts a calendar date (`YYYY-MM-DD`, interpreted as the start of that day in UTC) or an ISO 8601 date-time.",
7735
+ "example": "2024-01-01"
7736
+ },
7737
+ "required": false,
7738
+ "description": "Only return conversations created at or after this point. Accepts a calendar date (`YYYY-MM-DD`, interpreted as the start of that day in UTC) or an ISO 8601 date-time.",
7739
+ "name": "startDate",
7740
+ "in": "query"
7741
+ },
7742
+ {
7743
+ "schema": {
7744
+ "type": "string",
7745
+ "description": "Only return conversations created at or before this point. Accepts a calendar date (`YYYY-MM-DD`, interpreted as the *end* of that day in UTC, so the day itself is included) or an ISO 8601 date-time.",
7746
+ "example": "2024-01-31"
7747
+ },
7748
+ "required": false,
7749
+ "description": "Only return conversations created at or before this point. Accepts a calendar date (`YYYY-MM-DD`, interpreted as the *end* of that day in UTC, so the day itself is included) or an ISO 8601 date-time.",
7750
+ "name": "endDate",
7751
+ "in": "query"
7752
+ },
7566
7753
  {
7567
7754
  "schema": {
7568
7755
  "type": "string",
@@ -7572,6 +7759,33 @@
7572
7759
  "description": "Return only the conversation with this ID. Use this to fetch a single conversation from any source (widget, API, WhatsApp, etc.).",
7573
7760
  "name": "conversationId",
7574
7761
  "in": "query"
7762
+ },
7763
+ {
7764
+ "schema": {
7765
+ "type": "string",
7766
+ "enum": [
7767
+ "summary",
7768
+ "messages"
7769
+ ],
7770
+ "default": "messages",
7771
+ "description": "Whether to include message bodies. `summary` omits them and skips reading them from the database — use it to triage a page cheaply, then re-request a specific conversation with `conversationId`. Defaults to `messages`.",
7772
+ "example": "summary"
7773
+ },
7774
+ "required": false,
7775
+ "description": "Whether to include message bodies. `summary` omits them and skips reading them from the database — use it to triage a page cheaply, then re-request a specific conversation with `conversationId`. Defaults to `messages`.",
7776
+ "name": "include",
7777
+ "in": "query"
7778
+ },
7779
+ {
7780
+ "schema": {
7781
+ "type": "string",
7782
+ "description": "Comma-separated conversation sources to include, e.g. `API,WhatsApp`. Omit for all sources.",
7783
+ "example": "Widget or Iframe"
7784
+ },
7785
+ "required": false,
7786
+ "description": "Comma-separated conversation sources to include, e.g. `API,WhatsApp`. Omit for all sources.",
7787
+ "name": "source",
7788
+ "in": "query"
7575
7789
  }
7576
7790
  ],
7577
7791
  "responses": {
@@ -7586,16 +7800,30 @@
7586
7800
  }
7587
7801
  },
7588
7802
  "400": {
7589
- "description": "The request body failed schema validation. Inspect the `details` object in the error response for field-level errors.",
7803
+ "description": "Invalid request",
7590
7804
  "content": {
7591
7805
  "application/json": {
7592
7806
  "schema": {
7593
7807
  "$ref": "#/components/schemas/ErrorResponse"
7594
7808
  },
7595
- "example": {
7596
- "error": {
7597
- "code": "VALIDATION_INVALID_BODY",
7598
- "message": "Invalid request"
7809
+ "examples": {
7810
+ "VALIDATION_INVALID_BODY": {
7811
+ "summary": "The request body failed schema validation. Inspect the `details` object in the error response for field-level errors.",
7812
+ "value": {
7813
+ "error": {
7814
+ "code": "VALIDATION_INVALID_BODY",
7815
+ "message": "Invalid request"
7816
+ }
7817
+ }
7818
+ },
7819
+ "VALIDATION_INVALID_DATE_RANGE": {
7820
+ "summary": "The requested `createdAt` window is inverted. An inverted window can never match a row, so it is rejected rather than silently returning an empty page.",
7821
+ "value": {
7822
+ "error": {
7823
+ "code": "VALIDATION_INVALID_DATE_RANGE",
7824
+ "message": "startDate must not be after endDate"
7825
+ }
7826
+ }
7599
7827
  }
7600
7828
  }
7601
7829
  }
@@ -7686,6 +7914,7 @@
7686
7914
  },
7687
7915
  "/agents/{agentId}/conversations/{conversationId}": {
7688
7916
  "get": {
7917
+ "operationId": "getConversation",
7689
7918
  "tags": [
7690
7919
  "Conversations"
7691
7920
  ],
@@ -7834,6 +8063,7 @@
7834
8063
  },
7835
8064
  "/agents/{agentId}/conversations/{conversationId}/messages": {
7836
8065
  "get": {
8066
+ "operationId": "listConversationMessages",
7837
8067
  "tags": [
7838
8068
  "Conversations"
7839
8069
  ],
@@ -8023,6 +8253,7 @@
8023
8253
  },
8024
8254
  "/agents/{agentId}/users/{userId}/conversations": {
8025
8255
  "get": {
8256
+ "operationId": "listUserConversations",
8026
8257
  "tags": [
8027
8258
  "Conversations"
8028
8259
  ],
@@ -8198,6 +8429,7 @@
8198
8429
  },
8199
8430
  "/agents/{agentId}/conversations/{conversationId}/messages/{messageId}/feedback": {
8200
8431
  "patch": {
8432
+ "operationId": "updateMessageFeedback",
8201
8433
  "tags": [
8202
8434
  "Conversations"
8203
8435
  ],
@@ -8398,6 +8630,7 @@
8398
8630
  },
8399
8631
  "/agents/{agentId}/conversations/{conversationId}/tool-result": {
8400
8632
  "post": {
8633
+ "operationId": "submitToolResult",
8401
8634
  "tags": [
8402
8635
  "Agents"
8403
8636
  ],
@@ -8571,6 +8804,17 @@
8571
8804
  },
8572
8805
  "/agents/{agentId}/sources/summary": {
8573
8806
  "get": {
8807
+ "operationId": "getSourcesSummary",
8808
+ "x-mcp": {
8809
+ "tool": "chatbase_get_sources_summary",
8810
+ "scopes": [
8811
+ "sources:read"
8812
+ ],
8813
+ "annotations": {
8814
+ "readOnly": true,
8815
+ "idempotent": true
8816
+ }
8817
+ },
8574
8818
  "tags": [
8575
8819
  "Sources"
8576
8820
  ],
@@ -8691,6 +8935,18 @@
8691
8935
  },
8692
8936
  "/agents/{agentId}/sources": {
8693
8937
  "get": {
8938
+ "operationId": "listSources",
8939
+ "x-mcp": {
8940
+ "tool": "chatbase_list_sources",
8941
+ "scopes": [
8942
+ "sources:read"
8943
+ ],
8944
+ "annotations": {
8945
+ "readOnly": true,
8946
+ "idempotent": true
8947
+ },
8948
+ "maxItems": 50
8949
+ },
8694
8950
  "tags": [
8695
8951
  "Sources"
8696
8952
  ],
@@ -8872,6 +9128,14 @@
8872
9128
  }
8873
9129
  },
8874
9130
  "post": {
9131
+ "operationId": "createSource",
9132
+ "x-mcp": {
9133
+ "tool": "chatbase_create_source",
9134
+ "scopes": [
9135
+ "sources:write"
9136
+ ],
9137
+ "annotations": {}
9138
+ },
8875
9139
  "tags": [
8876
9140
  "Sources"
8877
9141
  ],
@@ -9049,6 +9313,17 @@
9049
9313
  },
9050
9314
  "/agents/{agentId}/sources/{sourceId}": {
9051
9315
  "get": {
9316
+ "operationId": "getSource",
9317
+ "x-mcp": {
9318
+ "tool": "chatbase_get_source",
9319
+ "scopes": [
9320
+ "sources:read"
9321
+ ],
9322
+ "annotations": {
9323
+ "readOnly": true,
9324
+ "idempotent": true
9325
+ }
9326
+ },
9052
9327
  "tags": [
9053
9328
  "Sources"
9054
9329
  ],
@@ -9195,6 +9470,16 @@
9195
9470
  }
9196
9471
  },
9197
9472
  "delete": {
9473
+ "operationId": "deleteSource",
9474
+ "x-mcp": {
9475
+ "tool": "chatbase_delete_source",
9476
+ "scopes": [
9477
+ "sources:delete"
9478
+ ],
9479
+ "annotations": {
9480
+ "destructive": true
9481
+ }
9482
+ },
9198
9483
  "tags": [
9199
9484
  "Sources"
9200
9485
  ],
@@ -9357,11 +9642,21 @@
9357
9642
  }
9358
9643
  },
9359
9644
  "put": {
9645
+ "operationId": "updateSource",
9646
+ "x-mcp": {
9647
+ "tool": "chatbase_update_source",
9648
+ "scopes": [
9649
+ "sources:write"
9650
+ ],
9651
+ "annotations": {
9652
+ "idempotent": true
9653
+ }
9654
+ },
9360
9655
  "tags": [
9361
9656
  "Sources"
9362
9657
  ],
9363
9658
  "summary": "Update source",
9364
- "description": "Updates an existing source. Accepts text, qna, and link sources.File sources require a dedicated endpoint. Link URL is immutable — to change it, delete and recreate the source. Ticket and Notion sources are not accepted.\n\n**Q&A request body limit:** The total request body must not exceed 4.5 MB for Q&A sources.",
9659
+ "description": "Updates an existing source. Accepts text, qna, and link sources. File sources require a dedicated endpoint. Link URL is immutable — to change it, delete and recreate the source. Ticket and Notion sources are not accepted.\n\n**Q&A request body limit:** The total request body must not exceed 4.5 MB for Q&A sources.",
9365
9660
  "security": [
9366
9661
  {
9367
9662
  "bearerAuth": []
@@ -9562,6 +9857,16 @@
9562
9857
  },
9563
9858
  "/agents/{agentId}/sources/{sourceId}/restore": {
9564
9859
  "post": {
9860
+ "operationId": "restoreSource",
9861
+ "x-mcp": {
9862
+ "tool": "chatbase_restore_source",
9863
+ "scopes": [
9864
+ "sources:write"
9865
+ ],
9866
+ "annotations": {
9867
+ "idempotent": true
9868
+ }
9869
+ },
9565
9870
  "tags": [
9566
9871
  "Sources"
9567
9872
  ],
@@ -9742,6 +10047,7 @@
9742
10047
  },
9743
10048
  "/agents/{agentId}/whatsapp/templates": {
9744
10049
  "get": {
10050
+ "operationId": "listWhatsAppTemplates",
9745
10051
  "tags": [
9746
10052
  "WhatsApp"
9747
10053
  ],
@@ -9862,6 +10168,7 @@
9862
10168
  },
9863
10169
  "/agents/{agentId}/whatsapp/messages/template": {
9864
10170
  "post": {
10171
+ "operationId": "sendWhatsAppTemplateMessage",
9865
10172
  "tags": [
9866
10173
  "WhatsApp"
9867
10174
  ],
@@ -10161,6 +10468,17 @@
10161
10468
  },
10162
10469
  "/agents/{agentId}/helpdesk/ticket-statuses": {
10163
10470
  "get": {
10471
+ "operationId": "listTicketStatuses",
10472
+ "x-mcp": {
10473
+ "tool": "chatbase_list_ticket_statuses",
10474
+ "scopes": [
10475
+ "helpdesk_tickets:read"
10476
+ ],
10477
+ "annotations": {
10478
+ "readOnly": true,
10479
+ "idempotent": true
10480
+ }
10481
+ },
10164
10482
  "tags": [
10165
10483
  "Helpdesk"
10166
10484
  ],
@@ -10297,6 +10615,17 @@
10297
10615
  },
10298
10616
  "/agents/{agentId}/helpdesk/teams": {
10299
10617
  "get": {
10618
+ "operationId": "listHelpdeskTeams",
10619
+ "x-mcp": {
10620
+ "tool": "chatbase_list_helpdesk_teams",
10621
+ "scopes": [
10622
+ "helpdesk_tickets:read"
10623
+ ],
10624
+ "annotations": {
10625
+ "readOnly": true,
10626
+ "idempotent": true
10627
+ }
10628
+ },
10300
10629
  "tags": [
10301
10630
  "Helpdesk"
10302
10631
  ],
@@ -10433,6 +10762,14 @@
10433
10762
  },
10434
10763
  "/agents/{agentId}/helpdesk/tickets": {
10435
10764
  "post": {
10765
+ "operationId": "createTicket",
10766
+ "x-mcp": {
10767
+ "tool": "chatbase_create_ticket",
10768
+ "scopes": [
10769
+ "helpdesk_tickets:write"
10770
+ ],
10771
+ "annotations": {}
10772
+ },
10436
10773
  "tags": [
10437
10774
  "Helpdesk"
10438
10775
  ],
@@ -10592,6 +10929,18 @@
10592
10929
  }
10593
10930
  },
10594
10931
  "get": {
10932
+ "operationId": "listTickets",
10933
+ "x-mcp": {
10934
+ "tool": "chatbase_list_tickets",
10935
+ "scopes": [
10936
+ "helpdesk_tickets:read"
10937
+ ],
10938
+ "annotations": {
10939
+ "readOnly": true,
10940
+ "idempotent": true
10941
+ },
10942
+ "maxItems": 25
10943
+ },
10595
10944
  "tags": [
10596
10945
  "Helpdesk"
10597
10946
  ],
@@ -10906,6 +11255,18 @@
10906
11255
  },
10907
11256
  "/agents/{agentId}/helpdesk/tickets/search": {
10908
11257
  "post": {
11258
+ "operationId": "searchTickets",
11259
+ "x-mcp": {
11260
+ "tool": "chatbase_search_tickets",
11261
+ "scopes": [
11262
+ "helpdesk_tickets:write"
11263
+ ],
11264
+ "annotations": {
11265
+ "readOnly": true,
11266
+ "idempotent": true
11267
+ },
11268
+ "maxItems": 25
11269
+ },
10909
11270
  "tags": [
10910
11271
  "Helpdesk"
10911
11272
  ],
@@ -11068,6 +11429,17 @@
11068
11429
  },
11069
11430
  "/agents/{agentId}/helpdesk/tickets/{ticketNumber}": {
11070
11431
  "get": {
11432
+ "operationId": "getTicket",
11433
+ "x-mcp": {
11434
+ "tool": "chatbase_get_ticket",
11435
+ "scopes": [
11436
+ "helpdesk_tickets:read"
11437
+ ],
11438
+ "annotations": {
11439
+ "readOnly": true,
11440
+ "idempotent": true
11441
+ }
11442
+ },
11071
11443
  "tags": [
11072
11444
  "Helpdesk"
11073
11445
  ],
@@ -11229,6 +11601,16 @@
11229
11601
  }
11230
11602
  },
11231
11603
  "patch": {
11604
+ "operationId": "updateTicket",
11605
+ "x-mcp": {
11606
+ "tool": "chatbase_update_ticket",
11607
+ "scopes": [
11608
+ "helpdesk_tickets:write"
11609
+ ],
11610
+ "annotations": {
11611
+ "idempotent": true
11612
+ }
11613
+ },
11232
11614
  "tags": [
11233
11615
  "Helpdesk"
11234
11616
  ],
@@ -11440,6 +11822,27 @@
11440
11822
  },
11441
11823
  "/agents/{agentId}/helpdesk/tickets/{ticketNumber}/messages": {
11442
11824
  "get": {
11825
+ "operationId": "listTicketMessages",
11826
+ "x-mcp": {
11827
+ "tool": "chatbase_list_ticket_messages",
11828
+ "scopes": [
11829
+ "helpdesk_tickets:read"
11830
+ ],
11831
+ "annotations": {
11832
+ "readOnly": true,
11833
+ "idempotent": true
11834
+ },
11835
+ "fields": [
11836
+ "id",
11837
+ "type",
11838
+ "sender",
11839
+ "contentText",
11840
+ "attachments",
11841
+ "createdAt",
11842
+ "metadata"
11843
+ ],
11844
+ "maxItems": 50
11845
+ },
11443
11846
  "tags": [
11444
11847
  "Helpdesk"
11445
11848
  ],
@@ -11670,6 +12073,14 @@
11670
12073
  }
11671
12074
  },
11672
12075
  "post": {
12076
+ "operationId": "createTicketMessage",
12077
+ "x-mcp": {
12078
+ "tool": "chatbase_create_ticket_message",
12079
+ "scopes": [
12080
+ "helpdesk_tickets:write"
12081
+ ],
12082
+ "annotations": {}
12083
+ },
11673
12084
  "tags": [
11674
12085
  "Helpdesk"
11675
12086
  ],
@@ -11874,7 +12285,418 @@
11874
12285
  }
11875
12286
  }
11876
12287
  }
12288
+ },
12289
+ "/api/v2/agents/{agentId}/sources": {
12290
+ "post": {
12291
+ "operationId": "createFileSource",
12292
+ "tags": [
12293
+ "Sources"
12294
+ ],
12295
+ "summary": "Create file source",
12296
+ "description": "Upload a file as a knowledge source for an agent. Accepts PDF, DOC, DOCX, and TXT files up to 20 MB.\n\n**Base URL:** `https://files.chatbase.co/api/v2` — this endpoint uses a different host from all other Sources endpoints.",
12297
+ "security": [
12298
+ {
12299
+ "bearerAuth": []
12300
+ }
12301
+ ],
12302
+ "parameters": [
12303
+ {
12304
+ "schema": {
12305
+ "type": "string",
12306
+ "minLength": 1,
12307
+ "example": "5QHA6VB-DIAbBhxwqxfdi"
12308
+ },
12309
+ "required": true,
12310
+ "name": "agentId",
12311
+ "in": "path",
12312
+ "description": "The agent ID"
12313
+ }
12314
+ ],
12315
+ "requestBody": {
12316
+ "required": true,
12317
+ "content": {
12318
+ "multipart/form-data": {
12319
+ "schema": {
12320
+ "type": "object",
12321
+ "properties": {
12322
+ "name": {
12323
+ "type": "string",
12324
+ "minLength": 1,
12325
+ "description": "Display name for the source.",
12326
+ "example": "Employee Handbook"
12327
+ },
12328
+ "file": {
12329
+ "type": "string",
12330
+ "format": "binary",
12331
+ "description": "File to upload. Formats: .pdf, .doc, .docx, .txt. Max 20 MB."
12332
+ }
12333
+ },
12334
+ "required": [
12335
+ "name",
12336
+ "file"
12337
+ ]
12338
+ }
12339
+ }
12340
+ }
12341
+ },
12342
+ "responses": {
12343
+ "201": {
12344
+ "description": "File source created. Status is `untrained` until the agent is retrained.",
12345
+ "content": {
12346
+ "application/json": {
12347
+ "schema": {
12348
+ "$ref": "#/components/schemas/SourceListItem"
12349
+ },
12350
+ "example": {
12351
+ "id": "a63a69a5-e7a9-4757-b73b-2041854d435d",
12352
+ "type": "file",
12353
+ "name": "Employee Handbook",
12354
+ "size": 245760,
12355
+ "createdAt": "2025-01-15T10:30:00.000Z",
12356
+ "status": "untrained",
12357
+ "metadata": null
12358
+ }
12359
+ }
12360
+ }
12361
+ },
12362
+ "400": {
12363
+ "description": "Missing required field, unsupported file type, or a file outside the allowed size range.",
12364
+ "content": {
12365
+ "application/json": {
12366
+ "schema": {
12367
+ "$ref": "#/components/schemas/ErrorResponse"
12368
+ },
12369
+ "example": {
12370
+ "error": {
12371
+ "code": "VALIDATION_INVALID_BODY",
12372
+ "message": "Missing required field, unsupported file type, or a file outside the allowed size range."
12373
+ }
12374
+ }
12375
+ }
12376
+ }
12377
+ },
12378
+ "401": {
12379
+ "description": "No Authorization header present.",
12380
+ "content": {
12381
+ "application/json": {
12382
+ "schema": {
12383
+ "$ref": "#/components/schemas/ErrorResponse"
12384
+ },
12385
+ "example": {
12386
+ "error": {
12387
+ "code": "AUTH_MISSING_API_KEY",
12388
+ "message": "No Authorization header present."
12389
+ }
12390
+ }
12391
+ }
12392
+ }
12393
+ },
12394
+ "403": {
12395
+ "description": "Standard plan or higher required.",
12396
+ "content": {
12397
+ "application/json": {
12398
+ "schema": {
12399
+ "$ref": "#/components/schemas/ErrorResponse"
12400
+ },
12401
+ "example": {
12402
+ "error": {
12403
+ "code": "SUBSCRIPTION_API_RESTRICTED_PLAN",
12404
+ "message": "Standard plan or higher required."
12405
+ }
12406
+ }
12407
+ }
12408
+ }
12409
+ },
12410
+ "404": {
12411
+ "description": "Agent not found.",
12412
+ "content": {
12413
+ "application/json": {
12414
+ "schema": {
12415
+ "$ref": "#/components/schemas/ErrorResponse"
12416
+ },
12417
+ "example": {
12418
+ "error": {
12419
+ "code": "AGENT_NOT_FOUND",
12420
+ "message": "Agent not found."
12421
+ }
12422
+ }
12423
+ }
12424
+ }
12425
+ },
12426
+ "422": {
12427
+ "description": "Adding this file would exceed the plan storage limit for this agent.",
12428
+ "content": {
12429
+ "application/json": {
12430
+ "schema": {
12431
+ "$ref": "#/components/schemas/ErrorResponse"
12432
+ },
12433
+ "example": {
12434
+ "error": {
12435
+ "code": "SOURCE_SIZE_LIMIT_EXCEEDED",
12436
+ "message": "Adding this file would exceed the plan storage limit for this agent."
12437
+ }
12438
+ }
12439
+ }
12440
+ }
12441
+ },
12442
+ "429": {
12443
+ "description": "Rate limit exceeded.",
12444
+ "content": {
12445
+ "application/json": {
12446
+ "schema": {
12447
+ "$ref": "#/components/schemas/ErrorResponse"
12448
+ },
12449
+ "example": {
12450
+ "error": {
12451
+ "code": "RATE_LIMIT_TOO_MANY_REQUESTS",
12452
+ "message": "Rate limit exceeded."
12453
+ }
12454
+ }
12455
+ }
12456
+ }
12457
+ },
12458
+ "500": {
12459
+ "description": "Unhandled server error.",
12460
+ "content": {
12461
+ "application/json": {
12462
+ "schema": {
12463
+ "$ref": "#/components/schemas/ErrorResponse"
12464
+ },
12465
+ "example": {
12466
+ "error": {
12467
+ "code": "INTERNAL_SERVER_ERROR",
12468
+ "message": "Unhandled server error."
12469
+ }
12470
+ }
12471
+ }
12472
+ }
12473
+ }
12474
+ },
12475
+ "servers": [
12476
+ {
12477
+ "url": "https://files.chatbase.co",
12478
+ "description": "Chatbase file upload server"
12479
+ }
12480
+ ]
12481
+ }
12482
+ },
12483
+ "/api/v2/agents/{agentId}/sources/{sourceId}": {
12484
+ "put": {
12485
+ "operationId": "updateFileSource",
12486
+ "tags": [
12487
+ "Sources"
12488
+ ],
12489
+ "summary": "Update file source",
12490
+ "description": "Replace a file source's content, rename it, or both. At least one of `name` or `file` must be provided.\n\n**Base URL:** `https://files.chatbase.co/api/v2` — this endpoint uses a different host from all other Sources endpoints.",
12491
+ "security": [
12492
+ {
12493
+ "bearerAuth": []
12494
+ }
12495
+ ],
12496
+ "parameters": [
12497
+ {
12498
+ "schema": {
12499
+ "type": "string",
12500
+ "minLength": 1,
12501
+ "example": "5QHA6VB-DIAbBhxwqxfdi"
12502
+ },
12503
+ "required": true,
12504
+ "name": "agentId",
12505
+ "in": "path",
12506
+ "description": "The agent ID"
12507
+ },
12508
+ {
12509
+ "schema": {
12510
+ "type": "string",
12511
+ "minLength": 1,
12512
+ "example": "a63a69a5-e7a9-4757-b73b-2041854d435d"
12513
+ },
12514
+ "required": true,
12515
+ "name": "sourceId",
12516
+ "in": "path",
12517
+ "description": "The source ID"
12518
+ }
12519
+ ],
12520
+ "requestBody": {
12521
+ "required": true,
12522
+ "content": {
12523
+ "multipart/form-data": {
12524
+ "schema": {
12525
+ "type": "object",
12526
+ "properties": {
12527
+ "name": {
12528
+ "type": "string",
12529
+ "minLength": 1,
12530
+ "description": "New display name. If omitted, the existing name is preserved.",
12531
+ "example": "Employee Handbook v2"
12532
+ },
12533
+ "file": {
12534
+ "type": "string",
12535
+ "format": "binary",
12536
+ "description": "Replacement file. Same constraints as create. If omitted, existing content is preserved."
12537
+ }
12538
+ }
12539
+ }
12540
+ }
12541
+ }
12542
+ },
12543
+ "responses": {
12544
+ "200": {
12545
+ "description": "Updated file source. If the file was replaced and previously `trained`, status becomes `updated`.",
12546
+ "content": {
12547
+ "application/json": {
12548
+ "schema": {
12549
+ "$ref": "#/components/schemas/SourceListItem"
12550
+ },
12551
+ "example": {
12552
+ "id": "a63a69a5-e7a9-4757-b73b-2041854d435d",
12553
+ "type": "file",
12554
+ "name": "Employee Handbook v2",
12555
+ "size": 261120,
12556
+ "createdAt": "2025-01-15T10:30:00.000Z",
12557
+ "status": "updated",
12558
+ "metadata": null
12559
+ }
12560
+ }
12561
+ }
12562
+ },
12563
+ "400": {
12564
+ "description": "No fields provided, unsupported file type, or a file outside the allowed size range.",
12565
+ "content": {
12566
+ "application/json": {
12567
+ "schema": {
12568
+ "$ref": "#/components/schemas/ErrorResponse"
12569
+ },
12570
+ "example": {
12571
+ "error": {
12572
+ "code": "VALIDATION_INVALID_BODY",
12573
+ "message": "No fields provided, unsupported file type, or a file outside the allowed size range."
12574
+ }
12575
+ }
12576
+ }
12577
+ }
12578
+ },
12579
+ "401": {
12580
+ "description": "No Authorization header present.",
12581
+ "content": {
12582
+ "application/json": {
12583
+ "schema": {
12584
+ "$ref": "#/components/schemas/ErrorResponse"
12585
+ },
12586
+ "example": {
12587
+ "error": {
12588
+ "code": "AUTH_MISSING_API_KEY",
12589
+ "message": "No Authorization header present."
12590
+ }
12591
+ }
12592
+ }
12593
+ }
12594
+ },
12595
+ "403": {
12596
+ "description": "Standard plan or higher required.",
12597
+ "content": {
12598
+ "application/json": {
12599
+ "schema": {
12600
+ "$ref": "#/components/schemas/ErrorResponse"
12601
+ },
12602
+ "example": {
12603
+ "error": {
12604
+ "code": "SUBSCRIPTION_API_RESTRICTED_PLAN",
12605
+ "message": "Standard plan or higher required."
12606
+ }
12607
+ }
12608
+ }
12609
+ }
12610
+ },
12611
+ "404": {
12612
+ "description": "Agent or source not found.",
12613
+ "content": {
12614
+ "application/json": {
12615
+ "schema": {
12616
+ "$ref": "#/components/schemas/ErrorResponse"
12617
+ },
12618
+ "example": {
12619
+ "error": {
12620
+ "code": "SOURCE_NOT_FOUND",
12621
+ "message": "Agent or source not found."
12622
+ }
12623
+ }
12624
+ }
12625
+ }
12626
+ },
12627
+ "409": {
12628
+ "description": "Source is pending deletion. Restore it before editing.",
12629
+ "content": {
12630
+ "application/json": {
12631
+ "schema": {
12632
+ "$ref": "#/components/schemas/ErrorResponse"
12633
+ },
12634
+ "example": {
12635
+ "error": {
12636
+ "code": "SOURCE_PENDING_DELETION",
12637
+ "message": "Source is pending deletion. Restore it before editing."
12638
+ }
12639
+ }
12640
+ }
12641
+ }
12642
+ },
12643
+ "422": {
12644
+ "description": "Adding this file would exceed the plan storage limit for this agent.",
12645
+ "content": {
12646
+ "application/json": {
12647
+ "schema": {
12648
+ "$ref": "#/components/schemas/ErrorResponse"
12649
+ },
12650
+ "example": {
12651
+ "error": {
12652
+ "code": "SOURCE_SIZE_LIMIT_EXCEEDED",
12653
+ "message": "Adding this file would exceed the plan storage limit for this agent."
12654
+ }
12655
+ }
12656
+ }
12657
+ }
12658
+ },
12659
+ "429": {
12660
+ "description": "Rate limit exceeded.",
12661
+ "content": {
12662
+ "application/json": {
12663
+ "schema": {
12664
+ "$ref": "#/components/schemas/ErrorResponse"
12665
+ },
12666
+ "example": {
12667
+ "error": {
12668
+ "code": "RATE_LIMIT_TOO_MANY_REQUESTS",
12669
+ "message": "Rate limit exceeded."
12670
+ }
12671
+ }
12672
+ }
12673
+ }
12674
+ },
12675
+ "500": {
12676
+ "description": "Unhandled server error.",
12677
+ "content": {
12678
+ "application/json": {
12679
+ "schema": {
12680
+ "$ref": "#/components/schemas/ErrorResponse"
12681
+ },
12682
+ "example": {
12683
+ "error": {
12684
+ "code": "INTERNAL_SERVER_ERROR",
12685
+ "message": "Unhandled server error."
12686
+ }
12687
+ }
12688
+ }
12689
+ }
12690
+ }
12691
+ },
12692
+ "servers": [
12693
+ {
12694
+ "url": "https://files.chatbase.co",
12695
+ "description": "Chatbase file upload server"
12696
+ }
12697
+ ]
12698
+ }
11877
12699
  }
11878
12700
  },
11879
12701
  "webhooks": {}
11880
- }
12702
+ }