From 91560d712e01be7942ec536da4c692ca4bfe7656 Mon Sep 17 00:00:00 2001 From: Richard Griffiths Date: Fri, 25 Sep 2026 16:14:05 +0200 Subject: [PATCH 1/3] chore(chat-client): regenerate after renaming widgets to Website Chats The Chat API renamed its widgets resource to Website Chats (the embeddable chat product is now called Website Chat): /v1/widgets -> /v1/website-chats, *ChatWidget(s) operations -> *WebsiteChat(s), widget_id -> website_chat_id, website_chat -> settings, website_chat_embed -> embed, bootstrap website_chat_id / frame_origin, sessions website_chat. Also picks up the anonymous email verification operations. Regenerates the @epilot/sdk chat definitions and the CLI chat entry. Co-authored-by: Claude --- .changeset/chat-client-website-chats.md | 17 + clients/chat-client/README.md | 24 +- clients/chat-client/package.json | 2 +- clients/chat-client/src/client.test.ts | 41 +- clients/chat-client/src/openapi-runtime.json | 58 +- clients/chat-client/src/openapi.d.ts | 927 +++++++++++------- clients/chat-client/src/openapi.json | 875 ++++++++++++++--- clients/chat-client/update-openapi.cjs | 8 +- packages/cli/definitions/chat.json | 875 ++++++++++++++--- packages/cli/docs/chat.md | 322 ++++-- packages/cli/docs/index.md | 2 +- packages/cli/src/generated/api-list.ts | 18 +- packages/epilot-sdk-v2/docs/chat.md | 308 ++++-- .../src/definitions/chat-runtime.json | 2 +- packages/epilot-sdk-v2/src/docs/chat.json | 2 +- packages/epilot-sdk-v2/src/types/chat.d.ts | 927 +++++++++++------- 16 files changed, 3230 insertions(+), 1178 deletions(-) create mode 100644 .changeset/chat-client-website-chats.md diff --git a/.changeset/chat-client-website-chats.md b/.changeset/chat-client-website-chats.md new file mode 100644 index 000000000..4ca6ef838 --- /dev/null +++ b/.changeset/chat-client-website-chats.md @@ -0,0 +1,17 @@ +--- +"@epilot/chat-client": minor +"@epilot/sdk": minor +"@epilot/cli": patch +--- + +Regenerate the chat client from the Chat API spec after the `widgets` resource was renamed to Website Chats (the embeddable chat product is now called Website Chat). + +Management operations move from `/v1/widgets` to `/v1/website-chats` (path parameter `{widget_id}` → `{website_chat_id}`): `listChatWidgets` → `listWebsiteChats`, `createChatWidget` → `createWebsiteChat`, `getChatWidget` → `getWebsiteChat`, `updateChatWidget` → `updateWebsiteChat` and `deleteChatWidget` → `deleteWebsiteChat`. The public configuration read `getPublicChatWidget` (`GET /v1/widgets/{widget_id}/configuration`) becomes `getPublicWebsiteChat` (`GET /v1/website-chats/{website_chat_id}/configuration`). + +Schemas are renamed to match: `ChatWidget` → `WebsiteChat`, `ListChatWidgetsResponse` → `ListWebsiteChatsResponse` (its `widgets` list → `website_chats`), `CreateChatWidgetRequest` → `CreateWebsiteChatRequest`, `UpdateChatWidgetRequest` → `UpdateWebsiteChatRequest`, `Widget` → `PublicWebsiteChat` and `WidgetDesign` → `WebsiteChatDesign`. + +Fields on the Website Chat resource and its create/update requests: `widget_id` → `website_chat_id`, `website_chat` → `settings` (still `WebsiteChatSettings`) and `website_chat_embed` → `embed`. In the anonymous flow, `POST /v1/bootstrap` takes `website_chat_id` instead of `widget_key` and returns `frame_origin` instead of `widget_origin`, and the `POST /v1/sessions` response carries the public configuration as `website_chat` instead of `widget`. + +The regenerated spec also brings the anonymous email verification operations, all authorised with the anonymous session token: `getChatVerification` (`GET /v1/verification`), `startChatEmailVerification` (`POST /v1/verification/email`), `verifyChatEmailCode` (`POST /v1/verification/code`) and `cancelChatVerification` (`POST /v1/verification/cancel`), returning the new `VerificationState`. The public Website Chat configuration gains `authentication.email_code`, and the public error codes gain `INVALID_VERIFICATION_CODE`, `VERIFICATION_EXPIRED`, `VERIFICATION_CONFLICT`, `VERIFICATION_DISABLED`, `VERIFICATION_UNAVAILABLE` and `IDENTITY_CHANGED`. + +This is a breaking change for callers of the old operation, schema and field names, with no aliases. The Chat API has no production consumers yet. diff --git a/clients/chat-client/README.md b/clients/chat-client/README.md index 29f98e1fa..d4709532b 100644 --- a/clients/chat-client/README.md +++ b/clients/chat-client/README.md @@ -1,6 +1,6 @@ # @epilot/chat-client -Generated TypeScript client for epilot Chat API widget management and public chat. +Generated TypeScript client for epilot Chat API Website Chat management and public chat. ## Usage @@ -9,13 +9,13 @@ import { createClient } from '@epilot/chat-client'; const chat = createClient(); chat.defaults.headers.common.Authorization = `Bearer ${accessToken}`; -const { data } = await chat.listChatWidgets(); -const { data: widget } = await chat.getChatWidget({ widget_id }); +const { data } = await chat.listWebsiteChats(); +const { data: websiteChat } = await chat.getWebsiteChat({ website_chat_id }); -await chat.updateChatWidget({ widget_id }, { - version: widget.version, - website_chat: { - ...widget.website_chat, +await chat.updateWebsiteChat({ website_chat_id }, { + version: websiteChat.version, + settings: { + ...websiteChat.settings, design_id, authentication: { email_code: { email_template_id } }, }, @@ -27,10 +27,12 @@ The same API is available as `epilot.chat` from `@epilot/sdk`, or through the for callers that want a shared singleton. Use a separate `createClient()` instance for anonymous chat. Bootstrap and session -creation use no epilot access token; `sendAnonymousChatMessage` uses the anonymous -session token. Its response is SSE: request `responseType: 'stream'` in Node and -consume the stream, or use a streaming fetch transport in the browser. The client -does not parse SSE events or implement the host/iframe handoff protocol. +creation use no epilot access token; `sendAnonymousChatMessage` and the email +verification operations (`getChatVerification`, `startChatEmailVerification`, +`verifyChatEmailCode`, `cancelChatVerification`) use the anonymous session token. +`sendAnonymousChatMessage` responds with SSE: request `responseType: 'stream'` in +Node and consume the stream, or use a streaming fetch transport in the browser. The +client does not parse SSE events or implement the host/iframe handoff protocol. ## Regeneration diff --git a/clients/chat-client/package.json b/clients/chat-client/package.json index c923465f8..a37f7fbe3 100644 --- a/clients/chat-client/package.json +++ b/clients/chat-client/package.json @@ -19,7 +19,7 @@ "keywords": [ "epilot", "chat", - "widgets" + "website-chat" ], "scripts": { "test": "vitest run", diff --git a/clients/chat-client/src/client.test.ts b/clients/chat-client/src/client.test.ts index 7beed596d..9497ee44d 100644 --- a/clients/chat-client/src/client.test.ts +++ b/clients/chat-client/src/client.test.ts @@ -9,33 +9,38 @@ describe('Chat client', () => { expect(client.defaults.baseURL).toBe('https://chat.sls.epilot.io'); expect(client.api.getOperations().map((operation) => operation.operationId)).toEqual( expect.arrayContaining([ - 'listChatWidgets', - 'createChatWidget', - 'getChatWidget', - 'updateChatWidget', - 'deleteChatWidget', - 'getPublicChatWidget', + 'listWebsiteChats', + 'createWebsiteChat', + 'getWebsiteChat', + 'updateWebsiteChat', + 'deleteWebsiteChat', + 'getPublicWebsiteChat', 'createPublicChatGrant', 'createAnonymousChatSession', 'sendAnonymousChatMessage', + 'getChatVerification', + 'startChatEmailVerification', + 'verifyChatEmailCode', + 'cancelChatVerification', ]), ); - expect(definition.paths['/v1/widgets'].get.security).toEqual([{ EpilotAuth: [] }]); + expect(definition.paths['/v1/website-chats'].get.security).toEqual([{ EpilotAuth: [] }]); expect(definition.paths['/v1/bootstrap'].post.security).toEqual([]); expect(definition.paths['/v1/sessions'].post.security).toEqual([]); - expect(definition.paths['/v1/widgets/{widget_id}/configuration'].get.security).toEqual([]); + expect(definition.paths['/v1/website-chats/{website_chat_id}/configuration'].get.security).toEqual([]); expect(definition.paths['/v1/messages'].post.security).toEqual([{ AnonymousSession: [] }]); + expect(definition.paths['/v1/verification/code'].post.security).toEqual([{ AnonymousSession: [] }]); expect(definition.components.responses.Error.content['application/json'].schema.properties.code.enum).toContain( 'SESSION_EXPIRED', ); expect(definition.components.schemas.Error.properties).not.toHaveProperty('code'); }); - it('encodes a widget update and preserves design and email verification settings', async () => { + it('encodes a Website Chat update and preserves design and email verification settings', async () => { const client = createClient(); - const payload: Components.Schemas.UpdateChatWidgetRequest = { + const payload: Components.Schemas.UpdateWebsiteChatRequest = { version: 1, - website_chat: { + settings: { allowed_origins: ['https://example.com'], organisation_name: 'Example Energy', default_locale: 'en', @@ -45,12 +50,18 @@ describe('Chat client', () => { }; client.defaults.adapter = async (config) => { expect(config.method).toBe('put'); - expect(config.url).toBe('/v1/widgets/widget-1'); + expect(config.url).toBe('/v1/website-chats/website-chat-1'); expect(JSON.parse(config.data)).toEqual(payload); - return { config, data: { widget_id: 'widget-1', ...payload }, status: 200, statusText: 'OK', headers: {} }; + return { + config, + data: { website_chat_id: 'website-chat-1', ...payload }, + status: 200, + statusText: 'OK', + headers: {}, + }; }; - const response = await client.updateChatWidget({ widget_id: 'widget-1' }, payload); - expect(response.data.website_chat.design_id).toBe(payload.website_chat?.design_id); + const response = await client.updateWebsiteChat({ website_chat_id: 'website-chat-1' }, payload); + expect(response.data.settings.design_id).toBe(payload.settings?.design_id); }); it('can isolate an anonymous session from the authenticated management singleton', () => { diff --git a/clients/chat-client/src/openapi-runtime.json b/clients/chat-client/src/openapi-runtime.json index 53a167145..d2deb9127 100644 --- a/clients/chat-client/src/openapi-runtime.json +++ b/clients/chat-client/src/openapi-runtime.json @@ -10,9 +10,9 @@ } ], "paths": { - "/v1/widgets": { + "/v1/website-chats": { "get": { - "operationId": "listChatWidgets", + "operationId": "listWebsiteChats", "responses": {}, "parameters": [ { @@ -22,7 +22,7 @@ ] }, "post": { - "operationId": "createChatWidget", + "operationId": "createWebsiteChat", "responses": {}, "requestBody": { "required": true, @@ -32,20 +32,20 @@ } } }, - "/v1/widgets/{widget_id}": { + "/v1/website-chats/{website_chat_id}": { "parameters": [ { "in": "path", - "name": "widget_id", + "name": "website_chat_id", "required": true } ], "get": { - "operationId": "getChatWidget", + "operationId": "getWebsiteChat", "responses": {} }, "put": { - "operationId": "updateChatWidget", + "operationId": "updateWebsiteChat", "responses": {}, "requestBody": { "required": true, @@ -55,7 +55,7 @@ } }, "delete": { - "operationId": "deleteChatWidget", + "operationId": "deleteWebsiteChat", "responses": {}, "parameters": [ { @@ -66,13 +66,13 @@ ] } }, - "/v1/widgets/{widget_id}/configuration": { + "/v1/website-chats/{website_chat_id}/configuration": { "get": { - "operationId": "getPublicChatWidget", + "operationId": "getPublicWebsiteChat", "parameters": [ { "in": "path", - "name": "widget_id", + "name": "website_chat_id", "required": true } ], @@ -114,6 +114,42 @@ }, "responses": {} } + }, + "/v1/verification": { + "get": { + "operationId": "getChatVerification", + "responses": {} + } + }, + "/v1/verification/email": { + "post": { + "operationId": "startChatEmailVerification", + "requestBody": { + "required": true, + "content": { + "application/json": {} + } + }, + "responses": {} + } + }, + "/v1/verification/code": { + "post": { + "operationId": "verifyChatEmailCode", + "requestBody": { + "required": true, + "content": { + "application/json": {} + } + }, + "responses": {} + } + }, + "/v1/verification/cancel": { + "post": { + "operationId": "cancelChatVerification", + "responses": {} + } } }, "components": { diff --git a/clients/chat-client/src/openapi.d.ts b/clients/chat-client/src/openapi.d.ts index 5376bcc92..2e91623e0 100644 --- a/clients/chat-client/src/openapi.d.ts +++ b/clients/chat-client/src/openapi.d.ts @@ -9,16 +9,16 @@ import type { declare namespace Components { namespace Responses { export interface Error { - code: "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; + code: "INVALID_VERIFICATION_CODE" | "VERIFICATION_EXPIRED" | "VERIFICATION_CONFLICT" | "VERIFICATION_DISABLED" | "VERIFICATION_UNAVAILABLE" | "IDENTITY_CHANGED" | "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; } } namespace Schemas { - export interface ChatWidget { + export interface CreateWebsiteChatRequest { name: string; agent_id: string | null; // uuid - website_chat: { + settings: { /** - * Exact HTTPS origins. Empty means the widget cannot start sessions. + * Exact HTTPS origins. Empty means the Website Chat cannot start sessions. */ allowed_origins: [ string?, @@ -75,99 +75,7 @@ declare namespace Components { organisation_name: string; default_locale: "en" | "de"; /** - * Design Builder configuration for the widget only. - */ - design_id?: string | null; // uuid - /** - * Email Builder template selection. Does not enable verification by itself. - */ - authentication?: { - email_code: { - email_template_id?: string | null; // uuid - }; - } | null; - }; - /** - * Stable public embed identifier, independent of the assigned agent. Not a credential. - */ - widget_id: string; // uuid - org_id: string; - /** - * Server-owned session binding; changes on reassignment or allowed-origin changes. - */ - binding_id: string; // uuid - version: number; - created_at: string; // date-time - updated_at: string; // date-time - website_chat_embed: { - script_url: string; // uri - chat_api_origin: string; // uri - demo_url: string; // uri - }; - } - export interface CreateChatWidgetRequest { - name: string; - agent_id: string | null; // uuid - website_chat: { - /** - * Exact HTTPS origins. Empty means the widget cannot start sessions. - */ - allowed_origins: [ - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string? - ]; - organisation_name: string; - default_locale: "en" | "de"; - /** - * Design Builder configuration for the widget only. + * Design Builder configuration for the Website Chat only. */ design_id?: string | null; // uuid /** @@ -187,13 +95,13 @@ declare namespace Components { [key: string]: any; }; } - export interface ListChatWidgetsResponse { - widgets: { + export interface ListWebsiteChatsResponse { + website_chats: { name: string; agent_id: string | null; // uuid - website_chat: { + settings: { /** - * Exact HTTPS origins. Empty means the widget cannot start sessions. + * Exact HTTPS origins. Empty means the Website Chat cannot start sessions. */ allowed_origins: [ string?, @@ -250,7 +158,7 @@ declare namespace Components { organisation_name: string; default_locale: "en" | "de"; /** - * Design Builder configuration for the widget only. + * Design Builder configuration for the Website Chat only. */ design_id?: string | null; // uuid /** @@ -265,7 +173,7 @@ declare namespace Components { /** * Stable public embed identifier, independent of the assigned agent. Not a credential. */ - widget_id: string; // uuid + website_chat_id: string; // uuid org_id: string; /** * Server-owned session binding; changes on reassignment or allowed-origin changes. @@ -274,7 +182,7 @@ declare namespace Components { version: number; created_at: string; // date-time updated_at: string; // date-time - website_chat_embed: { + embed: { script_url: string; // uri chat_api_origin: string; // uri demo_url: string; // uri @@ -283,7 +191,7 @@ declare namespace Components { next_cursor?: string; } export interface PublicChatError { - code: "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; + code: "INVALID_VERIFICATION_CODE" | "VERIFICATION_EXPIRED" | "VERIFICATION_CONFLICT" | "VERIFICATION_DISABLED" | "VERIFICATION_UNAVAILABLE" | "IDENTITY_CHANGED" | "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; } /** * JSON payload of one SSE data frame from sendAnonymousChatMessage. @@ -301,12 +209,58 @@ declare namespace Components { code: "UNAVAILABLE"; request_id: string; // uuid }; - export interface UpdateChatWidgetRequest { + export interface PublicWebsiteChat { + key: string; + organisationName: string; + assistantName: string; + defaultLocale: "en" | "de"; + authentication?: { + email_code: boolean; + }; + design?: { + id: string; // uuid + last_modified_at?: string; + style?: { + palette?: { + primary?: string; + background?: string; + }; + typography?: { + font?: { + font_family?: string; + }; + }; + shape?: { + border_radius?: number; + }; + }; + spark_theme?: { + accentColor?: string; + backgroundColor?: string; + fontBody?: string; + fontHeading?: string; + radius?: string; + scaling?: string; + spacing?: string; + appearance?: string; + neutralColor?: string; + styleVariant?: string; + labelPosition?: string; + inputStyle?: string; + inputColor?: string; + cardVariant?: string; + cardColor?: string; + highContrast?: boolean; + }; + }; + locales: ("en" | "de")[]; + } + export interface UpdateWebsiteChatRequest { name?: string; agent_id?: string | null; // uuid - website_chat?: { + settings?: { /** - * Exact HTTPS origins. Empty means the widget cannot start sessions. + * Exact HTTPS origins. Empty means the Website Chat cannot start sessions. */ allowed_origins: [ string?, @@ -363,7 +317,7 @@ declare namespace Components { organisation_name: string; default_locale: "en" | "de"; /** - * Design Builder configuration for the widget only. + * Design Builder configuration for the Website Chat only. */ design_id?: string | null; // uuid /** @@ -380,9 +334,153 @@ declare namespace Components { */ version: number; } + export interface VerificationState { + available: boolean; + conversation_id: string; // uuid + status: "anonymous" | "sending" | "pending" | "verified"; + challenge_id?: string; // uuid + /** + * Unix seconds + */ + code_expires_at?: number; + /** + * Unix seconds + */ + resend_after?: number; + email?: string; // email + contact_resolution?: "matched" | "ambiguous" | "not_found"; + } + export interface WebsiteChat { + name: string; + agent_id: string | null; // uuid + settings: { + /** + * Exact HTTPS origins. Empty means the Website Chat cannot start sessions. + */ + allowed_origins: [ + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string? + ]; + organisation_name: string; + default_locale: "en" | "de"; + /** + * Design Builder configuration for the Website Chat only. + */ + design_id?: string | null; // uuid + /** + * Email Builder template selection. Does not enable verification by itself. + */ + authentication?: { + email_code: { + email_template_id?: string | null; // uuid + }; + } | null; + }; + /** + * Stable public embed identifier, independent of the assigned agent. Not a credential. + */ + website_chat_id: string; // uuid + org_id: string; + /** + * Server-owned session binding; changes on reassignment or allowed-origin changes. + */ + binding_id: string; // uuid + version: number; + created_at: string; // date-time + updated_at: string; // date-time + embed: { + script_url: string; // uri + chat_api_origin: string; // uri + demo_url: string; // uri + }; + } + export interface WebsiteChatDesign { + id: string; // uuid + last_modified_at?: string; + style?: { + palette?: { + primary?: string; + background?: string; + }; + typography?: { + font?: { + font_family?: string; + }; + }; + shape?: { + border_radius?: number; + }; + }; + spark_theme?: { + accentColor?: string; + backgroundColor?: string; + fontBody?: string; + fontHeading?: string; + radius?: string; + scaling?: string; + spacing?: string; + appearance?: string; + neutralColor?: string; + styleVariant?: string; + labelPosition?: string; + inputStyle?: string; + inputColor?: string; + cardVariant?: string; + cardColor?: string; + highContrast?: boolean; + }; + } export interface WebsiteChatSettings { /** - * Exact HTTPS origins. Empty means the widget cannot start sessions. + * Exact HTTPS origins. Empty means the Website Chat cannot start sessions. */ allowed_origins: [ string?, @@ -439,100 +537,44 @@ declare namespace Components { organisation_name: string; default_locale: "en" | "de"; /** - * Design Builder configuration for the widget only. + * Design Builder configuration for the Website Chat only. */ design_id?: string | null; // uuid /** * Email Builder template selection. Does not enable verification by itself. - */ - authentication?: { - email_code: { - email_template_id?: string | null; // uuid - }; - } | null; - } - export interface Widget { - key: string; - organisationName: string; - assistantName: string; - defaultLocale: "en" | "de"; - design?: { - id: string; // uuid - last_modified_at?: string; - style?: { - palette?: { - primary?: string; - background?: string; - }; - typography?: { - font?: { - font_family?: string; - }; - }; - shape?: { - border_radius?: number; - }; - }; - spark_theme?: { - accentColor?: string; - backgroundColor?: string; - fontBody?: string; - fontHeading?: string; - radius?: string; - scaling?: string; - spacing?: string; - appearance?: string; - neutralColor?: string; - styleVariant?: string; - labelPosition?: string; - inputStyle?: string; - inputColor?: string; - cardVariant?: string; - cardColor?: string; - highContrast?: boolean; - }; - }; - locales: ("en" | "de")[]; - } - export interface WidgetDesign { - id: string; // uuid - last_modified_at?: string; - style?: { - palette?: { - primary?: string; - background?: string; - }; - typography?: { - font?: { - font_family?: string; - }; - }; - shape?: { - border_radius?: number; - }; - }; - spark_theme?: { - accentColor?: string; - backgroundColor?: string; - fontBody?: string; - fontHeading?: string; - radius?: string; - scaling?: string; - spacing?: string; - appearance?: string; - neutralColor?: string; - styleVariant?: string; - labelPosition?: string; - inputStyle?: string; - inputColor?: string; - cardVariant?: string; - cardColor?: string; - highContrast?: boolean; - }; + */ + authentication?: { + email_code: { + email_template_id?: string | null; // uuid + }; + } | null; } } } declare namespace Paths { + namespace CancelChatVerification { + namespace Responses { + export interface $200 { + available: boolean; + conversation_id: string; // uuid + status: "anonymous" | "sending" | "pending" | "verified"; + challenge_id?: string; // uuid + /** + * Unix seconds + */ + code_expires_at?: number; + /** + * Unix seconds + */ + resend_after?: number; + email?: string; // email + contact_resolution?: "matched" | "ambiguous" | "not_found"; + } + export interface Default { + code: "INVALID_VERIFICATION_CODE" | "VERIFICATION_EXPIRED" | "VERIFICATION_CONFLICT" | "VERIFICATION_DISABLED" | "VERIFICATION_UNAVAILABLE" | "IDENTITY_CHANGED" | "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; + } + } + } namespace CreateAnonymousChatSession { export interface RequestBody { grant: string; // ^[A-Za-z0-9_-]{43}$ @@ -545,11 +587,14 @@ declare namespace Paths { * Unix seconds */ expires_at: number; - widget: { + website_chat: { key: string; organisationName: string; assistantName: string; defaultLocale: "en" | "de"; + authentication?: { + email_code: boolean; + }; design?: { id: string; // uuid last_modified_at?: string; @@ -590,17 +635,36 @@ declare namespace Paths { }; } export interface Default { - code: "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; + code: "INVALID_VERIFICATION_CODE" | "VERIFICATION_EXPIRED" | "VERIFICATION_CONFLICT" | "VERIFICATION_DISABLED" | "VERIFICATION_UNAVAILABLE" | "IDENTITY_CHANGED" | "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; + } + } + } + namespace CreatePublicChatGrant { + export interface RequestBody { + website_chat_id: string; // ^[a-zA-Z0-9_-]{1,100}$ + } + namespace Responses { + export interface $201 { + grant: string; + /** + * example: + * 60 + */ + expires_in: number; + frame_origin: string; // uri + } + export interface Default { + code: "INVALID_VERIFICATION_CODE" | "VERIFICATION_EXPIRED" | "VERIFICATION_CONFLICT" | "VERIFICATION_DISABLED" | "VERIFICATION_UNAVAILABLE" | "IDENTITY_CHANGED" | "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; } } } - namespace CreateChatWidget { + namespace CreateWebsiteChat { export interface RequestBody { name: string; agent_id: string | null; // uuid - website_chat: { + settings: { /** - * Exact HTTPS origins. Empty means the widget cannot start sessions. + * Exact HTTPS origins. Empty means the Website Chat cannot start sessions. */ allowed_origins: [ string?, @@ -657,7 +721,7 @@ declare namespace Paths { organisation_name: string; default_locale: "en" | "de"; /** - * Design Builder configuration for the widget only. + * Design Builder configuration for the Website Chat only. */ design_id?: string | null; // uuid /** @@ -674,9 +738,9 @@ declare namespace Paths { export interface $201 { name: string; agent_id: string | null; // uuid - website_chat: { + settings: { /** - * Exact HTTPS origins. Empty means the widget cannot start sessions. + * Exact HTTPS origins. Empty means the Website Chat cannot start sessions. */ allowed_origins: [ string?, @@ -733,7 +797,7 @@ declare namespace Paths { organisation_name: string; default_locale: "en" | "de"; /** - * Design Builder configuration for the widget only. + * Design Builder configuration for the Website Chat only. */ design_id?: string | null; // uuid /** @@ -748,7 +812,7 @@ declare namespace Paths { /** * Stable public embed identifier, independent of the assigned agent. Not a credential. */ - widget_id: string; // uuid + website_chat_id: string; // uuid org_id: string; /** * Server-owned session binding; changes on reassignment or allowed-origin changes. @@ -757,7 +821,7 @@ declare namespace Paths { version: number; created_at: string; // date-time updated_at: string; // date-time - website_chat_embed: { + embed: { script_url: string; // uri chat_api_origin: string; // uri demo_url: string; // uri @@ -786,26 +850,7 @@ declare namespace Paths { } } } - namespace CreatePublicChatGrant { - export interface RequestBody { - widget_key: string; // ^[a-zA-Z0-9_-]{1,100}$ - } - namespace Responses { - export interface $201 { - grant: string; - /** - * example: - * 60 - */ - expires_in: number; - widget_origin: string; // uri - } - export interface Default { - code: "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; - } - } - } - namespace DeleteChatWidget { + namespace DeleteWebsiteChat { namespace Parameters { export type Version = number; } @@ -838,14 +883,96 @@ declare namespace Paths { } } } - namespace GetChatWidget { + namespace GetChatVerification { + namespace Responses { + export interface $200 { + available: boolean; + conversation_id: string; // uuid + status: "anonymous" | "sending" | "pending" | "verified"; + challenge_id?: string; // uuid + /** + * Unix seconds + */ + code_expires_at?: number; + /** + * Unix seconds + */ + resend_after?: number; + email?: string; // email + contact_resolution?: "matched" | "ambiguous" | "not_found"; + } + export interface Default { + code: "INVALID_VERIFICATION_CODE" | "VERIFICATION_EXPIRED" | "VERIFICATION_CONFLICT" | "VERIFICATION_DISABLED" | "VERIFICATION_UNAVAILABLE" | "IDENTITY_CHANGED" | "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; + } + } + } + namespace GetPublicWebsiteChat { + namespace Parameters { + export type WebsiteChatId = string; // ^[a-zA-Z0-9_-]{1,100}$ + } + export interface PathParameters { + website_chat_id: Parameters.WebsiteChatId /* ^[a-zA-Z0-9_-]{1,100}$ */; + } + namespace Responses { + export interface $200 { + key: string; + organisationName: string; + assistantName: string; + defaultLocale: "en" | "de"; + authentication?: { + email_code: boolean; + }; + design?: { + id: string; // uuid + last_modified_at?: string; + style?: { + palette?: { + primary?: string; + background?: string; + }; + typography?: { + font?: { + font_family?: string; + }; + }; + shape?: { + border_radius?: number; + }; + }; + spark_theme?: { + accentColor?: string; + backgroundColor?: string; + fontBody?: string; + fontHeading?: string; + radius?: string; + scaling?: string; + spacing?: string; + appearance?: string; + neutralColor?: string; + styleVariant?: string; + labelPosition?: string; + inputStyle?: string; + inputColor?: string; + cardVariant?: string; + cardColor?: string; + highContrast?: boolean; + }; + }; + locales: ("en" | "de")[]; + } + export interface Default { + code: "INVALID_VERIFICATION_CODE" | "VERIFICATION_EXPIRED" | "VERIFICATION_CONFLICT" | "VERIFICATION_DISABLED" | "VERIFICATION_UNAVAILABLE" | "IDENTITY_CHANGED" | "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; + } + } + } + namespace GetWebsiteChat { namespace Responses { export interface $200 { name: string; agent_id: string | null; // uuid - website_chat: { + settings: { /** - * Exact HTTPS origins. Empty means the widget cannot start sessions. + * Exact HTTPS origins. Empty means the Website Chat cannot start sessions. */ allowed_origins: [ string?, @@ -902,7 +1029,7 @@ declare namespace Paths { organisation_name: string; default_locale: "en" | "de"; /** - * Design Builder configuration for the widget only. + * Design Builder configuration for the Website Chat only. */ design_id?: string | null; // uuid /** @@ -917,7 +1044,7 @@ declare namespace Paths { /** * Stable public embed identifier, independent of the assigned agent. Not a credential. */ - widget_id: string; // uuid + website_chat_id: string; // uuid org_id: string; /** * Server-owned session binding; changes on reassignment or allowed-origin changes. @@ -926,7 +1053,7 @@ declare namespace Paths { version: number; created_at: string; // date-time updated_at: string; // date-time - website_chat_embed: { + embed: { script_url: string; // uri chat_api_origin: string; // uri demo_url: string; // uri @@ -955,63 +1082,7 @@ declare namespace Paths { } } } - namespace GetPublicChatWidget { - namespace Parameters { - export type WidgetId = string; // ^[a-zA-Z0-9_-]{1,100}$ - } - export interface PathParameters { - widget_id: Parameters.WidgetId /* ^[a-zA-Z0-9_-]{1,100}$ */; - } - namespace Responses { - export interface $200 { - key: string; - organisationName: string; - assistantName: string; - defaultLocale: "en" | "de"; - design?: { - id: string; // uuid - last_modified_at?: string; - style?: { - palette?: { - primary?: string; - background?: string; - }; - typography?: { - font?: { - font_family?: string; - }; - }; - shape?: { - border_radius?: number; - }; - }; - spark_theme?: { - accentColor?: string; - backgroundColor?: string; - fontBody?: string; - fontHeading?: string; - radius?: string; - scaling?: string; - spacing?: string; - appearance?: string; - neutralColor?: string; - styleVariant?: string; - labelPosition?: string; - inputStyle?: string; - inputColor?: string; - cardVariant?: string; - cardColor?: string; - highContrast?: boolean; - }; - }; - locales: ("en" | "de")[]; - } - export interface Default { - code: "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; - } - } - } - namespace ListChatWidgets { + namespace ListWebsiteChats { namespace Parameters { export type Cursor = string; } @@ -1020,12 +1091,12 @@ declare namespace Paths { } namespace Responses { export interface $200 { - widgets: { + website_chats: { name: string; agent_id: string | null; // uuid - website_chat: { + settings: { /** - * Exact HTTPS origins. Empty means the widget cannot start sessions. + * Exact HTTPS origins. Empty means the Website Chat cannot start sessions. */ allowed_origins: [ string?, @@ -1082,7 +1153,7 @@ declare namespace Paths { organisation_name: string; default_locale: "en" | "de"; /** - * Design Builder configuration for the widget only. + * Design Builder configuration for the Website Chat only. */ design_id?: string | null; // uuid /** @@ -1097,7 +1168,7 @@ declare namespace Paths { /** * Stable public embed identifier, independent of the assigned agent. Not a credential. */ - widget_id: string; // uuid + website_chat_id: string; // uuid org_id: string; /** * Server-owned session binding; changes on reassignment or allowed-origin changes. @@ -1106,7 +1177,7 @@ declare namespace Paths { version: number; created_at: string; // date-time updated_at: string; // date-time - website_chat_embed: { + embed: { script_url: string; // uri chat_api_origin: string; // uri demo_url: string; // uri @@ -1147,17 +1218,45 @@ declare namespace Paths { namespace Responses { export type $200 = string; export interface Default { - code: "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; + code: "INVALID_VERIFICATION_CODE" | "VERIFICATION_EXPIRED" | "VERIFICATION_CONFLICT" | "VERIFICATION_DISABLED" | "VERIFICATION_UNAVAILABLE" | "IDENTITY_CHANGED" | "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; + } + } + } + namespace StartChatEmailVerification { + export interface RequestBody { + request_id: string; // uuid + email: string; // email + locale: "en" | "de"; + } + namespace Responses { + export interface $200 { + available: boolean; + conversation_id: string; // uuid + status: "anonymous" | "sending" | "pending" | "verified"; + challenge_id?: string; // uuid + /** + * Unix seconds + */ + code_expires_at?: number; + /** + * Unix seconds + */ + resend_after?: number; + email?: string; // email + contact_resolution?: "matched" | "ambiguous" | "not_found"; + } + export interface Default { + code: "INVALID_VERIFICATION_CODE" | "VERIFICATION_EXPIRED" | "VERIFICATION_CONFLICT" | "VERIFICATION_DISABLED" | "VERIFICATION_UNAVAILABLE" | "IDENTITY_CHANGED" | "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; } } } - namespace UpdateChatWidget { + namespace UpdateWebsiteChat { export interface RequestBody { name?: string; agent_id?: string | null; // uuid - website_chat?: { + settings?: { /** - * Exact HTTPS origins. Empty means the widget cannot start sessions. + * Exact HTTPS origins. Empty means the Website Chat cannot start sessions. */ allowed_origins: [ string?, @@ -1214,7 +1313,7 @@ declare namespace Paths { organisation_name: string; default_locale: "en" | "de"; /** - * Design Builder configuration for the widget only. + * Design Builder configuration for the Website Chat only. */ design_id?: string | null; // uuid /** @@ -1235,9 +1334,9 @@ declare namespace Paths { export interface $200 { name: string; agent_id: string | null; // uuid - website_chat: { + settings: { /** - * Exact HTTPS origins. Empty means the widget cannot start sessions. + * Exact HTTPS origins. Empty means the Website Chat cannot start sessions. */ allowed_origins: [ string?, @@ -1294,7 +1393,7 @@ declare namespace Paths { organisation_name: string; default_locale: "en" | "de"; /** - * Design Builder configuration for the widget only. + * Design Builder configuration for the Website Chat only. */ design_id?: string | null; // uuid /** @@ -1309,7 +1408,7 @@ declare namespace Paths { /** * Stable public embed identifier, independent of the assigned agent. Not a credential. */ - widget_id: string; // uuid + website_chat_id: string; // uuid org_id: string; /** * Server-owned session binding; changes on reassignment or allowed-origin changes. @@ -1318,7 +1417,7 @@ declare namespace Paths { version: number; created_at: string; // date-time updated_at: string; // date-time - website_chat_embed: { + embed: { script_url: string; // uri chat_api_origin: string; // uri demo_url: string; // uri @@ -1347,12 +1446,39 @@ declare namespace Paths { } } } - namespace V1Widgets$WidgetId { + namespace V1WebsiteChats$WebsiteChatId { namespace Parameters { - export type WidgetId = string; // uuid + export type WebsiteChatId = string; // uuid } export interface PathParameters { - widget_id: Parameters.WidgetId /* uuid */; + website_chat_id: Parameters.WebsiteChatId /* uuid */; + } + } + namespace VerifyChatEmailCode { + export interface RequestBody { + challenge_id: string; // uuid + code: string; // ^\d{6}$ + } + namespace Responses { + export interface $200 { + available: boolean; + conversation_id: string; // uuid + status: "anonymous" | "sending" | "pending" | "verified"; + challenge_id?: string; // uuid + /** + * Unix seconds + */ + code_expires_at?: number; + /** + * Unix seconds + */ + resend_after?: number; + email?: string; // email + contact_resolution?: "matched" | "ambiguous" | "not_found"; + } + export interface Default { + code: "INVALID_VERIFICATION_CODE" | "VERIFICATION_EXPIRED" | "VERIFICATION_CONFLICT" | "VERIFICATION_DISABLED" | "VERIFICATION_UNAVAILABLE" | "IDENTITY_CHANGED" | "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; + } } } } @@ -1360,55 +1486,55 @@ declare namespace Paths { export interface OperationMethods { /** - * listChatWidgets + * listWebsiteChats */ - 'listChatWidgets'( - parameters?: Parameters | null, + 'listWebsiteChats'( + parameters?: Parameters | null, data?: any, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse /** - * createChatWidget + * createWebsiteChat */ - 'createChatWidget'( + 'createWebsiteChat'( parameters?: Parameters | null, - data?: Paths.CreateChatWidget.RequestBody, + data?: Paths.CreateWebsiteChat.RequestBody, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse /** - * getChatWidget + * getWebsiteChat */ - 'getChatWidget'( - parameters?: Parameters | null, + 'getWebsiteChat'( + parameters?: Parameters | null, data?: any, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse /** - * updateChatWidget + * updateWebsiteChat */ - 'updateChatWidget'( - parameters?: Parameters | null, - data?: Paths.UpdateChatWidget.RequestBody, + 'updateWebsiteChat'( + parameters?: Parameters | null, + data?: Paths.UpdateWebsiteChat.RequestBody, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse /** - * deleteChatWidget + * deleteWebsiteChat */ - 'deleteChatWidget'( - parameters?: Parameters | null, + 'deleteWebsiteChat'( + parameters?: Parameters | null, data?: any, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse /** - * getPublicChatWidget - Resolve visitor-facing configuration for an independent widget and its current agent assignment. The widget ID is not an organisation ID or a destination such as website or portal. + * getPublicWebsiteChat - Resolve visitor-facing configuration for an independent Website Chat and its current agent assignment. The Website Chat ID is not an organisation ID or a destination such as website or portal. */ - 'getPublicChatWidget'( - parameters?: Parameters | null, + 'getPublicWebsiteChat'( + parameters?: Parameters | null, data?: any, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse /** - * createPublicChatGrant - Called by the host website with its widget_key. Checks the saved website origin allowlist and issues a single-use grant for the iframe to exchange at POST /v1/sessions within 60 seconds. This deadline does not limit the resulting session. + * createPublicChatGrant - Called by the host website with its website_chat_id. Checks the saved website origin allowlist and issues a single-use grant for the iframe to exchange at POST /v1/sessions within 60 seconds. This deadline does not limit the resulting session. */ 'createPublicChatGrant'( parameters?: Parameters | null, @@ -1436,66 +1562,98 @@ export interface OperationMethods { data?: Paths.SendAnonymousChatMessage.RequestBody, config?: AxiosRequestConfig ): OperationResponse + /** + * getChatVerification - Read this session's verification state. No contact IDs or candidate records are exposed. + */ + 'getChatVerification'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + /** + * startChatEmailVerification - Start or resend an email challenge using the template saved on this session's Website Chat. Repeating the same request_id and payload does not send another email. Codes must never be sent as chat messages. + */ + 'startChatEmailVerification'( + parameters?: Parameters | null, + data?: Paths.StartChatEmailVerification.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse + /** + * verifyChatEmailCode - Verify a code for this session's current challenge. Success binds email proof and contact resolution to this session and starts a new conversation. It grants no account-tool permission. + */ + 'verifyChatEmailCode'( + parameters?: Parameters | null, + data?: Paths.VerifyChatEmailCode.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse + /** + * cancelChatVerification - Cancel a pending challenge or clear verified identity. Clearing verified identity starts a new anonymous conversation. In-flight verification cannot restore the cleared identity. + */ + 'cancelChatVerification'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse } export interface PathsDictionary { - ['/v1/widgets']: { + ['/v1/website-chats']: { /** - * listChatWidgets + * listWebsiteChats */ 'get'( - parameters?: Parameters | null, + parameters?: Parameters | null, data?: any, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse /** - * createChatWidget + * createWebsiteChat */ 'post'( parameters?: Parameters | null, - data?: Paths.CreateChatWidget.RequestBody, + data?: Paths.CreateWebsiteChat.RequestBody, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse } - ['/v1/widgets/{widget_id}']: { + ['/v1/website-chats/{website_chat_id}']: { /** - * getChatWidget + * getWebsiteChat */ 'get'( - parameters?: Parameters | null, + parameters?: Parameters | null, data?: any, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse /** - * updateChatWidget + * updateWebsiteChat */ 'put'( - parameters?: Parameters | null, - data?: Paths.UpdateChatWidget.RequestBody, + parameters?: Parameters | null, + data?: Paths.UpdateWebsiteChat.RequestBody, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse /** - * deleteChatWidget + * deleteWebsiteChat */ 'delete'( - parameters?: Parameters | null, + parameters?: Parameters | null, data?: any, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse } - ['/v1/widgets/{widget_id}/configuration']: { + ['/v1/website-chats/{website_chat_id}/configuration']: { /** - * getPublicChatWidget - Resolve visitor-facing configuration for an independent widget and its current agent assignment. The widget ID is not an organisation ID or a destination such as website or portal. + * getPublicWebsiteChat - Resolve visitor-facing configuration for an independent Website Chat and its current agent assignment. The Website Chat ID is not an organisation ID or a destination such as website or portal. */ 'get'( - parameters?: Parameters | null, + parameters?: Parameters | null, data?: any, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse } ['/v1/bootstrap']: { /** - * createPublicChatGrant - Called by the host website with its widget_key. Checks the saved website origin allowlist and issues a single-use grant for the iframe to exchange at POST /v1/sessions within 60 seconds. This deadline does not limit the resulting session. + * createPublicChatGrant - Called by the host website with its website_chat_id. Checks the saved website origin allowlist and issues a single-use grant for the iframe to exchange at POST /v1/sessions within 60 seconds. This deadline does not limit the resulting session. */ 'post'( parameters?: Parameters | null, @@ -1528,18 +1686,59 @@ export interface PathsDictionary { config?: AxiosRequestConfig ): OperationResponse } + ['/v1/verification']: { + /** + * getChatVerification - Read this session's verification state. No contact IDs or candidate records are exposed. + */ + 'get'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + } + ['/v1/verification/email']: { + /** + * startChatEmailVerification - Start or resend an email challenge using the template saved on this session's Website Chat. Repeating the same request_id and payload does not send another email. Codes must never be sent as chat messages. + */ + 'post'( + parameters?: Parameters | null, + data?: Paths.StartChatEmailVerification.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse + } + ['/v1/verification/code']: { + /** + * verifyChatEmailCode - Verify a code for this session's current challenge. Success binds email proof and contact resolution to this session and starts a new conversation. It grants no account-tool permission. + */ + 'post'( + parameters?: Parameters | null, + data?: Paths.VerifyChatEmailCode.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse + } + ['/v1/verification/cancel']: { + /** + * cancelChatVerification - Cancel a pending challenge or clear verified identity. Clearing verified identity starts a new anonymous conversation. In-flight verification cannot restore the cleared identity. + */ + 'post'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + } } export type Client = OpenAPIClient -export type ChatWidget = Components.Schemas.ChatWidget; -export type CreateChatWidgetRequest = Components.Schemas.CreateChatWidgetRequest; +export type CreateWebsiteChatRequest = Components.Schemas.CreateWebsiteChatRequest; export type Error = Components.Schemas.Error; -export type ListChatWidgetsResponse = Components.Schemas.ListChatWidgetsResponse; +export type ListWebsiteChatsResponse = Components.Schemas.ListWebsiteChatsResponse; export type PublicChatError = Components.Schemas.PublicChatError; export type PublicEvent = Components.Schemas.PublicEvent; -export type UpdateChatWidgetRequest = Components.Schemas.UpdateChatWidgetRequest; +export type PublicWebsiteChat = Components.Schemas.PublicWebsiteChat; +export type UpdateWebsiteChatRequest = Components.Schemas.UpdateWebsiteChatRequest; +export type VerificationState = Components.Schemas.VerificationState; +export type WebsiteChat = Components.Schemas.WebsiteChat; +export type WebsiteChatDesign = Components.Schemas.WebsiteChatDesign; export type WebsiteChatSettings = Components.Schemas.WebsiteChatSettings; -export type Widget = Components.Schemas.Widget; -export type WidgetDesign = Components.Schemas.WidgetDesign; diff --git a/clients/chat-client/src/openapi.json b/clients/chat-client/src/openapi.json index 7be35da83..dcff3b08a 100644 --- a/clients/chat-client/src/openapi.json +++ b/clients/chat-client/src/openapi.json @@ -3,7 +3,7 @@ "info": { "title": "epilot Chat API", "version": "0.1.0", - "description": "Widget management and anonymous browser chat." + "description": "Website Chat management and anonymous browser chat." }, "servers": [ { @@ -16,12 +16,12 @@ } ], "paths": { - "/v1/widgets": { + "/v1/website-chats": { "get": { "tags": [ - "Chat widgets" + "Website Chats" ], - "operationId": "listChatWidgets", + "operationId": "listWebsiteChats", "security": [ { "EpilotAuth": [] @@ -29,28 +29,28 @@ ], "responses": { "200": { - "description": "Widget response", + "description": "Website Chat response", "content": { "application/json": { "schema": { "type": "object", "required": [ - "widgets" + "website_chats" ], "properties": { - "widgets": { + "website_chats": { "type": "array", "items": { "type": "object", "required": [ - "widget_id", + "website_chat_id", "org_id", "agent_id", "binding_id", "version", "name", - "website_chat", - "website_chat_embed", + "settings", + "embed", "created_at", "updated_at" ], @@ -65,7 +65,7 @@ "format": "uuid", "nullable": true }, - "website_chat": { + "settings": { "type": "object", "additionalProperties": false, "required": [ @@ -78,7 +78,7 @@ "type": "array", "maxItems": 50, "uniqueItems": true, - "description": "Exact HTTPS origins. Empty means the widget cannot start sessions.", + "description": "Exact HTTPS origins. Empty means the Website Chat cannot start sessions.", "items": { "type": "string", "maxLength": 2048 @@ -100,7 +100,7 @@ "type": "string", "format": "uuid", "nullable": true, - "description": "Design Builder configuration for the widget only." + "description": "Design Builder configuration for the Website Chat only." }, "authentication": { "type": "object", @@ -126,7 +126,7 @@ } } }, - "widget_id": { + "website_chat_id": { "type": "string", "format": "uuid", "readOnly": true, @@ -157,7 +157,7 @@ "format": "date-time", "readOnly": true }, - "website_chat_embed": { + "embed": { "type": "object", "readOnly": true, "required": [ @@ -192,7 +192,7 @@ } }, "400": { - "description": "Invalid widget settings", + "description": "Invalid Website Chat settings", "content": { "application/json": { "schema": { @@ -213,7 +213,7 @@ } }, "404": { - "description": "Widget not found in this organisation", + "description": "Website Chat not found in this organisation", "content": { "application/json": { "schema": { @@ -234,7 +234,7 @@ } }, "409": { - "description": "Widget or assigned agent changed; reload before retrying", + "description": "Website Chat or assigned agent changed; reload before retrying", "content": { "application/json": { "schema": { @@ -268,9 +268,9 @@ }, "post": { "tags": [ - "Chat widgets" + "Website Chats" ], - "operationId": "createChatWidget", + "operationId": "createWebsiteChat", "security": [ { "EpilotAuth": [] @@ -278,20 +278,20 @@ ], "responses": { "201": { - "description": "Widget response", + "description": "Website Chat response", "content": { "application/json": { "schema": { "type": "object", "required": [ - "widget_id", + "website_chat_id", "org_id", "agent_id", "binding_id", "version", "name", - "website_chat", - "website_chat_embed", + "settings", + "embed", "created_at", "updated_at" ], @@ -306,7 +306,7 @@ "format": "uuid", "nullable": true }, - "website_chat": { + "settings": { "type": "object", "additionalProperties": false, "required": [ @@ -319,7 +319,7 @@ "type": "array", "maxItems": 50, "uniqueItems": true, - "description": "Exact HTTPS origins. Empty means the widget cannot start sessions.", + "description": "Exact HTTPS origins. Empty means the Website Chat cannot start sessions.", "items": { "type": "string", "maxLength": 2048 @@ -341,7 +341,7 @@ "type": "string", "format": "uuid", "nullable": true, - "description": "Design Builder configuration for the widget only." + "description": "Design Builder configuration for the Website Chat only." }, "authentication": { "type": "object", @@ -367,7 +367,7 @@ } } }, - "widget_id": { + "website_chat_id": { "type": "string", "format": "uuid", "readOnly": true, @@ -398,7 +398,7 @@ "format": "date-time", "readOnly": true }, - "website_chat_embed": { + "embed": { "type": "object", "readOnly": true, "required": [ @@ -427,7 +427,7 @@ } }, "400": { - "description": "Invalid widget settings", + "description": "Invalid Website Chat settings", "content": { "application/json": { "schema": { @@ -448,7 +448,7 @@ } }, "404": { - "description": "Widget not found in this organisation", + "description": "Website Chat not found in this organisation", "content": { "application/json": { "schema": { @@ -469,7 +469,7 @@ } }, "409": { - "description": "Widget or assigned agent changed; reload before retrying", + "description": "Website Chat or assigned agent changed; reload before retrying", "content": { "application/json": { "schema": { @@ -500,7 +500,7 @@ "required": [ "name", "agent_id", - "website_chat" + "settings" ], "properties": { "name": { @@ -513,7 +513,7 @@ "format": "uuid", "nullable": true }, - "website_chat": { + "settings": { "type": "object", "additionalProperties": false, "required": [ @@ -526,7 +526,7 @@ "type": "array", "maxItems": 50, "uniqueItems": true, - "description": "Exact HTTPS origins. Empty means the widget cannot start sessions.", + "description": "Exact HTTPS origins. Empty means the Website Chat cannot start sessions.", "items": { "type": "string", "maxLength": 2048 @@ -548,7 +548,7 @@ "type": "string", "format": "uuid", "nullable": true, - "description": "Design Builder configuration for the widget only." + "description": "Design Builder configuration for the Website Chat only." }, "authentication": { "type": "object", @@ -581,11 +581,11 @@ } } }, - "/v1/widgets/{widget_id}": { + "/v1/website-chats/{website_chat_id}": { "parameters": [ { "in": "path", - "name": "widget_id", + "name": "website_chat_id", "required": true, "schema": { "type": "string", @@ -595,9 +595,9 @@ ], "get": { "tags": [ - "Chat widgets" + "Website Chats" ], - "operationId": "getChatWidget", + "operationId": "getWebsiteChat", "security": [ { "EpilotAuth": [] @@ -605,20 +605,20 @@ ], "responses": { "200": { - "description": "Widget response", + "description": "Website Chat response", "content": { "application/json": { "schema": { "type": "object", "required": [ - "widget_id", + "website_chat_id", "org_id", "agent_id", "binding_id", "version", "name", - "website_chat", - "website_chat_embed", + "settings", + "embed", "created_at", "updated_at" ], @@ -633,7 +633,7 @@ "format": "uuid", "nullable": true }, - "website_chat": { + "settings": { "type": "object", "additionalProperties": false, "required": [ @@ -646,7 +646,7 @@ "type": "array", "maxItems": 50, "uniqueItems": true, - "description": "Exact HTTPS origins. Empty means the widget cannot start sessions.", + "description": "Exact HTTPS origins. Empty means the Website Chat cannot start sessions.", "items": { "type": "string", "maxLength": 2048 @@ -668,7 +668,7 @@ "type": "string", "format": "uuid", "nullable": true, - "description": "Design Builder configuration for the widget only." + "description": "Design Builder configuration for the Website Chat only." }, "authentication": { "type": "object", @@ -694,7 +694,7 @@ } } }, - "widget_id": { + "website_chat_id": { "type": "string", "format": "uuid", "readOnly": true, @@ -725,7 +725,7 @@ "format": "date-time", "readOnly": true }, - "website_chat_embed": { + "embed": { "type": "object", "readOnly": true, "required": [ @@ -754,7 +754,7 @@ } }, "400": { - "description": "Invalid widget settings", + "description": "Invalid Website Chat settings", "content": { "application/json": { "schema": { @@ -775,7 +775,7 @@ } }, "404": { - "description": "Widget not found in this organisation", + "description": "Website Chat not found in this organisation", "content": { "application/json": { "schema": { @@ -796,7 +796,7 @@ } }, "409": { - "description": "Widget or assigned agent changed; reload before retrying", + "description": "Website Chat or assigned agent changed; reload before retrying", "content": { "application/json": { "schema": { @@ -820,9 +820,9 @@ }, "put": { "tags": [ - "Chat widgets" + "Website Chats" ], - "operationId": "updateChatWidget", + "operationId": "updateWebsiteChat", "security": [ { "EpilotAuth": [] @@ -830,20 +830,20 @@ ], "responses": { "200": { - "description": "Widget response", + "description": "Website Chat response", "content": { "application/json": { "schema": { "type": "object", "required": [ - "widget_id", + "website_chat_id", "org_id", "agent_id", "binding_id", "version", "name", - "website_chat", - "website_chat_embed", + "settings", + "embed", "created_at", "updated_at" ], @@ -858,7 +858,7 @@ "format": "uuid", "nullable": true }, - "website_chat": { + "settings": { "type": "object", "additionalProperties": false, "required": [ @@ -871,7 +871,7 @@ "type": "array", "maxItems": 50, "uniqueItems": true, - "description": "Exact HTTPS origins. Empty means the widget cannot start sessions.", + "description": "Exact HTTPS origins. Empty means the Website Chat cannot start sessions.", "items": { "type": "string", "maxLength": 2048 @@ -893,7 +893,7 @@ "type": "string", "format": "uuid", "nullable": true, - "description": "Design Builder configuration for the widget only." + "description": "Design Builder configuration for the Website Chat only." }, "authentication": { "type": "object", @@ -919,7 +919,7 @@ } } }, - "widget_id": { + "website_chat_id": { "type": "string", "format": "uuid", "readOnly": true, @@ -950,7 +950,7 @@ "format": "date-time", "readOnly": true }, - "website_chat_embed": { + "embed": { "type": "object", "readOnly": true, "required": [ @@ -979,7 +979,7 @@ } }, "400": { - "description": "Invalid widget settings", + "description": "Invalid Website Chat settings", "content": { "application/json": { "schema": { @@ -1000,7 +1000,7 @@ } }, "404": { - "description": "Widget not found in this organisation", + "description": "Website Chat not found in this organisation", "content": { "application/json": { "schema": { @@ -1021,7 +1021,7 @@ } }, "409": { - "description": "Widget or assigned agent changed; reload before retrying", + "description": "Website Chat or assigned agent changed; reload before retrying", "content": { "application/json": { "schema": { @@ -1063,7 +1063,7 @@ "format": "uuid", "nullable": true }, - "website_chat": { + "settings": { "type": "object", "additionalProperties": false, "required": [ @@ -1076,7 +1076,7 @@ "type": "array", "maxItems": 50, "uniqueItems": true, - "description": "Exact HTTPS origins. Empty means the widget cannot start sessions.", + "description": "Exact HTTPS origins. Empty means the Website Chat cannot start sessions.", "items": { "type": "string", "maxLength": 2048 @@ -1098,7 +1098,7 @@ "type": "string", "format": "uuid", "nullable": true, - "description": "Design Builder configuration for the widget only." + "description": "Design Builder configuration for the Website Chat only." }, "authentication": { "type": "object", @@ -1137,9 +1137,9 @@ }, "delete": { "tags": [ - "Chat widgets" + "Website Chats" ], - "operationId": "deleteChatWidget", + "operationId": "deleteWebsiteChat", "security": [ { "EpilotAuth": [] @@ -1147,10 +1147,10 @@ ], "responses": { "204": { - "description": "Widget deleted" + "description": "Website Chat deleted" }, "400": { - "description": "Invalid widget settings", + "description": "Invalid Website Chat settings", "content": { "application/json": { "schema": { @@ -1171,7 +1171,7 @@ } }, "404": { - "description": "Widget not found in this organisation", + "description": "Website Chat not found in this organisation", "content": { "application/json": { "schema": { @@ -1192,7 +1192,7 @@ } }, "409": { - "description": "Widget or assigned agent changed; reload before retrying", + "description": "Website Chat or assigned agent changed; reload before retrying", "content": { "application/json": { "schema": { @@ -1226,15 +1226,15 @@ ] } }, - "/v1/widgets/{widget_id}/configuration": { + "/v1/website-chats/{website_chat_id}/configuration": { "get": { - "operationId": "getPublicChatWidget", - "description": "Resolve visitor-facing configuration for an independent widget and its current agent assignment. The widget ID is not an organisation ID or a destination such as website or portal.", + "operationId": "getPublicWebsiteChat", + "description": "Resolve visitor-facing configuration for an independent Website Chat and its current agent assignment. The Website Chat ID is not an organisation ID or a destination such as website or portal.", "parameters": [ { "in": "path", - "name": "widget_id", - "description": "Public widget ID, also used as widget_key in bootstrap and data-epilot-chat in the embed.", + "name": "website_chat_id", + "description": "Public Website Chat ID, also used as website_chat_id in bootstrap and data-epilot-chat in the embed.", "example": "550e8400-e29b-41d4-a716-446655440000", "required": true, "schema": { @@ -1274,6 +1274,18 @@ "de" ] }, + "authentication": { + "type": "object", + "additionalProperties": false, + "required": [ + "email_code" + ], + "properties": { + "email_code": { + "type": "boolean" + } + } + }, "design": { "type": "object", "additionalProperties": false, @@ -1423,7 +1435,7 @@ } }, "default": { - "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished widget, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", + "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished Website Chat, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", "content": { "application/json": { "schema": { @@ -1435,6 +1447,12 @@ "code": { "type": "string", "enum": [ + "INVALID_VERIFICATION_CODE", + "VERIFICATION_EXPIRED", + "VERIFICATION_CONFLICT", + "VERIFICATION_DISABLED", + "VERIFICATION_UNAVAILABLE", + "IDENTITY_CHANGED", "INVALID_REQUEST", "ORIGIN_DENIED", "NOT_FOUND", @@ -1461,7 +1479,7 @@ "/v1/bootstrap": { "post": { "operationId": "createPublicChatGrant", - "description": "Called by the host website with its widget_key. Checks the saved website origin allowlist and issues a single-use grant for the iframe to exchange at POST /v1/sessions within 60 seconds. This deadline does not limit the resulting session.", + "description": "Called by the host website with its website_chat_id. Checks the saved website origin allowlist and issues a single-use grant for the iframe to exchange at POST /v1/sessions within 60 seconds. This deadline does not limit the resulting session.", "requestBody": { "required": true, "content": { @@ -1470,10 +1488,10 @@ "type": "object", "additionalProperties": false, "required": [ - "widget_key" + "website_chat_id" ], "properties": { - "widget_key": { + "website_chat_id": { "type": "string", "pattern": "^[a-zA-Z0-9_-]{1,100}$" } @@ -1492,7 +1510,7 @@ "required": [ "grant", "expires_in", - "widget_origin" + "frame_origin" ], "properties": { "grant": { @@ -1502,7 +1520,7 @@ "type": "integer", "example": 60 }, - "widget_origin": { + "frame_origin": { "type": "string", "format": "uri" } @@ -1512,7 +1530,7 @@ } }, "default": { - "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished widget, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", + "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished Website Chat, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", "content": { "application/json": { "schema": { @@ -1524,6 +1542,12 @@ "code": { "type": "string", "enum": [ + "INVALID_VERIFICATION_CODE", + "VERIFICATION_EXPIRED", + "VERIFICATION_CONFLICT", + "VERIFICATION_DISABLED", + "VERIFICATION_UNAVAILABLE", + "IDENTITY_CHANGED", "INVALID_REQUEST", "ORIGIN_DENIED", "NOT_FOUND", @@ -1582,7 +1606,7 @@ "token", "conversation_id", "expires_at", - "widget" + "website_chat" ], "properties": { "token": { @@ -1596,7 +1620,7 @@ "type": "integer", "description": "Unix seconds" }, - "widget": { + "website_chat": { "type": "object", "required": [ "key", @@ -1622,6 +1646,18 @@ "de" ] }, + "authentication": { + "type": "object", + "additionalProperties": false, + "required": [ + "email_code" + ], + "properties": { + "email_code": { + "type": "boolean" + } + } + }, "design": { "type": "object", "additionalProperties": false, @@ -1773,7 +1809,7 @@ } }, "default": { - "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished widget, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", + "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished Website Chat, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", "content": { "application/json": { "schema": { @@ -1785,6 +1821,12 @@ "code": { "type": "string", "enum": [ + "INVALID_VERIFICATION_CODE", + "VERIFICATION_EXPIRED", + "VERIFICATION_CONFLICT", + "VERIFICATION_DISABLED", + "VERIFICATION_UNAVAILABLE", + "IDENTITY_CHANGED", "INVALID_REQUEST", "ORIGIN_DENIED", "NOT_FOUND", @@ -1870,7 +1912,7 @@ } }, "default": { - "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished widget, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", + "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished Website Chat, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", "content": { "application/json": { "schema": { @@ -1882,6 +1924,511 @@ "code": { "type": "string", "enum": [ + "INVALID_VERIFICATION_CODE", + "VERIFICATION_EXPIRED", + "VERIFICATION_CONFLICT", + "VERIFICATION_DISABLED", + "VERIFICATION_UNAVAILABLE", + "IDENTITY_CHANGED", + "INVALID_REQUEST", + "ORIGIN_DENIED", + "NOT_FOUND", + "INVALID_GRANT", + "SESSION_EXPIRED", + "RATE_LIMITED", + "SESSION_LIMIT", + "USAGE_LIMIT", + "REQUEST_CONFLICT", + "IN_PROGRESS", + "UNAVAILABLE", + "TEMPORARILY_UNAVAILABLE" + ] + } + } + } + } + } + } + } + } + }, + "/v1/verification": { + "get": { + "operationId": "getChatVerification", + "security": [ + { + "AnonymousSession": [] + } + ], + "description": "Read this session's verification state. No contact IDs or candidate records are exposed.", + "responses": { + "200": { + "description": "Current verification state", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "required": [ + "available", + "conversation_id", + "status" + ], + "properties": { + "available": { + "type": "boolean" + }, + "conversation_id": { + "type": "string", + "format": "uuid" + }, + "status": { + "type": "string", + "enum": [ + "anonymous", + "sending", + "pending", + "verified" + ] + }, + "challenge_id": { + "type": "string", + "format": "uuid" + }, + "code_expires_at": { + "type": "integer", + "description": "Unix seconds" + }, + "resend_after": { + "type": "integer", + "description": "Unix seconds" + }, + "email": { + "type": "string", + "format": "email", + "maxLength": 254 + }, + "contact_resolution": { + "type": "string", + "enum": [ + "matched", + "ambiguous", + "not_found" + ] + } + } + } + } + } + }, + "default": { + "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished Website Chat, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "code" + ], + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_VERIFICATION_CODE", + "VERIFICATION_EXPIRED", + "VERIFICATION_CONFLICT", + "VERIFICATION_DISABLED", + "VERIFICATION_UNAVAILABLE", + "IDENTITY_CHANGED", + "INVALID_REQUEST", + "ORIGIN_DENIED", + "NOT_FOUND", + "INVALID_GRANT", + "SESSION_EXPIRED", + "RATE_LIMITED", + "SESSION_LIMIT", + "USAGE_LIMIT", + "REQUEST_CONFLICT", + "IN_PROGRESS", + "UNAVAILABLE", + "TEMPORARILY_UNAVAILABLE" + ] + } + } + } + } + } + } + } + } + }, + "/v1/verification/email": { + "post": { + "operationId": "startChatEmailVerification", + "security": [ + { + "AnonymousSession": [] + } + ], + "description": "Start or resend an email challenge using the template saved on this session's Website Chat. Repeating the same request_id and payload does not send another email. Codes must never be sent as chat messages.", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "required": [ + "request_id", + "email", + "locale" + ], + "properties": { + "request_id": { + "type": "string", + "format": "uuid" + }, + "email": { + "type": "string", + "format": "email", + "maxLength": 254 + }, + "locale": { + "type": "string", + "enum": [ + "en", + "de" + ] + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Current verification state; pending does not reveal whether an email is registered", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "required": [ + "available", + "conversation_id", + "status" + ], + "properties": { + "available": { + "type": "boolean" + }, + "conversation_id": { + "type": "string", + "format": "uuid" + }, + "status": { + "type": "string", + "enum": [ + "anonymous", + "sending", + "pending", + "verified" + ] + }, + "challenge_id": { + "type": "string", + "format": "uuid" + }, + "code_expires_at": { + "type": "integer", + "description": "Unix seconds" + }, + "resend_after": { + "type": "integer", + "description": "Unix seconds" + }, + "email": { + "type": "string", + "format": "email", + "maxLength": 254 + }, + "contact_resolution": { + "type": "string", + "enum": [ + "matched", + "ambiguous", + "not_found" + ] + } + } + } + } + } + }, + "default": { + "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished Website Chat, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "code" + ], + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_VERIFICATION_CODE", + "VERIFICATION_EXPIRED", + "VERIFICATION_CONFLICT", + "VERIFICATION_DISABLED", + "VERIFICATION_UNAVAILABLE", + "IDENTITY_CHANGED", + "INVALID_REQUEST", + "ORIGIN_DENIED", + "NOT_FOUND", + "INVALID_GRANT", + "SESSION_EXPIRED", + "RATE_LIMITED", + "SESSION_LIMIT", + "USAGE_LIMIT", + "REQUEST_CONFLICT", + "IN_PROGRESS", + "UNAVAILABLE", + "TEMPORARILY_UNAVAILABLE" + ] + } + } + } + } + } + } + } + } + }, + "/v1/verification/code": { + "post": { + "operationId": "verifyChatEmailCode", + "security": [ + { + "AnonymousSession": [] + } + ], + "description": "Verify a code for this session's current challenge. Success binds email proof and contact resolution to this session and starts a new conversation. It grants no account-tool permission.", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "required": [ + "challenge_id", + "code" + ], + "properties": { + "challenge_id": { + "type": "string", + "format": "uuid" + }, + "code": { + "type": "string", + "pattern": "^\\d{6}$" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Verification result; duplicate contacts remain unresolved", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "required": [ + "available", + "conversation_id", + "status" + ], + "properties": { + "available": { + "type": "boolean" + }, + "conversation_id": { + "type": "string", + "format": "uuid" + }, + "status": { + "type": "string", + "enum": [ + "anonymous", + "sending", + "pending", + "verified" + ] + }, + "challenge_id": { + "type": "string", + "format": "uuid" + }, + "code_expires_at": { + "type": "integer", + "description": "Unix seconds" + }, + "resend_after": { + "type": "integer", + "description": "Unix seconds" + }, + "email": { + "type": "string", + "format": "email", + "maxLength": 254 + }, + "contact_resolution": { + "type": "string", + "enum": [ + "matched", + "ambiguous", + "not_found" + ] + } + } + } + } + } + }, + "default": { + "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished Website Chat, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "code" + ], + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_VERIFICATION_CODE", + "VERIFICATION_EXPIRED", + "VERIFICATION_CONFLICT", + "VERIFICATION_DISABLED", + "VERIFICATION_UNAVAILABLE", + "IDENTITY_CHANGED", + "INVALID_REQUEST", + "ORIGIN_DENIED", + "NOT_FOUND", + "INVALID_GRANT", + "SESSION_EXPIRED", + "RATE_LIMITED", + "SESSION_LIMIT", + "USAGE_LIMIT", + "REQUEST_CONFLICT", + "IN_PROGRESS", + "UNAVAILABLE", + "TEMPORARILY_UNAVAILABLE" + ] + } + } + } + } + } + } + } + } + }, + "/v1/verification/cancel": { + "post": { + "operationId": "cancelChatVerification", + "security": [ + { + "AnonymousSession": [] + } + ], + "description": "Cancel a pending challenge or clear verified identity. Clearing verified identity starts a new anonymous conversation. In-flight verification cannot restore the cleared identity.", + "responses": { + "200": { + "description": "Anonymous session state", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "required": [ + "available", + "conversation_id", + "status" + ], + "properties": { + "available": { + "type": "boolean" + }, + "conversation_id": { + "type": "string", + "format": "uuid" + }, + "status": { + "type": "string", + "enum": [ + "anonymous", + "sending", + "pending", + "verified" + ] + }, + "challenge_id": { + "type": "string", + "format": "uuid" + }, + "code_expires_at": { + "type": "integer", + "description": "Unix seconds" + }, + "resend_after": { + "type": "integer", + "description": "Unix seconds" + }, + "email": { + "type": "string", + "format": "email", + "maxLength": 254 + }, + "contact_resolution": { + "type": "string", + "enum": [ + "matched", + "ambiguous", + "not_found" + ] + } + } + } + } + } + }, + "default": { + "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished Website Chat, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "code" + ], + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_VERIFICATION_CODE", + "VERIFICATION_EXPIRED", + "VERIFICATION_CONFLICT", + "VERIFICATION_DISABLED", + "VERIFICATION_UNAVAILABLE", + "IDENTITY_CHANGED", "INVALID_REQUEST", "ORIGIN_DENIED", "NOT_FOUND", @@ -1914,29 +2461,29 @@ "AnonymousSession": { "type": "http", "scheme": "bearer", - "description": "Opaque, expiring anonymous session token; never an epilot user access token." + "description": "Opaque, expiring Chat session token; never an epilot user or Portal access token." } }, "schemas": { - "ListChatWidgetsResponse": { + "ListWebsiteChatsResponse": { "type": "object", "required": [ - "widgets" + "website_chats" ], "properties": { - "widgets": { + "website_chats": { "type": "array", "items": { "type": "object", "required": [ - "widget_id", + "website_chat_id", "org_id", "agent_id", "binding_id", "version", "name", - "website_chat", - "website_chat_embed", + "settings", + "embed", "created_at", "updated_at" ], @@ -1951,7 +2498,7 @@ "format": "uuid", "nullable": true }, - "website_chat": { + "settings": { "type": "object", "additionalProperties": false, "required": [ @@ -1964,7 +2511,7 @@ "type": "array", "maxItems": 50, "uniqueItems": true, - "description": "Exact HTTPS origins. Empty means the widget cannot start sessions.", + "description": "Exact HTTPS origins. Empty means the Website Chat cannot start sessions.", "items": { "type": "string", "maxLength": 2048 @@ -1986,7 +2533,7 @@ "type": "string", "format": "uuid", "nullable": true, - "description": "Design Builder configuration for the widget only." + "description": "Design Builder configuration for the Website Chat only." }, "authentication": { "type": "object", @@ -2012,7 +2559,7 @@ } } }, - "widget_id": { + "website_chat_id": { "type": "string", "format": "uuid", "readOnly": true, @@ -2043,7 +2590,7 @@ "format": "date-time", "readOnly": true }, - "website_chat_embed": { + "embed": { "type": "object", "readOnly": true, "required": [ @@ -2074,17 +2621,17 @@ } } }, - "ChatWidget": { + "WebsiteChat": { "type": "object", "required": [ - "widget_id", + "website_chat_id", "org_id", "agent_id", "binding_id", "version", "name", - "website_chat", - "website_chat_embed", + "settings", + "embed", "created_at", "updated_at" ], @@ -2099,7 +2646,7 @@ "format": "uuid", "nullable": true }, - "website_chat": { + "settings": { "type": "object", "additionalProperties": false, "required": [ @@ -2112,7 +2659,7 @@ "type": "array", "maxItems": 50, "uniqueItems": true, - "description": "Exact HTTPS origins. Empty means the widget cannot start sessions.", + "description": "Exact HTTPS origins. Empty means the Website Chat cannot start sessions.", "items": { "type": "string", "maxLength": 2048 @@ -2134,7 +2681,7 @@ "type": "string", "format": "uuid", "nullable": true, - "description": "Design Builder configuration for the widget only." + "description": "Design Builder configuration for the Website Chat only." }, "authentication": { "type": "object", @@ -2160,7 +2707,7 @@ } } }, - "widget_id": { + "website_chat_id": { "type": "string", "format": "uuid", "readOnly": true, @@ -2191,7 +2738,7 @@ "format": "date-time", "readOnly": true }, - "website_chat_embed": { + "embed": { "type": "object", "readOnly": true, "required": [ @@ -2229,7 +2776,7 @@ "type": "array", "maxItems": 50, "uniqueItems": true, - "description": "Exact HTTPS origins. Empty means the widget cannot start sessions.", + "description": "Exact HTTPS origins. Empty means the Website Chat cannot start sessions.", "items": { "type": "string", "maxLength": 2048 @@ -2251,7 +2798,7 @@ "type": "string", "format": "uuid", "nullable": true, - "description": "Design Builder configuration for the widget only." + "description": "Design Builder configuration for the Website Chat only." }, "authentication": { "type": "object", @@ -2291,13 +2838,13 @@ } } }, - "CreateChatWidgetRequest": { + "CreateWebsiteChatRequest": { "type": "object", "additionalProperties": false, "required": [ "name", "agent_id", - "website_chat" + "settings" ], "properties": { "name": { @@ -2310,7 +2857,7 @@ "format": "uuid", "nullable": true }, - "website_chat": { + "settings": { "type": "object", "additionalProperties": false, "required": [ @@ -2323,7 +2870,7 @@ "type": "array", "maxItems": 50, "uniqueItems": true, - "description": "Exact HTTPS origins. Empty means the widget cannot start sessions.", + "description": "Exact HTTPS origins. Empty means the Website Chat cannot start sessions.", "items": { "type": "string", "maxLength": 2048 @@ -2345,7 +2892,7 @@ "type": "string", "format": "uuid", "nullable": true, - "description": "Design Builder configuration for the widget only." + "description": "Design Builder configuration for the Website Chat only." }, "authentication": { "type": "object", @@ -2373,7 +2920,7 @@ } } }, - "UpdateChatWidgetRequest": { + "UpdateWebsiteChatRequest": { "type": "object", "additionalProperties": false, "required": [ @@ -2390,7 +2937,7 @@ "format": "uuid", "nullable": true }, - "website_chat": { + "settings": { "type": "object", "additionalProperties": false, "required": [ @@ -2403,7 +2950,7 @@ "type": "array", "maxItems": 50, "uniqueItems": true, - "description": "Exact HTTPS origins. Empty means the widget cannot start sessions.", + "description": "Exact HTTPS origins. Empty means the Website Chat cannot start sessions.", "items": { "type": "string", "maxLength": 2048 @@ -2425,7 +2972,7 @@ "type": "string", "format": "uuid", "nullable": true, - "description": "Design Builder configuration for the widget only." + "description": "Design Builder configuration for the Website Chat only." }, "authentication": { "type": "object", @@ -2458,7 +3005,59 @@ } } }, - "Widget": { + "VerificationState": { + "type": "object", + "additionalProperties": false, + "required": [ + "available", + "conversation_id", + "status" + ], + "properties": { + "available": { + "type": "boolean" + }, + "conversation_id": { + "type": "string", + "format": "uuid" + }, + "status": { + "type": "string", + "enum": [ + "anonymous", + "sending", + "pending", + "verified" + ] + }, + "challenge_id": { + "type": "string", + "format": "uuid" + }, + "code_expires_at": { + "type": "integer", + "description": "Unix seconds" + }, + "resend_after": { + "type": "integer", + "description": "Unix seconds" + }, + "email": { + "type": "string", + "format": "email", + "maxLength": 254 + }, + "contact_resolution": { + "type": "string", + "enum": [ + "matched", + "ambiguous", + "not_found" + ] + } + } + }, + "PublicWebsiteChat": { "type": "object", "required": [ "key", @@ -2484,6 +3083,18 @@ "de" ] }, + "authentication": { + "type": "object", + "additionalProperties": false, + "required": [ + "email_code" + ], + "properties": { + "email_code": { + "type": "boolean" + } + } + }, "design": { "type": "object", "additionalProperties": false, @@ -2629,7 +3240,7 @@ } } }, - "WidgetDesign": { + "WebsiteChatDesign": { "type": "object", "additionalProperties": false, "properties": { @@ -2854,6 +3465,12 @@ "code": { "type": "string", "enum": [ + "INVALID_VERIFICATION_CODE", + "VERIFICATION_EXPIRED", + "VERIFICATION_CONFLICT", + "VERIFICATION_DISABLED", + "VERIFICATION_UNAVAILABLE", + "IDENTITY_CHANGED", "INVALID_REQUEST", "ORIGIN_DENIED", "NOT_FOUND", @@ -2873,7 +3490,7 @@ }, "responses": { "Error": { - "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished widget, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", + "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished Website Chat, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", "content": { "application/json": { "schema": { @@ -2885,6 +3502,12 @@ "code": { "type": "string", "enum": [ + "INVALID_VERIFICATION_CODE", + "VERIFICATION_EXPIRED", + "VERIFICATION_CONFLICT", + "VERIFICATION_DISABLED", + "VERIFICATION_UNAVAILABLE", + "IDENTITY_CHANGED", "INVALID_REQUEST", "ORIGIN_DENIED", "NOT_FOUND", diff --git a/clients/chat-client/update-openapi.cjs b/clients/chat-client/update-openapi.cjs index e13e51c92..1949ab414 100644 --- a/clients/chat-client/update-openapi.cjs +++ b/clients/chat-client/update-openapi.cjs @@ -8,7 +8,7 @@ const { resolve, join } = require('node:path'); const serviceDir = process.argv[2]; if (!serviceDir) throw new Error('Usage: npm run openapi -- /path/to/chat-api'); const read = (path) => JSON.parse(readFileSync(resolve(serviceDir, path), 'utf8')); -const management = read('lambda/ApiHandlerFunction/src/widgets/definition.json'); +const management = read('lambda/ApiHandlerFunction/src/website-chats/definition.json'); const publicApi = read('lambda/ApiHandlerFunction/src/openapi/definition.json'); // Both documents define Error with different payloads. Preserve the public error @@ -41,7 +41,11 @@ for (const key of new Set([...Object.keys(management.components), ...Object.keys } const definition = { ...management, - info: { ...management.info, title: 'epilot Chat API', description: 'Widget management and anonymous browser chat.' }, + info: { + ...management.info, + title: 'epilot Chat API', + description: 'Website Chat management and anonymous browser chat.', + }, paths: mergeUnique(management.paths, publicApi.paths), components, }; diff --git a/packages/cli/definitions/chat.json b/packages/cli/definitions/chat.json index 7be35da83..dcff3b08a 100644 --- a/packages/cli/definitions/chat.json +++ b/packages/cli/definitions/chat.json @@ -3,7 +3,7 @@ "info": { "title": "epilot Chat API", "version": "0.1.0", - "description": "Widget management and anonymous browser chat." + "description": "Website Chat management and anonymous browser chat." }, "servers": [ { @@ -16,12 +16,12 @@ } ], "paths": { - "/v1/widgets": { + "/v1/website-chats": { "get": { "tags": [ - "Chat widgets" + "Website Chats" ], - "operationId": "listChatWidgets", + "operationId": "listWebsiteChats", "security": [ { "EpilotAuth": [] @@ -29,28 +29,28 @@ ], "responses": { "200": { - "description": "Widget response", + "description": "Website Chat response", "content": { "application/json": { "schema": { "type": "object", "required": [ - "widgets" + "website_chats" ], "properties": { - "widgets": { + "website_chats": { "type": "array", "items": { "type": "object", "required": [ - "widget_id", + "website_chat_id", "org_id", "agent_id", "binding_id", "version", "name", - "website_chat", - "website_chat_embed", + "settings", + "embed", "created_at", "updated_at" ], @@ -65,7 +65,7 @@ "format": "uuid", "nullable": true }, - "website_chat": { + "settings": { "type": "object", "additionalProperties": false, "required": [ @@ -78,7 +78,7 @@ "type": "array", "maxItems": 50, "uniqueItems": true, - "description": "Exact HTTPS origins. Empty means the widget cannot start sessions.", + "description": "Exact HTTPS origins. Empty means the Website Chat cannot start sessions.", "items": { "type": "string", "maxLength": 2048 @@ -100,7 +100,7 @@ "type": "string", "format": "uuid", "nullable": true, - "description": "Design Builder configuration for the widget only." + "description": "Design Builder configuration for the Website Chat only." }, "authentication": { "type": "object", @@ -126,7 +126,7 @@ } } }, - "widget_id": { + "website_chat_id": { "type": "string", "format": "uuid", "readOnly": true, @@ -157,7 +157,7 @@ "format": "date-time", "readOnly": true }, - "website_chat_embed": { + "embed": { "type": "object", "readOnly": true, "required": [ @@ -192,7 +192,7 @@ } }, "400": { - "description": "Invalid widget settings", + "description": "Invalid Website Chat settings", "content": { "application/json": { "schema": { @@ -213,7 +213,7 @@ } }, "404": { - "description": "Widget not found in this organisation", + "description": "Website Chat not found in this organisation", "content": { "application/json": { "schema": { @@ -234,7 +234,7 @@ } }, "409": { - "description": "Widget or assigned agent changed; reload before retrying", + "description": "Website Chat or assigned agent changed; reload before retrying", "content": { "application/json": { "schema": { @@ -268,9 +268,9 @@ }, "post": { "tags": [ - "Chat widgets" + "Website Chats" ], - "operationId": "createChatWidget", + "operationId": "createWebsiteChat", "security": [ { "EpilotAuth": [] @@ -278,20 +278,20 @@ ], "responses": { "201": { - "description": "Widget response", + "description": "Website Chat response", "content": { "application/json": { "schema": { "type": "object", "required": [ - "widget_id", + "website_chat_id", "org_id", "agent_id", "binding_id", "version", "name", - "website_chat", - "website_chat_embed", + "settings", + "embed", "created_at", "updated_at" ], @@ -306,7 +306,7 @@ "format": "uuid", "nullable": true }, - "website_chat": { + "settings": { "type": "object", "additionalProperties": false, "required": [ @@ -319,7 +319,7 @@ "type": "array", "maxItems": 50, "uniqueItems": true, - "description": "Exact HTTPS origins. Empty means the widget cannot start sessions.", + "description": "Exact HTTPS origins. Empty means the Website Chat cannot start sessions.", "items": { "type": "string", "maxLength": 2048 @@ -341,7 +341,7 @@ "type": "string", "format": "uuid", "nullable": true, - "description": "Design Builder configuration for the widget only." + "description": "Design Builder configuration for the Website Chat only." }, "authentication": { "type": "object", @@ -367,7 +367,7 @@ } } }, - "widget_id": { + "website_chat_id": { "type": "string", "format": "uuid", "readOnly": true, @@ -398,7 +398,7 @@ "format": "date-time", "readOnly": true }, - "website_chat_embed": { + "embed": { "type": "object", "readOnly": true, "required": [ @@ -427,7 +427,7 @@ } }, "400": { - "description": "Invalid widget settings", + "description": "Invalid Website Chat settings", "content": { "application/json": { "schema": { @@ -448,7 +448,7 @@ } }, "404": { - "description": "Widget not found in this organisation", + "description": "Website Chat not found in this organisation", "content": { "application/json": { "schema": { @@ -469,7 +469,7 @@ } }, "409": { - "description": "Widget or assigned agent changed; reload before retrying", + "description": "Website Chat or assigned agent changed; reload before retrying", "content": { "application/json": { "schema": { @@ -500,7 +500,7 @@ "required": [ "name", "agent_id", - "website_chat" + "settings" ], "properties": { "name": { @@ -513,7 +513,7 @@ "format": "uuid", "nullable": true }, - "website_chat": { + "settings": { "type": "object", "additionalProperties": false, "required": [ @@ -526,7 +526,7 @@ "type": "array", "maxItems": 50, "uniqueItems": true, - "description": "Exact HTTPS origins. Empty means the widget cannot start sessions.", + "description": "Exact HTTPS origins. Empty means the Website Chat cannot start sessions.", "items": { "type": "string", "maxLength": 2048 @@ -548,7 +548,7 @@ "type": "string", "format": "uuid", "nullable": true, - "description": "Design Builder configuration for the widget only." + "description": "Design Builder configuration for the Website Chat only." }, "authentication": { "type": "object", @@ -581,11 +581,11 @@ } } }, - "/v1/widgets/{widget_id}": { + "/v1/website-chats/{website_chat_id}": { "parameters": [ { "in": "path", - "name": "widget_id", + "name": "website_chat_id", "required": true, "schema": { "type": "string", @@ -595,9 +595,9 @@ ], "get": { "tags": [ - "Chat widgets" + "Website Chats" ], - "operationId": "getChatWidget", + "operationId": "getWebsiteChat", "security": [ { "EpilotAuth": [] @@ -605,20 +605,20 @@ ], "responses": { "200": { - "description": "Widget response", + "description": "Website Chat response", "content": { "application/json": { "schema": { "type": "object", "required": [ - "widget_id", + "website_chat_id", "org_id", "agent_id", "binding_id", "version", "name", - "website_chat", - "website_chat_embed", + "settings", + "embed", "created_at", "updated_at" ], @@ -633,7 +633,7 @@ "format": "uuid", "nullable": true }, - "website_chat": { + "settings": { "type": "object", "additionalProperties": false, "required": [ @@ -646,7 +646,7 @@ "type": "array", "maxItems": 50, "uniqueItems": true, - "description": "Exact HTTPS origins. Empty means the widget cannot start sessions.", + "description": "Exact HTTPS origins. Empty means the Website Chat cannot start sessions.", "items": { "type": "string", "maxLength": 2048 @@ -668,7 +668,7 @@ "type": "string", "format": "uuid", "nullable": true, - "description": "Design Builder configuration for the widget only." + "description": "Design Builder configuration for the Website Chat only." }, "authentication": { "type": "object", @@ -694,7 +694,7 @@ } } }, - "widget_id": { + "website_chat_id": { "type": "string", "format": "uuid", "readOnly": true, @@ -725,7 +725,7 @@ "format": "date-time", "readOnly": true }, - "website_chat_embed": { + "embed": { "type": "object", "readOnly": true, "required": [ @@ -754,7 +754,7 @@ } }, "400": { - "description": "Invalid widget settings", + "description": "Invalid Website Chat settings", "content": { "application/json": { "schema": { @@ -775,7 +775,7 @@ } }, "404": { - "description": "Widget not found in this organisation", + "description": "Website Chat not found in this organisation", "content": { "application/json": { "schema": { @@ -796,7 +796,7 @@ } }, "409": { - "description": "Widget or assigned agent changed; reload before retrying", + "description": "Website Chat or assigned agent changed; reload before retrying", "content": { "application/json": { "schema": { @@ -820,9 +820,9 @@ }, "put": { "tags": [ - "Chat widgets" + "Website Chats" ], - "operationId": "updateChatWidget", + "operationId": "updateWebsiteChat", "security": [ { "EpilotAuth": [] @@ -830,20 +830,20 @@ ], "responses": { "200": { - "description": "Widget response", + "description": "Website Chat response", "content": { "application/json": { "schema": { "type": "object", "required": [ - "widget_id", + "website_chat_id", "org_id", "agent_id", "binding_id", "version", "name", - "website_chat", - "website_chat_embed", + "settings", + "embed", "created_at", "updated_at" ], @@ -858,7 +858,7 @@ "format": "uuid", "nullable": true }, - "website_chat": { + "settings": { "type": "object", "additionalProperties": false, "required": [ @@ -871,7 +871,7 @@ "type": "array", "maxItems": 50, "uniqueItems": true, - "description": "Exact HTTPS origins. Empty means the widget cannot start sessions.", + "description": "Exact HTTPS origins. Empty means the Website Chat cannot start sessions.", "items": { "type": "string", "maxLength": 2048 @@ -893,7 +893,7 @@ "type": "string", "format": "uuid", "nullable": true, - "description": "Design Builder configuration for the widget only." + "description": "Design Builder configuration for the Website Chat only." }, "authentication": { "type": "object", @@ -919,7 +919,7 @@ } } }, - "widget_id": { + "website_chat_id": { "type": "string", "format": "uuid", "readOnly": true, @@ -950,7 +950,7 @@ "format": "date-time", "readOnly": true }, - "website_chat_embed": { + "embed": { "type": "object", "readOnly": true, "required": [ @@ -979,7 +979,7 @@ } }, "400": { - "description": "Invalid widget settings", + "description": "Invalid Website Chat settings", "content": { "application/json": { "schema": { @@ -1000,7 +1000,7 @@ } }, "404": { - "description": "Widget not found in this organisation", + "description": "Website Chat not found in this organisation", "content": { "application/json": { "schema": { @@ -1021,7 +1021,7 @@ } }, "409": { - "description": "Widget or assigned agent changed; reload before retrying", + "description": "Website Chat or assigned agent changed; reload before retrying", "content": { "application/json": { "schema": { @@ -1063,7 +1063,7 @@ "format": "uuid", "nullable": true }, - "website_chat": { + "settings": { "type": "object", "additionalProperties": false, "required": [ @@ -1076,7 +1076,7 @@ "type": "array", "maxItems": 50, "uniqueItems": true, - "description": "Exact HTTPS origins. Empty means the widget cannot start sessions.", + "description": "Exact HTTPS origins. Empty means the Website Chat cannot start sessions.", "items": { "type": "string", "maxLength": 2048 @@ -1098,7 +1098,7 @@ "type": "string", "format": "uuid", "nullable": true, - "description": "Design Builder configuration for the widget only." + "description": "Design Builder configuration for the Website Chat only." }, "authentication": { "type": "object", @@ -1137,9 +1137,9 @@ }, "delete": { "tags": [ - "Chat widgets" + "Website Chats" ], - "operationId": "deleteChatWidget", + "operationId": "deleteWebsiteChat", "security": [ { "EpilotAuth": [] @@ -1147,10 +1147,10 @@ ], "responses": { "204": { - "description": "Widget deleted" + "description": "Website Chat deleted" }, "400": { - "description": "Invalid widget settings", + "description": "Invalid Website Chat settings", "content": { "application/json": { "schema": { @@ -1171,7 +1171,7 @@ } }, "404": { - "description": "Widget not found in this organisation", + "description": "Website Chat not found in this organisation", "content": { "application/json": { "schema": { @@ -1192,7 +1192,7 @@ } }, "409": { - "description": "Widget or assigned agent changed; reload before retrying", + "description": "Website Chat or assigned agent changed; reload before retrying", "content": { "application/json": { "schema": { @@ -1226,15 +1226,15 @@ ] } }, - "/v1/widgets/{widget_id}/configuration": { + "/v1/website-chats/{website_chat_id}/configuration": { "get": { - "operationId": "getPublicChatWidget", - "description": "Resolve visitor-facing configuration for an independent widget and its current agent assignment. The widget ID is not an organisation ID or a destination such as website or portal.", + "operationId": "getPublicWebsiteChat", + "description": "Resolve visitor-facing configuration for an independent Website Chat and its current agent assignment. The Website Chat ID is not an organisation ID or a destination such as website or portal.", "parameters": [ { "in": "path", - "name": "widget_id", - "description": "Public widget ID, also used as widget_key in bootstrap and data-epilot-chat in the embed.", + "name": "website_chat_id", + "description": "Public Website Chat ID, also used as website_chat_id in bootstrap and data-epilot-chat in the embed.", "example": "550e8400-e29b-41d4-a716-446655440000", "required": true, "schema": { @@ -1274,6 +1274,18 @@ "de" ] }, + "authentication": { + "type": "object", + "additionalProperties": false, + "required": [ + "email_code" + ], + "properties": { + "email_code": { + "type": "boolean" + } + } + }, "design": { "type": "object", "additionalProperties": false, @@ -1423,7 +1435,7 @@ } }, "default": { - "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished widget, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", + "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished Website Chat, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", "content": { "application/json": { "schema": { @@ -1435,6 +1447,12 @@ "code": { "type": "string", "enum": [ + "INVALID_VERIFICATION_CODE", + "VERIFICATION_EXPIRED", + "VERIFICATION_CONFLICT", + "VERIFICATION_DISABLED", + "VERIFICATION_UNAVAILABLE", + "IDENTITY_CHANGED", "INVALID_REQUEST", "ORIGIN_DENIED", "NOT_FOUND", @@ -1461,7 +1479,7 @@ "/v1/bootstrap": { "post": { "operationId": "createPublicChatGrant", - "description": "Called by the host website with its widget_key. Checks the saved website origin allowlist and issues a single-use grant for the iframe to exchange at POST /v1/sessions within 60 seconds. This deadline does not limit the resulting session.", + "description": "Called by the host website with its website_chat_id. Checks the saved website origin allowlist and issues a single-use grant for the iframe to exchange at POST /v1/sessions within 60 seconds. This deadline does not limit the resulting session.", "requestBody": { "required": true, "content": { @@ -1470,10 +1488,10 @@ "type": "object", "additionalProperties": false, "required": [ - "widget_key" + "website_chat_id" ], "properties": { - "widget_key": { + "website_chat_id": { "type": "string", "pattern": "^[a-zA-Z0-9_-]{1,100}$" } @@ -1492,7 +1510,7 @@ "required": [ "grant", "expires_in", - "widget_origin" + "frame_origin" ], "properties": { "grant": { @@ -1502,7 +1520,7 @@ "type": "integer", "example": 60 }, - "widget_origin": { + "frame_origin": { "type": "string", "format": "uri" } @@ -1512,7 +1530,7 @@ } }, "default": { - "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished widget, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", + "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished Website Chat, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", "content": { "application/json": { "schema": { @@ -1524,6 +1542,12 @@ "code": { "type": "string", "enum": [ + "INVALID_VERIFICATION_CODE", + "VERIFICATION_EXPIRED", + "VERIFICATION_CONFLICT", + "VERIFICATION_DISABLED", + "VERIFICATION_UNAVAILABLE", + "IDENTITY_CHANGED", "INVALID_REQUEST", "ORIGIN_DENIED", "NOT_FOUND", @@ -1582,7 +1606,7 @@ "token", "conversation_id", "expires_at", - "widget" + "website_chat" ], "properties": { "token": { @@ -1596,7 +1620,7 @@ "type": "integer", "description": "Unix seconds" }, - "widget": { + "website_chat": { "type": "object", "required": [ "key", @@ -1622,6 +1646,18 @@ "de" ] }, + "authentication": { + "type": "object", + "additionalProperties": false, + "required": [ + "email_code" + ], + "properties": { + "email_code": { + "type": "boolean" + } + } + }, "design": { "type": "object", "additionalProperties": false, @@ -1773,7 +1809,7 @@ } }, "default": { - "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished widget, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", + "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished Website Chat, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", "content": { "application/json": { "schema": { @@ -1785,6 +1821,12 @@ "code": { "type": "string", "enum": [ + "INVALID_VERIFICATION_CODE", + "VERIFICATION_EXPIRED", + "VERIFICATION_CONFLICT", + "VERIFICATION_DISABLED", + "VERIFICATION_UNAVAILABLE", + "IDENTITY_CHANGED", "INVALID_REQUEST", "ORIGIN_DENIED", "NOT_FOUND", @@ -1870,7 +1912,7 @@ } }, "default": { - "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished widget, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", + "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished Website Chat, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", "content": { "application/json": { "schema": { @@ -1882,6 +1924,511 @@ "code": { "type": "string", "enum": [ + "INVALID_VERIFICATION_CODE", + "VERIFICATION_EXPIRED", + "VERIFICATION_CONFLICT", + "VERIFICATION_DISABLED", + "VERIFICATION_UNAVAILABLE", + "IDENTITY_CHANGED", + "INVALID_REQUEST", + "ORIGIN_DENIED", + "NOT_FOUND", + "INVALID_GRANT", + "SESSION_EXPIRED", + "RATE_LIMITED", + "SESSION_LIMIT", + "USAGE_LIMIT", + "REQUEST_CONFLICT", + "IN_PROGRESS", + "UNAVAILABLE", + "TEMPORARILY_UNAVAILABLE" + ] + } + } + } + } + } + } + } + } + }, + "/v1/verification": { + "get": { + "operationId": "getChatVerification", + "security": [ + { + "AnonymousSession": [] + } + ], + "description": "Read this session's verification state. No contact IDs or candidate records are exposed.", + "responses": { + "200": { + "description": "Current verification state", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "required": [ + "available", + "conversation_id", + "status" + ], + "properties": { + "available": { + "type": "boolean" + }, + "conversation_id": { + "type": "string", + "format": "uuid" + }, + "status": { + "type": "string", + "enum": [ + "anonymous", + "sending", + "pending", + "verified" + ] + }, + "challenge_id": { + "type": "string", + "format": "uuid" + }, + "code_expires_at": { + "type": "integer", + "description": "Unix seconds" + }, + "resend_after": { + "type": "integer", + "description": "Unix seconds" + }, + "email": { + "type": "string", + "format": "email", + "maxLength": 254 + }, + "contact_resolution": { + "type": "string", + "enum": [ + "matched", + "ambiguous", + "not_found" + ] + } + } + } + } + } + }, + "default": { + "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished Website Chat, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "code" + ], + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_VERIFICATION_CODE", + "VERIFICATION_EXPIRED", + "VERIFICATION_CONFLICT", + "VERIFICATION_DISABLED", + "VERIFICATION_UNAVAILABLE", + "IDENTITY_CHANGED", + "INVALID_REQUEST", + "ORIGIN_DENIED", + "NOT_FOUND", + "INVALID_GRANT", + "SESSION_EXPIRED", + "RATE_LIMITED", + "SESSION_LIMIT", + "USAGE_LIMIT", + "REQUEST_CONFLICT", + "IN_PROGRESS", + "UNAVAILABLE", + "TEMPORARILY_UNAVAILABLE" + ] + } + } + } + } + } + } + } + } + }, + "/v1/verification/email": { + "post": { + "operationId": "startChatEmailVerification", + "security": [ + { + "AnonymousSession": [] + } + ], + "description": "Start or resend an email challenge using the template saved on this session's Website Chat. Repeating the same request_id and payload does not send another email. Codes must never be sent as chat messages.", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "required": [ + "request_id", + "email", + "locale" + ], + "properties": { + "request_id": { + "type": "string", + "format": "uuid" + }, + "email": { + "type": "string", + "format": "email", + "maxLength": 254 + }, + "locale": { + "type": "string", + "enum": [ + "en", + "de" + ] + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Current verification state; pending does not reveal whether an email is registered", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "required": [ + "available", + "conversation_id", + "status" + ], + "properties": { + "available": { + "type": "boolean" + }, + "conversation_id": { + "type": "string", + "format": "uuid" + }, + "status": { + "type": "string", + "enum": [ + "anonymous", + "sending", + "pending", + "verified" + ] + }, + "challenge_id": { + "type": "string", + "format": "uuid" + }, + "code_expires_at": { + "type": "integer", + "description": "Unix seconds" + }, + "resend_after": { + "type": "integer", + "description": "Unix seconds" + }, + "email": { + "type": "string", + "format": "email", + "maxLength": 254 + }, + "contact_resolution": { + "type": "string", + "enum": [ + "matched", + "ambiguous", + "not_found" + ] + } + } + } + } + } + }, + "default": { + "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished Website Chat, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "code" + ], + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_VERIFICATION_CODE", + "VERIFICATION_EXPIRED", + "VERIFICATION_CONFLICT", + "VERIFICATION_DISABLED", + "VERIFICATION_UNAVAILABLE", + "IDENTITY_CHANGED", + "INVALID_REQUEST", + "ORIGIN_DENIED", + "NOT_FOUND", + "INVALID_GRANT", + "SESSION_EXPIRED", + "RATE_LIMITED", + "SESSION_LIMIT", + "USAGE_LIMIT", + "REQUEST_CONFLICT", + "IN_PROGRESS", + "UNAVAILABLE", + "TEMPORARILY_UNAVAILABLE" + ] + } + } + } + } + } + } + } + } + }, + "/v1/verification/code": { + "post": { + "operationId": "verifyChatEmailCode", + "security": [ + { + "AnonymousSession": [] + } + ], + "description": "Verify a code for this session's current challenge. Success binds email proof and contact resolution to this session and starts a new conversation. It grants no account-tool permission.", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "required": [ + "challenge_id", + "code" + ], + "properties": { + "challenge_id": { + "type": "string", + "format": "uuid" + }, + "code": { + "type": "string", + "pattern": "^\\d{6}$" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Verification result; duplicate contacts remain unresolved", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "required": [ + "available", + "conversation_id", + "status" + ], + "properties": { + "available": { + "type": "boolean" + }, + "conversation_id": { + "type": "string", + "format": "uuid" + }, + "status": { + "type": "string", + "enum": [ + "anonymous", + "sending", + "pending", + "verified" + ] + }, + "challenge_id": { + "type": "string", + "format": "uuid" + }, + "code_expires_at": { + "type": "integer", + "description": "Unix seconds" + }, + "resend_after": { + "type": "integer", + "description": "Unix seconds" + }, + "email": { + "type": "string", + "format": "email", + "maxLength": 254 + }, + "contact_resolution": { + "type": "string", + "enum": [ + "matched", + "ambiguous", + "not_found" + ] + } + } + } + } + } + }, + "default": { + "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished Website Chat, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "code" + ], + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_VERIFICATION_CODE", + "VERIFICATION_EXPIRED", + "VERIFICATION_CONFLICT", + "VERIFICATION_DISABLED", + "VERIFICATION_UNAVAILABLE", + "IDENTITY_CHANGED", + "INVALID_REQUEST", + "ORIGIN_DENIED", + "NOT_FOUND", + "INVALID_GRANT", + "SESSION_EXPIRED", + "RATE_LIMITED", + "SESSION_LIMIT", + "USAGE_LIMIT", + "REQUEST_CONFLICT", + "IN_PROGRESS", + "UNAVAILABLE", + "TEMPORARILY_UNAVAILABLE" + ] + } + } + } + } + } + } + } + } + }, + "/v1/verification/cancel": { + "post": { + "operationId": "cancelChatVerification", + "security": [ + { + "AnonymousSession": [] + } + ], + "description": "Cancel a pending challenge or clear verified identity. Clearing verified identity starts a new anonymous conversation. In-flight verification cannot restore the cleared identity.", + "responses": { + "200": { + "description": "Anonymous session state", + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": false, + "required": [ + "available", + "conversation_id", + "status" + ], + "properties": { + "available": { + "type": "boolean" + }, + "conversation_id": { + "type": "string", + "format": "uuid" + }, + "status": { + "type": "string", + "enum": [ + "anonymous", + "sending", + "pending", + "verified" + ] + }, + "challenge_id": { + "type": "string", + "format": "uuid" + }, + "code_expires_at": { + "type": "integer", + "description": "Unix seconds" + }, + "resend_after": { + "type": "integer", + "description": "Unix seconds" + }, + "email": { + "type": "string", + "format": "email", + "maxLength": 254 + }, + "contact_resolution": { + "type": "string", + "enum": [ + "matched", + "ambiguous", + "not_found" + ] + } + } + } + } + } + }, + "default": { + "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished Website Chat, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "code" + ], + "properties": { + "code": { + "type": "string", + "enum": [ + "INVALID_VERIFICATION_CODE", + "VERIFICATION_EXPIRED", + "VERIFICATION_CONFLICT", + "VERIFICATION_DISABLED", + "VERIFICATION_UNAVAILABLE", + "IDENTITY_CHANGED", "INVALID_REQUEST", "ORIGIN_DENIED", "NOT_FOUND", @@ -1914,29 +2461,29 @@ "AnonymousSession": { "type": "http", "scheme": "bearer", - "description": "Opaque, expiring anonymous session token; never an epilot user access token." + "description": "Opaque, expiring Chat session token; never an epilot user or Portal access token." } }, "schemas": { - "ListChatWidgetsResponse": { + "ListWebsiteChatsResponse": { "type": "object", "required": [ - "widgets" + "website_chats" ], "properties": { - "widgets": { + "website_chats": { "type": "array", "items": { "type": "object", "required": [ - "widget_id", + "website_chat_id", "org_id", "agent_id", "binding_id", "version", "name", - "website_chat", - "website_chat_embed", + "settings", + "embed", "created_at", "updated_at" ], @@ -1951,7 +2498,7 @@ "format": "uuid", "nullable": true }, - "website_chat": { + "settings": { "type": "object", "additionalProperties": false, "required": [ @@ -1964,7 +2511,7 @@ "type": "array", "maxItems": 50, "uniqueItems": true, - "description": "Exact HTTPS origins. Empty means the widget cannot start sessions.", + "description": "Exact HTTPS origins. Empty means the Website Chat cannot start sessions.", "items": { "type": "string", "maxLength": 2048 @@ -1986,7 +2533,7 @@ "type": "string", "format": "uuid", "nullable": true, - "description": "Design Builder configuration for the widget only." + "description": "Design Builder configuration for the Website Chat only." }, "authentication": { "type": "object", @@ -2012,7 +2559,7 @@ } } }, - "widget_id": { + "website_chat_id": { "type": "string", "format": "uuid", "readOnly": true, @@ -2043,7 +2590,7 @@ "format": "date-time", "readOnly": true }, - "website_chat_embed": { + "embed": { "type": "object", "readOnly": true, "required": [ @@ -2074,17 +2621,17 @@ } } }, - "ChatWidget": { + "WebsiteChat": { "type": "object", "required": [ - "widget_id", + "website_chat_id", "org_id", "agent_id", "binding_id", "version", "name", - "website_chat", - "website_chat_embed", + "settings", + "embed", "created_at", "updated_at" ], @@ -2099,7 +2646,7 @@ "format": "uuid", "nullable": true }, - "website_chat": { + "settings": { "type": "object", "additionalProperties": false, "required": [ @@ -2112,7 +2659,7 @@ "type": "array", "maxItems": 50, "uniqueItems": true, - "description": "Exact HTTPS origins. Empty means the widget cannot start sessions.", + "description": "Exact HTTPS origins. Empty means the Website Chat cannot start sessions.", "items": { "type": "string", "maxLength": 2048 @@ -2134,7 +2681,7 @@ "type": "string", "format": "uuid", "nullable": true, - "description": "Design Builder configuration for the widget only." + "description": "Design Builder configuration for the Website Chat only." }, "authentication": { "type": "object", @@ -2160,7 +2707,7 @@ } } }, - "widget_id": { + "website_chat_id": { "type": "string", "format": "uuid", "readOnly": true, @@ -2191,7 +2738,7 @@ "format": "date-time", "readOnly": true }, - "website_chat_embed": { + "embed": { "type": "object", "readOnly": true, "required": [ @@ -2229,7 +2776,7 @@ "type": "array", "maxItems": 50, "uniqueItems": true, - "description": "Exact HTTPS origins. Empty means the widget cannot start sessions.", + "description": "Exact HTTPS origins. Empty means the Website Chat cannot start sessions.", "items": { "type": "string", "maxLength": 2048 @@ -2251,7 +2798,7 @@ "type": "string", "format": "uuid", "nullable": true, - "description": "Design Builder configuration for the widget only." + "description": "Design Builder configuration for the Website Chat only." }, "authentication": { "type": "object", @@ -2291,13 +2838,13 @@ } } }, - "CreateChatWidgetRequest": { + "CreateWebsiteChatRequest": { "type": "object", "additionalProperties": false, "required": [ "name", "agent_id", - "website_chat" + "settings" ], "properties": { "name": { @@ -2310,7 +2857,7 @@ "format": "uuid", "nullable": true }, - "website_chat": { + "settings": { "type": "object", "additionalProperties": false, "required": [ @@ -2323,7 +2870,7 @@ "type": "array", "maxItems": 50, "uniqueItems": true, - "description": "Exact HTTPS origins. Empty means the widget cannot start sessions.", + "description": "Exact HTTPS origins. Empty means the Website Chat cannot start sessions.", "items": { "type": "string", "maxLength": 2048 @@ -2345,7 +2892,7 @@ "type": "string", "format": "uuid", "nullable": true, - "description": "Design Builder configuration for the widget only." + "description": "Design Builder configuration for the Website Chat only." }, "authentication": { "type": "object", @@ -2373,7 +2920,7 @@ } } }, - "UpdateChatWidgetRequest": { + "UpdateWebsiteChatRequest": { "type": "object", "additionalProperties": false, "required": [ @@ -2390,7 +2937,7 @@ "format": "uuid", "nullable": true }, - "website_chat": { + "settings": { "type": "object", "additionalProperties": false, "required": [ @@ -2403,7 +2950,7 @@ "type": "array", "maxItems": 50, "uniqueItems": true, - "description": "Exact HTTPS origins. Empty means the widget cannot start sessions.", + "description": "Exact HTTPS origins. Empty means the Website Chat cannot start sessions.", "items": { "type": "string", "maxLength": 2048 @@ -2425,7 +2972,7 @@ "type": "string", "format": "uuid", "nullable": true, - "description": "Design Builder configuration for the widget only." + "description": "Design Builder configuration for the Website Chat only." }, "authentication": { "type": "object", @@ -2458,7 +3005,59 @@ } } }, - "Widget": { + "VerificationState": { + "type": "object", + "additionalProperties": false, + "required": [ + "available", + "conversation_id", + "status" + ], + "properties": { + "available": { + "type": "boolean" + }, + "conversation_id": { + "type": "string", + "format": "uuid" + }, + "status": { + "type": "string", + "enum": [ + "anonymous", + "sending", + "pending", + "verified" + ] + }, + "challenge_id": { + "type": "string", + "format": "uuid" + }, + "code_expires_at": { + "type": "integer", + "description": "Unix seconds" + }, + "resend_after": { + "type": "integer", + "description": "Unix seconds" + }, + "email": { + "type": "string", + "format": "email", + "maxLength": 254 + }, + "contact_resolution": { + "type": "string", + "enum": [ + "matched", + "ambiguous", + "not_found" + ] + } + } + }, + "PublicWebsiteChat": { "type": "object", "required": [ "key", @@ -2484,6 +3083,18 @@ "de" ] }, + "authentication": { + "type": "object", + "additionalProperties": false, + "required": [ + "email_code" + ], + "properties": { + "email_code": { + "type": "boolean" + } + } + }, "design": { "type": "object", "additionalProperties": false, @@ -2629,7 +3240,7 @@ } } }, - "WidgetDesign": { + "WebsiteChatDesign": { "type": "object", "additionalProperties": false, "properties": { @@ -2854,6 +3465,12 @@ "code": { "type": "string", "enum": [ + "INVALID_VERIFICATION_CODE", + "VERIFICATION_EXPIRED", + "VERIFICATION_CONFLICT", + "VERIFICATION_DISABLED", + "VERIFICATION_UNAVAILABLE", + "IDENTITY_CHANGED", "INVALID_REQUEST", "ORIGIN_DENIED", "NOT_FOUND", @@ -2873,7 +3490,7 @@ }, "responses": { "Error": { - "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished widget, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", + "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished Website Chat, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", "content": { "application/json": { "schema": { @@ -2885,6 +3502,12 @@ "code": { "type": "string", "enum": [ + "INVALID_VERIFICATION_CODE", + "VERIFICATION_EXPIRED", + "VERIFICATION_CONFLICT", + "VERIFICATION_DISABLED", + "VERIFICATION_UNAVAILABLE", + "IDENTITY_CHANGED", "INVALID_REQUEST", "ORIGIN_DENIED", "NOT_FOUND", diff --git a/packages/cli/docs/chat.md b/packages/cli/docs/chat.md index f63d25cb9..53c109413 100644 --- a/packages/cli/docs/chat.md +++ b/packages/cli/docs/chat.md @@ -3,7 +3,7 @@ - **Base URL:** `https://chat.sls.epilot.io` - **API Docs:** [https://docs.epilot.io/api/chat](https://docs.epilot.io/api/chat) -Widget management and anonymous browser chat. +Website Chat management and anonymous browser chat. ## Quick Start @@ -12,7 +12,7 @@ Widget management and anonymous browser chat. epilot chat # Call an operation -epilot chat listChatWidgets +epilot chat listWebsiteChats ``` ## Common Flags @@ -35,22 +35,26 @@ epilot chat listChatWidgets ## Operations -**Chat widgets** -- [`listChatWidgets`](#listchatwidgets) — GET /v1/widgets -- [`createChatWidget`](#createchatwidget) — POST /v1/widgets -- [`getChatWidget`](#getchatwidget) — GET /v1/widgets/{widget_id} -- [`updateChatWidget`](#updatechatwidget) — PUT /v1/widgets/{widget_id} -- [`deleteChatWidget`](#deletechatwidget) — DELETE /v1/widgets/{widget_id} +**Website Chats** +- [`listWebsiteChats`](#listwebsitechats) — GET /v1/website-chats +- [`createWebsiteChat`](#createwebsitechat) — POST /v1/website-chats +- [`getWebsiteChat`](#getwebsitechat) — GET /v1/website-chats/{website_chat_id} +- [`updateWebsiteChat`](#updatewebsitechat) — PUT /v1/website-chats/{website_chat_id} +- [`deleteWebsiteChat`](#deletewebsitechat) — DELETE /v1/website-chats/{website_chat_id} **Other** -- [`getPublicChatWidget`](#getpublicchatwidget) — Resolve visitor-facing configuration for an independent widget and its current agent assignment. The widget ID is not an -- [`createPublicChatGrant`](#createpublicchatgrant) — Called by the host website with its widget_key. Checks the saved website origin allowlist and issues a single-use grant +- [`getPublicWebsiteChat`](#getpublicwebsitechat) — Resolve visitor-facing configuration for an independent Website Chat and its current agent assignment. The Website Chat +- [`createPublicChatGrant`](#createpublicchatgrant) — Called by the host website with its website_chat_id. Checks the saved website origin allowlist and issues a single-use g - [`createAnonymousChatSession`](#createanonymouschatsession) — Exchanges an unexpired grant once for an independent 30-minute session. Expired or previously used grants return 401 INV - [`sendAnonymousChatMessage`](#sendanonymouschatmessage) — Creates a turn or replays its persisted result. Reuse request_id and the exact +- [`getChatVerification`](#getchatverification) — Read this session's verification state. No contact IDs or candidate records are exposed. +- [`startChatEmailVerification`](#startchatemailverification) — Start or resend an email challenge using the template saved on this session's Website Chat. Repeating the same request_i +- [`verifyChatEmailCode`](#verifychatemailcode) — Verify a code for this session's current challenge. Success binds email proof and contact resolution to this session and +- [`cancelChatVerification`](#cancelchatverification) — Cancel a pending challenge or clear verified identity. Clearing verified identity starts a new anonymous conversation. I -### `listChatWidgets` +### `listWebsiteChats` -`GET /v1/widgets` +`GET /v1/website-chats` **Parameters** @@ -61,13 +65,13 @@ epilot chat listChatWidgets **Sample Call** ```bash -epilot chat listChatWidgets +epilot chat listWebsiteChats ``` With JSONata filter: ```bash -epilot chat listChatWidgets --jsonata 'widgets' +epilot chat listWebsiteChats --jsonata 'website_chats' ```
@@ -75,11 +79,11 @@ epilot chat listChatWidgets --jsonata 'widgets' ```json { - "widgets": [ + "website_chats": [ { "name": "string", "agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "website_chat": { + "settings": { "allowed_origins": ["string"], "organisation_name": "string", "default_locale": "en", @@ -90,13 +94,13 @@ epilot chat listChatWidgets --jsonata 'widgets' } } }, - "widget_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "website_chat_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "org_id": "string", "binding_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "version": 1, "created_at": "1970-01-01T00:00:00.000Z", "updated_at": "1970-01-01T00:00:00.000Z", - "website_chat_embed": { + "embed": { "script_url": "https://example.com/path", "chat_api_origin": "https://example.com/path", "demo_url": "https://example.com/path" @@ -111,26 +115,26 @@ epilot chat listChatWidgets --jsonata 'widgets' --- -### `createChatWidget` +### `createWebsiteChat` -`POST /v1/widgets` +`POST /v1/website-chats` **Request Body** (required) **Sample Call** ```bash -epilot chat createChatWidget +epilot chat createWebsiteChat ``` With request body: ```bash -epilot chat createChatWidget \ +epilot chat createWebsiteChat \ -d '{ "name": "string", "agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "website_chat": { + "settings": { "allowed_origins": ["string"], "organisation_name": "string", "default_locale": "en", @@ -147,13 +151,13 @@ epilot chat createChatWidget \ Using stdin pipe: ```bash -cat body.json | epilot chat createChatWidget +cat body.json | epilot chat createWebsiteChat ``` With JSONata filter: ```bash -epilot chat createChatWidget --jsonata 'name' +epilot chat createWebsiteChat --jsonata 'name' ```
@@ -163,7 +167,7 @@ epilot chat createChatWidget --jsonata 'name' { "name": "string", "agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "website_chat": { + "settings": { "allowed_origins": ["string"], "organisation_name": "string", "default_locale": "en", @@ -174,13 +178,13 @@ epilot chat createChatWidget --jsonata 'name' } } }, - "widget_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "website_chat_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "org_id": "string", "binding_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "version": 1, "created_at": "1970-01-01T00:00:00.000Z", "updated_at": "1970-01-01T00:00:00.000Z", - "website_chat_embed": { + "embed": { "script_url": "https://example.com/path", "chat_api_origin": "https://example.com/path", "demo_url": "https://example.com/path" @@ -192,33 +196,33 @@ epilot chat createChatWidget --jsonata 'name' --- -### `getChatWidget` +### `getWebsiteChat` -`GET /v1/widgets/{widget_id}` +`GET /v1/website-chats/{website_chat_id}` **Parameters** | Name | In | Type | Required | Description | | ---- | -- | ---- | -------- | ----------- | -| `widget_id` | path | string (uuid) | Yes | | +| `website_chat_id` | path | string (uuid) | Yes | | **Sample Call** ```bash -epilot chat getChatWidget \ - -p widget_id=123e4567-e89b-12d3-a456-426614174000 +epilot chat getWebsiteChat \ + -p website_chat_id=123e4567-e89b-12d3-a456-426614174000 ``` Using positional args for path parameters: ```bash -epilot chat getChatWidget 123e4567-e89b-12d3-a456-426614174000 +epilot chat getWebsiteChat 123e4567-e89b-12d3-a456-426614174000 ``` With JSONata filter: ```bash -epilot chat getChatWidget -p widget_id=123e4567-e89b-12d3-a456-426614174000 --jsonata 'name' +epilot chat getWebsiteChat -p website_chat_id=123e4567-e89b-12d3-a456-426614174000 --jsonata 'name' ```
@@ -228,7 +232,7 @@ epilot chat getChatWidget -p widget_id=123e4567-e89b-12d3-a456-426614174000 --js { "name": "string", "agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "website_chat": { + "settings": { "allowed_origins": ["string"], "organisation_name": "string", "default_locale": "en", @@ -239,13 +243,13 @@ epilot chat getChatWidget -p widget_id=123e4567-e89b-12d3-a456-426614174000 --js } } }, - "widget_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "website_chat_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "org_id": "string", "binding_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "version": 1, "created_at": "1970-01-01T00:00:00.000Z", "updated_at": "1970-01-01T00:00:00.000Z", - "website_chat_embed": { + "embed": { "script_url": "https://example.com/path", "chat_api_origin": "https://example.com/path", "demo_url": "https://example.com/path" @@ -257,34 +261,34 @@ epilot chat getChatWidget -p widget_id=123e4567-e89b-12d3-a456-426614174000 --js --- -### `updateChatWidget` +### `updateWebsiteChat` -`PUT /v1/widgets/{widget_id}` +`PUT /v1/website-chats/{website_chat_id}` **Parameters** | Name | In | Type | Required | Description | | ---- | -- | ---- | -------- | ----------- | -| `widget_id` | path | string (uuid) | Yes | | +| `website_chat_id` | path | string (uuid) | Yes | | **Request Body** (required) **Sample Call** ```bash -epilot chat updateChatWidget \ - -p widget_id=123e4567-e89b-12d3-a456-426614174000 +epilot chat updateWebsiteChat \ + -p website_chat_id=123e4567-e89b-12d3-a456-426614174000 ``` With request body: ```bash -epilot chat updateChatWidget \ - -p widget_id=123e4567-e89b-12d3-a456-426614174000 \ +epilot chat updateWebsiteChat \ + -p website_chat_id=123e4567-e89b-12d3-a456-426614174000 \ -d '{ "name": "string", "agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "website_chat": { + "settings": { "allowed_origins": ["string"], "organisation_name": "string", "default_locale": "en", @@ -302,19 +306,19 @@ epilot chat updateChatWidget \ Using positional args for path parameters: ```bash -epilot chat updateChatWidget 123e4567-e89b-12d3-a456-426614174000 +epilot chat updateWebsiteChat 123e4567-e89b-12d3-a456-426614174000 ``` Using stdin pipe: ```bash -cat body.json | epilot chat updateChatWidget -p widget_id=123e4567-e89b-12d3-a456-426614174000 +cat body.json | epilot chat updateWebsiteChat -p website_chat_id=123e4567-e89b-12d3-a456-426614174000 ``` With JSONata filter: ```bash -epilot chat updateChatWidget -p widget_id=123e4567-e89b-12d3-a456-426614174000 --jsonata 'name' +epilot chat updateWebsiteChat -p website_chat_id=123e4567-e89b-12d3-a456-426614174000 --jsonata 'name' ```
@@ -324,7 +328,7 @@ epilot chat updateChatWidget -p widget_id=123e4567-e89b-12d3-a456-426614174000 - { "name": "string", "agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "website_chat": { + "settings": { "allowed_origins": ["string"], "organisation_name": "string", "default_locale": "en", @@ -335,13 +339,13 @@ epilot chat updateChatWidget -p widget_id=123e4567-e89b-12d3-a456-426614174000 - } } }, - "widget_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "website_chat_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "org_id": "string", "binding_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "version": 1, "created_at": "1970-01-01T00:00:00.000Z", "updated_at": "1970-01-01T00:00:00.000Z", - "website_chat_embed": { + "embed": { "script_url": "https://example.com/path", "chat_api_origin": "https://example.com/path", "demo_url": "https://example.com/path" @@ -353,68 +357,68 @@ epilot chat updateChatWidget -p widget_id=123e4567-e89b-12d3-a456-426614174000 - --- -### `deleteChatWidget` +### `deleteWebsiteChat` -`DELETE /v1/widgets/{widget_id}` +`DELETE /v1/website-chats/{website_chat_id}` **Parameters** | Name | In | Type | Required | Description | | ---- | -- | ---- | -------- | ----------- | -| `widget_id` | path | string (uuid) | Yes | | +| `website_chat_id` | path | string (uuid) | Yes | | | `version` | query | number | Yes | | **Sample Call** ```bash -epilot chat deleteChatWidget \ - -p widget_id=123e4567-e89b-12d3-a456-426614174000 \ +epilot chat deleteWebsiteChat \ + -p website_chat_id=123e4567-e89b-12d3-a456-426614174000 \ -p version=1 ``` Using positional args for path parameters: ```bash -epilot chat deleteChatWidget 123e4567-e89b-12d3-a456-426614174000 +epilot chat deleteWebsiteChat 123e4567-e89b-12d3-a456-426614174000 ``` With JSONata filter: ```bash -epilot chat deleteChatWidget -p widget_id=123e4567-e89b-12d3-a456-426614174000 -p version=1 --jsonata '$' +epilot chat deleteWebsiteChat -p website_chat_id=123e4567-e89b-12d3-a456-426614174000 -p version=1 --jsonata '$' ``` --- -### `getPublicChatWidget` +### `getPublicWebsiteChat` -Resolve visitor-facing configuration for an independent widget and its current agent assignment. The widget ID is not an +Resolve visitor-facing configuration for an independent Website Chat and its current agent assignment. The Website Chat -`GET /v1/widgets/{widget_id}/configuration` +`GET /v1/website-chats/{website_chat_id}/configuration` **Parameters** | Name | In | Type | Required | Description | | ---- | -- | ---- | -------- | ----------- | -| `widget_id` | path | string | Yes | Public widget ID, also used as widget_key in bootstrap and data-epilot-chat in the embed. | +| `website_chat_id` | path | string | Yes | Public Website Chat ID, also used as website_chat_id in bootstrap and data-epilot-chat in the embed. | **Sample Call** ```bash -epilot chat getPublicChatWidget \ - -p widget_id=550e8400-e29b-41d4-a716-446655440000 +epilot chat getPublicWebsiteChat \ + -p website_chat_id=550e8400-e29b-41d4-a716-446655440000 ``` Using positional args for path parameters: ```bash -epilot chat getPublicChatWidget 550e8400-e29b-41d4-a716-446655440000 +epilot chat getPublicWebsiteChat 550e8400-e29b-41d4-a716-446655440000 ``` With JSONata filter: ```bash -epilot chat getPublicChatWidget -p widget_id=550e8400-e29b-41d4-a716-446655440000 --jsonata 'key' +epilot chat getPublicWebsiteChat -p website_chat_id=550e8400-e29b-41d4-a716-446655440000 --jsonata 'key' ```
@@ -426,6 +430,9 @@ epilot chat getPublicChatWidget -p widget_id=550e8400-e29b-41d4-a716-44665544000 "organisationName": "string", "assistantName": "string", "defaultLocale": "en", + "authentication": { + "email_code": true + }, "design": { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "last_modified_at": "string", @@ -472,7 +479,7 @@ epilot chat getPublicChatWidget -p widget_id=550e8400-e29b-41d4-a716-44665544000 ### `createPublicChatGrant` -Called by the host website with its widget_key. Checks the saved website origin allowlist and issues a single-use grant +Called by the host website with its website_chat_id. Checks the saved website origin allowlist and issues a single-use g `POST /v1/bootstrap` @@ -482,7 +489,7 @@ Called by the host website with its widget_key. Checks the saved website origin ```bash epilot chat createPublicChatGrant \ - -d '{"widget_key":"string"}' + -d '{"website_chat_id":"string"}' ``` Using stdin pipe: @@ -504,7 +511,7 @@ epilot chat createPublicChatGrant --jsonata 'grant' { "grant": "string", "expires_in": 60, - "widget_origin": "https://example.com/path" + "frame_origin": "https://example.com/path" } ``` @@ -547,11 +554,14 @@ epilot chat createAnonymousChatSession --jsonata 'token' "token": "string", "conversation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "expires_at": 0, - "widget": { + "website_chat": { "key": "string", "organisationName": "string", "assistantName": "string", "defaultLocale": "en", + "authentication": { + "email_code": true + }, "design": { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "last_modified_at": "string", @@ -625,3 +635,173 @@ epilot chat sendAnonymousChatMessage --jsonata '$' ``` --- + +### `getChatVerification` + +Read this session's verification state. No contact IDs or candidate records are exposed. + +`GET /v1/verification` + +**Sample Call** + +```bash +epilot chat getChatVerification +``` + +With JSONata filter: + +```bash +epilot chat getChatVerification --jsonata 'email' +``` + +
+Sample Response + +```json +{ + "available": true, + "conversation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "status": "anonymous", + "challenge_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "code_expires_at": 0, + "resend_after": 0, + "email": "user@example.com", + "contact_resolution": "matched" +} +``` + +
+ +--- + +### `startChatEmailVerification` + +Start or resend an email challenge using the template saved on this session's Website Chat. Repeating the same request_i + +`POST /v1/verification/email` + +**Request Body** (required) + +**Sample Call** + +```bash +epilot chat startChatEmailVerification \ + -d '{"request_id":"3fa85f64-5717-4562-b3fc-2c963f66afa6","email":"user@example.com","locale":"en"}' +``` + +Using stdin pipe: + +```bash +cat body.json | epilot chat startChatEmailVerification +``` + +With JSONata filter: + +```bash +epilot chat startChatEmailVerification --jsonata 'email' +``` + +
+Sample Response + +```json +{ + "available": true, + "conversation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "status": "anonymous", + "challenge_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "code_expires_at": 0, + "resend_after": 0, + "email": "user@example.com", + "contact_resolution": "matched" +} +``` + +
+ +--- + +### `verifyChatEmailCode` + +Verify a code for this session's current challenge. Success binds email proof and contact resolution to this session and + +`POST /v1/verification/code` + +**Request Body** (required) + +**Sample Call** + +```bash +epilot chat verifyChatEmailCode \ + -d '{"challenge_id":"3fa85f64-5717-4562-b3fc-2c963f66afa6","code":"string"}' +``` + +Using stdin pipe: + +```bash +cat body.json | epilot chat verifyChatEmailCode +``` + +With JSONata filter: + +```bash +epilot chat verifyChatEmailCode --jsonata 'email' +``` + +
+Sample Response + +```json +{ + "available": true, + "conversation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "status": "anonymous", + "challenge_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "code_expires_at": 0, + "resend_after": 0, + "email": "user@example.com", + "contact_resolution": "matched" +} +``` + +
+ +--- + +### `cancelChatVerification` + +Cancel a pending challenge or clear verified identity. Clearing verified identity starts a new anonymous conversation. I + +`POST /v1/verification/cancel` + +**Sample Call** + +```bash +epilot chat cancelChatVerification +``` + +With JSONata filter: + +```bash +epilot chat cancelChatVerification --jsonata 'email' +``` + +
+Sample Response + +```json +{ + "available": true, + "conversation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "status": "anonymous", + "challenge_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "code_expires_at": 0, + "resend_after": 0, + "email": "user@example.com", + "contact_resolution": "matched" +} +``` + +
+ +--- diff --git a/packages/cli/docs/index.md b/packages/cli/docs/index.md index 6d2941c71..4bd80b222 100644 --- a/packages/cli/docs/index.md +++ b/packages/cli/docs/index.md @@ -22,7 +22,7 @@ npx epilot auth login | Billing API | `epilot billing` | 14 | [billing.md](./billing.md) | | Blueprint Manifest API | `epilot blueprint-manifest` | 73 | [blueprint-manifest.md](./blueprint-manifest.md) | | Calendar API | `epilot calendar` | 28 | [calendar.md](./calendar.md) | -| epilot Chat API | `epilot chat` | 9 | [chat.md](./chat.md) | +| epilot Chat API | `epilot chat` | 13 | [chat.md](./chat.md) | | Configuration Hub API | `epilot configuration-hub` | 21 | [configuration-hub.md](./configuration-hub.md) | | Consent API | `epilot consent` | 3 | [consent.md](./consent.md) | | Portal API | `epilot customer-portal` | 173 | [customer-portal.md](./customer-portal.md) | diff --git a/packages/cli/src/generated/api-list.ts b/packages/cli/src/generated/api-list.ts index b011edc55..bcd760676 100644 --- a/packages/cli/src/generated/api-list.ts +++ b/packages/cli/src/generated/api-list.ts @@ -301,17 +301,21 @@ export const API_LIST: ApiInfo[] = [ kebabName: 'chat', title: 'epilot Chat API', serverUrl: 'https://chat.sls.epilot.io', - operationCount: 9, + operationCount: 13, operationIds: [ - 'listChatWidgets', - 'createChatWidget', - 'getChatWidget', - 'updateChatWidget', - 'deleteChatWidget', - 'getPublicChatWidget', + 'listWebsiteChats', + 'createWebsiteChat', + 'getWebsiteChat', + 'updateWebsiteChat', + 'deleteWebsiteChat', + 'getPublicWebsiteChat', 'createPublicChatGrant', 'createAnonymousChatSession', 'sendAnonymousChatMessage', + 'getChatVerification', + 'startChatEmailVerification', + 'verifyChatEmailCode', + 'cancelChatVerification', ], }, { diff --git a/packages/epilot-sdk-v2/docs/chat.md b/packages/epilot-sdk-v2/docs/chat.md index 0b4842336..1d9580fe1 100644 --- a/packages/epilot-sdk-v2/docs/chat.md +++ b/packages/epilot-sdk-v2/docs/chat.md @@ -9,7 +9,7 @@ import { epilot } from '@epilot/sdk' epilot.authorize(() => '') -const { data } = await epilot.chat.listChatWidgets(...) +const { data } = await epilot.chat.listWebsiteChats(...) ``` ### Tree-shakeable import @@ -19,42 +19,47 @@ import { getClient, authorize } from '@epilot/sdk/chat' const chatClient = getClient() authorize(chatClient, () => '') -const { data } = await chatClient.listChatWidgets(...) +const { data } = await chatClient.listWebsiteChats(...) ``` ## Operations -**Chat widgets** -- [`listChatWidgets`](#listchatwidgets) -- [`createChatWidget`](#createchatwidget) -- [`getChatWidget`](#getchatwidget) -- [`updateChatWidget`](#updatechatwidget) -- [`deleteChatWidget`](#deletechatwidget) +**Website Chats** +- [`listWebsiteChats`](#listwebsitechats) +- [`createWebsiteChat`](#createwebsitechat) +- [`getWebsiteChat`](#getwebsitechat) +- [`updateWebsiteChat`](#updatewebsitechat) +- [`deleteWebsiteChat`](#deletewebsitechat) **Other** -- [`getPublicChatWidget`](#getpublicchatwidget) +- [`getPublicWebsiteChat`](#getpublicwebsitechat) - [`createPublicChatGrant`](#createpublicchatgrant) - [`createAnonymousChatSession`](#createanonymouschatsession) - [`sendAnonymousChatMessage`](#sendanonymouschatmessage) +- [`getChatVerification`](#getchatverification) +- [`startChatEmailVerification`](#startchatemailverification) +- [`verifyChatEmailCode`](#verifychatemailcode) +- [`cancelChatVerification`](#cancelchatverification) **Schemas** -- [`ListChatWidgetsResponse`](#listchatwidgetsresponse) -- [`ChatWidget`](#chatwidget) +- [`ListWebsiteChatsResponse`](#listwebsitechatsresponse) +- [`WebsiteChat`](#websitechat) - [`WebsiteChatSettings`](#websitechatsettings) - [`Error`](#error) -- [`CreateChatWidgetRequest`](#createchatwidgetrequest) -- [`UpdateChatWidgetRequest`](#updatechatwidgetrequest) -- [`Widget`](#widget) -- [`WidgetDesign`](#widgetdesign) +- [`CreateWebsiteChatRequest`](#createwebsitechatrequest) +- [`UpdateWebsiteChatRequest`](#updatewebsitechatrequest) +- [`VerificationState`](#verificationstate) +- [`PublicWebsiteChat`](#publicwebsitechat) +- [`WebsiteChatDesign`](#websitechatdesign) - [`PublicEvent`](#publicevent) - [`PublicChatError`](#publicchaterror) -### `listChatWidgets` +### `listWebsiteChats` -`GET /v1/widgets` +`GET /v1/website-chats` ```ts -const { data } = await client.listChatWidgets({ +const { data } = await client.listWebsiteChats({ cursor: 'example', }) ``` @@ -64,11 +69,11 @@ const { data } = await client.listChatWidgets({ ```json { - "widgets": [ + "website_chats": [ { "name": "string", "agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "website_chat": { + "settings": { "allowed_origins": ["string"], "organisation_name": "string", "default_locale": "en", @@ -79,13 +84,13 @@ const { data } = await client.listChatWidgets({ } } }, - "widget_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "website_chat_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "org_id": "string", "binding_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "version": 1, "created_at": "1970-01-01T00:00:00.000Z", "updated_at": "1970-01-01T00:00:00.000Z", - "website_chat_embed": { + "embed": { "script_url": "https://example.com/path", "chat_api_origin": "https://example.com/path", "demo_url": "https://example.com/path" @@ -100,17 +105,17 @@ const { data } = await client.listChatWidgets({ --- -### `createChatWidget` +### `createWebsiteChat` -`POST /v1/widgets` +`POST /v1/website-chats` ```ts -const { data } = await client.createChatWidget( +const { data } = await client.createWebsiteChat( null, { name: 'string', agent_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6', - website_chat: { + settings: { allowed_origins: ['string'], organisation_name: 'string', default_locale: 'en', @@ -132,7 +137,7 @@ const { data } = await client.createChatWidget( { "name": "string", "agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "website_chat": { + "settings": { "allowed_origins": ["string"], "organisation_name": "string", "default_locale": "en", @@ -143,13 +148,13 @@ const { data } = await client.createChatWidget( } } }, - "widget_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "website_chat_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "org_id": "string", "binding_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "version": 1, "created_at": "1970-01-01T00:00:00.000Z", "updated_at": "1970-01-01T00:00:00.000Z", - "website_chat_embed": { + "embed": { "script_url": "https://example.com/path", "chat_api_origin": "https://example.com/path", "demo_url": "https://example.com/path" @@ -161,13 +166,13 @@ const { data } = await client.createChatWidget( --- -### `getChatWidget` +### `getWebsiteChat` -`GET /v1/widgets/{widget_id}` +`GET /v1/website-chats/{website_chat_id}` ```ts -const { data } = await client.getChatWidget({ - widget_id: 'example', +const { data } = await client.getWebsiteChat({ + website_chat_id: 'example', }) ``` @@ -178,7 +183,7 @@ const { data } = await client.getChatWidget({ { "name": "string", "agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "website_chat": { + "settings": { "allowed_origins": ["string"], "organisation_name": "string", "default_locale": "en", @@ -189,13 +194,13 @@ const { data } = await client.getChatWidget({ } } }, - "widget_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "website_chat_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "org_id": "string", "binding_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "version": 1, "created_at": "1970-01-01T00:00:00.000Z", "updated_at": "1970-01-01T00:00:00.000Z", - "website_chat_embed": { + "embed": { "script_url": "https://example.com/path", "chat_api_origin": "https://example.com/path", "demo_url": "https://example.com/path" @@ -207,19 +212,19 @@ const { data } = await client.getChatWidget({ --- -### `updateChatWidget` +### `updateWebsiteChat` -`PUT /v1/widgets/{widget_id}` +`PUT /v1/website-chats/{website_chat_id}` ```ts -const { data } = await client.updateChatWidget( +const { data } = await client.updateWebsiteChat( { - widget_id: 'example', + website_chat_id: 'example', }, { name: 'string', agent_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6', - website_chat: { + settings: { allowed_origins: ['string'], organisation_name: 'string', default_locale: 'en', @@ -242,7 +247,7 @@ const { data } = await client.updateChatWidget( { "name": "string", "agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "website_chat": { + "settings": { "allowed_origins": ["string"], "organisation_name": "string", "default_locale": "en", @@ -253,13 +258,13 @@ const { data } = await client.updateChatWidget( } } }, - "widget_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "website_chat_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "org_id": "string", "binding_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "version": 1, "created_at": "1970-01-01T00:00:00.000Z", "updated_at": "1970-01-01T00:00:00.000Z", - "website_chat_embed": { + "embed": { "script_url": "https://example.com/path", "chat_api_origin": "https://example.com/path", "demo_url": "https://example.com/path" @@ -271,26 +276,26 @@ const { data } = await client.updateChatWidget( --- -### `deleteChatWidget` +### `deleteWebsiteChat` -`DELETE /v1/widgets/{widget_id}` +`DELETE /v1/website-chats/{website_chat_id}` ```ts -const { data } = await client.deleteChatWidget({ - widget_id: 'example', +const { data } = await client.deleteWebsiteChat({ + website_chat_id: 'example', version: 1, }) ``` --- -### `getPublicChatWidget` +### `getPublicWebsiteChat` -`GET /v1/widgets/{widget_id}/configuration` +`GET /v1/website-chats/{website_chat_id}/configuration` ```ts -const { data } = await client.getPublicChatWidget({ - widget_id: 'example', +const { data } = await client.getPublicWebsiteChat({ + website_chat_id: 'example', }) ``` @@ -303,6 +308,9 @@ const { data } = await client.getPublicChatWidget({ "organisationName": "string", "assistantName": "string", "defaultLocale": "en", + "authentication": { + "email_code": true + }, "design": { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "last_modified_at": "string", @@ -355,7 +363,7 @@ const { data } = await client.getPublicChatWidget({ const { data } = await client.createPublicChatGrant( null, { - widget_key: 'string' + website_chat_id: 'string' }, ) ``` @@ -367,7 +375,7 @@ const { data } = await client.createPublicChatGrant( { "grant": "string", "expires_in": 60, - "widget_origin": "https://example.com/path" + "frame_origin": "https://example.com/path" } ``` @@ -396,11 +404,14 @@ const { data } = await client.createAnonymousChatSession( "token": "string", "conversation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "expires_at": 0, - "widget": { + "website_chat": { "key": "string", "organisationName": "string", "assistantName": "string", "defaultLocale": "en", + "authentication": { + "email_code": true + }, "design": { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "last_modified_at": "string", @@ -464,29 +475,154 @@ const { data } = await client.sendAnonymousChatMessage( --- +### `getChatVerification` + +`GET /v1/verification` + +```ts +const { data } = await client.getChatVerification() +``` + +
+Response + +```json +{ + "available": true, + "conversation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "status": "anonymous", + "challenge_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "code_expires_at": 0, + "resend_after": 0, + "email": "user@example.com", + "contact_resolution": "matched" +} +``` + +
+ +--- + +### `startChatEmailVerification` + +`POST /v1/verification/email` + +```ts +const { data } = await client.startChatEmailVerification( + null, + { + request_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6', + email: 'user@example.com', + locale: 'en' + }, +) +``` + +
+Response + +```json +{ + "available": true, + "conversation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "status": "anonymous", + "challenge_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "code_expires_at": 0, + "resend_after": 0, + "email": "user@example.com", + "contact_resolution": "matched" +} +``` + +
+ +--- + +### `verifyChatEmailCode` + +`POST /v1/verification/code` + +```ts +const { data } = await client.verifyChatEmailCode( + null, + { + challenge_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6', + code: 'string' + }, +) +``` + +
+Response + +```json +{ + "available": true, + "conversation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "status": "anonymous", + "challenge_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "code_expires_at": 0, + "resend_after": 0, + "email": "user@example.com", + "contact_resolution": "matched" +} +``` + +
+ +--- + +### `cancelChatVerification` + +`POST /v1/verification/cancel` + +```ts +const { data } = await client.cancelChatVerification() +``` + +
+Response + +```json +{ + "available": true, + "conversation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "status": "anonymous", + "challenge_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "code_expires_at": 0, + "resend_after": 0, + "email": "user@example.com", + "contact_resolution": "matched" +} +``` + +
+ +--- + ## Schemas -### `ListChatWidgetsResponse` +### `ListWebsiteChatsResponse` ```ts -type ListChatWidgetsResponse = { - widgets: Array<{ +type ListWebsiteChatsResponse = { + website_chats: Array<{ name: string agent_id: string // uuid - website_chat: { + settings: { allowed_origins: { ... } organisation_name: { ... } default_locale: { ... } design_id?: { ... } authentication?: { ... } } - widget_id: string // uuid + website_chat_id: string // uuid org_id: string binding_id: string // uuid version: number created_at: string // date-time updated_at: string // date-time - website_chat_embed: { + embed: { script_url: { ... } chat_api_origin: { ... } demo_url: { ... } @@ -496,13 +632,13 @@ type ListChatWidgetsResponse = { } ``` -### `ChatWidget` +### `WebsiteChat` ```ts -type ChatWidget = { +type WebsiteChat = { name: string agent_id: string // uuid - website_chat: { + settings: { allowed_origins: string[] organisation_name: string default_locale: "en" | "de" @@ -511,13 +647,13 @@ type ChatWidget = { email_code: { ... } } } - widget_id: string // uuid + website_chat_id: string // uuid org_id: string binding_id: string // uuid version: number created_at: string // date-time updated_at: string // date-time - website_chat_embed: { + embed: { script_url: string // uri chat_api_origin: string // uri demo_url: string // uri @@ -551,13 +687,13 @@ type Error = { } ``` -### `CreateChatWidgetRequest` +### `CreateWebsiteChatRequest` ```ts -type CreateChatWidgetRequest = { +type CreateWebsiteChatRequest = { name: string agent_id: string // uuid - website_chat: { + settings: { allowed_origins: string[] organisation_name: string default_locale: "en" | "de" @@ -569,13 +705,13 @@ type CreateChatWidgetRequest = { } ``` -### `UpdateChatWidgetRequest` +### `UpdateWebsiteChatRequest` ```ts -type UpdateChatWidgetRequest = { +type UpdateWebsiteChatRequest = { name?: string agent_id?: string // uuid - website_chat?: { + settings?: { allowed_origins: string[] organisation_name: string default_locale: "en" | "de" @@ -588,14 +724,32 @@ type UpdateChatWidgetRequest = { } ``` -### `Widget` +### `VerificationState` ```ts -type Widget = { +type VerificationState = { + available: boolean + conversation_id: string // uuid + status: "anonymous" | "sending" | "pending" | "verified" + challenge_id?: string // uuid + code_expires_at?: number + resend_after?: number + email?: string // email + contact_resolution?: "matched" | "ambiguous" | "not_found" +} +``` + +### `PublicWebsiteChat` + +```ts +type PublicWebsiteChat = { key: string organisationName: string assistantName: string defaultLocale: "en" | "de" + authentication?: { + email_code: boolean + } design?: { id: string // uuid last_modified_at?: string @@ -627,10 +781,10 @@ type Widget = { } ``` -### `WidgetDesign` +### `WebsiteChatDesign` ```ts -type WidgetDesign = { +type WebsiteChatDesign = { id: string // uuid last_modified_at?: string style?: { @@ -690,6 +844,6 @@ type PublicEvent = { ```ts type PublicChatError = { - code: "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE" + code: "INVALID_VERIFICATION_CODE" | "VERIFICATION_EXPIRED" | "VERIFICATION_CONFLICT" | "VERIFICATION_DISABLED" | "VERIFICATION_UNAVAILABLE" | "IDENTITY_CHANGED" | "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE" } ``` diff --git a/packages/epilot-sdk-v2/src/definitions/chat-runtime.json b/packages/epilot-sdk-v2/src/definitions/chat-runtime.json index 32856895b..5c43fa46c 100644 --- a/packages/epilot-sdk-v2/src/definitions/chat-runtime.json +++ b/packages/epilot-sdk-v2/src/definitions/chat-runtime.json @@ -1 +1 @@ -{"s":"https://chat.sls.epilot.io","o":[["listChatWidgets","get","/v1/widgets",[["cursor","q"]]],["createChatWidget","post","/v1/widgets",null,1],["getChatWidget","get","/v1/widgets/{widget_id}"],["updateChatWidget","put","/v1/widgets/{widget_id}",null,1],["deleteChatWidget","delete","/v1/widgets/{widget_id}",[["version","q",true]]],["getPublicChatWidget","get","/v1/widgets/{widget_id}/configuration",[["widget_id","p",true]]],["createPublicChatGrant","post","/v1/bootstrap",null,1],["createAnonymousChatSession","post","/v1/sessions",null,1],["sendAnonymousChatMessage","post","/v1/messages",null,1]],"v":"3.0.3","pp":{"/v1/widgets/{widget_id}":[["widget_id","p",true]]}} \ No newline at end of file +{"s":"https://chat.sls.epilot.io","o":[["listWebsiteChats","get","/v1/website-chats",[["cursor","q"]]],["createWebsiteChat","post","/v1/website-chats",null,1],["getWebsiteChat","get","/v1/website-chats/{website_chat_id}"],["updateWebsiteChat","put","/v1/website-chats/{website_chat_id}",null,1],["deleteWebsiteChat","delete","/v1/website-chats/{website_chat_id}",[["version","q",true]]],["getPublicWebsiteChat","get","/v1/website-chats/{website_chat_id}/configuration",[["website_chat_id","p",true]]],["createPublicChatGrant","post","/v1/bootstrap",null,1],["createAnonymousChatSession","post","/v1/sessions",null,1],["sendAnonymousChatMessage","post","/v1/messages",null,1],["getChatVerification","get","/v1/verification"],["startChatEmailVerification","post","/v1/verification/email",null,1],["verifyChatEmailCode","post","/v1/verification/code",null,1],["cancelChatVerification","post","/v1/verification/cancel"]],"v":"3.0.3","pp":{"/v1/website-chats/{website_chat_id}":[["website_chat_id","p",true]]}} \ No newline at end of file diff --git a/packages/epilot-sdk-v2/src/docs/chat.json b/packages/epilot-sdk-v2/src/docs/chat.json index ce3af27cb..0439e0b29 100644 --- a/packages/epilot-sdk-v2/src/docs/chat.json +++ b/packages/epilot-sdk-v2/src/docs/chat.json @@ -1 +1 @@ -"# epilot Chat API\n\n- **Base URL:** `https://chat.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/chat](https://docs.epilot.io/api/chat)\n\n## Usage\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\nepilot.authorize(() => '')\nconst { data } = await epilot.chat.listChatWidgets(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from '@epilot/sdk/chat'\n\nconst chatClient = getClient()\nauthorize(chatClient, () => '')\nconst { data } = await chatClient.listChatWidgets(...)\n```\n\n## Operations\n\n**Chat widgets**\n- [`listChatWidgets`](#listchatwidgets)\n- [`createChatWidget`](#createchatwidget)\n- [`getChatWidget`](#getchatwidget)\n- [`updateChatWidget`](#updatechatwidget)\n- [`deleteChatWidget`](#deletechatwidget)\n\n**Other**\n- [`getPublicChatWidget`](#getpublicchatwidget)\n- [`createPublicChatGrant`](#createpublicchatgrant)\n- [`createAnonymousChatSession`](#createanonymouschatsession)\n- [`sendAnonymousChatMessage`](#sendanonymouschatmessage)\n\n**Schemas**\n- [`ListChatWidgetsResponse`](#listchatwidgetsresponse)\n- [`ChatWidget`](#chatwidget)\n- [`WebsiteChatSettings`](#websitechatsettings)\n- [`Error`](#error)\n- [`CreateChatWidgetRequest`](#createchatwidgetrequest)\n- [`UpdateChatWidgetRequest`](#updatechatwidgetrequest)\n- [`Widget`](#widget)\n- [`WidgetDesign`](#widgetdesign)\n- [`PublicEvent`](#publicevent)\n- [`PublicChatError`](#publicchaterror)\n\n### `listChatWidgets`\n\n`GET /v1/widgets`\n\n```ts\nconst { data } = await client.listChatWidgets({\n cursor: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"widgets\": [\n {\n \"name\": \"string\",\n \"agent_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"website_chat\": {\n \"allowed_origins\": [\"string\"],\n \"organisation_name\": \"string\",\n \"default_locale\": \"en\",\n \"design_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"authentication\": {\n \"email_code\": {\n \"email_template_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n }\n },\n \"widget_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"org_id\": \"string\",\n \"binding_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"version\": 1,\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"website_chat_embed\": {\n \"script_url\": \"https://example.com/path\",\n \"chat_api_origin\": \"https://example.com/path\",\n \"demo_url\": \"https://example.com/path\"\n }\n }\n ],\n \"next_cursor\": \"string\"\n}\n```\n\n
\n\n---\n\n### `createChatWidget`\n\n`POST /v1/widgets`\n\n```ts\nconst { data } = await client.createChatWidget(\n null,\n {\n name: 'string',\n agent_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n website_chat: {\n allowed_origins: ['string'],\n organisation_name: 'string',\n default_locale: 'en',\n design_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n authentication: {\n email_code: {\n email_template_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6'\n }\n }\n }\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"name\": \"string\",\n \"agent_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"website_chat\": {\n \"allowed_origins\": [\"string\"],\n \"organisation_name\": \"string\",\n \"default_locale\": \"en\",\n \"design_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"authentication\": {\n \"email_code\": {\n \"email_template_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n }\n },\n \"widget_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"org_id\": \"string\",\n \"binding_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"version\": 1,\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"website_chat_embed\": {\n \"script_url\": \"https://example.com/path\",\n \"chat_api_origin\": \"https://example.com/path\",\n \"demo_url\": \"https://example.com/path\"\n }\n}\n```\n\n
\n\n---\n\n### `getChatWidget`\n\n`GET /v1/widgets/{widget_id}`\n\n```ts\nconst { data } = await client.getChatWidget({\n widget_id: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"name\": \"string\",\n \"agent_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"website_chat\": {\n \"allowed_origins\": [\"string\"],\n \"organisation_name\": \"string\",\n \"default_locale\": \"en\",\n \"design_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"authentication\": {\n \"email_code\": {\n \"email_template_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n }\n },\n \"widget_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"org_id\": \"string\",\n \"binding_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"version\": 1,\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"website_chat_embed\": {\n \"script_url\": \"https://example.com/path\",\n \"chat_api_origin\": \"https://example.com/path\",\n \"demo_url\": \"https://example.com/path\"\n }\n}\n```\n\n
\n\n---\n\n### `updateChatWidget`\n\n`PUT /v1/widgets/{widget_id}`\n\n```ts\nconst { data } = await client.updateChatWidget(\n {\n widget_id: 'example',\n },\n {\n name: 'string',\n agent_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n website_chat: {\n allowed_origins: ['string'],\n organisation_name: 'string',\n default_locale: 'en',\n design_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n authentication: {\n email_code: {\n email_template_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6'\n }\n }\n },\n version: 1\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"name\": \"string\",\n \"agent_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"website_chat\": {\n \"allowed_origins\": [\"string\"],\n \"organisation_name\": \"string\",\n \"default_locale\": \"en\",\n \"design_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"authentication\": {\n \"email_code\": {\n \"email_template_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n }\n },\n \"widget_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"org_id\": \"string\",\n \"binding_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"version\": 1,\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"website_chat_embed\": {\n \"script_url\": \"https://example.com/path\",\n \"chat_api_origin\": \"https://example.com/path\",\n \"demo_url\": \"https://example.com/path\"\n }\n}\n```\n\n
\n\n---\n\n### `deleteChatWidget`\n\n`DELETE /v1/widgets/{widget_id}`\n\n```ts\nconst { data } = await client.deleteChatWidget({\n widget_id: 'example',\n version: 1,\n})\n```\n\n---\n\n### `getPublicChatWidget`\n\n`GET /v1/widgets/{widget_id}/configuration`\n\n```ts\nconst { data } = await client.getPublicChatWidget({\n widget_id: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"key\": \"string\",\n \"organisationName\": \"string\",\n \"assistantName\": \"string\",\n \"defaultLocale\": \"en\",\n \"design\": {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"last_modified_at\": \"string\",\n \"style\": {\n \"palette\": {\n \"primary\": \"string\",\n \"background\": \"string\"\n },\n \"typography\": {\n \"font\": {\n \"font_family\": \"string\"\n }\n },\n \"shape\": {\n \"border_radius\": 0\n }\n },\n \"spark_theme\": {\n \"accentColor\": \"string\",\n \"backgroundColor\": \"string\",\n \"fontBody\": \"string\",\n \"fontHeading\": \"string\",\n \"radius\": \"string\",\n \"scaling\": \"string\",\n \"spacing\": \"string\",\n \"appearance\": \"string\",\n \"neutralColor\": \"string\",\n \"styleVariant\": \"string\",\n \"labelPosition\": \"string\",\n \"inputStyle\": \"string\",\n \"inputColor\": \"string\",\n \"cardVariant\": \"string\",\n \"cardColor\": \"string\",\n \"highContrast\": true\n }\n },\n \"locales\": [\"en\"]\n}\n```\n\n
\n\n---\n\n### `createPublicChatGrant`\n\n`POST /v1/bootstrap`\n\n```ts\nconst { data } = await client.createPublicChatGrant(\n null,\n {\n widget_key: 'string'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"grant\": \"string\",\n \"expires_in\": 60,\n \"widget_origin\": \"https://example.com/path\"\n}\n```\n\n
\n\n---\n\n### `createAnonymousChatSession`\n\n`POST /v1/sessions`\n\n```ts\nconst { data } = await client.createAnonymousChatSession(\n null,\n {\n grant: 'string'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"token\": \"string\",\n \"conversation_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"expires_at\": 0,\n \"widget\": {\n \"key\": \"string\",\n \"organisationName\": \"string\",\n \"assistantName\": \"string\",\n \"defaultLocale\": \"en\",\n \"design\": {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"last_modified_at\": \"string\",\n \"style\": {\n \"palette\": {\n \"primary\": \"string\",\n \"background\": \"string\"\n },\n \"typography\": {\n \"font\": {\n \"font_family\": \"string\"\n }\n },\n \"shape\": {\n \"border_radius\": 0\n }\n },\n \"spark_theme\": {\n \"accentColor\": \"string\",\n \"backgroundColor\": \"string\",\n \"fontBody\": \"string\",\n \"fontHeading\": \"string\",\n \"radius\": \"string\",\n \"scaling\": \"string\",\n \"spacing\": \"string\",\n \"appearance\": \"string\",\n \"neutralColor\": \"string\",\n \"styleVariant\": \"string\",\n \"labelPosition\": \"string\",\n \"inputStyle\": \"string\",\n \"inputColor\": \"string\",\n \"cardVariant\": \"string\",\n \"cardColor\": \"string\",\n \"highContrast\": true\n }\n },\n \"locales\": [\"en\"]\n }\n}\n```\n\n
\n\n---\n\n### `sendAnonymousChatMessage`\n\n`POST /v1/messages`\n\n```ts\nconst { data } = await client.sendAnonymousChatMessage(\n null,\n {\n request_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n message: 'string',\n locale: 'en',\n simple_language: true\n },\n)\n```\n\n---\n\n## Schemas\n\n### `ListChatWidgetsResponse`\n\n```ts\ntype ListChatWidgetsResponse = {\n widgets: Array<{\n name: string\n agent_id: string // uuid\n website_chat: {\n allowed_origins: { ... }\n organisation_name: { ... }\n default_locale: { ... }\n design_id?: { ... }\n authentication?: { ... }\n }\n widget_id: string // uuid\n org_id: string\n binding_id: string // uuid\n version: number\n created_at: string // date-time\n updated_at: string // date-time\n website_chat_embed: {\n script_url: { ... }\n chat_api_origin: { ... }\n demo_url: { ... }\n }\n }>\n next_cursor?: string\n}\n```\n\n### `ChatWidget`\n\n```ts\ntype ChatWidget = {\n name: string\n agent_id: string // uuid\n website_chat: {\n allowed_origins: string[]\n organisation_name: string\n default_locale: \"en\" | \"de\"\n design_id?: string // uuid\n authentication?: {\n email_code: { ... }\n }\n }\n widget_id: string // uuid\n org_id: string\n binding_id: string // uuid\n version: number\n created_at: string // date-time\n updated_at: string // date-time\n website_chat_embed: {\n script_url: string // uri\n chat_api_origin: string // uri\n demo_url: string // uri\n }\n}\n```\n\n### `WebsiteChatSettings`\n\n```ts\ntype WebsiteChatSettings = {\n allowed_origins: string[]\n organisation_name: string\n default_locale: \"en\" | \"de\"\n design_id?: string // uuid\n authentication?: {\n email_code: {\n email_template_id?: { ... }\n }\n }\n}\n```\n\n### `Error`\n\n```ts\ntype Error = {\n error?: string\n message?: string\n details?: object\n}\n```\n\n### `CreateChatWidgetRequest`\n\n```ts\ntype CreateChatWidgetRequest = {\n name: string\n agent_id: string // uuid\n website_chat: {\n allowed_origins: string[]\n organisation_name: string\n default_locale: \"en\" | \"de\"\n design_id?: string // uuid\n authentication?: {\n email_code: { ... }\n }\n }\n}\n```\n\n### `UpdateChatWidgetRequest`\n\n```ts\ntype UpdateChatWidgetRequest = {\n name?: string\n agent_id?: string // uuid\n website_chat?: {\n allowed_origins: string[]\n organisation_name: string\n default_locale: \"en\" | \"de\"\n design_id?: string // uuid\n authentication?: {\n email_code: { ... }\n }\n }\n version: number\n}\n```\n\n### `Widget`\n\n```ts\ntype Widget = {\n key: string\n organisationName: string\n assistantName: string\n defaultLocale: \"en\" | \"de\"\n design?: {\n id: string // uuid\n last_modified_at?: string\n style?: {\n palette?: { ... }\n typography?: { ... }\n shape?: { ... }\n }\n spark_theme?: {\n accentColor?: { ... }\n backgroundColor?: { ... }\n fontBody?: { ... }\n fontHeading?: { ... }\n radius?: { ... }\n scaling?: { ... }\n spacing?: { ... }\n appearance?: { ... }\n neutralColor?: { ... }\n styleVariant?: { ... }\n labelPosition?: { ... }\n inputStyle?: { ... }\n inputColor?: { ... }\n cardVariant?: { ... }\n cardColor?: { ... }\n highContrast?: { ... }\n }\n }\n locales: \"en\" | \"de\"[]\n}\n```\n\n### `WidgetDesign`\n\n```ts\ntype WidgetDesign = {\n id: string // uuid\n last_modified_at?: string\n style?: {\n palette?: {\n primary?: { ... }\n background?: { ... }\n }\n typography?: {\n font?: { ... }\n }\n shape?: {\n border_radius?: { ... }\n }\n }\n spark_theme?: {\n accentColor?: string\n backgroundColor?: string\n fontBody?: string\n fontHeading?: string\n radius?: string\n scaling?: string\n spacing?: string\n appearance?: string\n neutralColor?: string\n styleVariant?: string\n labelPosition?: string\n inputStyle?: string\n inputColor?: string\n cardVariant?: string\n cardColor?: string\n highContrast?: boolean\n }\n}\n```\n\n### `PublicEvent`\n\nJSON payload of one SSE data frame from sendAnonymousChatMessage.\n\n```ts\ntype PublicEvent = {\n type: \"delta\"\n text: string\n request_id: string // uuid\n} | {\n type: \"complete\"\n text: string\n request_id: string // uuid\n} | {\n type: \"error\"\n code: \"UNAVAILABLE\"\n request_id: string // uuid\n}\n```\n\n### `PublicChatError`\n\n```ts\ntype PublicChatError = {\n code: \"INVALID_REQUEST\" | \"ORIGIN_DENIED\" | \"NOT_FOUND\" | \"INVALID_GRANT\" | \"SESSION_EXPIRED\" | \"RATE_LIMITED\" | \"SESSION_LIMIT\" | \"USAGE_LIMIT\" | \"REQUEST_CONFLICT\" | \"IN_PROGRESS\" | \"UNAVAILABLE\" | \"TEMPORARILY_UNAVAILABLE\"\n}\n```\n" +"# epilot Chat API\n\n- **Base URL:** `https://chat.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/chat](https://docs.epilot.io/api/chat)\n\n## Usage\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\nepilot.authorize(() => '')\nconst { data } = await epilot.chat.listWebsiteChats(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from '@epilot/sdk/chat'\n\nconst chatClient = getClient()\nauthorize(chatClient, () => '')\nconst { data } = await chatClient.listWebsiteChats(...)\n```\n\n## Operations\n\n**Website Chats**\n- [`listWebsiteChats`](#listwebsitechats)\n- [`createWebsiteChat`](#createwebsitechat)\n- [`getWebsiteChat`](#getwebsitechat)\n- [`updateWebsiteChat`](#updatewebsitechat)\n- [`deleteWebsiteChat`](#deletewebsitechat)\n\n**Other**\n- [`getPublicWebsiteChat`](#getpublicwebsitechat)\n- [`createPublicChatGrant`](#createpublicchatgrant)\n- [`createAnonymousChatSession`](#createanonymouschatsession)\n- [`sendAnonymousChatMessage`](#sendanonymouschatmessage)\n- [`getChatVerification`](#getchatverification)\n- [`startChatEmailVerification`](#startchatemailverification)\n- [`verifyChatEmailCode`](#verifychatemailcode)\n- [`cancelChatVerification`](#cancelchatverification)\n\n**Schemas**\n- [`ListWebsiteChatsResponse`](#listwebsitechatsresponse)\n- [`WebsiteChat`](#websitechat)\n- [`WebsiteChatSettings`](#websitechatsettings)\n- [`Error`](#error)\n- [`CreateWebsiteChatRequest`](#createwebsitechatrequest)\n- [`UpdateWebsiteChatRequest`](#updatewebsitechatrequest)\n- [`VerificationState`](#verificationstate)\n- [`PublicWebsiteChat`](#publicwebsitechat)\n- [`WebsiteChatDesign`](#websitechatdesign)\n- [`PublicEvent`](#publicevent)\n- [`PublicChatError`](#publicchaterror)\n\n### `listWebsiteChats`\n\n`GET /v1/website-chats`\n\n```ts\nconst { data } = await client.listWebsiteChats({\n cursor: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"website_chats\": [\n {\n \"name\": \"string\",\n \"agent_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"settings\": {\n \"allowed_origins\": [\"string\"],\n \"organisation_name\": \"string\",\n \"default_locale\": \"en\",\n \"design_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"authentication\": {\n \"email_code\": {\n \"email_template_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n }\n },\n \"website_chat_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"org_id\": \"string\",\n \"binding_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"version\": 1,\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"embed\": {\n \"script_url\": \"https://example.com/path\",\n \"chat_api_origin\": \"https://example.com/path\",\n \"demo_url\": \"https://example.com/path\"\n }\n }\n ],\n \"next_cursor\": \"string\"\n}\n```\n\n
\n\n---\n\n### `createWebsiteChat`\n\n`POST /v1/website-chats`\n\n```ts\nconst { data } = await client.createWebsiteChat(\n null,\n {\n name: 'string',\n agent_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n settings: {\n allowed_origins: ['string'],\n organisation_name: 'string',\n default_locale: 'en',\n design_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n authentication: {\n email_code: {\n email_template_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6'\n }\n }\n }\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"name\": \"string\",\n \"agent_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"settings\": {\n \"allowed_origins\": [\"string\"],\n \"organisation_name\": \"string\",\n \"default_locale\": \"en\",\n \"design_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"authentication\": {\n \"email_code\": {\n \"email_template_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n }\n },\n \"website_chat_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"org_id\": \"string\",\n \"binding_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"version\": 1,\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"embed\": {\n \"script_url\": \"https://example.com/path\",\n \"chat_api_origin\": \"https://example.com/path\",\n \"demo_url\": \"https://example.com/path\"\n }\n}\n```\n\n
\n\n---\n\n### `getWebsiteChat`\n\n`GET /v1/website-chats/{website_chat_id}`\n\n```ts\nconst { data } = await client.getWebsiteChat({\n website_chat_id: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"name\": \"string\",\n \"agent_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"settings\": {\n \"allowed_origins\": [\"string\"],\n \"organisation_name\": \"string\",\n \"default_locale\": \"en\",\n \"design_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"authentication\": {\n \"email_code\": {\n \"email_template_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n }\n },\n \"website_chat_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"org_id\": \"string\",\n \"binding_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"version\": 1,\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"embed\": {\n \"script_url\": \"https://example.com/path\",\n \"chat_api_origin\": \"https://example.com/path\",\n \"demo_url\": \"https://example.com/path\"\n }\n}\n```\n\n
\n\n---\n\n### `updateWebsiteChat`\n\n`PUT /v1/website-chats/{website_chat_id}`\n\n```ts\nconst { data } = await client.updateWebsiteChat(\n {\n website_chat_id: 'example',\n },\n {\n name: 'string',\n agent_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n settings: {\n allowed_origins: ['string'],\n organisation_name: 'string',\n default_locale: 'en',\n design_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n authentication: {\n email_code: {\n email_template_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6'\n }\n }\n },\n version: 1\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"name\": \"string\",\n \"agent_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"settings\": {\n \"allowed_origins\": [\"string\"],\n \"organisation_name\": \"string\",\n \"default_locale\": \"en\",\n \"design_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"authentication\": {\n \"email_code\": {\n \"email_template_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n }\n },\n \"website_chat_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"org_id\": \"string\",\n \"binding_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"version\": 1,\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"embed\": {\n \"script_url\": \"https://example.com/path\",\n \"chat_api_origin\": \"https://example.com/path\",\n \"demo_url\": \"https://example.com/path\"\n }\n}\n```\n\n
\n\n---\n\n### `deleteWebsiteChat`\n\n`DELETE /v1/website-chats/{website_chat_id}`\n\n```ts\nconst { data } = await client.deleteWebsiteChat({\n website_chat_id: 'example',\n version: 1,\n})\n```\n\n---\n\n### `getPublicWebsiteChat`\n\n`GET /v1/website-chats/{website_chat_id}/configuration`\n\n```ts\nconst { data } = await client.getPublicWebsiteChat({\n website_chat_id: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"key\": \"string\",\n \"organisationName\": \"string\",\n \"assistantName\": \"string\",\n \"defaultLocale\": \"en\",\n \"authentication\": {\n \"email_code\": true\n },\n \"design\": {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"last_modified_at\": \"string\",\n \"style\": {\n \"palette\": {\n \"primary\": \"string\",\n \"background\": \"string\"\n },\n \"typography\": {\n \"font\": {\n \"font_family\": \"string\"\n }\n },\n \"shape\": {\n \"border_radius\": 0\n }\n },\n \"spark_theme\": {\n \"accentColor\": \"string\",\n \"backgroundColor\": \"string\",\n \"fontBody\": \"string\",\n \"fontHeading\": \"string\",\n \"radius\": \"string\",\n \"scaling\": \"string\",\n \"spacing\": \"string\",\n \"appearance\": \"string\",\n \"neutralColor\": \"string\",\n \"styleVariant\": \"string\",\n \"labelPosition\": \"string\",\n \"inputStyle\": \"string\",\n \"inputColor\": \"string\",\n \"cardVariant\": \"string\",\n \"cardColor\": \"string\",\n \"highContrast\": true\n }\n },\n \"locales\": [\"en\"]\n}\n```\n\n
\n\n---\n\n### `createPublicChatGrant`\n\n`POST /v1/bootstrap`\n\n```ts\nconst { data } = await client.createPublicChatGrant(\n null,\n {\n website_chat_id: 'string'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"grant\": \"string\",\n \"expires_in\": 60,\n \"frame_origin\": \"https://example.com/path\"\n}\n```\n\n
\n\n---\n\n### `createAnonymousChatSession`\n\n`POST /v1/sessions`\n\n```ts\nconst { data } = await client.createAnonymousChatSession(\n null,\n {\n grant: 'string'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"token\": \"string\",\n \"conversation_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"expires_at\": 0,\n \"website_chat\": {\n \"key\": \"string\",\n \"organisationName\": \"string\",\n \"assistantName\": \"string\",\n \"defaultLocale\": \"en\",\n \"authentication\": {\n \"email_code\": true\n },\n \"design\": {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"last_modified_at\": \"string\",\n \"style\": {\n \"palette\": {\n \"primary\": \"string\",\n \"background\": \"string\"\n },\n \"typography\": {\n \"font\": {\n \"font_family\": \"string\"\n }\n },\n \"shape\": {\n \"border_radius\": 0\n }\n },\n \"spark_theme\": {\n \"accentColor\": \"string\",\n \"backgroundColor\": \"string\",\n \"fontBody\": \"string\",\n \"fontHeading\": \"string\",\n \"radius\": \"string\",\n \"scaling\": \"string\",\n \"spacing\": \"string\",\n \"appearance\": \"string\",\n \"neutralColor\": \"string\",\n \"styleVariant\": \"string\",\n \"labelPosition\": \"string\",\n \"inputStyle\": \"string\",\n \"inputColor\": \"string\",\n \"cardVariant\": \"string\",\n \"cardColor\": \"string\",\n \"highContrast\": true\n }\n },\n \"locales\": [\"en\"]\n }\n}\n```\n\n
\n\n---\n\n### `sendAnonymousChatMessage`\n\n`POST /v1/messages`\n\n```ts\nconst { data } = await client.sendAnonymousChatMessage(\n null,\n {\n request_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n message: 'string',\n locale: 'en',\n simple_language: true\n },\n)\n```\n\n---\n\n### `getChatVerification`\n\n`GET /v1/verification`\n\n```ts\nconst { data } = await client.getChatVerification()\n```\n\n
\nResponse\n\n```json\n{\n \"available\": true,\n \"conversation_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"status\": \"anonymous\",\n \"challenge_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"code_expires_at\": 0,\n \"resend_after\": 0,\n \"email\": \"user@example.com\",\n \"contact_resolution\": \"matched\"\n}\n```\n\n
\n\n---\n\n### `startChatEmailVerification`\n\n`POST /v1/verification/email`\n\n```ts\nconst { data } = await client.startChatEmailVerification(\n null,\n {\n request_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n email: 'user@example.com',\n locale: 'en'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"available\": true,\n \"conversation_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"status\": \"anonymous\",\n \"challenge_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"code_expires_at\": 0,\n \"resend_after\": 0,\n \"email\": \"user@example.com\",\n \"contact_resolution\": \"matched\"\n}\n```\n\n
\n\n---\n\n### `verifyChatEmailCode`\n\n`POST /v1/verification/code`\n\n```ts\nconst { data } = await client.verifyChatEmailCode(\n null,\n {\n challenge_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n code: 'string'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"available\": true,\n \"conversation_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"status\": \"anonymous\",\n \"challenge_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"code_expires_at\": 0,\n \"resend_after\": 0,\n \"email\": \"user@example.com\",\n \"contact_resolution\": \"matched\"\n}\n```\n\n
\n\n---\n\n### `cancelChatVerification`\n\n`POST /v1/verification/cancel`\n\n```ts\nconst { data } = await client.cancelChatVerification()\n```\n\n
\nResponse\n\n```json\n{\n \"available\": true,\n \"conversation_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"status\": \"anonymous\",\n \"challenge_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"code_expires_at\": 0,\n \"resend_after\": 0,\n \"email\": \"user@example.com\",\n \"contact_resolution\": \"matched\"\n}\n```\n\n
\n\n---\n\n## Schemas\n\n### `ListWebsiteChatsResponse`\n\n```ts\ntype ListWebsiteChatsResponse = {\n website_chats: Array<{\n name: string\n agent_id: string // uuid\n settings: {\n allowed_origins: { ... }\n organisation_name: { ... }\n default_locale: { ... }\n design_id?: { ... }\n authentication?: { ... }\n }\n website_chat_id: string // uuid\n org_id: string\n binding_id: string // uuid\n version: number\n created_at: string // date-time\n updated_at: string // date-time\n embed: {\n script_url: { ... }\n chat_api_origin: { ... }\n demo_url: { ... }\n }\n }>\n next_cursor?: string\n}\n```\n\n### `WebsiteChat`\n\n```ts\ntype WebsiteChat = {\n name: string\n agent_id: string // uuid\n settings: {\n allowed_origins: string[]\n organisation_name: string\n default_locale: \"en\" | \"de\"\n design_id?: string // uuid\n authentication?: {\n email_code: { ... }\n }\n }\n website_chat_id: string // uuid\n org_id: string\n binding_id: string // uuid\n version: number\n created_at: string // date-time\n updated_at: string // date-time\n embed: {\n script_url: string // uri\n chat_api_origin: string // uri\n demo_url: string // uri\n }\n}\n```\n\n### `WebsiteChatSettings`\n\n```ts\ntype WebsiteChatSettings = {\n allowed_origins: string[]\n organisation_name: string\n default_locale: \"en\" | \"de\"\n design_id?: string // uuid\n authentication?: {\n email_code: {\n email_template_id?: { ... }\n }\n }\n}\n```\n\n### `Error`\n\n```ts\ntype Error = {\n error?: string\n message?: string\n details?: object\n}\n```\n\n### `CreateWebsiteChatRequest`\n\n```ts\ntype CreateWebsiteChatRequest = {\n name: string\n agent_id: string // uuid\n settings: {\n allowed_origins: string[]\n organisation_name: string\n default_locale: \"en\" | \"de\"\n design_id?: string // uuid\n authentication?: {\n email_code: { ... }\n }\n }\n}\n```\n\n### `UpdateWebsiteChatRequest`\n\n```ts\ntype UpdateWebsiteChatRequest = {\n name?: string\n agent_id?: string // uuid\n settings?: {\n allowed_origins: string[]\n organisation_name: string\n default_locale: \"en\" | \"de\"\n design_id?: string // uuid\n authentication?: {\n email_code: { ... }\n }\n }\n version: number\n}\n```\n\n### `VerificationState`\n\n```ts\ntype VerificationState = {\n available: boolean\n conversation_id: string // uuid\n status: \"anonymous\" | \"sending\" | \"pending\" | \"verified\"\n challenge_id?: string // uuid\n code_expires_at?: number\n resend_after?: number\n email?: string // email\n contact_resolution?: \"matched\" | \"ambiguous\" | \"not_found\"\n}\n```\n\n### `PublicWebsiteChat`\n\n```ts\ntype PublicWebsiteChat = {\n key: string\n organisationName: string\n assistantName: string\n defaultLocale: \"en\" | \"de\"\n authentication?: {\n email_code: boolean\n }\n design?: {\n id: string // uuid\n last_modified_at?: string\n style?: {\n palette?: { ... }\n typography?: { ... }\n shape?: { ... }\n }\n spark_theme?: {\n accentColor?: { ... }\n backgroundColor?: { ... }\n fontBody?: { ... }\n fontHeading?: { ... }\n radius?: { ... }\n scaling?: { ... }\n spacing?: { ... }\n appearance?: { ... }\n neutralColor?: { ... }\n styleVariant?: { ... }\n labelPosition?: { ... }\n inputStyle?: { ... }\n inputColor?: { ... }\n cardVariant?: { ... }\n cardColor?: { ... }\n highContrast?: { ... }\n }\n }\n locales: \"en\" | \"de\"[]\n}\n```\n\n### `WebsiteChatDesign`\n\n```ts\ntype WebsiteChatDesign = {\n id: string // uuid\n last_modified_at?: string\n style?: {\n palette?: {\n primary?: { ... }\n background?: { ... }\n }\n typography?: {\n font?: { ... }\n }\n shape?: {\n border_radius?: { ... }\n }\n }\n spark_theme?: {\n accentColor?: string\n backgroundColor?: string\n fontBody?: string\n fontHeading?: string\n radius?: string\n scaling?: string\n spacing?: string\n appearance?: string\n neutralColor?: string\n styleVariant?: string\n labelPosition?: string\n inputStyle?: string\n inputColor?: string\n cardVariant?: string\n cardColor?: string\n highContrast?: boolean\n }\n}\n```\n\n### `PublicEvent`\n\nJSON payload of one SSE data frame from sendAnonymousChatMessage.\n\n```ts\ntype PublicEvent = {\n type: \"delta\"\n text: string\n request_id: string // uuid\n} | {\n type: \"complete\"\n text: string\n request_id: string // uuid\n} | {\n type: \"error\"\n code: \"UNAVAILABLE\"\n request_id: string // uuid\n}\n```\n\n### `PublicChatError`\n\n```ts\ntype PublicChatError = {\n code: \"INVALID_VERIFICATION_CODE\" | \"VERIFICATION_EXPIRED\" | \"VERIFICATION_CONFLICT\" | \"VERIFICATION_DISABLED\" | \"VERIFICATION_UNAVAILABLE\" | \"IDENTITY_CHANGED\" | \"INVALID_REQUEST\" | \"ORIGIN_DENIED\" | \"NOT_FOUND\" | \"INVALID_GRANT\" | \"SESSION_EXPIRED\" | \"RATE_LIMITED\" | \"SESSION_LIMIT\" | \"USAGE_LIMIT\" | \"REQUEST_CONFLICT\" | \"IN_PROGRESS\" | \"UNAVAILABLE\" | \"TEMPORARILY_UNAVAILABLE\"\n}\n```\n" diff --git a/packages/epilot-sdk-v2/src/types/chat.d.ts b/packages/epilot-sdk-v2/src/types/chat.d.ts index a48984764..27760f737 100644 --- a/packages/epilot-sdk-v2/src/types/chat.d.ts +++ b/packages/epilot-sdk-v2/src/types/chat.d.ts @@ -10,16 +10,16 @@ import type { export declare namespace Components { namespace Responses { export interface Error { - code: "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; + code: "INVALID_VERIFICATION_CODE" | "VERIFICATION_EXPIRED" | "VERIFICATION_CONFLICT" | "VERIFICATION_DISABLED" | "VERIFICATION_UNAVAILABLE" | "IDENTITY_CHANGED" | "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; } } namespace Schemas { - export interface ChatWidget { + export interface CreateWebsiteChatRequest { name: string; agent_id: string | null; // uuid - website_chat: { + settings: { /** - * Exact HTTPS origins. Empty means the widget cannot start sessions. + * Exact HTTPS origins. Empty means the Website Chat cannot start sessions. */ allowed_origins: [ string?, @@ -76,99 +76,7 @@ export declare namespace Components { organisation_name: string; default_locale: "en" | "de"; /** - * Design Builder configuration for the widget only. - */ - design_id?: string | null; // uuid - /** - * Email Builder template selection. Does not enable verification by itself. - */ - authentication?: { - email_code: { - email_template_id?: string | null; // uuid - }; - } | null; - }; - /** - * Stable public embed identifier, independent of the assigned agent. Not a credential. - */ - widget_id: string; // uuid - org_id: string; - /** - * Server-owned session binding; changes on reassignment or allowed-origin changes. - */ - binding_id: string; // uuid - version: number; - created_at: string; // date-time - updated_at: string; // date-time - website_chat_embed: { - script_url: string; // uri - chat_api_origin: string; // uri - demo_url: string; // uri - }; - } - export interface CreateChatWidgetRequest { - name: string; - agent_id: string | null; // uuid - website_chat: { - /** - * Exact HTTPS origins. Empty means the widget cannot start sessions. - */ - allowed_origins: [ - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string? - ]; - organisation_name: string; - default_locale: "en" | "de"; - /** - * Design Builder configuration for the widget only. + * Design Builder configuration for the Website Chat only. */ design_id?: string | null; // uuid /** @@ -188,13 +96,13 @@ export declare namespace Components { [key: string]: any; }; } - export interface ListChatWidgetsResponse { - widgets: { + export interface ListWebsiteChatsResponse { + website_chats: { name: string; agent_id: string | null; // uuid - website_chat: { + settings: { /** - * Exact HTTPS origins. Empty means the widget cannot start sessions. + * Exact HTTPS origins. Empty means the Website Chat cannot start sessions. */ allowed_origins: [ string?, @@ -251,7 +159,7 @@ export declare namespace Components { organisation_name: string; default_locale: "en" | "de"; /** - * Design Builder configuration for the widget only. + * Design Builder configuration for the Website Chat only. */ design_id?: string | null; // uuid /** @@ -266,7 +174,7 @@ export declare namespace Components { /** * Stable public embed identifier, independent of the assigned agent. Not a credential. */ - widget_id: string; // uuid + website_chat_id: string; // uuid org_id: string; /** * Server-owned session binding; changes on reassignment or allowed-origin changes. @@ -275,7 +183,7 @@ export declare namespace Components { version: number; created_at: string; // date-time updated_at: string; // date-time - website_chat_embed: { + embed: { script_url: string; // uri chat_api_origin: string; // uri demo_url: string; // uri @@ -284,7 +192,7 @@ export declare namespace Components { next_cursor?: string; } export interface PublicChatError { - code: "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; + code: "INVALID_VERIFICATION_CODE" | "VERIFICATION_EXPIRED" | "VERIFICATION_CONFLICT" | "VERIFICATION_DISABLED" | "VERIFICATION_UNAVAILABLE" | "IDENTITY_CHANGED" | "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; } /** * JSON payload of one SSE data frame from sendAnonymousChatMessage. @@ -302,12 +210,58 @@ export declare namespace Components { code: "UNAVAILABLE"; request_id: string; // uuid }; - export interface UpdateChatWidgetRequest { + export interface PublicWebsiteChat { + key: string; + organisationName: string; + assistantName: string; + defaultLocale: "en" | "de"; + authentication?: { + email_code: boolean; + }; + design?: { + id: string; // uuid + last_modified_at?: string; + style?: { + palette?: { + primary?: string; + background?: string; + }; + typography?: { + font?: { + font_family?: string; + }; + }; + shape?: { + border_radius?: number; + }; + }; + spark_theme?: { + accentColor?: string; + backgroundColor?: string; + fontBody?: string; + fontHeading?: string; + radius?: string; + scaling?: string; + spacing?: string; + appearance?: string; + neutralColor?: string; + styleVariant?: string; + labelPosition?: string; + inputStyle?: string; + inputColor?: string; + cardVariant?: string; + cardColor?: string; + highContrast?: boolean; + }; + }; + locales: ("en" | "de")[]; + } + export interface UpdateWebsiteChatRequest { name?: string; agent_id?: string | null; // uuid - website_chat?: { + settings?: { /** - * Exact HTTPS origins. Empty means the widget cannot start sessions. + * Exact HTTPS origins. Empty means the Website Chat cannot start sessions. */ allowed_origins: [ string?, @@ -364,7 +318,7 @@ export declare namespace Components { organisation_name: string; default_locale: "en" | "de"; /** - * Design Builder configuration for the widget only. + * Design Builder configuration for the Website Chat only. */ design_id?: string | null; // uuid /** @@ -381,9 +335,153 @@ export declare namespace Components { */ version: number; } + export interface VerificationState { + available: boolean; + conversation_id: string; // uuid + status: "anonymous" | "sending" | "pending" | "verified"; + challenge_id?: string; // uuid + /** + * Unix seconds + */ + code_expires_at?: number; + /** + * Unix seconds + */ + resend_after?: number; + email?: string; // email + contact_resolution?: "matched" | "ambiguous" | "not_found"; + } + export interface WebsiteChat { + name: string; + agent_id: string | null; // uuid + settings: { + /** + * Exact HTTPS origins. Empty means the Website Chat cannot start sessions. + */ + allowed_origins: [ + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string? + ]; + organisation_name: string; + default_locale: "en" | "de"; + /** + * Design Builder configuration for the Website Chat only. + */ + design_id?: string | null; // uuid + /** + * Email Builder template selection. Does not enable verification by itself. + */ + authentication?: { + email_code: { + email_template_id?: string | null; // uuid + }; + } | null; + }; + /** + * Stable public embed identifier, independent of the assigned agent. Not a credential. + */ + website_chat_id: string; // uuid + org_id: string; + /** + * Server-owned session binding; changes on reassignment or allowed-origin changes. + */ + binding_id: string; // uuid + version: number; + created_at: string; // date-time + updated_at: string; // date-time + embed: { + script_url: string; // uri + chat_api_origin: string; // uri + demo_url: string; // uri + }; + } + export interface WebsiteChatDesign { + id: string; // uuid + last_modified_at?: string; + style?: { + palette?: { + primary?: string; + background?: string; + }; + typography?: { + font?: { + font_family?: string; + }; + }; + shape?: { + border_radius?: number; + }; + }; + spark_theme?: { + accentColor?: string; + backgroundColor?: string; + fontBody?: string; + fontHeading?: string; + radius?: string; + scaling?: string; + spacing?: string; + appearance?: string; + neutralColor?: string; + styleVariant?: string; + labelPosition?: string; + inputStyle?: string; + inputColor?: string; + cardVariant?: string; + cardColor?: string; + highContrast?: boolean; + }; + } export interface WebsiteChatSettings { /** - * Exact HTTPS origins. Empty means the widget cannot start sessions. + * Exact HTTPS origins. Empty means the Website Chat cannot start sessions. */ allowed_origins: [ string?, @@ -440,100 +538,44 @@ export declare namespace Components { organisation_name: string; default_locale: "en" | "de"; /** - * Design Builder configuration for the widget only. + * Design Builder configuration for the Website Chat only. */ design_id?: string | null; // uuid /** * Email Builder template selection. Does not enable verification by itself. - */ - authentication?: { - email_code: { - email_template_id?: string | null; // uuid - }; - } | null; - } - export interface Widget { - key: string; - organisationName: string; - assistantName: string; - defaultLocale: "en" | "de"; - design?: { - id: string; // uuid - last_modified_at?: string; - style?: { - palette?: { - primary?: string; - background?: string; - }; - typography?: { - font?: { - font_family?: string; - }; - }; - shape?: { - border_radius?: number; - }; - }; - spark_theme?: { - accentColor?: string; - backgroundColor?: string; - fontBody?: string; - fontHeading?: string; - radius?: string; - scaling?: string; - spacing?: string; - appearance?: string; - neutralColor?: string; - styleVariant?: string; - labelPosition?: string; - inputStyle?: string; - inputColor?: string; - cardVariant?: string; - cardColor?: string; - highContrast?: boolean; - }; - }; - locales: ("en" | "de")[]; - } - export interface WidgetDesign { - id: string; // uuid - last_modified_at?: string; - style?: { - palette?: { - primary?: string; - background?: string; - }; - typography?: { - font?: { - font_family?: string; - }; - }; - shape?: { - border_radius?: number; - }; - }; - spark_theme?: { - accentColor?: string; - backgroundColor?: string; - fontBody?: string; - fontHeading?: string; - radius?: string; - scaling?: string; - spacing?: string; - appearance?: string; - neutralColor?: string; - styleVariant?: string; - labelPosition?: string; - inputStyle?: string; - inputColor?: string; - cardVariant?: string; - cardColor?: string; - highContrast?: boolean; - }; + */ + authentication?: { + email_code: { + email_template_id?: string | null; // uuid + }; + } | null; } } } export declare namespace Paths { + namespace CancelChatVerification { + namespace Responses { + export interface $200 { + available: boolean; + conversation_id: string; // uuid + status: "anonymous" | "sending" | "pending" | "verified"; + challenge_id?: string; // uuid + /** + * Unix seconds + */ + code_expires_at?: number; + /** + * Unix seconds + */ + resend_after?: number; + email?: string; // email + contact_resolution?: "matched" | "ambiguous" | "not_found"; + } + export interface Default { + code: "INVALID_VERIFICATION_CODE" | "VERIFICATION_EXPIRED" | "VERIFICATION_CONFLICT" | "VERIFICATION_DISABLED" | "VERIFICATION_UNAVAILABLE" | "IDENTITY_CHANGED" | "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; + } + } + } namespace CreateAnonymousChatSession { export interface RequestBody { grant: string; // ^[A-Za-z0-9_-]{43}$ @@ -546,11 +588,14 @@ export declare namespace Paths { * Unix seconds */ expires_at: number; - widget: { + website_chat: { key: string; organisationName: string; assistantName: string; defaultLocale: "en" | "de"; + authentication?: { + email_code: boolean; + }; design?: { id: string; // uuid last_modified_at?: string; @@ -591,17 +636,36 @@ export declare namespace Paths { }; } export interface Default { - code: "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; + code: "INVALID_VERIFICATION_CODE" | "VERIFICATION_EXPIRED" | "VERIFICATION_CONFLICT" | "VERIFICATION_DISABLED" | "VERIFICATION_UNAVAILABLE" | "IDENTITY_CHANGED" | "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; + } + } + } + namespace CreatePublicChatGrant { + export interface RequestBody { + website_chat_id: string; // ^[a-zA-Z0-9_-]{1,100}$ + } + namespace Responses { + export interface $201 { + grant: string; + /** + * example: + * 60 + */ + expires_in: number; + frame_origin: string; // uri + } + export interface Default { + code: "INVALID_VERIFICATION_CODE" | "VERIFICATION_EXPIRED" | "VERIFICATION_CONFLICT" | "VERIFICATION_DISABLED" | "VERIFICATION_UNAVAILABLE" | "IDENTITY_CHANGED" | "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; } } } - namespace CreateChatWidget { + namespace CreateWebsiteChat { export interface RequestBody { name: string; agent_id: string | null; // uuid - website_chat: { + settings: { /** - * Exact HTTPS origins. Empty means the widget cannot start sessions. + * Exact HTTPS origins. Empty means the Website Chat cannot start sessions. */ allowed_origins: [ string?, @@ -658,7 +722,7 @@ export declare namespace Paths { organisation_name: string; default_locale: "en" | "de"; /** - * Design Builder configuration for the widget only. + * Design Builder configuration for the Website Chat only. */ design_id?: string | null; // uuid /** @@ -675,9 +739,9 @@ export declare namespace Paths { export interface $201 { name: string; agent_id: string | null; // uuid - website_chat: { + settings: { /** - * Exact HTTPS origins. Empty means the widget cannot start sessions. + * Exact HTTPS origins. Empty means the Website Chat cannot start sessions. */ allowed_origins: [ string?, @@ -734,7 +798,7 @@ export declare namespace Paths { organisation_name: string; default_locale: "en" | "de"; /** - * Design Builder configuration for the widget only. + * Design Builder configuration for the Website Chat only. */ design_id?: string | null; // uuid /** @@ -749,7 +813,7 @@ export declare namespace Paths { /** * Stable public embed identifier, independent of the assigned agent. Not a credential. */ - widget_id: string; // uuid + website_chat_id: string; // uuid org_id: string; /** * Server-owned session binding; changes on reassignment or allowed-origin changes. @@ -758,7 +822,7 @@ export declare namespace Paths { version: number; created_at: string; // date-time updated_at: string; // date-time - website_chat_embed: { + embed: { script_url: string; // uri chat_api_origin: string; // uri demo_url: string; // uri @@ -787,26 +851,7 @@ export declare namespace Paths { } } } - namespace CreatePublicChatGrant { - export interface RequestBody { - widget_key: string; // ^[a-zA-Z0-9_-]{1,100}$ - } - namespace Responses { - export interface $201 { - grant: string; - /** - * example: - * 60 - */ - expires_in: number; - widget_origin: string; // uri - } - export interface Default { - code: "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; - } - } - } - namespace DeleteChatWidget { + namespace DeleteWebsiteChat { namespace Parameters { export type Version = number; } @@ -839,14 +884,96 @@ export declare namespace Paths { } } } - namespace GetChatWidget { + namespace GetChatVerification { + namespace Responses { + export interface $200 { + available: boolean; + conversation_id: string; // uuid + status: "anonymous" | "sending" | "pending" | "verified"; + challenge_id?: string; // uuid + /** + * Unix seconds + */ + code_expires_at?: number; + /** + * Unix seconds + */ + resend_after?: number; + email?: string; // email + contact_resolution?: "matched" | "ambiguous" | "not_found"; + } + export interface Default { + code: "INVALID_VERIFICATION_CODE" | "VERIFICATION_EXPIRED" | "VERIFICATION_CONFLICT" | "VERIFICATION_DISABLED" | "VERIFICATION_UNAVAILABLE" | "IDENTITY_CHANGED" | "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; + } + } + } + namespace GetPublicWebsiteChat { + namespace Parameters { + export type WebsiteChatId = string; // ^[a-zA-Z0-9_-]{1,100}$ + } + export interface PathParameters { + website_chat_id: Parameters.WebsiteChatId /* ^[a-zA-Z0-9_-]{1,100}$ */; + } + namespace Responses { + export interface $200 { + key: string; + organisationName: string; + assistantName: string; + defaultLocale: "en" | "de"; + authentication?: { + email_code: boolean; + }; + design?: { + id: string; // uuid + last_modified_at?: string; + style?: { + palette?: { + primary?: string; + background?: string; + }; + typography?: { + font?: { + font_family?: string; + }; + }; + shape?: { + border_radius?: number; + }; + }; + spark_theme?: { + accentColor?: string; + backgroundColor?: string; + fontBody?: string; + fontHeading?: string; + radius?: string; + scaling?: string; + spacing?: string; + appearance?: string; + neutralColor?: string; + styleVariant?: string; + labelPosition?: string; + inputStyle?: string; + inputColor?: string; + cardVariant?: string; + cardColor?: string; + highContrast?: boolean; + }; + }; + locales: ("en" | "de")[]; + } + export interface Default { + code: "INVALID_VERIFICATION_CODE" | "VERIFICATION_EXPIRED" | "VERIFICATION_CONFLICT" | "VERIFICATION_DISABLED" | "VERIFICATION_UNAVAILABLE" | "IDENTITY_CHANGED" | "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; + } + } + } + namespace GetWebsiteChat { namespace Responses { export interface $200 { name: string; agent_id: string | null; // uuid - website_chat: { + settings: { /** - * Exact HTTPS origins. Empty means the widget cannot start sessions. + * Exact HTTPS origins. Empty means the Website Chat cannot start sessions. */ allowed_origins: [ string?, @@ -903,7 +1030,7 @@ export declare namespace Paths { organisation_name: string; default_locale: "en" | "de"; /** - * Design Builder configuration for the widget only. + * Design Builder configuration for the Website Chat only. */ design_id?: string | null; // uuid /** @@ -918,7 +1045,7 @@ export declare namespace Paths { /** * Stable public embed identifier, independent of the assigned agent. Not a credential. */ - widget_id: string; // uuid + website_chat_id: string; // uuid org_id: string; /** * Server-owned session binding; changes on reassignment or allowed-origin changes. @@ -927,7 +1054,7 @@ export declare namespace Paths { version: number; created_at: string; // date-time updated_at: string; // date-time - website_chat_embed: { + embed: { script_url: string; // uri chat_api_origin: string; // uri demo_url: string; // uri @@ -956,63 +1083,7 @@ export declare namespace Paths { } } } - namespace GetPublicChatWidget { - namespace Parameters { - export type WidgetId = string; // ^[a-zA-Z0-9_-]{1,100}$ - } - export interface PathParameters { - widget_id: Parameters.WidgetId /* ^[a-zA-Z0-9_-]{1,100}$ */; - } - namespace Responses { - export interface $200 { - key: string; - organisationName: string; - assistantName: string; - defaultLocale: "en" | "de"; - design?: { - id: string; // uuid - last_modified_at?: string; - style?: { - palette?: { - primary?: string; - background?: string; - }; - typography?: { - font?: { - font_family?: string; - }; - }; - shape?: { - border_radius?: number; - }; - }; - spark_theme?: { - accentColor?: string; - backgroundColor?: string; - fontBody?: string; - fontHeading?: string; - radius?: string; - scaling?: string; - spacing?: string; - appearance?: string; - neutralColor?: string; - styleVariant?: string; - labelPosition?: string; - inputStyle?: string; - inputColor?: string; - cardVariant?: string; - cardColor?: string; - highContrast?: boolean; - }; - }; - locales: ("en" | "de")[]; - } - export interface Default { - code: "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; - } - } - } - namespace ListChatWidgets { + namespace ListWebsiteChats { namespace Parameters { export type Cursor = string; } @@ -1021,12 +1092,12 @@ export declare namespace Paths { } namespace Responses { export interface $200 { - widgets: { + website_chats: { name: string; agent_id: string | null; // uuid - website_chat: { + settings: { /** - * Exact HTTPS origins. Empty means the widget cannot start sessions. + * Exact HTTPS origins. Empty means the Website Chat cannot start sessions. */ allowed_origins: [ string?, @@ -1083,7 +1154,7 @@ export declare namespace Paths { organisation_name: string; default_locale: "en" | "de"; /** - * Design Builder configuration for the widget only. + * Design Builder configuration for the Website Chat only. */ design_id?: string | null; // uuid /** @@ -1098,7 +1169,7 @@ export declare namespace Paths { /** * Stable public embed identifier, independent of the assigned agent. Not a credential. */ - widget_id: string; // uuid + website_chat_id: string; // uuid org_id: string; /** * Server-owned session binding; changes on reassignment or allowed-origin changes. @@ -1107,7 +1178,7 @@ export declare namespace Paths { version: number; created_at: string; // date-time updated_at: string; // date-time - website_chat_embed: { + embed: { script_url: string; // uri chat_api_origin: string; // uri demo_url: string; // uri @@ -1148,17 +1219,45 @@ export declare namespace Paths { namespace Responses { export type $200 = string; export interface Default { - code: "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; + code: "INVALID_VERIFICATION_CODE" | "VERIFICATION_EXPIRED" | "VERIFICATION_CONFLICT" | "VERIFICATION_DISABLED" | "VERIFICATION_UNAVAILABLE" | "IDENTITY_CHANGED" | "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; + } + } + } + namespace StartChatEmailVerification { + export interface RequestBody { + request_id: string; // uuid + email: string; // email + locale: "en" | "de"; + } + namespace Responses { + export interface $200 { + available: boolean; + conversation_id: string; // uuid + status: "anonymous" | "sending" | "pending" | "verified"; + challenge_id?: string; // uuid + /** + * Unix seconds + */ + code_expires_at?: number; + /** + * Unix seconds + */ + resend_after?: number; + email?: string; // email + contact_resolution?: "matched" | "ambiguous" | "not_found"; + } + export interface Default { + code: "INVALID_VERIFICATION_CODE" | "VERIFICATION_EXPIRED" | "VERIFICATION_CONFLICT" | "VERIFICATION_DISABLED" | "VERIFICATION_UNAVAILABLE" | "IDENTITY_CHANGED" | "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; } } } - namespace UpdateChatWidget { + namespace UpdateWebsiteChat { export interface RequestBody { name?: string; agent_id?: string | null; // uuid - website_chat?: { + settings?: { /** - * Exact HTTPS origins. Empty means the widget cannot start sessions. + * Exact HTTPS origins. Empty means the Website Chat cannot start sessions. */ allowed_origins: [ string?, @@ -1215,7 +1314,7 @@ export declare namespace Paths { organisation_name: string; default_locale: "en" | "de"; /** - * Design Builder configuration for the widget only. + * Design Builder configuration for the Website Chat only. */ design_id?: string | null; // uuid /** @@ -1236,9 +1335,9 @@ export declare namespace Paths { export interface $200 { name: string; agent_id: string | null; // uuid - website_chat: { + settings: { /** - * Exact HTTPS origins. Empty means the widget cannot start sessions. + * Exact HTTPS origins. Empty means the Website Chat cannot start sessions. */ allowed_origins: [ string?, @@ -1295,7 +1394,7 @@ export declare namespace Paths { organisation_name: string; default_locale: "en" | "de"; /** - * Design Builder configuration for the widget only. + * Design Builder configuration for the Website Chat only. */ design_id?: string | null; // uuid /** @@ -1310,7 +1409,7 @@ export declare namespace Paths { /** * Stable public embed identifier, independent of the assigned agent. Not a credential. */ - widget_id: string; // uuid + website_chat_id: string; // uuid org_id: string; /** * Server-owned session binding; changes on reassignment or allowed-origin changes. @@ -1319,7 +1418,7 @@ export declare namespace Paths { version: number; created_at: string; // date-time updated_at: string; // date-time - website_chat_embed: { + embed: { script_url: string; // uri chat_api_origin: string; // uri demo_url: string; // uri @@ -1348,12 +1447,39 @@ export declare namespace Paths { } } } - namespace V1Widgets$WidgetId { + namespace V1WebsiteChats$WebsiteChatId { namespace Parameters { - export type WidgetId = string; // uuid + export type WebsiteChatId = string; // uuid } export interface PathParameters { - widget_id: Parameters.WidgetId /* uuid */; + website_chat_id: Parameters.WebsiteChatId /* uuid */; + } + } + namespace VerifyChatEmailCode { + export interface RequestBody { + challenge_id: string; // uuid + code: string; // ^\d{6}$ + } + namespace Responses { + export interface $200 { + available: boolean; + conversation_id: string; // uuid + status: "anonymous" | "sending" | "pending" | "verified"; + challenge_id?: string; // uuid + /** + * Unix seconds + */ + code_expires_at?: number; + /** + * Unix seconds + */ + resend_after?: number; + email?: string; // email + contact_resolution?: "matched" | "ambiguous" | "not_found"; + } + export interface Default { + code: "INVALID_VERIFICATION_CODE" | "VERIFICATION_EXPIRED" | "VERIFICATION_CONFLICT" | "VERIFICATION_DISABLED" | "VERIFICATION_UNAVAILABLE" | "IDENTITY_CHANGED" | "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; + } } } } @@ -1361,55 +1487,55 @@ export declare namespace Paths { export interface OperationMethods { /** - * listChatWidgets + * listWebsiteChats */ - 'listChatWidgets'( - parameters?: Parameters | null, + 'listWebsiteChats'( + parameters?: Parameters | null, data?: any, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse /** - * createChatWidget + * createWebsiteChat */ - 'createChatWidget'( + 'createWebsiteChat'( parameters?: Parameters | null, - data?: Paths.CreateChatWidget.RequestBody, + data?: Paths.CreateWebsiteChat.RequestBody, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse /** - * getChatWidget + * getWebsiteChat */ - 'getChatWidget'( - parameters?: Parameters | null, + 'getWebsiteChat'( + parameters?: Parameters | null, data?: any, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse /** - * updateChatWidget + * updateWebsiteChat */ - 'updateChatWidget'( - parameters?: Parameters | null, - data?: Paths.UpdateChatWidget.RequestBody, + 'updateWebsiteChat'( + parameters?: Parameters | null, + data?: Paths.UpdateWebsiteChat.RequestBody, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse /** - * deleteChatWidget + * deleteWebsiteChat */ - 'deleteChatWidget'( - parameters?: Parameters | null, + 'deleteWebsiteChat'( + parameters?: Parameters | null, data?: any, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse /** - * getPublicChatWidget - Resolve visitor-facing configuration for an independent widget and its current agent assignment. The widget ID is not an organisation ID or a destination such as website or portal. + * getPublicWebsiteChat - Resolve visitor-facing configuration for an independent Website Chat and its current agent assignment. The Website Chat ID is not an organisation ID or a destination such as website or portal. */ - 'getPublicChatWidget'( - parameters?: Parameters | null, + 'getPublicWebsiteChat'( + parameters?: Parameters | null, data?: any, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse /** - * createPublicChatGrant - Called by the host website with its widget_key. Checks the saved website origin allowlist and issues a single-use grant for the iframe to exchange at POST /v1/sessions within 60 seconds. This deadline does not limit the resulting session. + * createPublicChatGrant - Called by the host website with its website_chat_id. Checks the saved website origin allowlist and issues a single-use grant for the iframe to exchange at POST /v1/sessions within 60 seconds. This deadline does not limit the resulting session. */ 'createPublicChatGrant'( parameters?: Parameters | null, @@ -1437,66 +1563,98 @@ export interface OperationMethods { data?: Paths.SendAnonymousChatMessage.RequestBody, config?: AxiosRequestConfig ): OperationResponse + /** + * getChatVerification - Read this session's verification state. No contact IDs or candidate records are exposed. + */ + 'getChatVerification'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + /** + * startChatEmailVerification - Start or resend an email challenge using the template saved on this session's Website Chat. Repeating the same request_id and payload does not send another email. Codes must never be sent as chat messages. + */ + 'startChatEmailVerification'( + parameters?: Parameters | null, + data?: Paths.StartChatEmailVerification.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse + /** + * verifyChatEmailCode - Verify a code for this session's current challenge. Success binds email proof and contact resolution to this session and starts a new conversation. It grants no account-tool permission. + */ + 'verifyChatEmailCode'( + parameters?: Parameters | null, + data?: Paths.VerifyChatEmailCode.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse + /** + * cancelChatVerification - Cancel a pending challenge or clear verified identity. Clearing verified identity starts a new anonymous conversation. In-flight verification cannot restore the cleared identity. + */ + 'cancelChatVerification'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse } export interface PathsDictionary { - ['/v1/widgets']: { + ['/v1/website-chats']: { /** - * listChatWidgets + * listWebsiteChats */ 'get'( - parameters?: Parameters | null, + parameters?: Parameters | null, data?: any, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse /** - * createChatWidget + * createWebsiteChat */ 'post'( parameters?: Parameters | null, - data?: Paths.CreateChatWidget.RequestBody, + data?: Paths.CreateWebsiteChat.RequestBody, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse } - ['/v1/widgets/{widget_id}']: { + ['/v1/website-chats/{website_chat_id}']: { /** - * getChatWidget + * getWebsiteChat */ 'get'( - parameters?: Parameters | null, + parameters?: Parameters | null, data?: any, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse /** - * updateChatWidget + * updateWebsiteChat */ 'put'( - parameters?: Parameters | null, - data?: Paths.UpdateChatWidget.RequestBody, + parameters?: Parameters | null, + data?: Paths.UpdateWebsiteChat.RequestBody, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse /** - * deleteChatWidget + * deleteWebsiteChat */ 'delete'( - parameters?: Parameters | null, + parameters?: Parameters | null, data?: any, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse } - ['/v1/widgets/{widget_id}/configuration']: { + ['/v1/website-chats/{website_chat_id}/configuration']: { /** - * getPublicChatWidget - Resolve visitor-facing configuration for an independent widget and its current agent assignment. The widget ID is not an organisation ID or a destination such as website or portal. + * getPublicWebsiteChat - Resolve visitor-facing configuration for an independent Website Chat and its current agent assignment. The Website Chat ID is not an organisation ID or a destination such as website or portal. */ 'get'( - parameters?: Parameters | null, + parameters?: Parameters | null, data?: any, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse } ['/v1/bootstrap']: { /** - * createPublicChatGrant - Called by the host website with its widget_key. Checks the saved website origin allowlist and issues a single-use grant for the iframe to exchange at POST /v1/sessions within 60 seconds. This deadline does not limit the resulting session. + * createPublicChatGrant - Called by the host website with its website_chat_id. Checks the saved website origin allowlist and issues a single-use grant for the iframe to exchange at POST /v1/sessions within 60 seconds. This deadline does not limit the resulting session. */ 'post'( parameters?: Parameters | null, @@ -1529,18 +1687,59 @@ export interface PathsDictionary { config?: AxiosRequestConfig ): OperationResponse } + ['/v1/verification']: { + /** + * getChatVerification - Read this session's verification state. No contact IDs or candidate records are exposed. + */ + 'get'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + } + ['/v1/verification/email']: { + /** + * startChatEmailVerification - Start or resend an email challenge using the template saved on this session's Website Chat. Repeating the same request_id and payload does not send another email. Codes must never be sent as chat messages. + */ + 'post'( + parameters?: Parameters | null, + data?: Paths.StartChatEmailVerification.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse + } + ['/v1/verification/code']: { + /** + * verifyChatEmailCode - Verify a code for this session's current challenge. Success binds email proof and contact resolution to this session and starts a new conversation. It grants no account-tool permission. + */ + 'post'( + parameters?: Parameters | null, + data?: Paths.VerifyChatEmailCode.RequestBody, + config?: AxiosRequestConfig + ): OperationResponse + } + ['/v1/verification/cancel']: { + /** + * cancelChatVerification - Cancel a pending challenge or clear verified identity. Clearing verified identity starts a new anonymous conversation. In-flight verification cannot restore the cleared identity. + */ + 'post'( + parameters?: Parameters | null, + data?: any, + config?: AxiosRequestConfig + ): OperationResponse + } } export type Client = OpenAPIClient -export type ChatWidget = Components.Schemas.ChatWidget; -export type CreateChatWidgetRequest = Components.Schemas.CreateChatWidgetRequest; +export type CreateWebsiteChatRequest = Components.Schemas.CreateWebsiteChatRequest; export type Error = Components.Schemas.Error; -export type ListChatWidgetsResponse = Components.Schemas.ListChatWidgetsResponse; +export type ListWebsiteChatsResponse = Components.Schemas.ListWebsiteChatsResponse; export type PublicChatError = Components.Schemas.PublicChatError; export type PublicEvent = Components.Schemas.PublicEvent; -export type UpdateChatWidgetRequest = Components.Schemas.UpdateChatWidgetRequest; +export type PublicWebsiteChat = Components.Schemas.PublicWebsiteChat; +export type UpdateWebsiteChatRequest = Components.Schemas.UpdateWebsiteChatRequest; +export type VerificationState = Components.Schemas.VerificationState; +export type WebsiteChat = Components.Schemas.WebsiteChat; +export type WebsiteChatDesign = Components.Schemas.WebsiteChatDesign; export type WebsiteChatSettings = Components.Schemas.WebsiteChatSettings; -export type Widget = Components.Schemas.Widget; -export type WidgetDesign = Components.Schemas.WidgetDesign; From 30108ef334611342e6b2294fbf722030dfa6b998 Mon Sep 17 00:00:00 2001 From: Richard Griffiths Date: Fri, 25 Sep 2026 16:18:42 +0200 Subject: [PATCH 2/3] chore(chat-client): leave @epilot/sdk and @epilot/cli regeneration to CI Co-authored-by: Claude --- .changeset/chat-client-website-chats.md | 2 - packages/cli/definitions/chat.json | 875 +++-------------- packages/cli/docs/chat.md | 322 ++---- packages/cli/docs/index.md | 2 +- packages/cli/src/generated/api-list.ts | 18 +- packages/epilot-sdk-v2/docs/chat.md | 308 ++---- .../src/definitions/chat-runtime.json | 2 +- packages/epilot-sdk-v2/src/docs/chat.json | 2 +- packages/epilot-sdk-v2/src/types/chat.d.ts | 915 +++++++----------- 9 files changed, 642 insertions(+), 1804 deletions(-) diff --git a/.changeset/chat-client-website-chats.md b/.changeset/chat-client-website-chats.md index 4ca6ef838..4c1b7f3e4 100644 --- a/.changeset/chat-client-website-chats.md +++ b/.changeset/chat-client-website-chats.md @@ -1,7 +1,5 @@ --- "@epilot/chat-client": minor -"@epilot/sdk": minor -"@epilot/cli": patch --- Regenerate the chat client from the Chat API spec after the `widgets` resource was renamed to Website Chats (the embeddable chat product is now called Website Chat). diff --git a/packages/cli/definitions/chat.json b/packages/cli/definitions/chat.json index dcff3b08a..7be35da83 100644 --- a/packages/cli/definitions/chat.json +++ b/packages/cli/definitions/chat.json @@ -3,7 +3,7 @@ "info": { "title": "epilot Chat API", "version": "0.1.0", - "description": "Website Chat management and anonymous browser chat." + "description": "Widget management and anonymous browser chat." }, "servers": [ { @@ -16,12 +16,12 @@ } ], "paths": { - "/v1/website-chats": { + "/v1/widgets": { "get": { "tags": [ - "Website Chats" + "Chat widgets" ], - "operationId": "listWebsiteChats", + "operationId": "listChatWidgets", "security": [ { "EpilotAuth": [] @@ -29,28 +29,28 @@ ], "responses": { "200": { - "description": "Website Chat response", + "description": "Widget response", "content": { "application/json": { "schema": { "type": "object", "required": [ - "website_chats" + "widgets" ], "properties": { - "website_chats": { + "widgets": { "type": "array", "items": { "type": "object", "required": [ - "website_chat_id", + "widget_id", "org_id", "agent_id", "binding_id", "version", "name", - "settings", - "embed", + "website_chat", + "website_chat_embed", "created_at", "updated_at" ], @@ -65,7 +65,7 @@ "format": "uuid", "nullable": true }, - "settings": { + "website_chat": { "type": "object", "additionalProperties": false, "required": [ @@ -78,7 +78,7 @@ "type": "array", "maxItems": 50, "uniqueItems": true, - "description": "Exact HTTPS origins. Empty means the Website Chat cannot start sessions.", + "description": "Exact HTTPS origins. Empty means the widget cannot start sessions.", "items": { "type": "string", "maxLength": 2048 @@ -100,7 +100,7 @@ "type": "string", "format": "uuid", "nullable": true, - "description": "Design Builder configuration for the Website Chat only." + "description": "Design Builder configuration for the widget only." }, "authentication": { "type": "object", @@ -126,7 +126,7 @@ } } }, - "website_chat_id": { + "widget_id": { "type": "string", "format": "uuid", "readOnly": true, @@ -157,7 +157,7 @@ "format": "date-time", "readOnly": true }, - "embed": { + "website_chat_embed": { "type": "object", "readOnly": true, "required": [ @@ -192,7 +192,7 @@ } }, "400": { - "description": "Invalid Website Chat settings", + "description": "Invalid widget settings", "content": { "application/json": { "schema": { @@ -213,7 +213,7 @@ } }, "404": { - "description": "Website Chat not found in this organisation", + "description": "Widget not found in this organisation", "content": { "application/json": { "schema": { @@ -234,7 +234,7 @@ } }, "409": { - "description": "Website Chat or assigned agent changed; reload before retrying", + "description": "Widget or assigned agent changed; reload before retrying", "content": { "application/json": { "schema": { @@ -268,9 +268,9 @@ }, "post": { "tags": [ - "Website Chats" + "Chat widgets" ], - "operationId": "createWebsiteChat", + "operationId": "createChatWidget", "security": [ { "EpilotAuth": [] @@ -278,20 +278,20 @@ ], "responses": { "201": { - "description": "Website Chat response", + "description": "Widget response", "content": { "application/json": { "schema": { "type": "object", "required": [ - "website_chat_id", + "widget_id", "org_id", "agent_id", "binding_id", "version", "name", - "settings", - "embed", + "website_chat", + "website_chat_embed", "created_at", "updated_at" ], @@ -306,7 +306,7 @@ "format": "uuid", "nullable": true }, - "settings": { + "website_chat": { "type": "object", "additionalProperties": false, "required": [ @@ -319,7 +319,7 @@ "type": "array", "maxItems": 50, "uniqueItems": true, - "description": "Exact HTTPS origins. Empty means the Website Chat cannot start sessions.", + "description": "Exact HTTPS origins. Empty means the widget cannot start sessions.", "items": { "type": "string", "maxLength": 2048 @@ -341,7 +341,7 @@ "type": "string", "format": "uuid", "nullable": true, - "description": "Design Builder configuration for the Website Chat only." + "description": "Design Builder configuration for the widget only." }, "authentication": { "type": "object", @@ -367,7 +367,7 @@ } } }, - "website_chat_id": { + "widget_id": { "type": "string", "format": "uuid", "readOnly": true, @@ -398,7 +398,7 @@ "format": "date-time", "readOnly": true }, - "embed": { + "website_chat_embed": { "type": "object", "readOnly": true, "required": [ @@ -427,7 +427,7 @@ } }, "400": { - "description": "Invalid Website Chat settings", + "description": "Invalid widget settings", "content": { "application/json": { "schema": { @@ -448,7 +448,7 @@ } }, "404": { - "description": "Website Chat not found in this organisation", + "description": "Widget not found in this organisation", "content": { "application/json": { "schema": { @@ -469,7 +469,7 @@ } }, "409": { - "description": "Website Chat or assigned agent changed; reload before retrying", + "description": "Widget or assigned agent changed; reload before retrying", "content": { "application/json": { "schema": { @@ -500,7 +500,7 @@ "required": [ "name", "agent_id", - "settings" + "website_chat" ], "properties": { "name": { @@ -513,7 +513,7 @@ "format": "uuid", "nullable": true }, - "settings": { + "website_chat": { "type": "object", "additionalProperties": false, "required": [ @@ -526,7 +526,7 @@ "type": "array", "maxItems": 50, "uniqueItems": true, - "description": "Exact HTTPS origins. Empty means the Website Chat cannot start sessions.", + "description": "Exact HTTPS origins. Empty means the widget cannot start sessions.", "items": { "type": "string", "maxLength": 2048 @@ -548,7 +548,7 @@ "type": "string", "format": "uuid", "nullable": true, - "description": "Design Builder configuration for the Website Chat only." + "description": "Design Builder configuration for the widget only." }, "authentication": { "type": "object", @@ -581,11 +581,11 @@ } } }, - "/v1/website-chats/{website_chat_id}": { + "/v1/widgets/{widget_id}": { "parameters": [ { "in": "path", - "name": "website_chat_id", + "name": "widget_id", "required": true, "schema": { "type": "string", @@ -595,9 +595,9 @@ ], "get": { "tags": [ - "Website Chats" + "Chat widgets" ], - "operationId": "getWebsiteChat", + "operationId": "getChatWidget", "security": [ { "EpilotAuth": [] @@ -605,20 +605,20 @@ ], "responses": { "200": { - "description": "Website Chat response", + "description": "Widget response", "content": { "application/json": { "schema": { "type": "object", "required": [ - "website_chat_id", + "widget_id", "org_id", "agent_id", "binding_id", "version", "name", - "settings", - "embed", + "website_chat", + "website_chat_embed", "created_at", "updated_at" ], @@ -633,7 +633,7 @@ "format": "uuid", "nullable": true }, - "settings": { + "website_chat": { "type": "object", "additionalProperties": false, "required": [ @@ -646,7 +646,7 @@ "type": "array", "maxItems": 50, "uniqueItems": true, - "description": "Exact HTTPS origins. Empty means the Website Chat cannot start sessions.", + "description": "Exact HTTPS origins. Empty means the widget cannot start sessions.", "items": { "type": "string", "maxLength": 2048 @@ -668,7 +668,7 @@ "type": "string", "format": "uuid", "nullable": true, - "description": "Design Builder configuration for the Website Chat only." + "description": "Design Builder configuration for the widget only." }, "authentication": { "type": "object", @@ -694,7 +694,7 @@ } } }, - "website_chat_id": { + "widget_id": { "type": "string", "format": "uuid", "readOnly": true, @@ -725,7 +725,7 @@ "format": "date-time", "readOnly": true }, - "embed": { + "website_chat_embed": { "type": "object", "readOnly": true, "required": [ @@ -754,7 +754,7 @@ } }, "400": { - "description": "Invalid Website Chat settings", + "description": "Invalid widget settings", "content": { "application/json": { "schema": { @@ -775,7 +775,7 @@ } }, "404": { - "description": "Website Chat not found in this organisation", + "description": "Widget not found in this organisation", "content": { "application/json": { "schema": { @@ -796,7 +796,7 @@ } }, "409": { - "description": "Website Chat or assigned agent changed; reload before retrying", + "description": "Widget or assigned agent changed; reload before retrying", "content": { "application/json": { "schema": { @@ -820,9 +820,9 @@ }, "put": { "tags": [ - "Website Chats" + "Chat widgets" ], - "operationId": "updateWebsiteChat", + "operationId": "updateChatWidget", "security": [ { "EpilotAuth": [] @@ -830,20 +830,20 @@ ], "responses": { "200": { - "description": "Website Chat response", + "description": "Widget response", "content": { "application/json": { "schema": { "type": "object", "required": [ - "website_chat_id", + "widget_id", "org_id", "agent_id", "binding_id", "version", "name", - "settings", - "embed", + "website_chat", + "website_chat_embed", "created_at", "updated_at" ], @@ -858,7 +858,7 @@ "format": "uuid", "nullable": true }, - "settings": { + "website_chat": { "type": "object", "additionalProperties": false, "required": [ @@ -871,7 +871,7 @@ "type": "array", "maxItems": 50, "uniqueItems": true, - "description": "Exact HTTPS origins. Empty means the Website Chat cannot start sessions.", + "description": "Exact HTTPS origins. Empty means the widget cannot start sessions.", "items": { "type": "string", "maxLength": 2048 @@ -893,7 +893,7 @@ "type": "string", "format": "uuid", "nullable": true, - "description": "Design Builder configuration for the Website Chat only." + "description": "Design Builder configuration for the widget only." }, "authentication": { "type": "object", @@ -919,7 +919,7 @@ } } }, - "website_chat_id": { + "widget_id": { "type": "string", "format": "uuid", "readOnly": true, @@ -950,7 +950,7 @@ "format": "date-time", "readOnly": true }, - "embed": { + "website_chat_embed": { "type": "object", "readOnly": true, "required": [ @@ -979,7 +979,7 @@ } }, "400": { - "description": "Invalid Website Chat settings", + "description": "Invalid widget settings", "content": { "application/json": { "schema": { @@ -1000,7 +1000,7 @@ } }, "404": { - "description": "Website Chat not found in this organisation", + "description": "Widget not found in this organisation", "content": { "application/json": { "schema": { @@ -1021,7 +1021,7 @@ } }, "409": { - "description": "Website Chat or assigned agent changed; reload before retrying", + "description": "Widget or assigned agent changed; reload before retrying", "content": { "application/json": { "schema": { @@ -1063,7 +1063,7 @@ "format": "uuid", "nullable": true }, - "settings": { + "website_chat": { "type": "object", "additionalProperties": false, "required": [ @@ -1076,7 +1076,7 @@ "type": "array", "maxItems": 50, "uniqueItems": true, - "description": "Exact HTTPS origins. Empty means the Website Chat cannot start sessions.", + "description": "Exact HTTPS origins. Empty means the widget cannot start sessions.", "items": { "type": "string", "maxLength": 2048 @@ -1098,7 +1098,7 @@ "type": "string", "format": "uuid", "nullable": true, - "description": "Design Builder configuration for the Website Chat only." + "description": "Design Builder configuration for the widget only." }, "authentication": { "type": "object", @@ -1137,9 +1137,9 @@ }, "delete": { "tags": [ - "Website Chats" + "Chat widgets" ], - "operationId": "deleteWebsiteChat", + "operationId": "deleteChatWidget", "security": [ { "EpilotAuth": [] @@ -1147,10 +1147,10 @@ ], "responses": { "204": { - "description": "Website Chat deleted" + "description": "Widget deleted" }, "400": { - "description": "Invalid Website Chat settings", + "description": "Invalid widget settings", "content": { "application/json": { "schema": { @@ -1171,7 +1171,7 @@ } }, "404": { - "description": "Website Chat not found in this organisation", + "description": "Widget not found in this organisation", "content": { "application/json": { "schema": { @@ -1192,7 +1192,7 @@ } }, "409": { - "description": "Website Chat or assigned agent changed; reload before retrying", + "description": "Widget or assigned agent changed; reload before retrying", "content": { "application/json": { "schema": { @@ -1226,15 +1226,15 @@ ] } }, - "/v1/website-chats/{website_chat_id}/configuration": { + "/v1/widgets/{widget_id}/configuration": { "get": { - "operationId": "getPublicWebsiteChat", - "description": "Resolve visitor-facing configuration for an independent Website Chat and its current agent assignment. The Website Chat ID is not an organisation ID or a destination such as website or portal.", + "operationId": "getPublicChatWidget", + "description": "Resolve visitor-facing configuration for an independent widget and its current agent assignment. The widget ID is not an organisation ID or a destination such as website or portal.", "parameters": [ { "in": "path", - "name": "website_chat_id", - "description": "Public Website Chat ID, also used as website_chat_id in bootstrap and data-epilot-chat in the embed.", + "name": "widget_id", + "description": "Public widget ID, also used as widget_key in bootstrap and data-epilot-chat in the embed.", "example": "550e8400-e29b-41d4-a716-446655440000", "required": true, "schema": { @@ -1274,18 +1274,6 @@ "de" ] }, - "authentication": { - "type": "object", - "additionalProperties": false, - "required": [ - "email_code" - ], - "properties": { - "email_code": { - "type": "boolean" - } - } - }, "design": { "type": "object", "additionalProperties": false, @@ -1435,7 +1423,7 @@ } }, "default": { - "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished Website Chat, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", + "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished widget, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", "content": { "application/json": { "schema": { @@ -1447,12 +1435,6 @@ "code": { "type": "string", "enum": [ - "INVALID_VERIFICATION_CODE", - "VERIFICATION_EXPIRED", - "VERIFICATION_CONFLICT", - "VERIFICATION_DISABLED", - "VERIFICATION_UNAVAILABLE", - "IDENTITY_CHANGED", "INVALID_REQUEST", "ORIGIN_DENIED", "NOT_FOUND", @@ -1479,7 +1461,7 @@ "/v1/bootstrap": { "post": { "operationId": "createPublicChatGrant", - "description": "Called by the host website with its website_chat_id. Checks the saved website origin allowlist and issues a single-use grant for the iframe to exchange at POST /v1/sessions within 60 seconds. This deadline does not limit the resulting session.", + "description": "Called by the host website with its widget_key. Checks the saved website origin allowlist and issues a single-use grant for the iframe to exchange at POST /v1/sessions within 60 seconds. This deadline does not limit the resulting session.", "requestBody": { "required": true, "content": { @@ -1488,10 +1470,10 @@ "type": "object", "additionalProperties": false, "required": [ - "website_chat_id" + "widget_key" ], "properties": { - "website_chat_id": { + "widget_key": { "type": "string", "pattern": "^[a-zA-Z0-9_-]{1,100}$" } @@ -1510,7 +1492,7 @@ "required": [ "grant", "expires_in", - "frame_origin" + "widget_origin" ], "properties": { "grant": { @@ -1520,7 +1502,7 @@ "type": "integer", "example": 60 }, - "frame_origin": { + "widget_origin": { "type": "string", "format": "uri" } @@ -1530,7 +1512,7 @@ } }, "default": { - "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished Website Chat, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", + "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished widget, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", "content": { "application/json": { "schema": { @@ -1542,12 +1524,6 @@ "code": { "type": "string", "enum": [ - "INVALID_VERIFICATION_CODE", - "VERIFICATION_EXPIRED", - "VERIFICATION_CONFLICT", - "VERIFICATION_DISABLED", - "VERIFICATION_UNAVAILABLE", - "IDENTITY_CHANGED", "INVALID_REQUEST", "ORIGIN_DENIED", "NOT_FOUND", @@ -1606,7 +1582,7 @@ "token", "conversation_id", "expires_at", - "website_chat" + "widget" ], "properties": { "token": { @@ -1620,7 +1596,7 @@ "type": "integer", "description": "Unix seconds" }, - "website_chat": { + "widget": { "type": "object", "required": [ "key", @@ -1646,18 +1622,6 @@ "de" ] }, - "authentication": { - "type": "object", - "additionalProperties": false, - "required": [ - "email_code" - ], - "properties": { - "email_code": { - "type": "boolean" - } - } - }, "design": { "type": "object", "additionalProperties": false, @@ -1809,7 +1773,7 @@ } }, "default": { - "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished Website Chat, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", + "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished widget, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", "content": { "application/json": { "schema": { @@ -1821,12 +1785,6 @@ "code": { "type": "string", "enum": [ - "INVALID_VERIFICATION_CODE", - "VERIFICATION_EXPIRED", - "VERIFICATION_CONFLICT", - "VERIFICATION_DISABLED", - "VERIFICATION_UNAVAILABLE", - "IDENTITY_CHANGED", "INVALID_REQUEST", "ORIGIN_DENIED", "NOT_FOUND", @@ -1912,7 +1870,7 @@ } }, "default": { - "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished Website Chat, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", + "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished widget, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", "content": { "application/json": { "schema": { @@ -1924,511 +1882,6 @@ "code": { "type": "string", "enum": [ - "INVALID_VERIFICATION_CODE", - "VERIFICATION_EXPIRED", - "VERIFICATION_CONFLICT", - "VERIFICATION_DISABLED", - "VERIFICATION_UNAVAILABLE", - "IDENTITY_CHANGED", - "INVALID_REQUEST", - "ORIGIN_DENIED", - "NOT_FOUND", - "INVALID_GRANT", - "SESSION_EXPIRED", - "RATE_LIMITED", - "SESSION_LIMIT", - "USAGE_LIMIT", - "REQUEST_CONFLICT", - "IN_PROGRESS", - "UNAVAILABLE", - "TEMPORARILY_UNAVAILABLE" - ] - } - } - } - } - } - } - } - } - }, - "/v1/verification": { - "get": { - "operationId": "getChatVerification", - "security": [ - { - "AnonymousSession": [] - } - ], - "description": "Read this session's verification state. No contact IDs or candidate records are exposed.", - "responses": { - "200": { - "description": "Current verification state", - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": false, - "required": [ - "available", - "conversation_id", - "status" - ], - "properties": { - "available": { - "type": "boolean" - }, - "conversation_id": { - "type": "string", - "format": "uuid" - }, - "status": { - "type": "string", - "enum": [ - "anonymous", - "sending", - "pending", - "verified" - ] - }, - "challenge_id": { - "type": "string", - "format": "uuid" - }, - "code_expires_at": { - "type": "integer", - "description": "Unix seconds" - }, - "resend_after": { - "type": "integer", - "description": "Unix seconds" - }, - "email": { - "type": "string", - "format": "email", - "maxLength": 254 - }, - "contact_resolution": { - "type": "string", - "enum": [ - "matched", - "ambiguous", - "not_found" - ] - } - } - } - } - } - }, - "default": { - "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished Website Chat, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "code" - ], - "properties": { - "code": { - "type": "string", - "enum": [ - "INVALID_VERIFICATION_CODE", - "VERIFICATION_EXPIRED", - "VERIFICATION_CONFLICT", - "VERIFICATION_DISABLED", - "VERIFICATION_UNAVAILABLE", - "IDENTITY_CHANGED", - "INVALID_REQUEST", - "ORIGIN_DENIED", - "NOT_FOUND", - "INVALID_GRANT", - "SESSION_EXPIRED", - "RATE_LIMITED", - "SESSION_LIMIT", - "USAGE_LIMIT", - "REQUEST_CONFLICT", - "IN_PROGRESS", - "UNAVAILABLE", - "TEMPORARILY_UNAVAILABLE" - ] - } - } - } - } - } - } - } - } - }, - "/v1/verification/email": { - "post": { - "operationId": "startChatEmailVerification", - "security": [ - { - "AnonymousSession": [] - } - ], - "description": "Start or resend an email challenge using the template saved on this session's Website Chat. Repeating the same request_id and payload does not send another email. Codes must never be sent as chat messages.", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": false, - "required": [ - "request_id", - "email", - "locale" - ], - "properties": { - "request_id": { - "type": "string", - "format": "uuid" - }, - "email": { - "type": "string", - "format": "email", - "maxLength": 254 - }, - "locale": { - "type": "string", - "enum": [ - "en", - "de" - ] - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Current verification state; pending does not reveal whether an email is registered", - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": false, - "required": [ - "available", - "conversation_id", - "status" - ], - "properties": { - "available": { - "type": "boolean" - }, - "conversation_id": { - "type": "string", - "format": "uuid" - }, - "status": { - "type": "string", - "enum": [ - "anonymous", - "sending", - "pending", - "verified" - ] - }, - "challenge_id": { - "type": "string", - "format": "uuid" - }, - "code_expires_at": { - "type": "integer", - "description": "Unix seconds" - }, - "resend_after": { - "type": "integer", - "description": "Unix seconds" - }, - "email": { - "type": "string", - "format": "email", - "maxLength": 254 - }, - "contact_resolution": { - "type": "string", - "enum": [ - "matched", - "ambiguous", - "not_found" - ] - } - } - } - } - } - }, - "default": { - "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished Website Chat, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "code" - ], - "properties": { - "code": { - "type": "string", - "enum": [ - "INVALID_VERIFICATION_CODE", - "VERIFICATION_EXPIRED", - "VERIFICATION_CONFLICT", - "VERIFICATION_DISABLED", - "VERIFICATION_UNAVAILABLE", - "IDENTITY_CHANGED", - "INVALID_REQUEST", - "ORIGIN_DENIED", - "NOT_FOUND", - "INVALID_GRANT", - "SESSION_EXPIRED", - "RATE_LIMITED", - "SESSION_LIMIT", - "USAGE_LIMIT", - "REQUEST_CONFLICT", - "IN_PROGRESS", - "UNAVAILABLE", - "TEMPORARILY_UNAVAILABLE" - ] - } - } - } - } - } - } - } - } - }, - "/v1/verification/code": { - "post": { - "operationId": "verifyChatEmailCode", - "security": [ - { - "AnonymousSession": [] - } - ], - "description": "Verify a code for this session's current challenge. Success binds email proof and contact resolution to this session and starts a new conversation. It grants no account-tool permission.", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": false, - "required": [ - "challenge_id", - "code" - ], - "properties": { - "challenge_id": { - "type": "string", - "format": "uuid" - }, - "code": { - "type": "string", - "pattern": "^\\d{6}$" - } - } - } - } - } - }, - "responses": { - "200": { - "description": "Verification result; duplicate contacts remain unresolved", - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": false, - "required": [ - "available", - "conversation_id", - "status" - ], - "properties": { - "available": { - "type": "boolean" - }, - "conversation_id": { - "type": "string", - "format": "uuid" - }, - "status": { - "type": "string", - "enum": [ - "anonymous", - "sending", - "pending", - "verified" - ] - }, - "challenge_id": { - "type": "string", - "format": "uuid" - }, - "code_expires_at": { - "type": "integer", - "description": "Unix seconds" - }, - "resend_after": { - "type": "integer", - "description": "Unix seconds" - }, - "email": { - "type": "string", - "format": "email", - "maxLength": 254 - }, - "contact_resolution": { - "type": "string", - "enum": [ - "matched", - "ambiguous", - "not_found" - ] - } - } - } - } - } - }, - "default": { - "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished Website Chat, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "code" - ], - "properties": { - "code": { - "type": "string", - "enum": [ - "INVALID_VERIFICATION_CODE", - "VERIFICATION_EXPIRED", - "VERIFICATION_CONFLICT", - "VERIFICATION_DISABLED", - "VERIFICATION_UNAVAILABLE", - "IDENTITY_CHANGED", - "INVALID_REQUEST", - "ORIGIN_DENIED", - "NOT_FOUND", - "INVALID_GRANT", - "SESSION_EXPIRED", - "RATE_LIMITED", - "SESSION_LIMIT", - "USAGE_LIMIT", - "REQUEST_CONFLICT", - "IN_PROGRESS", - "UNAVAILABLE", - "TEMPORARILY_UNAVAILABLE" - ] - } - } - } - } - } - } - } - } - }, - "/v1/verification/cancel": { - "post": { - "operationId": "cancelChatVerification", - "security": [ - { - "AnonymousSession": [] - } - ], - "description": "Cancel a pending challenge or clear verified identity. Clearing verified identity starts a new anonymous conversation. In-flight verification cannot restore the cleared identity.", - "responses": { - "200": { - "description": "Anonymous session state", - "content": { - "application/json": { - "schema": { - "type": "object", - "additionalProperties": false, - "required": [ - "available", - "conversation_id", - "status" - ], - "properties": { - "available": { - "type": "boolean" - }, - "conversation_id": { - "type": "string", - "format": "uuid" - }, - "status": { - "type": "string", - "enum": [ - "anonymous", - "sending", - "pending", - "verified" - ] - }, - "challenge_id": { - "type": "string", - "format": "uuid" - }, - "code_expires_at": { - "type": "integer", - "description": "Unix seconds" - }, - "resend_after": { - "type": "integer", - "description": "Unix seconds" - }, - "email": { - "type": "string", - "format": "email", - "maxLength": 254 - }, - "contact_resolution": { - "type": "string", - "enum": [ - "matched", - "ambiguous", - "not_found" - ] - } - } - } - } - } - }, - "default": { - "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished Website Chat, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "code" - ], - "properties": { - "code": { - "type": "string", - "enum": [ - "INVALID_VERIFICATION_CODE", - "VERIFICATION_EXPIRED", - "VERIFICATION_CONFLICT", - "VERIFICATION_DISABLED", - "VERIFICATION_UNAVAILABLE", - "IDENTITY_CHANGED", "INVALID_REQUEST", "ORIGIN_DENIED", "NOT_FOUND", @@ -2461,29 +1914,29 @@ "AnonymousSession": { "type": "http", "scheme": "bearer", - "description": "Opaque, expiring Chat session token; never an epilot user or Portal access token." + "description": "Opaque, expiring anonymous session token; never an epilot user access token." } }, "schemas": { - "ListWebsiteChatsResponse": { + "ListChatWidgetsResponse": { "type": "object", "required": [ - "website_chats" + "widgets" ], "properties": { - "website_chats": { + "widgets": { "type": "array", "items": { "type": "object", "required": [ - "website_chat_id", + "widget_id", "org_id", "agent_id", "binding_id", "version", "name", - "settings", - "embed", + "website_chat", + "website_chat_embed", "created_at", "updated_at" ], @@ -2498,7 +1951,7 @@ "format": "uuid", "nullable": true }, - "settings": { + "website_chat": { "type": "object", "additionalProperties": false, "required": [ @@ -2511,7 +1964,7 @@ "type": "array", "maxItems": 50, "uniqueItems": true, - "description": "Exact HTTPS origins. Empty means the Website Chat cannot start sessions.", + "description": "Exact HTTPS origins. Empty means the widget cannot start sessions.", "items": { "type": "string", "maxLength": 2048 @@ -2533,7 +1986,7 @@ "type": "string", "format": "uuid", "nullable": true, - "description": "Design Builder configuration for the Website Chat only." + "description": "Design Builder configuration for the widget only." }, "authentication": { "type": "object", @@ -2559,7 +2012,7 @@ } } }, - "website_chat_id": { + "widget_id": { "type": "string", "format": "uuid", "readOnly": true, @@ -2590,7 +2043,7 @@ "format": "date-time", "readOnly": true }, - "embed": { + "website_chat_embed": { "type": "object", "readOnly": true, "required": [ @@ -2621,17 +2074,17 @@ } } }, - "WebsiteChat": { + "ChatWidget": { "type": "object", "required": [ - "website_chat_id", + "widget_id", "org_id", "agent_id", "binding_id", "version", "name", - "settings", - "embed", + "website_chat", + "website_chat_embed", "created_at", "updated_at" ], @@ -2646,7 +2099,7 @@ "format": "uuid", "nullable": true }, - "settings": { + "website_chat": { "type": "object", "additionalProperties": false, "required": [ @@ -2659,7 +2112,7 @@ "type": "array", "maxItems": 50, "uniqueItems": true, - "description": "Exact HTTPS origins. Empty means the Website Chat cannot start sessions.", + "description": "Exact HTTPS origins. Empty means the widget cannot start sessions.", "items": { "type": "string", "maxLength": 2048 @@ -2681,7 +2134,7 @@ "type": "string", "format": "uuid", "nullable": true, - "description": "Design Builder configuration for the Website Chat only." + "description": "Design Builder configuration for the widget only." }, "authentication": { "type": "object", @@ -2707,7 +2160,7 @@ } } }, - "website_chat_id": { + "widget_id": { "type": "string", "format": "uuid", "readOnly": true, @@ -2738,7 +2191,7 @@ "format": "date-time", "readOnly": true }, - "embed": { + "website_chat_embed": { "type": "object", "readOnly": true, "required": [ @@ -2776,7 +2229,7 @@ "type": "array", "maxItems": 50, "uniqueItems": true, - "description": "Exact HTTPS origins. Empty means the Website Chat cannot start sessions.", + "description": "Exact HTTPS origins. Empty means the widget cannot start sessions.", "items": { "type": "string", "maxLength": 2048 @@ -2798,7 +2251,7 @@ "type": "string", "format": "uuid", "nullable": true, - "description": "Design Builder configuration for the Website Chat only." + "description": "Design Builder configuration for the widget only." }, "authentication": { "type": "object", @@ -2838,13 +2291,13 @@ } } }, - "CreateWebsiteChatRequest": { + "CreateChatWidgetRequest": { "type": "object", "additionalProperties": false, "required": [ "name", "agent_id", - "settings" + "website_chat" ], "properties": { "name": { @@ -2857,7 +2310,7 @@ "format": "uuid", "nullable": true }, - "settings": { + "website_chat": { "type": "object", "additionalProperties": false, "required": [ @@ -2870,7 +2323,7 @@ "type": "array", "maxItems": 50, "uniqueItems": true, - "description": "Exact HTTPS origins. Empty means the Website Chat cannot start sessions.", + "description": "Exact HTTPS origins. Empty means the widget cannot start sessions.", "items": { "type": "string", "maxLength": 2048 @@ -2892,7 +2345,7 @@ "type": "string", "format": "uuid", "nullable": true, - "description": "Design Builder configuration for the Website Chat only." + "description": "Design Builder configuration for the widget only." }, "authentication": { "type": "object", @@ -2920,7 +2373,7 @@ } } }, - "UpdateWebsiteChatRequest": { + "UpdateChatWidgetRequest": { "type": "object", "additionalProperties": false, "required": [ @@ -2937,7 +2390,7 @@ "format": "uuid", "nullable": true }, - "settings": { + "website_chat": { "type": "object", "additionalProperties": false, "required": [ @@ -2950,7 +2403,7 @@ "type": "array", "maxItems": 50, "uniqueItems": true, - "description": "Exact HTTPS origins. Empty means the Website Chat cannot start sessions.", + "description": "Exact HTTPS origins. Empty means the widget cannot start sessions.", "items": { "type": "string", "maxLength": 2048 @@ -2972,7 +2425,7 @@ "type": "string", "format": "uuid", "nullable": true, - "description": "Design Builder configuration for the Website Chat only." + "description": "Design Builder configuration for the widget only." }, "authentication": { "type": "object", @@ -3005,59 +2458,7 @@ } } }, - "VerificationState": { - "type": "object", - "additionalProperties": false, - "required": [ - "available", - "conversation_id", - "status" - ], - "properties": { - "available": { - "type": "boolean" - }, - "conversation_id": { - "type": "string", - "format": "uuid" - }, - "status": { - "type": "string", - "enum": [ - "anonymous", - "sending", - "pending", - "verified" - ] - }, - "challenge_id": { - "type": "string", - "format": "uuid" - }, - "code_expires_at": { - "type": "integer", - "description": "Unix seconds" - }, - "resend_after": { - "type": "integer", - "description": "Unix seconds" - }, - "email": { - "type": "string", - "format": "email", - "maxLength": 254 - }, - "contact_resolution": { - "type": "string", - "enum": [ - "matched", - "ambiguous", - "not_found" - ] - } - } - }, - "PublicWebsiteChat": { + "Widget": { "type": "object", "required": [ "key", @@ -3083,18 +2484,6 @@ "de" ] }, - "authentication": { - "type": "object", - "additionalProperties": false, - "required": [ - "email_code" - ], - "properties": { - "email_code": { - "type": "boolean" - } - } - }, "design": { "type": "object", "additionalProperties": false, @@ -3240,7 +2629,7 @@ } } }, - "WebsiteChatDesign": { + "WidgetDesign": { "type": "object", "additionalProperties": false, "properties": { @@ -3465,12 +2854,6 @@ "code": { "type": "string", "enum": [ - "INVALID_VERIFICATION_CODE", - "VERIFICATION_EXPIRED", - "VERIFICATION_CONFLICT", - "VERIFICATION_DISABLED", - "VERIFICATION_UNAVAILABLE", - "IDENTITY_CHANGED", "INVALID_REQUEST", "ORIGIN_DENIED", "NOT_FOUND", @@ -3490,7 +2873,7 @@ }, "responses": { "Error": { - "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished Website Chat, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", + "description": "400 invalid input, 401 expired capability, 403 origin denied, 404 unpublished widget, 409 conflict, 413 too large, 429 rate limit, or 503 unavailable.", "content": { "application/json": { "schema": { @@ -3502,12 +2885,6 @@ "code": { "type": "string", "enum": [ - "INVALID_VERIFICATION_CODE", - "VERIFICATION_EXPIRED", - "VERIFICATION_CONFLICT", - "VERIFICATION_DISABLED", - "VERIFICATION_UNAVAILABLE", - "IDENTITY_CHANGED", "INVALID_REQUEST", "ORIGIN_DENIED", "NOT_FOUND", diff --git a/packages/cli/docs/chat.md b/packages/cli/docs/chat.md index 53c109413..f63d25cb9 100644 --- a/packages/cli/docs/chat.md +++ b/packages/cli/docs/chat.md @@ -3,7 +3,7 @@ - **Base URL:** `https://chat.sls.epilot.io` - **API Docs:** [https://docs.epilot.io/api/chat](https://docs.epilot.io/api/chat) -Website Chat management and anonymous browser chat. +Widget management and anonymous browser chat. ## Quick Start @@ -12,7 +12,7 @@ Website Chat management and anonymous browser chat. epilot chat # Call an operation -epilot chat listWebsiteChats +epilot chat listChatWidgets ``` ## Common Flags @@ -35,26 +35,22 @@ epilot chat listWebsiteChats ## Operations -**Website Chats** -- [`listWebsiteChats`](#listwebsitechats) — GET /v1/website-chats -- [`createWebsiteChat`](#createwebsitechat) — POST /v1/website-chats -- [`getWebsiteChat`](#getwebsitechat) — GET /v1/website-chats/{website_chat_id} -- [`updateWebsiteChat`](#updatewebsitechat) — PUT /v1/website-chats/{website_chat_id} -- [`deleteWebsiteChat`](#deletewebsitechat) — DELETE /v1/website-chats/{website_chat_id} +**Chat widgets** +- [`listChatWidgets`](#listchatwidgets) — GET /v1/widgets +- [`createChatWidget`](#createchatwidget) — POST /v1/widgets +- [`getChatWidget`](#getchatwidget) — GET /v1/widgets/{widget_id} +- [`updateChatWidget`](#updatechatwidget) — PUT /v1/widgets/{widget_id} +- [`deleteChatWidget`](#deletechatwidget) — DELETE /v1/widgets/{widget_id} **Other** -- [`getPublicWebsiteChat`](#getpublicwebsitechat) — Resolve visitor-facing configuration for an independent Website Chat and its current agent assignment. The Website Chat -- [`createPublicChatGrant`](#createpublicchatgrant) — Called by the host website with its website_chat_id. Checks the saved website origin allowlist and issues a single-use g +- [`getPublicChatWidget`](#getpublicchatwidget) — Resolve visitor-facing configuration for an independent widget and its current agent assignment. The widget ID is not an +- [`createPublicChatGrant`](#createpublicchatgrant) — Called by the host website with its widget_key. Checks the saved website origin allowlist and issues a single-use grant - [`createAnonymousChatSession`](#createanonymouschatsession) — Exchanges an unexpired grant once for an independent 30-minute session. Expired or previously used grants return 401 INV - [`sendAnonymousChatMessage`](#sendanonymouschatmessage) — Creates a turn or replays its persisted result. Reuse request_id and the exact -- [`getChatVerification`](#getchatverification) — Read this session's verification state. No contact IDs or candidate records are exposed. -- [`startChatEmailVerification`](#startchatemailverification) — Start or resend an email challenge using the template saved on this session's Website Chat. Repeating the same request_i -- [`verifyChatEmailCode`](#verifychatemailcode) — Verify a code for this session's current challenge. Success binds email proof and contact resolution to this session and -- [`cancelChatVerification`](#cancelchatverification) — Cancel a pending challenge or clear verified identity. Clearing verified identity starts a new anonymous conversation. I -### `listWebsiteChats` +### `listChatWidgets` -`GET /v1/website-chats` +`GET /v1/widgets` **Parameters** @@ -65,13 +61,13 @@ epilot chat listWebsiteChats **Sample Call** ```bash -epilot chat listWebsiteChats +epilot chat listChatWidgets ``` With JSONata filter: ```bash -epilot chat listWebsiteChats --jsonata 'website_chats' +epilot chat listChatWidgets --jsonata 'widgets' ```
@@ -79,11 +75,11 @@ epilot chat listWebsiteChats --jsonata 'website_chats' ```json { - "website_chats": [ + "widgets": [ { "name": "string", "agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "settings": { + "website_chat": { "allowed_origins": ["string"], "organisation_name": "string", "default_locale": "en", @@ -94,13 +90,13 @@ epilot chat listWebsiteChats --jsonata 'website_chats' } } }, - "website_chat_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "widget_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "org_id": "string", "binding_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "version": 1, "created_at": "1970-01-01T00:00:00.000Z", "updated_at": "1970-01-01T00:00:00.000Z", - "embed": { + "website_chat_embed": { "script_url": "https://example.com/path", "chat_api_origin": "https://example.com/path", "demo_url": "https://example.com/path" @@ -115,26 +111,26 @@ epilot chat listWebsiteChats --jsonata 'website_chats' --- -### `createWebsiteChat` +### `createChatWidget` -`POST /v1/website-chats` +`POST /v1/widgets` **Request Body** (required) **Sample Call** ```bash -epilot chat createWebsiteChat +epilot chat createChatWidget ``` With request body: ```bash -epilot chat createWebsiteChat \ +epilot chat createChatWidget \ -d '{ "name": "string", "agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "settings": { + "website_chat": { "allowed_origins": ["string"], "organisation_name": "string", "default_locale": "en", @@ -151,13 +147,13 @@ epilot chat createWebsiteChat \ Using stdin pipe: ```bash -cat body.json | epilot chat createWebsiteChat +cat body.json | epilot chat createChatWidget ``` With JSONata filter: ```bash -epilot chat createWebsiteChat --jsonata 'name' +epilot chat createChatWidget --jsonata 'name' ```
@@ -167,7 +163,7 @@ epilot chat createWebsiteChat --jsonata 'name' { "name": "string", "agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "settings": { + "website_chat": { "allowed_origins": ["string"], "organisation_name": "string", "default_locale": "en", @@ -178,13 +174,13 @@ epilot chat createWebsiteChat --jsonata 'name' } } }, - "website_chat_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "widget_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "org_id": "string", "binding_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "version": 1, "created_at": "1970-01-01T00:00:00.000Z", "updated_at": "1970-01-01T00:00:00.000Z", - "embed": { + "website_chat_embed": { "script_url": "https://example.com/path", "chat_api_origin": "https://example.com/path", "demo_url": "https://example.com/path" @@ -196,33 +192,33 @@ epilot chat createWebsiteChat --jsonata 'name' --- -### `getWebsiteChat` +### `getChatWidget` -`GET /v1/website-chats/{website_chat_id}` +`GET /v1/widgets/{widget_id}` **Parameters** | Name | In | Type | Required | Description | | ---- | -- | ---- | -------- | ----------- | -| `website_chat_id` | path | string (uuid) | Yes | | +| `widget_id` | path | string (uuid) | Yes | | **Sample Call** ```bash -epilot chat getWebsiteChat \ - -p website_chat_id=123e4567-e89b-12d3-a456-426614174000 +epilot chat getChatWidget \ + -p widget_id=123e4567-e89b-12d3-a456-426614174000 ``` Using positional args for path parameters: ```bash -epilot chat getWebsiteChat 123e4567-e89b-12d3-a456-426614174000 +epilot chat getChatWidget 123e4567-e89b-12d3-a456-426614174000 ``` With JSONata filter: ```bash -epilot chat getWebsiteChat -p website_chat_id=123e4567-e89b-12d3-a456-426614174000 --jsonata 'name' +epilot chat getChatWidget -p widget_id=123e4567-e89b-12d3-a456-426614174000 --jsonata 'name' ```
@@ -232,7 +228,7 @@ epilot chat getWebsiteChat -p website_chat_id=123e4567-e89b-12d3-a456-4266141740 { "name": "string", "agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "settings": { + "website_chat": { "allowed_origins": ["string"], "organisation_name": "string", "default_locale": "en", @@ -243,13 +239,13 @@ epilot chat getWebsiteChat -p website_chat_id=123e4567-e89b-12d3-a456-4266141740 } } }, - "website_chat_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "widget_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "org_id": "string", "binding_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "version": 1, "created_at": "1970-01-01T00:00:00.000Z", "updated_at": "1970-01-01T00:00:00.000Z", - "embed": { + "website_chat_embed": { "script_url": "https://example.com/path", "chat_api_origin": "https://example.com/path", "demo_url": "https://example.com/path" @@ -261,34 +257,34 @@ epilot chat getWebsiteChat -p website_chat_id=123e4567-e89b-12d3-a456-4266141740 --- -### `updateWebsiteChat` +### `updateChatWidget` -`PUT /v1/website-chats/{website_chat_id}` +`PUT /v1/widgets/{widget_id}` **Parameters** | Name | In | Type | Required | Description | | ---- | -- | ---- | -------- | ----------- | -| `website_chat_id` | path | string (uuid) | Yes | | +| `widget_id` | path | string (uuid) | Yes | | **Request Body** (required) **Sample Call** ```bash -epilot chat updateWebsiteChat \ - -p website_chat_id=123e4567-e89b-12d3-a456-426614174000 +epilot chat updateChatWidget \ + -p widget_id=123e4567-e89b-12d3-a456-426614174000 ``` With request body: ```bash -epilot chat updateWebsiteChat \ - -p website_chat_id=123e4567-e89b-12d3-a456-426614174000 \ +epilot chat updateChatWidget \ + -p widget_id=123e4567-e89b-12d3-a456-426614174000 \ -d '{ "name": "string", "agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "settings": { + "website_chat": { "allowed_origins": ["string"], "organisation_name": "string", "default_locale": "en", @@ -306,19 +302,19 @@ epilot chat updateWebsiteChat \ Using positional args for path parameters: ```bash -epilot chat updateWebsiteChat 123e4567-e89b-12d3-a456-426614174000 +epilot chat updateChatWidget 123e4567-e89b-12d3-a456-426614174000 ``` Using stdin pipe: ```bash -cat body.json | epilot chat updateWebsiteChat -p website_chat_id=123e4567-e89b-12d3-a456-426614174000 +cat body.json | epilot chat updateChatWidget -p widget_id=123e4567-e89b-12d3-a456-426614174000 ``` With JSONata filter: ```bash -epilot chat updateWebsiteChat -p website_chat_id=123e4567-e89b-12d3-a456-426614174000 --jsonata 'name' +epilot chat updateChatWidget -p widget_id=123e4567-e89b-12d3-a456-426614174000 --jsonata 'name' ```
@@ -328,7 +324,7 @@ epilot chat updateWebsiteChat -p website_chat_id=123e4567-e89b-12d3-a456-4266141 { "name": "string", "agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "settings": { + "website_chat": { "allowed_origins": ["string"], "organisation_name": "string", "default_locale": "en", @@ -339,13 +335,13 @@ epilot chat updateWebsiteChat -p website_chat_id=123e4567-e89b-12d3-a456-4266141 } } }, - "website_chat_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "widget_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "org_id": "string", "binding_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "version": 1, "created_at": "1970-01-01T00:00:00.000Z", "updated_at": "1970-01-01T00:00:00.000Z", - "embed": { + "website_chat_embed": { "script_url": "https://example.com/path", "chat_api_origin": "https://example.com/path", "demo_url": "https://example.com/path" @@ -357,68 +353,68 @@ epilot chat updateWebsiteChat -p website_chat_id=123e4567-e89b-12d3-a456-4266141 --- -### `deleteWebsiteChat` +### `deleteChatWidget` -`DELETE /v1/website-chats/{website_chat_id}` +`DELETE /v1/widgets/{widget_id}` **Parameters** | Name | In | Type | Required | Description | | ---- | -- | ---- | -------- | ----------- | -| `website_chat_id` | path | string (uuid) | Yes | | +| `widget_id` | path | string (uuid) | Yes | | | `version` | query | number | Yes | | **Sample Call** ```bash -epilot chat deleteWebsiteChat \ - -p website_chat_id=123e4567-e89b-12d3-a456-426614174000 \ +epilot chat deleteChatWidget \ + -p widget_id=123e4567-e89b-12d3-a456-426614174000 \ -p version=1 ``` Using positional args for path parameters: ```bash -epilot chat deleteWebsiteChat 123e4567-e89b-12d3-a456-426614174000 +epilot chat deleteChatWidget 123e4567-e89b-12d3-a456-426614174000 ``` With JSONata filter: ```bash -epilot chat deleteWebsiteChat -p website_chat_id=123e4567-e89b-12d3-a456-426614174000 -p version=1 --jsonata '$' +epilot chat deleteChatWidget -p widget_id=123e4567-e89b-12d3-a456-426614174000 -p version=1 --jsonata '$' ``` --- -### `getPublicWebsiteChat` +### `getPublicChatWidget` -Resolve visitor-facing configuration for an independent Website Chat and its current agent assignment. The Website Chat +Resolve visitor-facing configuration for an independent widget and its current agent assignment. The widget ID is not an -`GET /v1/website-chats/{website_chat_id}/configuration` +`GET /v1/widgets/{widget_id}/configuration` **Parameters** | Name | In | Type | Required | Description | | ---- | -- | ---- | -------- | ----------- | -| `website_chat_id` | path | string | Yes | Public Website Chat ID, also used as website_chat_id in bootstrap and data-epilot-chat in the embed. | +| `widget_id` | path | string | Yes | Public widget ID, also used as widget_key in bootstrap and data-epilot-chat in the embed. | **Sample Call** ```bash -epilot chat getPublicWebsiteChat \ - -p website_chat_id=550e8400-e29b-41d4-a716-446655440000 +epilot chat getPublicChatWidget \ + -p widget_id=550e8400-e29b-41d4-a716-446655440000 ``` Using positional args for path parameters: ```bash -epilot chat getPublicWebsiteChat 550e8400-e29b-41d4-a716-446655440000 +epilot chat getPublicChatWidget 550e8400-e29b-41d4-a716-446655440000 ``` With JSONata filter: ```bash -epilot chat getPublicWebsiteChat -p website_chat_id=550e8400-e29b-41d4-a716-446655440000 --jsonata 'key' +epilot chat getPublicChatWidget -p widget_id=550e8400-e29b-41d4-a716-446655440000 --jsonata 'key' ```
@@ -430,9 +426,6 @@ epilot chat getPublicWebsiteChat -p website_chat_id=550e8400-e29b-41d4-a716-4466 "organisationName": "string", "assistantName": "string", "defaultLocale": "en", - "authentication": { - "email_code": true - }, "design": { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "last_modified_at": "string", @@ -479,7 +472,7 @@ epilot chat getPublicWebsiteChat -p website_chat_id=550e8400-e29b-41d4-a716-4466 ### `createPublicChatGrant` -Called by the host website with its website_chat_id. Checks the saved website origin allowlist and issues a single-use g +Called by the host website with its widget_key. Checks the saved website origin allowlist and issues a single-use grant `POST /v1/bootstrap` @@ -489,7 +482,7 @@ Called by the host website with its website_chat_id. Checks the saved website or ```bash epilot chat createPublicChatGrant \ - -d '{"website_chat_id":"string"}' + -d '{"widget_key":"string"}' ``` Using stdin pipe: @@ -511,7 +504,7 @@ epilot chat createPublicChatGrant --jsonata 'grant' { "grant": "string", "expires_in": 60, - "frame_origin": "https://example.com/path" + "widget_origin": "https://example.com/path" } ``` @@ -554,14 +547,11 @@ epilot chat createAnonymousChatSession --jsonata 'token' "token": "string", "conversation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "expires_at": 0, - "website_chat": { + "widget": { "key": "string", "organisationName": "string", "assistantName": "string", "defaultLocale": "en", - "authentication": { - "email_code": true - }, "design": { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "last_modified_at": "string", @@ -635,173 +625,3 @@ epilot chat sendAnonymousChatMessage --jsonata '$' ``` --- - -### `getChatVerification` - -Read this session's verification state. No contact IDs or candidate records are exposed. - -`GET /v1/verification` - -**Sample Call** - -```bash -epilot chat getChatVerification -``` - -With JSONata filter: - -```bash -epilot chat getChatVerification --jsonata 'email' -``` - -
-Sample Response - -```json -{ - "available": true, - "conversation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "status": "anonymous", - "challenge_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "code_expires_at": 0, - "resend_after": 0, - "email": "user@example.com", - "contact_resolution": "matched" -} -``` - -
- ---- - -### `startChatEmailVerification` - -Start or resend an email challenge using the template saved on this session's Website Chat. Repeating the same request_i - -`POST /v1/verification/email` - -**Request Body** (required) - -**Sample Call** - -```bash -epilot chat startChatEmailVerification \ - -d '{"request_id":"3fa85f64-5717-4562-b3fc-2c963f66afa6","email":"user@example.com","locale":"en"}' -``` - -Using stdin pipe: - -```bash -cat body.json | epilot chat startChatEmailVerification -``` - -With JSONata filter: - -```bash -epilot chat startChatEmailVerification --jsonata 'email' -``` - -
-Sample Response - -```json -{ - "available": true, - "conversation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "status": "anonymous", - "challenge_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "code_expires_at": 0, - "resend_after": 0, - "email": "user@example.com", - "contact_resolution": "matched" -} -``` - -
- ---- - -### `verifyChatEmailCode` - -Verify a code for this session's current challenge. Success binds email proof and contact resolution to this session and - -`POST /v1/verification/code` - -**Request Body** (required) - -**Sample Call** - -```bash -epilot chat verifyChatEmailCode \ - -d '{"challenge_id":"3fa85f64-5717-4562-b3fc-2c963f66afa6","code":"string"}' -``` - -Using stdin pipe: - -```bash -cat body.json | epilot chat verifyChatEmailCode -``` - -With JSONata filter: - -```bash -epilot chat verifyChatEmailCode --jsonata 'email' -``` - -
-Sample Response - -```json -{ - "available": true, - "conversation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "status": "anonymous", - "challenge_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "code_expires_at": 0, - "resend_after": 0, - "email": "user@example.com", - "contact_resolution": "matched" -} -``` - -
- ---- - -### `cancelChatVerification` - -Cancel a pending challenge or clear verified identity. Clearing verified identity starts a new anonymous conversation. I - -`POST /v1/verification/cancel` - -**Sample Call** - -```bash -epilot chat cancelChatVerification -``` - -With JSONata filter: - -```bash -epilot chat cancelChatVerification --jsonata 'email' -``` - -
-Sample Response - -```json -{ - "available": true, - "conversation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "status": "anonymous", - "challenge_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "code_expires_at": 0, - "resend_after": 0, - "email": "user@example.com", - "contact_resolution": "matched" -} -``` - -
- ---- diff --git a/packages/cli/docs/index.md b/packages/cli/docs/index.md index 4bd80b222..6d2941c71 100644 --- a/packages/cli/docs/index.md +++ b/packages/cli/docs/index.md @@ -22,7 +22,7 @@ npx epilot auth login | Billing API | `epilot billing` | 14 | [billing.md](./billing.md) | | Blueprint Manifest API | `epilot blueprint-manifest` | 73 | [blueprint-manifest.md](./blueprint-manifest.md) | | Calendar API | `epilot calendar` | 28 | [calendar.md](./calendar.md) | -| epilot Chat API | `epilot chat` | 13 | [chat.md](./chat.md) | +| epilot Chat API | `epilot chat` | 9 | [chat.md](./chat.md) | | Configuration Hub API | `epilot configuration-hub` | 21 | [configuration-hub.md](./configuration-hub.md) | | Consent API | `epilot consent` | 3 | [consent.md](./consent.md) | | Portal API | `epilot customer-portal` | 173 | [customer-portal.md](./customer-portal.md) | diff --git a/packages/cli/src/generated/api-list.ts b/packages/cli/src/generated/api-list.ts index bcd760676..b011edc55 100644 --- a/packages/cli/src/generated/api-list.ts +++ b/packages/cli/src/generated/api-list.ts @@ -301,21 +301,17 @@ export const API_LIST: ApiInfo[] = [ kebabName: 'chat', title: 'epilot Chat API', serverUrl: 'https://chat.sls.epilot.io', - operationCount: 13, + operationCount: 9, operationIds: [ - 'listWebsiteChats', - 'createWebsiteChat', - 'getWebsiteChat', - 'updateWebsiteChat', - 'deleteWebsiteChat', - 'getPublicWebsiteChat', + 'listChatWidgets', + 'createChatWidget', + 'getChatWidget', + 'updateChatWidget', + 'deleteChatWidget', + 'getPublicChatWidget', 'createPublicChatGrant', 'createAnonymousChatSession', 'sendAnonymousChatMessage', - 'getChatVerification', - 'startChatEmailVerification', - 'verifyChatEmailCode', - 'cancelChatVerification', ], }, { diff --git a/packages/epilot-sdk-v2/docs/chat.md b/packages/epilot-sdk-v2/docs/chat.md index 1d9580fe1..0b4842336 100644 --- a/packages/epilot-sdk-v2/docs/chat.md +++ b/packages/epilot-sdk-v2/docs/chat.md @@ -9,7 +9,7 @@ import { epilot } from '@epilot/sdk' epilot.authorize(() => '') -const { data } = await epilot.chat.listWebsiteChats(...) +const { data } = await epilot.chat.listChatWidgets(...) ``` ### Tree-shakeable import @@ -19,47 +19,42 @@ import { getClient, authorize } from '@epilot/sdk/chat' const chatClient = getClient() authorize(chatClient, () => '') -const { data } = await chatClient.listWebsiteChats(...) +const { data } = await chatClient.listChatWidgets(...) ``` ## Operations -**Website Chats** -- [`listWebsiteChats`](#listwebsitechats) -- [`createWebsiteChat`](#createwebsitechat) -- [`getWebsiteChat`](#getwebsitechat) -- [`updateWebsiteChat`](#updatewebsitechat) -- [`deleteWebsiteChat`](#deletewebsitechat) +**Chat widgets** +- [`listChatWidgets`](#listchatwidgets) +- [`createChatWidget`](#createchatwidget) +- [`getChatWidget`](#getchatwidget) +- [`updateChatWidget`](#updatechatwidget) +- [`deleteChatWidget`](#deletechatwidget) **Other** -- [`getPublicWebsiteChat`](#getpublicwebsitechat) +- [`getPublicChatWidget`](#getpublicchatwidget) - [`createPublicChatGrant`](#createpublicchatgrant) - [`createAnonymousChatSession`](#createanonymouschatsession) - [`sendAnonymousChatMessage`](#sendanonymouschatmessage) -- [`getChatVerification`](#getchatverification) -- [`startChatEmailVerification`](#startchatemailverification) -- [`verifyChatEmailCode`](#verifychatemailcode) -- [`cancelChatVerification`](#cancelchatverification) **Schemas** -- [`ListWebsiteChatsResponse`](#listwebsitechatsresponse) -- [`WebsiteChat`](#websitechat) +- [`ListChatWidgetsResponse`](#listchatwidgetsresponse) +- [`ChatWidget`](#chatwidget) - [`WebsiteChatSettings`](#websitechatsettings) - [`Error`](#error) -- [`CreateWebsiteChatRequest`](#createwebsitechatrequest) -- [`UpdateWebsiteChatRequest`](#updatewebsitechatrequest) -- [`VerificationState`](#verificationstate) -- [`PublicWebsiteChat`](#publicwebsitechat) -- [`WebsiteChatDesign`](#websitechatdesign) +- [`CreateChatWidgetRequest`](#createchatwidgetrequest) +- [`UpdateChatWidgetRequest`](#updatechatwidgetrequest) +- [`Widget`](#widget) +- [`WidgetDesign`](#widgetdesign) - [`PublicEvent`](#publicevent) - [`PublicChatError`](#publicchaterror) -### `listWebsiteChats` +### `listChatWidgets` -`GET /v1/website-chats` +`GET /v1/widgets` ```ts -const { data } = await client.listWebsiteChats({ +const { data } = await client.listChatWidgets({ cursor: 'example', }) ``` @@ -69,11 +64,11 @@ const { data } = await client.listWebsiteChats({ ```json { - "website_chats": [ + "widgets": [ { "name": "string", "agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "settings": { + "website_chat": { "allowed_origins": ["string"], "organisation_name": "string", "default_locale": "en", @@ -84,13 +79,13 @@ const { data } = await client.listWebsiteChats({ } } }, - "website_chat_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "widget_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "org_id": "string", "binding_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "version": 1, "created_at": "1970-01-01T00:00:00.000Z", "updated_at": "1970-01-01T00:00:00.000Z", - "embed": { + "website_chat_embed": { "script_url": "https://example.com/path", "chat_api_origin": "https://example.com/path", "demo_url": "https://example.com/path" @@ -105,17 +100,17 @@ const { data } = await client.listWebsiteChats({ --- -### `createWebsiteChat` +### `createChatWidget` -`POST /v1/website-chats` +`POST /v1/widgets` ```ts -const { data } = await client.createWebsiteChat( +const { data } = await client.createChatWidget( null, { name: 'string', agent_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6', - settings: { + website_chat: { allowed_origins: ['string'], organisation_name: 'string', default_locale: 'en', @@ -137,7 +132,7 @@ const { data } = await client.createWebsiteChat( { "name": "string", "agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "settings": { + "website_chat": { "allowed_origins": ["string"], "organisation_name": "string", "default_locale": "en", @@ -148,13 +143,13 @@ const { data } = await client.createWebsiteChat( } } }, - "website_chat_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "widget_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "org_id": "string", "binding_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "version": 1, "created_at": "1970-01-01T00:00:00.000Z", "updated_at": "1970-01-01T00:00:00.000Z", - "embed": { + "website_chat_embed": { "script_url": "https://example.com/path", "chat_api_origin": "https://example.com/path", "demo_url": "https://example.com/path" @@ -166,13 +161,13 @@ const { data } = await client.createWebsiteChat( --- -### `getWebsiteChat` +### `getChatWidget` -`GET /v1/website-chats/{website_chat_id}` +`GET /v1/widgets/{widget_id}` ```ts -const { data } = await client.getWebsiteChat({ - website_chat_id: 'example', +const { data } = await client.getChatWidget({ + widget_id: 'example', }) ``` @@ -183,7 +178,7 @@ const { data } = await client.getWebsiteChat({ { "name": "string", "agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "settings": { + "website_chat": { "allowed_origins": ["string"], "organisation_name": "string", "default_locale": "en", @@ -194,13 +189,13 @@ const { data } = await client.getWebsiteChat({ } } }, - "website_chat_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "widget_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "org_id": "string", "binding_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "version": 1, "created_at": "1970-01-01T00:00:00.000Z", "updated_at": "1970-01-01T00:00:00.000Z", - "embed": { + "website_chat_embed": { "script_url": "https://example.com/path", "chat_api_origin": "https://example.com/path", "demo_url": "https://example.com/path" @@ -212,19 +207,19 @@ const { data } = await client.getWebsiteChat({ --- -### `updateWebsiteChat` +### `updateChatWidget` -`PUT /v1/website-chats/{website_chat_id}` +`PUT /v1/widgets/{widget_id}` ```ts -const { data } = await client.updateWebsiteChat( +const { data } = await client.updateChatWidget( { - website_chat_id: 'example', + widget_id: 'example', }, { name: 'string', agent_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6', - settings: { + website_chat: { allowed_origins: ['string'], organisation_name: 'string', default_locale: 'en', @@ -247,7 +242,7 @@ const { data } = await client.updateWebsiteChat( { "name": "string", "agent_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "settings": { + "website_chat": { "allowed_origins": ["string"], "organisation_name": "string", "default_locale": "en", @@ -258,13 +253,13 @@ const { data } = await client.updateWebsiteChat( } } }, - "website_chat_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "widget_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "org_id": "string", "binding_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "version": 1, "created_at": "1970-01-01T00:00:00.000Z", "updated_at": "1970-01-01T00:00:00.000Z", - "embed": { + "website_chat_embed": { "script_url": "https://example.com/path", "chat_api_origin": "https://example.com/path", "demo_url": "https://example.com/path" @@ -276,26 +271,26 @@ const { data } = await client.updateWebsiteChat( --- -### `deleteWebsiteChat` +### `deleteChatWidget` -`DELETE /v1/website-chats/{website_chat_id}` +`DELETE /v1/widgets/{widget_id}` ```ts -const { data } = await client.deleteWebsiteChat({ - website_chat_id: 'example', +const { data } = await client.deleteChatWidget({ + widget_id: 'example', version: 1, }) ``` --- -### `getPublicWebsiteChat` +### `getPublicChatWidget` -`GET /v1/website-chats/{website_chat_id}/configuration` +`GET /v1/widgets/{widget_id}/configuration` ```ts -const { data } = await client.getPublicWebsiteChat({ - website_chat_id: 'example', +const { data } = await client.getPublicChatWidget({ + widget_id: 'example', }) ``` @@ -308,9 +303,6 @@ const { data } = await client.getPublicWebsiteChat({ "organisationName": "string", "assistantName": "string", "defaultLocale": "en", - "authentication": { - "email_code": true - }, "design": { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "last_modified_at": "string", @@ -363,7 +355,7 @@ const { data } = await client.getPublicWebsiteChat({ const { data } = await client.createPublicChatGrant( null, { - website_chat_id: 'string' + widget_key: 'string' }, ) ``` @@ -375,7 +367,7 @@ const { data } = await client.createPublicChatGrant( { "grant": "string", "expires_in": 60, - "frame_origin": "https://example.com/path" + "widget_origin": "https://example.com/path" } ``` @@ -404,14 +396,11 @@ const { data } = await client.createAnonymousChatSession( "token": "string", "conversation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "expires_at": 0, - "website_chat": { + "widget": { "key": "string", "organisationName": "string", "assistantName": "string", "defaultLocale": "en", - "authentication": { - "email_code": true - }, "design": { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "last_modified_at": "string", @@ -475,154 +464,29 @@ const { data } = await client.sendAnonymousChatMessage( --- -### `getChatVerification` - -`GET /v1/verification` - -```ts -const { data } = await client.getChatVerification() -``` - -
-Response - -```json -{ - "available": true, - "conversation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "status": "anonymous", - "challenge_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "code_expires_at": 0, - "resend_after": 0, - "email": "user@example.com", - "contact_resolution": "matched" -} -``` - -
- ---- - -### `startChatEmailVerification` - -`POST /v1/verification/email` - -```ts -const { data } = await client.startChatEmailVerification( - null, - { - request_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6', - email: 'user@example.com', - locale: 'en' - }, -) -``` - -
-Response - -```json -{ - "available": true, - "conversation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "status": "anonymous", - "challenge_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "code_expires_at": 0, - "resend_after": 0, - "email": "user@example.com", - "contact_resolution": "matched" -} -``` - -
- ---- - -### `verifyChatEmailCode` - -`POST /v1/verification/code` - -```ts -const { data } = await client.verifyChatEmailCode( - null, - { - challenge_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6', - code: 'string' - }, -) -``` - -
-Response - -```json -{ - "available": true, - "conversation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "status": "anonymous", - "challenge_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "code_expires_at": 0, - "resend_after": 0, - "email": "user@example.com", - "contact_resolution": "matched" -} -``` - -
- ---- - -### `cancelChatVerification` - -`POST /v1/verification/cancel` - -```ts -const { data } = await client.cancelChatVerification() -``` - -
-Response - -```json -{ - "available": true, - "conversation_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "status": "anonymous", - "challenge_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", - "code_expires_at": 0, - "resend_after": 0, - "email": "user@example.com", - "contact_resolution": "matched" -} -``` - -
- ---- - ## Schemas -### `ListWebsiteChatsResponse` +### `ListChatWidgetsResponse` ```ts -type ListWebsiteChatsResponse = { - website_chats: Array<{ +type ListChatWidgetsResponse = { + widgets: Array<{ name: string agent_id: string // uuid - settings: { + website_chat: { allowed_origins: { ... } organisation_name: { ... } default_locale: { ... } design_id?: { ... } authentication?: { ... } } - website_chat_id: string // uuid + widget_id: string // uuid org_id: string binding_id: string // uuid version: number created_at: string // date-time updated_at: string // date-time - embed: { + website_chat_embed: { script_url: { ... } chat_api_origin: { ... } demo_url: { ... } @@ -632,13 +496,13 @@ type ListWebsiteChatsResponse = { } ``` -### `WebsiteChat` +### `ChatWidget` ```ts -type WebsiteChat = { +type ChatWidget = { name: string agent_id: string // uuid - settings: { + website_chat: { allowed_origins: string[] organisation_name: string default_locale: "en" | "de" @@ -647,13 +511,13 @@ type WebsiteChat = { email_code: { ... } } } - website_chat_id: string // uuid + widget_id: string // uuid org_id: string binding_id: string // uuid version: number created_at: string // date-time updated_at: string // date-time - embed: { + website_chat_embed: { script_url: string // uri chat_api_origin: string // uri demo_url: string // uri @@ -687,13 +551,13 @@ type Error = { } ``` -### `CreateWebsiteChatRequest` +### `CreateChatWidgetRequest` ```ts -type CreateWebsiteChatRequest = { +type CreateChatWidgetRequest = { name: string agent_id: string // uuid - settings: { + website_chat: { allowed_origins: string[] organisation_name: string default_locale: "en" | "de" @@ -705,13 +569,13 @@ type CreateWebsiteChatRequest = { } ``` -### `UpdateWebsiteChatRequest` +### `UpdateChatWidgetRequest` ```ts -type UpdateWebsiteChatRequest = { +type UpdateChatWidgetRequest = { name?: string agent_id?: string // uuid - settings?: { + website_chat?: { allowed_origins: string[] organisation_name: string default_locale: "en" | "de" @@ -724,32 +588,14 @@ type UpdateWebsiteChatRequest = { } ``` -### `VerificationState` +### `Widget` ```ts -type VerificationState = { - available: boolean - conversation_id: string // uuid - status: "anonymous" | "sending" | "pending" | "verified" - challenge_id?: string // uuid - code_expires_at?: number - resend_after?: number - email?: string // email - contact_resolution?: "matched" | "ambiguous" | "not_found" -} -``` - -### `PublicWebsiteChat` - -```ts -type PublicWebsiteChat = { +type Widget = { key: string organisationName: string assistantName: string defaultLocale: "en" | "de" - authentication?: { - email_code: boolean - } design?: { id: string // uuid last_modified_at?: string @@ -781,10 +627,10 @@ type PublicWebsiteChat = { } ``` -### `WebsiteChatDesign` +### `WidgetDesign` ```ts -type WebsiteChatDesign = { +type WidgetDesign = { id: string // uuid last_modified_at?: string style?: { @@ -844,6 +690,6 @@ type PublicEvent = { ```ts type PublicChatError = { - code: "INVALID_VERIFICATION_CODE" | "VERIFICATION_EXPIRED" | "VERIFICATION_CONFLICT" | "VERIFICATION_DISABLED" | "VERIFICATION_UNAVAILABLE" | "IDENTITY_CHANGED" | "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE" + code: "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE" } ``` diff --git a/packages/epilot-sdk-v2/src/definitions/chat-runtime.json b/packages/epilot-sdk-v2/src/definitions/chat-runtime.json index 5c43fa46c..32856895b 100644 --- a/packages/epilot-sdk-v2/src/definitions/chat-runtime.json +++ b/packages/epilot-sdk-v2/src/definitions/chat-runtime.json @@ -1 +1 @@ -{"s":"https://chat.sls.epilot.io","o":[["listWebsiteChats","get","/v1/website-chats",[["cursor","q"]]],["createWebsiteChat","post","/v1/website-chats",null,1],["getWebsiteChat","get","/v1/website-chats/{website_chat_id}"],["updateWebsiteChat","put","/v1/website-chats/{website_chat_id}",null,1],["deleteWebsiteChat","delete","/v1/website-chats/{website_chat_id}",[["version","q",true]]],["getPublicWebsiteChat","get","/v1/website-chats/{website_chat_id}/configuration",[["website_chat_id","p",true]]],["createPublicChatGrant","post","/v1/bootstrap",null,1],["createAnonymousChatSession","post","/v1/sessions",null,1],["sendAnonymousChatMessage","post","/v1/messages",null,1],["getChatVerification","get","/v1/verification"],["startChatEmailVerification","post","/v1/verification/email",null,1],["verifyChatEmailCode","post","/v1/verification/code",null,1],["cancelChatVerification","post","/v1/verification/cancel"]],"v":"3.0.3","pp":{"/v1/website-chats/{website_chat_id}":[["website_chat_id","p",true]]}} \ No newline at end of file +{"s":"https://chat.sls.epilot.io","o":[["listChatWidgets","get","/v1/widgets",[["cursor","q"]]],["createChatWidget","post","/v1/widgets",null,1],["getChatWidget","get","/v1/widgets/{widget_id}"],["updateChatWidget","put","/v1/widgets/{widget_id}",null,1],["deleteChatWidget","delete","/v1/widgets/{widget_id}",[["version","q",true]]],["getPublicChatWidget","get","/v1/widgets/{widget_id}/configuration",[["widget_id","p",true]]],["createPublicChatGrant","post","/v1/bootstrap",null,1],["createAnonymousChatSession","post","/v1/sessions",null,1],["sendAnonymousChatMessage","post","/v1/messages",null,1]],"v":"3.0.3","pp":{"/v1/widgets/{widget_id}":[["widget_id","p",true]]}} \ No newline at end of file diff --git a/packages/epilot-sdk-v2/src/docs/chat.json b/packages/epilot-sdk-v2/src/docs/chat.json index 0439e0b29..ce3af27cb 100644 --- a/packages/epilot-sdk-v2/src/docs/chat.json +++ b/packages/epilot-sdk-v2/src/docs/chat.json @@ -1 +1 @@ -"# epilot Chat API\n\n- **Base URL:** `https://chat.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/chat](https://docs.epilot.io/api/chat)\n\n## Usage\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\nepilot.authorize(() => '')\nconst { data } = await epilot.chat.listWebsiteChats(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from '@epilot/sdk/chat'\n\nconst chatClient = getClient()\nauthorize(chatClient, () => '')\nconst { data } = await chatClient.listWebsiteChats(...)\n```\n\n## Operations\n\n**Website Chats**\n- [`listWebsiteChats`](#listwebsitechats)\n- [`createWebsiteChat`](#createwebsitechat)\n- [`getWebsiteChat`](#getwebsitechat)\n- [`updateWebsiteChat`](#updatewebsitechat)\n- [`deleteWebsiteChat`](#deletewebsitechat)\n\n**Other**\n- [`getPublicWebsiteChat`](#getpublicwebsitechat)\n- [`createPublicChatGrant`](#createpublicchatgrant)\n- [`createAnonymousChatSession`](#createanonymouschatsession)\n- [`sendAnonymousChatMessage`](#sendanonymouschatmessage)\n- [`getChatVerification`](#getchatverification)\n- [`startChatEmailVerification`](#startchatemailverification)\n- [`verifyChatEmailCode`](#verifychatemailcode)\n- [`cancelChatVerification`](#cancelchatverification)\n\n**Schemas**\n- [`ListWebsiteChatsResponse`](#listwebsitechatsresponse)\n- [`WebsiteChat`](#websitechat)\n- [`WebsiteChatSettings`](#websitechatsettings)\n- [`Error`](#error)\n- [`CreateWebsiteChatRequest`](#createwebsitechatrequest)\n- [`UpdateWebsiteChatRequest`](#updatewebsitechatrequest)\n- [`VerificationState`](#verificationstate)\n- [`PublicWebsiteChat`](#publicwebsitechat)\n- [`WebsiteChatDesign`](#websitechatdesign)\n- [`PublicEvent`](#publicevent)\n- [`PublicChatError`](#publicchaterror)\n\n### `listWebsiteChats`\n\n`GET /v1/website-chats`\n\n```ts\nconst { data } = await client.listWebsiteChats({\n cursor: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"website_chats\": [\n {\n \"name\": \"string\",\n \"agent_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"settings\": {\n \"allowed_origins\": [\"string\"],\n \"organisation_name\": \"string\",\n \"default_locale\": \"en\",\n \"design_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"authentication\": {\n \"email_code\": {\n \"email_template_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n }\n },\n \"website_chat_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"org_id\": \"string\",\n \"binding_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"version\": 1,\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"embed\": {\n \"script_url\": \"https://example.com/path\",\n \"chat_api_origin\": \"https://example.com/path\",\n \"demo_url\": \"https://example.com/path\"\n }\n }\n ],\n \"next_cursor\": \"string\"\n}\n```\n\n
\n\n---\n\n### `createWebsiteChat`\n\n`POST /v1/website-chats`\n\n```ts\nconst { data } = await client.createWebsiteChat(\n null,\n {\n name: 'string',\n agent_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n settings: {\n allowed_origins: ['string'],\n organisation_name: 'string',\n default_locale: 'en',\n design_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n authentication: {\n email_code: {\n email_template_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6'\n }\n }\n }\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"name\": \"string\",\n \"agent_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"settings\": {\n \"allowed_origins\": [\"string\"],\n \"organisation_name\": \"string\",\n \"default_locale\": \"en\",\n \"design_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"authentication\": {\n \"email_code\": {\n \"email_template_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n }\n },\n \"website_chat_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"org_id\": \"string\",\n \"binding_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"version\": 1,\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"embed\": {\n \"script_url\": \"https://example.com/path\",\n \"chat_api_origin\": \"https://example.com/path\",\n \"demo_url\": \"https://example.com/path\"\n }\n}\n```\n\n
\n\n---\n\n### `getWebsiteChat`\n\n`GET /v1/website-chats/{website_chat_id}`\n\n```ts\nconst { data } = await client.getWebsiteChat({\n website_chat_id: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"name\": \"string\",\n \"agent_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"settings\": {\n \"allowed_origins\": [\"string\"],\n \"organisation_name\": \"string\",\n \"default_locale\": \"en\",\n \"design_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"authentication\": {\n \"email_code\": {\n \"email_template_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n }\n },\n \"website_chat_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"org_id\": \"string\",\n \"binding_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"version\": 1,\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"embed\": {\n \"script_url\": \"https://example.com/path\",\n \"chat_api_origin\": \"https://example.com/path\",\n \"demo_url\": \"https://example.com/path\"\n }\n}\n```\n\n
\n\n---\n\n### `updateWebsiteChat`\n\n`PUT /v1/website-chats/{website_chat_id}`\n\n```ts\nconst { data } = await client.updateWebsiteChat(\n {\n website_chat_id: 'example',\n },\n {\n name: 'string',\n agent_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n settings: {\n allowed_origins: ['string'],\n organisation_name: 'string',\n default_locale: 'en',\n design_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n authentication: {\n email_code: {\n email_template_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6'\n }\n }\n },\n version: 1\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"name\": \"string\",\n \"agent_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"settings\": {\n \"allowed_origins\": [\"string\"],\n \"organisation_name\": \"string\",\n \"default_locale\": \"en\",\n \"design_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"authentication\": {\n \"email_code\": {\n \"email_template_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n }\n },\n \"website_chat_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"org_id\": \"string\",\n \"binding_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"version\": 1,\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"embed\": {\n \"script_url\": \"https://example.com/path\",\n \"chat_api_origin\": \"https://example.com/path\",\n \"demo_url\": \"https://example.com/path\"\n }\n}\n```\n\n
\n\n---\n\n### `deleteWebsiteChat`\n\n`DELETE /v1/website-chats/{website_chat_id}`\n\n```ts\nconst { data } = await client.deleteWebsiteChat({\n website_chat_id: 'example',\n version: 1,\n})\n```\n\n---\n\n### `getPublicWebsiteChat`\n\n`GET /v1/website-chats/{website_chat_id}/configuration`\n\n```ts\nconst { data } = await client.getPublicWebsiteChat({\n website_chat_id: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"key\": \"string\",\n \"organisationName\": \"string\",\n \"assistantName\": \"string\",\n \"defaultLocale\": \"en\",\n \"authentication\": {\n \"email_code\": true\n },\n \"design\": {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"last_modified_at\": \"string\",\n \"style\": {\n \"palette\": {\n \"primary\": \"string\",\n \"background\": \"string\"\n },\n \"typography\": {\n \"font\": {\n \"font_family\": \"string\"\n }\n },\n \"shape\": {\n \"border_radius\": 0\n }\n },\n \"spark_theme\": {\n \"accentColor\": \"string\",\n \"backgroundColor\": \"string\",\n \"fontBody\": \"string\",\n \"fontHeading\": \"string\",\n \"radius\": \"string\",\n \"scaling\": \"string\",\n \"spacing\": \"string\",\n \"appearance\": \"string\",\n \"neutralColor\": \"string\",\n \"styleVariant\": \"string\",\n \"labelPosition\": \"string\",\n \"inputStyle\": \"string\",\n \"inputColor\": \"string\",\n \"cardVariant\": \"string\",\n \"cardColor\": \"string\",\n \"highContrast\": true\n }\n },\n \"locales\": [\"en\"]\n}\n```\n\n
\n\n---\n\n### `createPublicChatGrant`\n\n`POST /v1/bootstrap`\n\n```ts\nconst { data } = await client.createPublicChatGrant(\n null,\n {\n website_chat_id: 'string'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"grant\": \"string\",\n \"expires_in\": 60,\n \"frame_origin\": \"https://example.com/path\"\n}\n```\n\n
\n\n---\n\n### `createAnonymousChatSession`\n\n`POST /v1/sessions`\n\n```ts\nconst { data } = await client.createAnonymousChatSession(\n null,\n {\n grant: 'string'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"token\": \"string\",\n \"conversation_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"expires_at\": 0,\n \"website_chat\": {\n \"key\": \"string\",\n \"organisationName\": \"string\",\n \"assistantName\": \"string\",\n \"defaultLocale\": \"en\",\n \"authentication\": {\n \"email_code\": true\n },\n \"design\": {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"last_modified_at\": \"string\",\n \"style\": {\n \"palette\": {\n \"primary\": \"string\",\n \"background\": \"string\"\n },\n \"typography\": {\n \"font\": {\n \"font_family\": \"string\"\n }\n },\n \"shape\": {\n \"border_radius\": 0\n }\n },\n \"spark_theme\": {\n \"accentColor\": \"string\",\n \"backgroundColor\": \"string\",\n \"fontBody\": \"string\",\n \"fontHeading\": \"string\",\n \"radius\": \"string\",\n \"scaling\": \"string\",\n \"spacing\": \"string\",\n \"appearance\": \"string\",\n \"neutralColor\": \"string\",\n \"styleVariant\": \"string\",\n \"labelPosition\": \"string\",\n \"inputStyle\": \"string\",\n \"inputColor\": \"string\",\n \"cardVariant\": \"string\",\n \"cardColor\": \"string\",\n \"highContrast\": true\n }\n },\n \"locales\": [\"en\"]\n }\n}\n```\n\n
\n\n---\n\n### `sendAnonymousChatMessage`\n\n`POST /v1/messages`\n\n```ts\nconst { data } = await client.sendAnonymousChatMessage(\n null,\n {\n request_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n message: 'string',\n locale: 'en',\n simple_language: true\n },\n)\n```\n\n---\n\n### `getChatVerification`\n\n`GET /v1/verification`\n\n```ts\nconst { data } = await client.getChatVerification()\n```\n\n
\nResponse\n\n```json\n{\n \"available\": true,\n \"conversation_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"status\": \"anonymous\",\n \"challenge_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"code_expires_at\": 0,\n \"resend_after\": 0,\n \"email\": \"user@example.com\",\n \"contact_resolution\": \"matched\"\n}\n```\n\n
\n\n---\n\n### `startChatEmailVerification`\n\n`POST /v1/verification/email`\n\n```ts\nconst { data } = await client.startChatEmailVerification(\n null,\n {\n request_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n email: 'user@example.com',\n locale: 'en'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"available\": true,\n \"conversation_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"status\": \"anonymous\",\n \"challenge_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"code_expires_at\": 0,\n \"resend_after\": 0,\n \"email\": \"user@example.com\",\n \"contact_resolution\": \"matched\"\n}\n```\n\n
\n\n---\n\n### `verifyChatEmailCode`\n\n`POST /v1/verification/code`\n\n```ts\nconst { data } = await client.verifyChatEmailCode(\n null,\n {\n challenge_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n code: 'string'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"available\": true,\n \"conversation_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"status\": \"anonymous\",\n \"challenge_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"code_expires_at\": 0,\n \"resend_after\": 0,\n \"email\": \"user@example.com\",\n \"contact_resolution\": \"matched\"\n}\n```\n\n
\n\n---\n\n### `cancelChatVerification`\n\n`POST /v1/verification/cancel`\n\n```ts\nconst { data } = await client.cancelChatVerification()\n```\n\n
\nResponse\n\n```json\n{\n \"available\": true,\n \"conversation_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"status\": \"anonymous\",\n \"challenge_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"code_expires_at\": 0,\n \"resend_after\": 0,\n \"email\": \"user@example.com\",\n \"contact_resolution\": \"matched\"\n}\n```\n\n
\n\n---\n\n## Schemas\n\n### `ListWebsiteChatsResponse`\n\n```ts\ntype ListWebsiteChatsResponse = {\n website_chats: Array<{\n name: string\n agent_id: string // uuid\n settings: {\n allowed_origins: { ... }\n organisation_name: { ... }\n default_locale: { ... }\n design_id?: { ... }\n authentication?: { ... }\n }\n website_chat_id: string // uuid\n org_id: string\n binding_id: string // uuid\n version: number\n created_at: string // date-time\n updated_at: string // date-time\n embed: {\n script_url: { ... }\n chat_api_origin: { ... }\n demo_url: { ... }\n }\n }>\n next_cursor?: string\n}\n```\n\n### `WebsiteChat`\n\n```ts\ntype WebsiteChat = {\n name: string\n agent_id: string // uuid\n settings: {\n allowed_origins: string[]\n organisation_name: string\n default_locale: \"en\" | \"de\"\n design_id?: string // uuid\n authentication?: {\n email_code: { ... }\n }\n }\n website_chat_id: string // uuid\n org_id: string\n binding_id: string // uuid\n version: number\n created_at: string // date-time\n updated_at: string // date-time\n embed: {\n script_url: string // uri\n chat_api_origin: string // uri\n demo_url: string // uri\n }\n}\n```\n\n### `WebsiteChatSettings`\n\n```ts\ntype WebsiteChatSettings = {\n allowed_origins: string[]\n organisation_name: string\n default_locale: \"en\" | \"de\"\n design_id?: string // uuid\n authentication?: {\n email_code: {\n email_template_id?: { ... }\n }\n }\n}\n```\n\n### `Error`\n\n```ts\ntype Error = {\n error?: string\n message?: string\n details?: object\n}\n```\n\n### `CreateWebsiteChatRequest`\n\n```ts\ntype CreateWebsiteChatRequest = {\n name: string\n agent_id: string // uuid\n settings: {\n allowed_origins: string[]\n organisation_name: string\n default_locale: \"en\" | \"de\"\n design_id?: string // uuid\n authentication?: {\n email_code: { ... }\n }\n }\n}\n```\n\n### `UpdateWebsiteChatRequest`\n\n```ts\ntype UpdateWebsiteChatRequest = {\n name?: string\n agent_id?: string // uuid\n settings?: {\n allowed_origins: string[]\n organisation_name: string\n default_locale: \"en\" | \"de\"\n design_id?: string // uuid\n authentication?: {\n email_code: { ... }\n }\n }\n version: number\n}\n```\n\n### `VerificationState`\n\n```ts\ntype VerificationState = {\n available: boolean\n conversation_id: string // uuid\n status: \"anonymous\" | \"sending\" | \"pending\" | \"verified\"\n challenge_id?: string // uuid\n code_expires_at?: number\n resend_after?: number\n email?: string // email\n contact_resolution?: \"matched\" | \"ambiguous\" | \"not_found\"\n}\n```\n\n### `PublicWebsiteChat`\n\n```ts\ntype PublicWebsiteChat = {\n key: string\n organisationName: string\n assistantName: string\n defaultLocale: \"en\" | \"de\"\n authentication?: {\n email_code: boolean\n }\n design?: {\n id: string // uuid\n last_modified_at?: string\n style?: {\n palette?: { ... }\n typography?: { ... }\n shape?: { ... }\n }\n spark_theme?: {\n accentColor?: { ... }\n backgroundColor?: { ... }\n fontBody?: { ... }\n fontHeading?: { ... }\n radius?: { ... }\n scaling?: { ... }\n spacing?: { ... }\n appearance?: { ... }\n neutralColor?: { ... }\n styleVariant?: { ... }\n labelPosition?: { ... }\n inputStyle?: { ... }\n inputColor?: { ... }\n cardVariant?: { ... }\n cardColor?: { ... }\n highContrast?: { ... }\n }\n }\n locales: \"en\" | \"de\"[]\n}\n```\n\n### `WebsiteChatDesign`\n\n```ts\ntype WebsiteChatDesign = {\n id: string // uuid\n last_modified_at?: string\n style?: {\n palette?: {\n primary?: { ... }\n background?: { ... }\n }\n typography?: {\n font?: { ... }\n }\n shape?: {\n border_radius?: { ... }\n }\n }\n spark_theme?: {\n accentColor?: string\n backgroundColor?: string\n fontBody?: string\n fontHeading?: string\n radius?: string\n scaling?: string\n spacing?: string\n appearance?: string\n neutralColor?: string\n styleVariant?: string\n labelPosition?: string\n inputStyle?: string\n inputColor?: string\n cardVariant?: string\n cardColor?: string\n highContrast?: boolean\n }\n}\n```\n\n### `PublicEvent`\n\nJSON payload of one SSE data frame from sendAnonymousChatMessage.\n\n```ts\ntype PublicEvent = {\n type: \"delta\"\n text: string\n request_id: string // uuid\n} | {\n type: \"complete\"\n text: string\n request_id: string // uuid\n} | {\n type: \"error\"\n code: \"UNAVAILABLE\"\n request_id: string // uuid\n}\n```\n\n### `PublicChatError`\n\n```ts\ntype PublicChatError = {\n code: \"INVALID_VERIFICATION_CODE\" | \"VERIFICATION_EXPIRED\" | \"VERIFICATION_CONFLICT\" | \"VERIFICATION_DISABLED\" | \"VERIFICATION_UNAVAILABLE\" | \"IDENTITY_CHANGED\" | \"INVALID_REQUEST\" | \"ORIGIN_DENIED\" | \"NOT_FOUND\" | \"INVALID_GRANT\" | \"SESSION_EXPIRED\" | \"RATE_LIMITED\" | \"SESSION_LIMIT\" | \"USAGE_LIMIT\" | \"REQUEST_CONFLICT\" | \"IN_PROGRESS\" | \"UNAVAILABLE\" | \"TEMPORARILY_UNAVAILABLE\"\n}\n```\n" +"# epilot Chat API\n\n- **Base URL:** `https://chat.sls.epilot.io`\n- **Full API Docs:** [https://docs.epilot.io/api/chat](https://docs.epilot.io/api/chat)\n\n## Usage\n\n```ts\nimport { epilot } from '@epilot/sdk'\n\nepilot.authorize(() => '')\nconst { data } = await epilot.chat.listChatWidgets(...)\n```\n\n### Tree-shakeable import\n\n```ts\nimport { getClient, authorize } from '@epilot/sdk/chat'\n\nconst chatClient = getClient()\nauthorize(chatClient, () => '')\nconst { data } = await chatClient.listChatWidgets(...)\n```\n\n## Operations\n\n**Chat widgets**\n- [`listChatWidgets`](#listchatwidgets)\n- [`createChatWidget`](#createchatwidget)\n- [`getChatWidget`](#getchatwidget)\n- [`updateChatWidget`](#updatechatwidget)\n- [`deleteChatWidget`](#deletechatwidget)\n\n**Other**\n- [`getPublicChatWidget`](#getpublicchatwidget)\n- [`createPublicChatGrant`](#createpublicchatgrant)\n- [`createAnonymousChatSession`](#createanonymouschatsession)\n- [`sendAnonymousChatMessage`](#sendanonymouschatmessage)\n\n**Schemas**\n- [`ListChatWidgetsResponse`](#listchatwidgetsresponse)\n- [`ChatWidget`](#chatwidget)\n- [`WebsiteChatSettings`](#websitechatsettings)\n- [`Error`](#error)\n- [`CreateChatWidgetRequest`](#createchatwidgetrequest)\n- [`UpdateChatWidgetRequest`](#updatechatwidgetrequest)\n- [`Widget`](#widget)\n- [`WidgetDesign`](#widgetdesign)\n- [`PublicEvent`](#publicevent)\n- [`PublicChatError`](#publicchaterror)\n\n### `listChatWidgets`\n\n`GET /v1/widgets`\n\n```ts\nconst { data } = await client.listChatWidgets({\n cursor: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"widgets\": [\n {\n \"name\": \"string\",\n \"agent_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"website_chat\": {\n \"allowed_origins\": [\"string\"],\n \"organisation_name\": \"string\",\n \"default_locale\": \"en\",\n \"design_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"authentication\": {\n \"email_code\": {\n \"email_template_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n }\n },\n \"widget_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"org_id\": \"string\",\n \"binding_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"version\": 1,\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"website_chat_embed\": {\n \"script_url\": \"https://example.com/path\",\n \"chat_api_origin\": \"https://example.com/path\",\n \"demo_url\": \"https://example.com/path\"\n }\n }\n ],\n \"next_cursor\": \"string\"\n}\n```\n\n
\n\n---\n\n### `createChatWidget`\n\n`POST /v1/widgets`\n\n```ts\nconst { data } = await client.createChatWidget(\n null,\n {\n name: 'string',\n agent_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n website_chat: {\n allowed_origins: ['string'],\n organisation_name: 'string',\n default_locale: 'en',\n design_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n authentication: {\n email_code: {\n email_template_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6'\n }\n }\n }\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"name\": \"string\",\n \"agent_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"website_chat\": {\n \"allowed_origins\": [\"string\"],\n \"organisation_name\": \"string\",\n \"default_locale\": \"en\",\n \"design_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"authentication\": {\n \"email_code\": {\n \"email_template_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n }\n },\n \"widget_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"org_id\": \"string\",\n \"binding_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"version\": 1,\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"website_chat_embed\": {\n \"script_url\": \"https://example.com/path\",\n \"chat_api_origin\": \"https://example.com/path\",\n \"demo_url\": \"https://example.com/path\"\n }\n}\n```\n\n
\n\n---\n\n### `getChatWidget`\n\n`GET /v1/widgets/{widget_id}`\n\n```ts\nconst { data } = await client.getChatWidget({\n widget_id: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"name\": \"string\",\n \"agent_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"website_chat\": {\n \"allowed_origins\": [\"string\"],\n \"organisation_name\": \"string\",\n \"default_locale\": \"en\",\n \"design_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"authentication\": {\n \"email_code\": {\n \"email_template_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n }\n },\n \"widget_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"org_id\": \"string\",\n \"binding_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"version\": 1,\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"website_chat_embed\": {\n \"script_url\": \"https://example.com/path\",\n \"chat_api_origin\": \"https://example.com/path\",\n \"demo_url\": \"https://example.com/path\"\n }\n}\n```\n\n
\n\n---\n\n### `updateChatWidget`\n\n`PUT /v1/widgets/{widget_id}`\n\n```ts\nconst { data } = await client.updateChatWidget(\n {\n widget_id: 'example',\n },\n {\n name: 'string',\n agent_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n website_chat: {\n allowed_origins: ['string'],\n organisation_name: 'string',\n default_locale: 'en',\n design_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n authentication: {\n email_code: {\n email_template_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6'\n }\n }\n },\n version: 1\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"name\": \"string\",\n \"agent_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"website_chat\": {\n \"allowed_origins\": [\"string\"],\n \"organisation_name\": \"string\",\n \"default_locale\": \"en\",\n \"design_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"authentication\": {\n \"email_code\": {\n \"email_template_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\"\n }\n }\n },\n \"widget_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"org_id\": \"string\",\n \"binding_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"version\": 1,\n \"created_at\": \"1970-01-01T00:00:00.000Z\",\n \"updated_at\": \"1970-01-01T00:00:00.000Z\",\n \"website_chat_embed\": {\n \"script_url\": \"https://example.com/path\",\n \"chat_api_origin\": \"https://example.com/path\",\n \"demo_url\": \"https://example.com/path\"\n }\n}\n```\n\n
\n\n---\n\n### `deleteChatWidget`\n\n`DELETE /v1/widgets/{widget_id}`\n\n```ts\nconst { data } = await client.deleteChatWidget({\n widget_id: 'example',\n version: 1,\n})\n```\n\n---\n\n### `getPublicChatWidget`\n\n`GET /v1/widgets/{widget_id}/configuration`\n\n```ts\nconst { data } = await client.getPublicChatWidget({\n widget_id: 'example',\n})\n```\n\n
\nResponse\n\n```json\n{\n \"key\": \"string\",\n \"organisationName\": \"string\",\n \"assistantName\": \"string\",\n \"defaultLocale\": \"en\",\n \"design\": {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"last_modified_at\": \"string\",\n \"style\": {\n \"palette\": {\n \"primary\": \"string\",\n \"background\": \"string\"\n },\n \"typography\": {\n \"font\": {\n \"font_family\": \"string\"\n }\n },\n \"shape\": {\n \"border_radius\": 0\n }\n },\n \"spark_theme\": {\n \"accentColor\": \"string\",\n \"backgroundColor\": \"string\",\n \"fontBody\": \"string\",\n \"fontHeading\": \"string\",\n \"radius\": \"string\",\n \"scaling\": \"string\",\n \"spacing\": \"string\",\n \"appearance\": \"string\",\n \"neutralColor\": \"string\",\n \"styleVariant\": \"string\",\n \"labelPosition\": \"string\",\n \"inputStyle\": \"string\",\n \"inputColor\": \"string\",\n \"cardVariant\": \"string\",\n \"cardColor\": \"string\",\n \"highContrast\": true\n }\n },\n \"locales\": [\"en\"]\n}\n```\n\n
\n\n---\n\n### `createPublicChatGrant`\n\n`POST /v1/bootstrap`\n\n```ts\nconst { data } = await client.createPublicChatGrant(\n null,\n {\n widget_key: 'string'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"grant\": \"string\",\n \"expires_in\": 60,\n \"widget_origin\": \"https://example.com/path\"\n}\n```\n\n
\n\n---\n\n### `createAnonymousChatSession`\n\n`POST /v1/sessions`\n\n```ts\nconst { data } = await client.createAnonymousChatSession(\n null,\n {\n grant: 'string'\n },\n)\n```\n\n
\nResponse\n\n```json\n{\n \"token\": \"string\",\n \"conversation_id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"expires_at\": 0,\n \"widget\": {\n \"key\": \"string\",\n \"organisationName\": \"string\",\n \"assistantName\": \"string\",\n \"defaultLocale\": \"en\",\n \"design\": {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"last_modified_at\": \"string\",\n \"style\": {\n \"palette\": {\n \"primary\": \"string\",\n \"background\": \"string\"\n },\n \"typography\": {\n \"font\": {\n \"font_family\": \"string\"\n }\n },\n \"shape\": {\n \"border_radius\": 0\n }\n },\n \"spark_theme\": {\n \"accentColor\": \"string\",\n \"backgroundColor\": \"string\",\n \"fontBody\": \"string\",\n \"fontHeading\": \"string\",\n \"radius\": \"string\",\n \"scaling\": \"string\",\n \"spacing\": \"string\",\n \"appearance\": \"string\",\n \"neutralColor\": \"string\",\n \"styleVariant\": \"string\",\n \"labelPosition\": \"string\",\n \"inputStyle\": \"string\",\n \"inputColor\": \"string\",\n \"cardVariant\": \"string\",\n \"cardColor\": \"string\",\n \"highContrast\": true\n }\n },\n \"locales\": [\"en\"]\n }\n}\n```\n\n
\n\n---\n\n### `sendAnonymousChatMessage`\n\n`POST /v1/messages`\n\n```ts\nconst { data } = await client.sendAnonymousChatMessage(\n null,\n {\n request_id: '3fa85f64-5717-4562-b3fc-2c963f66afa6',\n message: 'string',\n locale: 'en',\n simple_language: true\n },\n)\n```\n\n---\n\n## Schemas\n\n### `ListChatWidgetsResponse`\n\n```ts\ntype ListChatWidgetsResponse = {\n widgets: Array<{\n name: string\n agent_id: string // uuid\n website_chat: {\n allowed_origins: { ... }\n organisation_name: { ... }\n default_locale: { ... }\n design_id?: { ... }\n authentication?: { ... }\n }\n widget_id: string // uuid\n org_id: string\n binding_id: string // uuid\n version: number\n created_at: string // date-time\n updated_at: string // date-time\n website_chat_embed: {\n script_url: { ... }\n chat_api_origin: { ... }\n demo_url: { ... }\n }\n }>\n next_cursor?: string\n}\n```\n\n### `ChatWidget`\n\n```ts\ntype ChatWidget = {\n name: string\n agent_id: string // uuid\n website_chat: {\n allowed_origins: string[]\n organisation_name: string\n default_locale: \"en\" | \"de\"\n design_id?: string // uuid\n authentication?: {\n email_code: { ... }\n }\n }\n widget_id: string // uuid\n org_id: string\n binding_id: string // uuid\n version: number\n created_at: string // date-time\n updated_at: string // date-time\n website_chat_embed: {\n script_url: string // uri\n chat_api_origin: string // uri\n demo_url: string // uri\n }\n}\n```\n\n### `WebsiteChatSettings`\n\n```ts\ntype WebsiteChatSettings = {\n allowed_origins: string[]\n organisation_name: string\n default_locale: \"en\" | \"de\"\n design_id?: string // uuid\n authentication?: {\n email_code: {\n email_template_id?: { ... }\n }\n }\n}\n```\n\n### `Error`\n\n```ts\ntype Error = {\n error?: string\n message?: string\n details?: object\n}\n```\n\n### `CreateChatWidgetRequest`\n\n```ts\ntype CreateChatWidgetRequest = {\n name: string\n agent_id: string // uuid\n website_chat: {\n allowed_origins: string[]\n organisation_name: string\n default_locale: \"en\" | \"de\"\n design_id?: string // uuid\n authentication?: {\n email_code: { ... }\n }\n }\n}\n```\n\n### `UpdateChatWidgetRequest`\n\n```ts\ntype UpdateChatWidgetRequest = {\n name?: string\n agent_id?: string // uuid\n website_chat?: {\n allowed_origins: string[]\n organisation_name: string\n default_locale: \"en\" | \"de\"\n design_id?: string // uuid\n authentication?: {\n email_code: { ... }\n }\n }\n version: number\n}\n```\n\n### `Widget`\n\n```ts\ntype Widget = {\n key: string\n organisationName: string\n assistantName: string\n defaultLocale: \"en\" | \"de\"\n design?: {\n id: string // uuid\n last_modified_at?: string\n style?: {\n palette?: { ... }\n typography?: { ... }\n shape?: { ... }\n }\n spark_theme?: {\n accentColor?: { ... }\n backgroundColor?: { ... }\n fontBody?: { ... }\n fontHeading?: { ... }\n radius?: { ... }\n scaling?: { ... }\n spacing?: { ... }\n appearance?: { ... }\n neutralColor?: { ... }\n styleVariant?: { ... }\n labelPosition?: { ... }\n inputStyle?: { ... }\n inputColor?: { ... }\n cardVariant?: { ... }\n cardColor?: { ... }\n highContrast?: { ... }\n }\n }\n locales: \"en\" | \"de\"[]\n}\n```\n\n### `WidgetDesign`\n\n```ts\ntype WidgetDesign = {\n id: string // uuid\n last_modified_at?: string\n style?: {\n palette?: {\n primary?: { ... }\n background?: { ... }\n }\n typography?: {\n font?: { ... }\n }\n shape?: {\n border_radius?: { ... }\n }\n }\n spark_theme?: {\n accentColor?: string\n backgroundColor?: string\n fontBody?: string\n fontHeading?: string\n radius?: string\n scaling?: string\n spacing?: string\n appearance?: string\n neutralColor?: string\n styleVariant?: string\n labelPosition?: string\n inputStyle?: string\n inputColor?: string\n cardVariant?: string\n cardColor?: string\n highContrast?: boolean\n }\n}\n```\n\n### `PublicEvent`\n\nJSON payload of one SSE data frame from sendAnonymousChatMessage.\n\n```ts\ntype PublicEvent = {\n type: \"delta\"\n text: string\n request_id: string // uuid\n} | {\n type: \"complete\"\n text: string\n request_id: string // uuid\n} | {\n type: \"error\"\n code: \"UNAVAILABLE\"\n request_id: string // uuid\n}\n```\n\n### `PublicChatError`\n\n```ts\ntype PublicChatError = {\n code: \"INVALID_REQUEST\" | \"ORIGIN_DENIED\" | \"NOT_FOUND\" | \"INVALID_GRANT\" | \"SESSION_EXPIRED\" | \"RATE_LIMITED\" | \"SESSION_LIMIT\" | \"USAGE_LIMIT\" | \"REQUEST_CONFLICT\" | \"IN_PROGRESS\" | \"UNAVAILABLE\" | \"TEMPORARILY_UNAVAILABLE\"\n}\n```\n" diff --git a/packages/epilot-sdk-v2/src/types/chat.d.ts b/packages/epilot-sdk-v2/src/types/chat.d.ts index 27760f737..a48984764 100644 --- a/packages/epilot-sdk-v2/src/types/chat.d.ts +++ b/packages/epilot-sdk-v2/src/types/chat.d.ts @@ -10,16 +10,16 @@ import type { export declare namespace Components { namespace Responses { export interface Error { - code: "INVALID_VERIFICATION_CODE" | "VERIFICATION_EXPIRED" | "VERIFICATION_CONFLICT" | "VERIFICATION_DISABLED" | "VERIFICATION_UNAVAILABLE" | "IDENTITY_CHANGED" | "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; + code: "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; } } namespace Schemas { - export interface CreateWebsiteChatRequest { + export interface ChatWidget { name: string; agent_id: string | null; // uuid - settings: { + website_chat: { /** - * Exact HTTPS origins. Empty means the Website Chat cannot start sessions. + * Exact HTTPS origins. Empty means the widget cannot start sessions. */ allowed_origins: [ string?, @@ -76,7 +76,99 @@ export declare namespace Components { organisation_name: string; default_locale: "en" | "de"; /** - * Design Builder configuration for the Website Chat only. + * Design Builder configuration for the widget only. + */ + design_id?: string | null; // uuid + /** + * Email Builder template selection. Does not enable verification by itself. + */ + authentication?: { + email_code: { + email_template_id?: string | null; // uuid + }; + } | null; + }; + /** + * Stable public embed identifier, independent of the assigned agent. Not a credential. + */ + widget_id: string; // uuid + org_id: string; + /** + * Server-owned session binding; changes on reassignment or allowed-origin changes. + */ + binding_id: string; // uuid + version: number; + created_at: string; // date-time + updated_at: string; // date-time + website_chat_embed: { + script_url: string; // uri + chat_api_origin: string; // uri + demo_url: string; // uri + }; + } + export interface CreateChatWidgetRequest { + name: string; + agent_id: string | null; // uuid + website_chat: { + /** + * Exact HTTPS origins. Empty means the widget cannot start sessions. + */ + allowed_origins: [ + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string?, + string? + ]; + organisation_name: string; + default_locale: "en" | "de"; + /** + * Design Builder configuration for the widget only. */ design_id?: string | null; // uuid /** @@ -96,13 +188,13 @@ export declare namespace Components { [key: string]: any; }; } - export interface ListWebsiteChatsResponse { - website_chats: { + export interface ListChatWidgetsResponse { + widgets: { name: string; agent_id: string | null; // uuid - settings: { + website_chat: { /** - * Exact HTTPS origins. Empty means the Website Chat cannot start sessions. + * Exact HTTPS origins. Empty means the widget cannot start sessions. */ allowed_origins: [ string?, @@ -159,7 +251,7 @@ export declare namespace Components { organisation_name: string; default_locale: "en" | "de"; /** - * Design Builder configuration for the Website Chat only. + * Design Builder configuration for the widget only. */ design_id?: string | null; // uuid /** @@ -174,7 +266,7 @@ export declare namespace Components { /** * Stable public embed identifier, independent of the assigned agent. Not a credential. */ - website_chat_id: string; // uuid + widget_id: string; // uuid org_id: string; /** * Server-owned session binding; changes on reassignment or allowed-origin changes. @@ -183,7 +275,7 @@ export declare namespace Components { version: number; created_at: string; // date-time updated_at: string; // date-time - embed: { + website_chat_embed: { script_url: string; // uri chat_api_origin: string; // uri demo_url: string; // uri @@ -192,7 +284,7 @@ export declare namespace Components { next_cursor?: string; } export interface PublicChatError { - code: "INVALID_VERIFICATION_CODE" | "VERIFICATION_EXPIRED" | "VERIFICATION_CONFLICT" | "VERIFICATION_DISABLED" | "VERIFICATION_UNAVAILABLE" | "IDENTITY_CHANGED" | "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; + code: "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; } /** * JSON payload of one SSE data frame from sendAnonymousChatMessage. @@ -210,58 +302,12 @@ export declare namespace Components { code: "UNAVAILABLE"; request_id: string; // uuid }; - export interface PublicWebsiteChat { - key: string; - organisationName: string; - assistantName: string; - defaultLocale: "en" | "de"; - authentication?: { - email_code: boolean; - }; - design?: { - id: string; // uuid - last_modified_at?: string; - style?: { - palette?: { - primary?: string; - background?: string; - }; - typography?: { - font?: { - font_family?: string; - }; - }; - shape?: { - border_radius?: number; - }; - }; - spark_theme?: { - accentColor?: string; - backgroundColor?: string; - fontBody?: string; - fontHeading?: string; - radius?: string; - scaling?: string; - spacing?: string; - appearance?: string; - neutralColor?: string; - styleVariant?: string; - labelPosition?: string; - inputStyle?: string; - inputColor?: string; - cardVariant?: string; - cardColor?: string; - highContrast?: boolean; - }; - }; - locales: ("en" | "de")[]; - } - export interface UpdateWebsiteChatRequest { + export interface UpdateChatWidgetRequest { name?: string; agent_id?: string | null; // uuid - settings?: { + website_chat?: { /** - * Exact HTTPS origins. Empty means the Website Chat cannot start sessions. + * Exact HTTPS origins. Empty means the widget cannot start sessions. */ allowed_origins: [ string?, @@ -318,7 +364,7 @@ export declare namespace Components { organisation_name: string; default_locale: "en" | "de"; /** - * Design Builder configuration for the Website Chat only. + * Design Builder configuration for the widget only. */ design_id?: string | null; // uuid /** @@ -335,153 +381,9 @@ export declare namespace Components { */ version: number; } - export interface VerificationState { - available: boolean; - conversation_id: string; // uuid - status: "anonymous" | "sending" | "pending" | "verified"; - challenge_id?: string; // uuid - /** - * Unix seconds - */ - code_expires_at?: number; - /** - * Unix seconds - */ - resend_after?: number; - email?: string; // email - contact_resolution?: "matched" | "ambiguous" | "not_found"; - } - export interface WebsiteChat { - name: string; - agent_id: string | null; // uuid - settings: { - /** - * Exact HTTPS origins. Empty means the Website Chat cannot start sessions. - */ - allowed_origins: [ - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string?, - string? - ]; - organisation_name: string; - default_locale: "en" | "de"; - /** - * Design Builder configuration for the Website Chat only. - */ - design_id?: string | null; // uuid - /** - * Email Builder template selection. Does not enable verification by itself. - */ - authentication?: { - email_code: { - email_template_id?: string | null; // uuid - }; - } | null; - }; - /** - * Stable public embed identifier, independent of the assigned agent. Not a credential. - */ - website_chat_id: string; // uuid - org_id: string; - /** - * Server-owned session binding; changes on reassignment or allowed-origin changes. - */ - binding_id: string; // uuid - version: number; - created_at: string; // date-time - updated_at: string; // date-time - embed: { - script_url: string; // uri - chat_api_origin: string; // uri - demo_url: string; // uri - }; - } - export interface WebsiteChatDesign { - id: string; // uuid - last_modified_at?: string; - style?: { - palette?: { - primary?: string; - background?: string; - }; - typography?: { - font?: { - font_family?: string; - }; - }; - shape?: { - border_radius?: number; - }; - }; - spark_theme?: { - accentColor?: string; - backgroundColor?: string; - fontBody?: string; - fontHeading?: string; - radius?: string; - scaling?: string; - spacing?: string; - appearance?: string; - neutralColor?: string; - styleVariant?: string; - labelPosition?: string; - inputStyle?: string; - inputColor?: string; - cardVariant?: string; - cardColor?: string; - highContrast?: boolean; - }; - } export interface WebsiteChatSettings { /** - * Exact HTTPS origins. Empty means the Website Chat cannot start sessions. + * Exact HTTPS origins. Empty means the widget cannot start sessions. */ allowed_origins: [ string?, @@ -538,7 +440,7 @@ export declare namespace Components { organisation_name: string; default_locale: "en" | "de"; /** - * Design Builder configuration for the Website Chat only. + * Design Builder configuration for the widget only. */ design_id?: string | null; // uuid /** @@ -550,32 +452,88 @@ export declare namespace Components { }; } | null; } + export interface Widget { + key: string; + organisationName: string; + assistantName: string; + defaultLocale: "en" | "de"; + design?: { + id: string; // uuid + last_modified_at?: string; + style?: { + palette?: { + primary?: string; + background?: string; + }; + typography?: { + font?: { + font_family?: string; + }; + }; + shape?: { + border_radius?: number; + }; + }; + spark_theme?: { + accentColor?: string; + backgroundColor?: string; + fontBody?: string; + fontHeading?: string; + radius?: string; + scaling?: string; + spacing?: string; + appearance?: string; + neutralColor?: string; + styleVariant?: string; + labelPosition?: string; + inputStyle?: string; + inputColor?: string; + cardVariant?: string; + cardColor?: string; + highContrast?: boolean; + }; + }; + locales: ("en" | "de")[]; + } + export interface WidgetDesign { + id: string; // uuid + last_modified_at?: string; + style?: { + palette?: { + primary?: string; + background?: string; + }; + typography?: { + font?: { + font_family?: string; + }; + }; + shape?: { + border_radius?: number; + }; + }; + spark_theme?: { + accentColor?: string; + backgroundColor?: string; + fontBody?: string; + fontHeading?: string; + radius?: string; + scaling?: string; + spacing?: string; + appearance?: string; + neutralColor?: string; + styleVariant?: string; + labelPosition?: string; + inputStyle?: string; + inputColor?: string; + cardVariant?: string; + cardColor?: string; + highContrast?: boolean; + }; + } } } export declare namespace Paths { - namespace CancelChatVerification { - namespace Responses { - export interface $200 { - available: boolean; - conversation_id: string; // uuid - status: "anonymous" | "sending" | "pending" | "verified"; - challenge_id?: string; // uuid - /** - * Unix seconds - */ - code_expires_at?: number; - /** - * Unix seconds - */ - resend_after?: number; - email?: string; // email - contact_resolution?: "matched" | "ambiguous" | "not_found"; - } - export interface Default { - code: "INVALID_VERIFICATION_CODE" | "VERIFICATION_EXPIRED" | "VERIFICATION_CONFLICT" | "VERIFICATION_DISABLED" | "VERIFICATION_UNAVAILABLE" | "IDENTITY_CHANGED" | "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; - } - } - } namespace CreateAnonymousChatSession { export interface RequestBody { grant: string; // ^[A-Za-z0-9_-]{43}$ @@ -588,14 +546,11 @@ export declare namespace Paths { * Unix seconds */ expires_at: number; - website_chat: { + widget: { key: string; organisationName: string; assistantName: string; defaultLocale: "en" | "de"; - authentication?: { - email_code: boolean; - }; design?: { id: string; // uuid last_modified_at?: string; @@ -636,36 +591,17 @@ export declare namespace Paths { }; } export interface Default { - code: "INVALID_VERIFICATION_CODE" | "VERIFICATION_EXPIRED" | "VERIFICATION_CONFLICT" | "VERIFICATION_DISABLED" | "VERIFICATION_UNAVAILABLE" | "IDENTITY_CHANGED" | "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; - } - } - } - namespace CreatePublicChatGrant { - export interface RequestBody { - website_chat_id: string; // ^[a-zA-Z0-9_-]{1,100}$ - } - namespace Responses { - export interface $201 { - grant: string; - /** - * example: - * 60 - */ - expires_in: number; - frame_origin: string; // uri - } - export interface Default { - code: "INVALID_VERIFICATION_CODE" | "VERIFICATION_EXPIRED" | "VERIFICATION_CONFLICT" | "VERIFICATION_DISABLED" | "VERIFICATION_UNAVAILABLE" | "IDENTITY_CHANGED" | "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; + code: "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; } } } - namespace CreateWebsiteChat { + namespace CreateChatWidget { export interface RequestBody { name: string; agent_id: string | null; // uuid - settings: { + website_chat: { /** - * Exact HTTPS origins. Empty means the Website Chat cannot start sessions. + * Exact HTTPS origins. Empty means the widget cannot start sessions. */ allowed_origins: [ string?, @@ -722,7 +658,7 @@ export declare namespace Paths { organisation_name: string; default_locale: "en" | "de"; /** - * Design Builder configuration for the Website Chat only. + * Design Builder configuration for the widget only. */ design_id?: string | null; // uuid /** @@ -739,9 +675,9 @@ export declare namespace Paths { export interface $201 { name: string; agent_id: string | null; // uuid - settings: { + website_chat: { /** - * Exact HTTPS origins. Empty means the Website Chat cannot start sessions. + * Exact HTTPS origins. Empty means the widget cannot start sessions. */ allowed_origins: [ string?, @@ -798,7 +734,7 @@ export declare namespace Paths { organisation_name: string; default_locale: "en" | "de"; /** - * Design Builder configuration for the Website Chat only. + * Design Builder configuration for the widget only. */ design_id?: string | null; // uuid /** @@ -813,7 +749,7 @@ export declare namespace Paths { /** * Stable public embed identifier, independent of the assigned agent. Not a credential. */ - website_chat_id: string; // uuid + widget_id: string; // uuid org_id: string; /** * Server-owned session binding; changes on reassignment or allowed-origin changes. @@ -822,7 +758,7 @@ export declare namespace Paths { version: number; created_at: string; // date-time updated_at: string; // date-time - embed: { + website_chat_embed: { script_url: string; // uri chat_api_origin: string; // uri demo_url: string; // uri @@ -851,7 +787,26 @@ export declare namespace Paths { } } } - namespace DeleteWebsiteChat { + namespace CreatePublicChatGrant { + export interface RequestBody { + widget_key: string; // ^[a-zA-Z0-9_-]{1,100}$ + } + namespace Responses { + export interface $201 { + grant: string; + /** + * example: + * 60 + */ + expires_in: number; + widget_origin: string; // uri + } + export interface Default { + code: "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; + } + } + } + namespace DeleteChatWidget { namespace Parameters { export type Version = number; } @@ -884,96 +839,14 @@ export declare namespace Paths { } } } - namespace GetChatVerification { - namespace Responses { - export interface $200 { - available: boolean; - conversation_id: string; // uuid - status: "anonymous" | "sending" | "pending" | "verified"; - challenge_id?: string; // uuid - /** - * Unix seconds - */ - code_expires_at?: number; - /** - * Unix seconds - */ - resend_after?: number; - email?: string; // email - contact_resolution?: "matched" | "ambiguous" | "not_found"; - } - export interface Default { - code: "INVALID_VERIFICATION_CODE" | "VERIFICATION_EXPIRED" | "VERIFICATION_CONFLICT" | "VERIFICATION_DISABLED" | "VERIFICATION_UNAVAILABLE" | "IDENTITY_CHANGED" | "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; - } - } - } - namespace GetPublicWebsiteChat { - namespace Parameters { - export type WebsiteChatId = string; // ^[a-zA-Z0-9_-]{1,100}$ - } - export interface PathParameters { - website_chat_id: Parameters.WebsiteChatId /* ^[a-zA-Z0-9_-]{1,100}$ */; - } - namespace Responses { - export interface $200 { - key: string; - organisationName: string; - assistantName: string; - defaultLocale: "en" | "de"; - authentication?: { - email_code: boolean; - }; - design?: { - id: string; // uuid - last_modified_at?: string; - style?: { - palette?: { - primary?: string; - background?: string; - }; - typography?: { - font?: { - font_family?: string; - }; - }; - shape?: { - border_radius?: number; - }; - }; - spark_theme?: { - accentColor?: string; - backgroundColor?: string; - fontBody?: string; - fontHeading?: string; - radius?: string; - scaling?: string; - spacing?: string; - appearance?: string; - neutralColor?: string; - styleVariant?: string; - labelPosition?: string; - inputStyle?: string; - inputColor?: string; - cardVariant?: string; - cardColor?: string; - highContrast?: boolean; - }; - }; - locales: ("en" | "de")[]; - } - export interface Default { - code: "INVALID_VERIFICATION_CODE" | "VERIFICATION_EXPIRED" | "VERIFICATION_CONFLICT" | "VERIFICATION_DISABLED" | "VERIFICATION_UNAVAILABLE" | "IDENTITY_CHANGED" | "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; - } - } - } - namespace GetWebsiteChat { + namespace GetChatWidget { namespace Responses { export interface $200 { name: string; agent_id: string | null; // uuid - settings: { + website_chat: { /** - * Exact HTTPS origins. Empty means the Website Chat cannot start sessions. + * Exact HTTPS origins. Empty means the widget cannot start sessions. */ allowed_origins: [ string?, @@ -1030,7 +903,7 @@ export declare namespace Paths { organisation_name: string; default_locale: "en" | "de"; /** - * Design Builder configuration for the Website Chat only. + * Design Builder configuration for the widget only. */ design_id?: string | null; // uuid /** @@ -1045,7 +918,7 @@ export declare namespace Paths { /** * Stable public embed identifier, independent of the assigned agent. Not a credential. */ - website_chat_id: string; // uuid + widget_id: string; // uuid org_id: string; /** * Server-owned session binding; changes on reassignment or allowed-origin changes. @@ -1054,7 +927,7 @@ export declare namespace Paths { version: number; created_at: string; // date-time updated_at: string; // date-time - embed: { + website_chat_embed: { script_url: string; // uri chat_api_origin: string; // uri demo_url: string; // uri @@ -1083,7 +956,63 @@ export declare namespace Paths { } } } - namespace ListWebsiteChats { + namespace GetPublicChatWidget { + namespace Parameters { + export type WidgetId = string; // ^[a-zA-Z0-9_-]{1,100}$ + } + export interface PathParameters { + widget_id: Parameters.WidgetId /* ^[a-zA-Z0-9_-]{1,100}$ */; + } + namespace Responses { + export interface $200 { + key: string; + organisationName: string; + assistantName: string; + defaultLocale: "en" | "de"; + design?: { + id: string; // uuid + last_modified_at?: string; + style?: { + palette?: { + primary?: string; + background?: string; + }; + typography?: { + font?: { + font_family?: string; + }; + }; + shape?: { + border_radius?: number; + }; + }; + spark_theme?: { + accentColor?: string; + backgroundColor?: string; + fontBody?: string; + fontHeading?: string; + radius?: string; + scaling?: string; + spacing?: string; + appearance?: string; + neutralColor?: string; + styleVariant?: string; + labelPosition?: string; + inputStyle?: string; + inputColor?: string; + cardVariant?: string; + cardColor?: string; + highContrast?: boolean; + }; + }; + locales: ("en" | "de")[]; + } + export interface Default { + code: "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; + } + } + } + namespace ListChatWidgets { namespace Parameters { export type Cursor = string; } @@ -1092,12 +1021,12 @@ export declare namespace Paths { } namespace Responses { export interface $200 { - website_chats: { + widgets: { name: string; agent_id: string | null; // uuid - settings: { + website_chat: { /** - * Exact HTTPS origins. Empty means the Website Chat cannot start sessions. + * Exact HTTPS origins. Empty means the widget cannot start sessions. */ allowed_origins: [ string?, @@ -1154,7 +1083,7 @@ export declare namespace Paths { organisation_name: string; default_locale: "en" | "de"; /** - * Design Builder configuration for the Website Chat only. + * Design Builder configuration for the widget only. */ design_id?: string | null; // uuid /** @@ -1169,7 +1098,7 @@ export declare namespace Paths { /** * Stable public embed identifier, independent of the assigned agent. Not a credential. */ - website_chat_id: string; // uuid + widget_id: string; // uuid org_id: string; /** * Server-owned session binding; changes on reassignment or allowed-origin changes. @@ -1178,7 +1107,7 @@ export declare namespace Paths { version: number; created_at: string; // date-time updated_at: string; // date-time - embed: { + website_chat_embed: { script_url: string; // uri chat_api_origin: string; // uri demo_url: string; // uri @@ -1219,45 +1148,17 @@ export declare namespace Paths { namespace Responses { export type $200 = string; export interface Default { - code: "INVALID_VERIFICATION_CODE" | "VERIFICATION_EXPIRED" | "VERIFICATION_CONFLICT" | "VERIFICATION_DISABLED" | "VERIFICATION_UNAVAILABLE" | "IDENTITY_CHANGED" | "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; - } - } - } - namespace StartChatEmailVerification { - export interface RequestBody { - request_id: string; // uuid - email: string; // email - locale: "en" | "de"; - } - namespace Responses { - export interface $200 { - available: boolean; - conversation_id: string; // uuid - status: "anonymous" | "sending" | "pending" | "verified"; - challenge_id?: string; // uuid - /** - * Unix seconds - */ - code_expires_at?: number; - /** - * Unix seconds - */ - resend_after?: number; - email?: string; // email - contact_resolution?: "matched" | "ambiguous" | "not_found"; - } - export interface Default { - code: "INVALID_VERIFICATION_CODE" | "VERIFICATION_EXPIRED" | "VERIFICATION_CONFLICT" | "VERIFICATION_DISABLED" | "VERIFICATION_UNAVAILABLE" | "IDENTITY_CHANGED" | "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; + code: "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; } } } - namespace UpdateWebsiteChat { + namespace UpdateChatWidget { export interface RequestBody { name?: string; agent_id?: string | null; // uuid - settings?: { + website_chat?: { /** - * Exact HTTPS origins. Empty means the Website Chat cannot start sessions. + * Exact HTTPS origins. Empty means the widget cannot start sessions. */ allowed_origins: [ string?, @@ -1314,7 +1215,7 @@ export declare namespace Paths { organisation_name: string; default_locale: "en" | "de"; /** - * Design Builder configuration for the Website Chat only. + * Design Builder configuration for the widget only. */ design_id?: string | null; // uuid /** @@ -1335,9 +1236,9 @@ export declare namespace Paths { export interface $200 { name: string; agent_id: string | null; // uuid - settings: { + website_chat: { /** - * Exact HTTPS origins. Empty means the Website Chat cannot start sessions. + * Exact HTTPS origins. Empty means the widget cannot start sessions. */ allowed_origins: [ string?, @@ -1394,7 +1295,7 @@ export declare namespace Paths { organisation_name: string; default_locale: "en" | "de"; /** - * Design Builder configuration for the Website Chat only. + * Design Builder configuration for the widget only. */ design_id?: string | null; // uuid /** @@ -1409,7 +1310,7 @@ export declare namespace Paths { /** * Stable public embed identifier, independent of the assigned agent. Not a credential. */ - website_chat_id: string; // uuid + widget_id: string; // uuid org_id: string; /** * Server-owned session binding; changes on reassignment or allowed-origin changes. @@ -1418,7 +1319,7 @@ export declare namespace Paths { version: number; created_at: string; // date-time updated_at: string; // date-time - embed: { + website_chat_embed: { script_url: string; // uri chat_api_origin: string; // uri demo_url: string; // uri @@ -1447,39 +1348,12 @@ export declare namespace Paths { } } } - namespace V1WebsiteChats$WebsiteChatId { + namespace V1Widgets$WidgetId { namespace Parameters { - export type WebsiteChatId = string; // uuid + export type WidgetId = string; // uuid } export interface PathParameters { - website_chat_id: Parameters.WebsiteChatId /* uuid */; - } - } - namespace VerifyChatEmailCode { - export interface RequestBody { - challenge_id: string; // uuid - code: string; // ^\d{6}$ - } - namespace Responses { - export interface $200 { - available: boolean; - conversation_id: string; // uuid - status: "anonymous" | "sending" | "pending" | "verified"; - challenge_id?: string; // uuid - /** - * Unix seconds - */ - code_expires_at?: number; - /** - * Unix seconds - */ - resend_after?: number; - email?: string; // email - contact_resolution?: "matched" | "ambiguous" | "not_found"; - } - export interface Default { - code: "INVALID_VERIFICATION_CODE" | "VERIFICATION_EXPIRED" | "VERIFICATION_CONFLICT" | "VERIFICATION_DISABLED" | "VERIFICATION_UNAVAILABLE" | "IDENTITY_CHANGED" | "INVALID_REQUEST" | "ORIGIN_DENIED" | "NOT_FOUND" | "INVALID_GRANT" | "SESSION_EXPIRED" | "RATE_LIMITED" | "SESSION_LIMIT" | "USAGE_LIMIT" | "REQUEST_CONFLICT" | "IN_PROGRESS" | "UNAVAILABLE" | "TEMPORARILY_UNAVAILABLE"; - } + widget_id: Parameters.WidgetId /* uuid */; } } } @@ -1487,55 +1361,55 @@ export declare namespace Paths { export interface OperationMethods { /** - * listWebsiteChats + * listChatWidgets */ - 'listWebsiteChats'( - parameters?: Parameters | null, + 'listChatWidgets'( + parameters?: Parameters | null, data?: any, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse /** - * createWebsiteChat + * createChatWidget */ - 'createWebsiteChat'( + 'createChatWidget'( parameters?: Parameters | null, - data?: Paths.CreateWebsiteChat.RequestBody, + data?: Paths.CreateChatWidget.RequestBody, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse /** - * getWebsiteChat + * getChatWidget */ - 'getWebsiteChat'( - parameters?: Parameters | null, + 'getChatWidget'( + parameters?: Parameters | null, data?: any, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse /** - * updateWebsiteChat + * updateChatWidget */ - 'updateWebsiteChat'( - parameters?: Parameters | null, - data?: Paths.UpdateWebsiteChat.RequestBody, + 'updateChatWidget'( + parameters?: Parameters | null, + data?: Paths.UpdateChatWidget.RequestBody, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse /** - * deleteWebsiteChat + * deleteChatWidget */ - 'deleteWebsiteChat'( - parameters?: Parameters | null, + 'deleteChatWidget'( + parameters?: Parameters | null, data?: any, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse /** - * getPublicWebsiteChat - Resolve visitor-facing configuration for an independent Website Chat and its current agent assignment. The Website Chat ID is not an organisation ID or a destination such as website or portal. + * getPublicChatWidget - Resolve visitor-facing configuration for an independent widget and its current agent assignment. The widget ID is not an organisation ID or a destination such as website or portal. */ - 'getPublicWebsiteChat'( - parameters?: Parameters | null, + 'getPublicChatWidget'( + parameters?: Parameters | null, data?: any, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse /** - * createPublicChatGrant - Called by the host website with its website_chat_id. Checks the saved website origin allowlist and issues a single-use grant for the iframe to exchange at POST /v1/sessions within 60 seconds. This deadline does not limit the resulting session. + * createPublicChatGrant - Called by the host website with its widget_key. Checks the saved website origin allowlist and issues a single-use grant for the iframe to exchange at POST /v1/sessions within 60 seconds. This deadline does not limit the resulting session. */ 'createPublicChatGrant'( parameters?: Parameters | null, @@ -1563,98 +1437,66 @@ export interface OperationMethods { data?: Paths.SendAnonymousChatMessage.RequestBody, config?: AxiosRequestConfig ): OperationResponse - /** - * getChatVerification - Read this session's verification state. No contact IDs or candidate records are exposed. - */ - 'getChatVerification'( - parameters?: Parameters | null, - data?: any, - config?: AxiosRequestConfig - ): OperationResponse - /** - * startChatEmailVerification - Start or resend an email challenge using the template saved on this session's Website Chat. Repeating the same request_id and payload does not send another email. Codes must never be sent as chat messages. - */ - 'startChatEmailVerification'( - parameters?: Parameters | null, - data?: Paths.StartChatEmailVerification.RequestBody, - config?: AxiosRequestConfig - ): OperationResponse - /** - * verifyChatEmailCode - Verify a code for this session's current challenge. Success binds email proof and contact resolution to this session and starts a new conversation. It grants no account-tool permission. - */ - 'verifyChatEmailCode'( - parameters?: Parameters | null, - data?: Paths.VerifyChatEmailCode.RequestBody, - config?: AxiosRequestConfig - ): OperationResponse - /** - * cancelChatVerification - Cancel a pending challenge or clear verified identity. Clearing verified identity starts a new anonymous conversation. In-flight verification cannot restore the cleared identity. - */ - 'cancelChatVerification'( - parameters?: Parameters | null, - data?: any, - config?: AxiosRequestConfig - ): OperationResponse } export interface PathsDictionary { - ['/v1/website-chats']: { + ['/v1/widgets']: { /** - * listWebsiteChats + * listChatWidgets */ 'get'( - parameters?: Parameters | null, + parameters?: Parameters | null, data?: any, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse /** - * createWebsiteChat + * createChatWidget */ 'post'( parameters?: Parameters | null, - data?: Paths.CreateWebsiteChat.RequestBody, + data?: Paths.CreateChatWidget.RequestBody, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse } - ['/v1/website-chats/{website_chat_id}']: { + ['/v1/widgets/{widget_id}']: { /** - * getWebsiteChat + * getChatWidget */ 'get'( - parameters?: Parameters | null, + parameters?: Parameters | null, data?: any, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse /** - * updateWebsiteChat + * updateChatWidget */ 'put'( - parameters?: Parameters | null, - data?: Paths.UpdateWebsiteChat.RequestBody, + parameters?: Parameters | null, + data?: Paths.UpdateChatWidget.RequestBody, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse /** - * deleteWebsiteChat + * deleteChatWidget */ 'delete'( - parameters?: Parameters | null, + parameters?: Parameters | null, data?: any, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse } - ['/v1/website-chats/{website_chat_id}/configuration']: { + ['/v1/widgets/{widget_id}/configuration']: { /** - * getPublicWebsiteChat - Resolve visitor-facing configuration for an independent Website Chat and its current agent assignment. The Website Chat ID is not an organisation ID or a destination such as website or portal. + * getPublicChatWidget - Resolve visitor-facing configuration for an independent widget and its current agent assignment. The widget ID is not an organisation ID or a destination such as website or portal. */ 'get'( - parameters?: Parameters | null, + parameters?: Parameters | null, data?: any, config?: AxiosRequestConfig - ): OperationResponse + ): OperationResponse } ['/v1/bootstrap']: { /** - * createPublicChatGrant - Called by the host website with its website_chat_id. Checks the saved website origin allowlist and issues a single-use grant for the iframe to exchange at POST /v1/sessions within 60 seconds. This deadline does not limit the resulting session. + * createPublicChatGrant - Called by the host website with its widget_key. Checks the saved website origin allowlist and issues a single-use grant for the iframe to exchange at POST /v1/sessions within 60 seconds. This deadline does not limit the resulting session. */ 'post'( parameters?: Parameters | null, @@ -1687,59 +1529,18 @@ export interface PathsDictionary { config?: AxiosRequestConfig ): OperationResponse } - ['/v1/verification']: { - /** - * getChatVerification - Read this session's verification state. No contact IDs or candidate records are exposed. - */ - 'get'( - parameters?: Parameters | null, - data?: any, - config?: AxiosRequestConfig - ): OperationResponse - } - ['/v1/verification/email']: { - /** - * startChatEmailVerification - Start or resend an email challenge using the template saved on this session's Website Chat. Repeating the same request_id and payload does not send another email. Codes must never be sent as chat messages. - */ - 'post'( - parameters?: Parameters | null, - data?: Paths.StartChatEmailVerification.RequestBody, - config?: AxiosRequestConfig - ): OperationResponse - } - ['/v1/verification/code']: { - /** - * verifyChatEmailCode - Verify a code for this session's current challenge. Success binds email proof and contact resolution to this session and starts a new conversation. It grants no account-tool permission. - */ - 'post'( - parameters?: Parameters | null, - data?: Paths.VerifyChatEmailCode.RequestBody, - config?: AxiosRequestConfig - ): OperationResponse - } - ['/v1/verification/cancel']: { - /** - * cancelChatVerification - Cancel a pending challenge or clear verified identity. Clearing verified identity starts a new anonymous conversation. In-flight verification cannot restore the cleared identity. - */ - 'post'( - parameters?: Parameters | null, - data?: any, - config?: AxiosRequestConfig - ): OperationResponse - } } export type Client = OpenAPIClient -export type CreateWebsiteChatRequest = Components.Schemas.CreateWebsiteChatRequest; +export type ChatWidget = Components.Schemas.ChatWidget; +export type CreateChatWidgetRequest = Components.Schemas.CreateChatWidgetRequest; export type Error = Components.Schemas.Error; -export type ListWebsiteChatsResponse = Components.Schemas.ListWebsiteChatsResponse; +export type ListChatWidgetsResponse = Components.Schemas.ListChatWidgetsResponse; export type PublicChatError = Components.Schemas.PublicChatError; export type PublicEvent = Components.Schemas.PublicEvent; -export type PublicWebsiteChat = Components.Schemas.PublicWebsiteChat; -export type UpdateWebsiteChatRequest = Components.Schemas.UpdateWebsiteChatRequest; -export type VerificationState = Components.Schemas.VerificationState; -export type WebsiteChat = Components.Schemas.WebsiteChat; -export type WebsiteChatDesign = Components.Schemas.WebsiteChatDesign; +export type UpdateChatWidgetRequest = Components.Schemas.UpdateChatWidgetRequest; export type WebsiteChatSettings = Components.Schemas.WebsiteChatSettings; +export type Widget = Components.Schemas.Widget; +export type WidgetDesign = Components.Schemas.WidgetDesign; From adf0f1501de9732a9547a97cf1a91ea4df17c8f4 Mon Sep 17 00:00:00 2001 From: Richard Griffiths Date: Fri, 25 Sep 2026 16:28:30 +0200 Subject: [PATCH 3/3] chore(chat-client): update to 0.2.0 instead of a changeset Co-authored-by: Claude --- .changeset/chat-client-website-chats.md | 15 --------------- clients/chat-client/package.json | 2 +- 2 files changed, 1 insertion(+), 16 deletions(-) delete mode 100644 .changeset/chat-client-website-chats.md diff --git a/.changeset/chat-client-website-chats.md b/.changeset/chat-client-website-chats.md deleted file mode 100644 index 4c1b7f3e4..000000000 --- a/.changeset/chat-client-website-chats.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -"@epilot/chat-client": minor ---- - -Regenerate the chat client from the Chat API spec after the `widgets` resource was renamed to Website Chats (the embeddable chat product is now called Website Chat). - -Management operations move from `/v1/widgets` to `/v1/website-chats` (path parameter `{widget_id}` → `{website_chat_id}`): `listChatWidgets` → `listWebsiteChats`, `createChatWidget` → `createWebsiteChat`, `getChatWidget` → `getWebsiteChat`, `updateChatWidget` → `updateWebsiteChat` and `deleteChatWidget` → `deleteWebsiteChat`. The public configuration read `getPublicChatWidget` (`GET /v1/widgets/{widget_id}/configuration`) becomes `getPublicWebsiteChat` (`GET /v1/website-chats/{website_chat_id}/configuration`). - -Schemas are renamed to match: `ChatWidget` → `WebsiteChat`, `ListChatWidgetsResponse` → `ListWebsiteChatsResponse` (its `widgets` list → `website_chats`), `CreateChatWidgetRequest` → `CreateWebsiteChatRequest`, `UpdateChatWidgetRequest` → `UpdateWebsiteChatRequest`, `Widget` → `PublicWebsiteChat` and `WidgetDesign` → `WebsiteChatDesign`. - -Fields on the Website Chat resource and its create/update requests: `widget_id` → `website_chat_id`, `website_chat` → `settings` (still `WebsiteChatSettings`) and `website_chat_embed` → `embed`. In the anonymous flow, `POST /v1/bootstrap` takes `website_chat_id` instead of `widget_key` and returns `frame_origin` instead of `widget_origin`, and the `POST /v1/sessions` response carries the public configuration as `website_chat` instead of `widget`. - -The regenerated spec also brings the anonymous email verification operations, all authorised with the anonymous session token: `getChatVerification` (`GET /v1/verification`), `startChatEmailVerification` (`POST /v1/verification/email`), `verifyChatEmailCode` (`POST /v1/verification/code`) and `cancelChatVerification` (`POST /v1/verification/cancel`), returning the new `VerificationState`. The public Website Chat configuration gains `authentication.email_code`, and the public error codes gain `INVALID_VERIFICATION_CODE`, `VERIFICATION_EXPIRED`, `VERIFICATION_CONFLICT`, `VERIFICATION_DISABLED`, `VERIFICATION_UNAVAILABLE` and `IDENTITY_CHANGED`. - -This is a breaking change for callers of the old operation, schema and field names, with no aliases. The Chat API has no production consumers yet. diff --git a/clients/chat-client/package.json b/clients/chat-client/package.json index a37f7fbe3..b982dc978 100644 --- a/clients/chat-client/package.json +++ b/clients/chat-client/package.json @@ -1,6 +1,6 @@ { "name": "@epilot/chat-client", - "version": "0.1.1", + "version": "0.2.0", "description": "Client for the epilot Chat API", "main": "dist/index.js", "types": "dist/index.d.ts",