{"openapi":"3.0.0","info":{"title":"OSWALD Admin API","version":"v1"},"components":{"securitySchemes":{"jwt":{"type":"apiKey","in":"header","name":"Authorization","description":"The login token, bare or as `Bearer <token>`"}},"schemas":{"Chatbot":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"name":{"type":"string"},"organizationId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"locales":{"type":"array","items":{"type":"string"}}},"required":["id","name"]},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"statusCode":{"type":"number"},"name":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","additionalProperties":{"nullable":true}}},"required":["statusCode","name","message","details"]}},"required":["error"]},"ChatbotCreate":{"type":"object","properties":{"name":{"type":"string","minLength":1},"chatbot_status":{"type":"object","additionalProperties":{"nullable":true}},"trainingStatus":{"type":"string"},"locale":{"type":"string"},"defaultLocale":{"type":"string"},"treshold":{"type":"number"},"contextTtl":{"type":"number"},"welcome":{"type":"object","additionalProperties":{"nullable":true}},"welcomeCommand":{"type":"boolean"},"junk":{"type":"object","additionalProperties":{"nullable":true}},"junkCommand":{"type":"boolean"},"errorMessage":{"type":"object","additionalProperties":{"nullable":true}},"errorCommand":{"type":"boolean"},"token":{"type":"string"},"description":{"type":"string"},"status_development":{"type":"string"},"status_production":{"type":"string"},"publishStatus":{"type":"string"},"publishError":{"type":"string"},"engineRunning":{"type":"boolean"},"widget":{"type":"object","additionalProperties":{"nullable":true}},"environmentVariables":{"type":"object","additionalProperties":{"nullable":true}},"nlpSettings":{"type":"object","additionalProperties":{"nullable":true}},"locales":{"type":"array","items":{"type":"string"}},"allowedOrigins":{"type":"array","items":{"type":"string"}},"anonymizeAfterMinutes":{"type":"number"},"messageTtl":{"type":"number"},"metadataFieldsToPurge":{"type":"object","additionalProperties":{"nullable":true}},"chat_exports":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}},"LLMContextualizer":{"type":"string"},"monitoringProbeText":{"type":"string"},"indexUpgrade":{"type":"string"},"timeMessage":{"type":"object","additionalProperties":{"nullable":true}},"timeMessageTime":{"type":"number"},"timeCommand":{"type":"boolean"},"takeoverMessage":{"type":"object","additionalProperties":{"nullable":true}},"takeoverCommand":{"type":"boolean"},"whitelistUris":{"type":"array","items":{"type":"string"}},"responderUrl":{"type":"string"},"alwaysOn":{"type":"boolean"},"GenerativeAnswerCheck":{"type":"boolean"},"dialogTags":{"type":"object","additionalProperties":{"nullable":true}},"organizationId":{"type":"string","minLength":1}},"required":["name","organizationId"]},"ChatbotUpdate":{"type":"object","properties":{"name":{"type":"string","minLength":1},"chatbot_status":{"type":"object","additionalProperties":{"nullable":true}},"trainingStatus":{"type":"string"},"locale":{"type":"string"},"defaultLocale":{"type":"string"},"treshold":{"type":"number"},"contextTtl":{"type":"number"},"welcome":{"type":"object","additionalProperties":{"nullable":true}},"welcomeCommand":{"type":"boolean"},"junk":{"type":"object","additionalProperties":{"nullable":true}},"junkCommand":{"type":"boolean"},"errorMessage":{"type":"object","additionalProperties":{"nullable":true}},"errorCommand":{"type":"boolean"},"token":{"type":"string"},"description":{"type":"string"},"status_development":{"type":"string"},"status_production":{"type":"string"},"publishStatus":{"type":"string"},"publishError":{"type":"string"},"engineRunning":{"type":"boolean"},"widget":{"type":"object","additionalProperties":{"nullable":true}},"environmentVariables":{"type":"object","additionalProperties":{"nullable":true}},"nlpSettings":{"type":"object","additionalProperties":{"nullable":true}},"locales":{"type":"array","items":{"type":"string"}},"allowedOrigins":{"type":"array","items":{"type":"string"}},"anonymizeAfterMinutes":{"type":"number"},"messageTtl":{"type":"number"},"metadataFieldsToPurge":{"type":"object","additionalProperties":{"nullable":true}},"chat_exports":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}},"LLMContextualizer":{"type":"string"},"monitoringProbeText":{"type":"string"},"indexUpgrade":{"type":"string"},"timeMessage":{"type":"object","additionalProperties":{"nullable":true}},"timeMessageTime":{"type":"number"},"timeCommand":{"type":"boolean"},"takeoverMessage":{"type":"object","additionalProperties":{"nullable":true}},"takeoverCommand":{"type":"boolean"},"whitelistUris":{"type":"array","items":{"type":"string"}},"responderUrl":{"type":"string"},"alwaysOn":{"type":"boolean"},"GenerativeAnswerCheck":{"type":"boolean"},"dialogTags":{"type":"object","additionalProperties":{"nullable":true}}}},"Count":{"type":"object","properties":{"count":{"type":"number"}},"required":["count"]},"ChatbotExport":{"type":"object","properties":{"id":{"anyOf":[{"type":"string"},{"type":"number"}]},"name":{"type":"string","minLength":1},"intents":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}},"charts":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}},"testcases":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}},"codeSnippets":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}},"states":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}},"bookmarks":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}},"entityLabels":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}},"dialogs":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}}},"required":["name","intents","charts","testcases","codeSnippets","states","bookmarks","entityLabels","dialogs"]},"ChatbotApiKey":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"name":{"type":"string"},"prefix":{"type":"string","example":"osw_a1b2"},"createdAt":{"type":"string","format":"date-time"},"createdBy":{"type":"string"},"lastUsedAt":{"type":"string","nullable":true,"format":"date-time"},"revokedAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","name","prefix","createdAt","lastUsedAt","revokedAt"]},"ChatbotApiKeyCreated":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"name":{"type":"string"},"prefix":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"key":{"type":"string","example":"osw_…"}},"required":["id","name","prefix","createdAt","key"]},"ChatbotApiKeyCreate":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100}},"required":["name"]},"ChatbotVersion":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"chatbotId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"name":{"type":"string"},"label":{"type":"string"},"fileId":{"type":"string"},"stats":{"type":"object","additionalProperties":{"nullable":true}}},"required":["id"]},"ChatbotVersionCreate":{"type":"object","properties":{"chatbotId":{"type":"string","minLength":1},"date":{"type":"string","nullable":true},"name":{"type":"string"},"fileId":{"type":"string"},"label":{"type":"string"},"stats":{"type":"object","additionalProperties":{"nullable":true}}},"required":["chatbotId"]},"ChatbotVersionUpdate":{"type":"object","properties":{"date":{"type":"string","nullable":true},"name":{"type":"string"},"fileId":{"type":"string"},"label":{"type":"string"},"stats":{"type":"object","additionalProperties":{"nullable":true}}}},"Intent":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"label":{"type":"string"},"chatbotId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"parentIntentId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"}},"required":["id","label"]},"IntentCreate":{"type":"object","properties":{"label":{"type":"string","minLength":1},"chatbotId":{"type":"string","minLength":1},"parentIntentId":{"type":"string"}},"required":["label","chatbotId"]},"IntentUpdate":{"type":"object","properties":{"label":{"type":"string","minLength":1},"parentIntentId":{"type":"string"}}},"Sentence":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"text":{"type":"string"},"lang":{"type":"string"},"chatbotId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"intentId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"}},"required":["id","text","lang"]},"SentenceCreate":{"type":"object","properties":{"text":{"type":"string","minLength":1},"lang":{"type":"string","minLength":1},"chatbotId":{"type":"string","minLength":1},"intentId":{"type":"string"}},"required":["text","lang","chatbotId"]},"SentenceUpdate":{"type":"object","properties":{"text":{"type":"string","minLength":1},"lang":{"type":"string","minLength":1},"intentId":{"type":"string"}}},"EntityLabel":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"label":{"type":"string"},"kind":{"type":"string"},"chatbotId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"useForCorrections":{"type":"boolean"}},"required":["id","label"]},"EntityLabelCreate":{"type":"object","properties":{"label":{"type":"string","minLength":1},"chatbotId":{"type":"string","minLength":1},"kind":{"type":"string"},"useForCorrections":{"type":"boolean"}},"required":["label","chatbotId"]},"EntityLabelUpdate":{"type":"object","properties":{"label":{"type":"string","minLength":1},"kind":{"type":"string"},"useForCorrections":{"type":"boolean"}}},"EntityValue":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"chatbotId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"labelId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"useForCorrections":{"type":"boolean"},"isRegex":{"type":"boolean"}},"required":["id"]},"EntityValueCreate":{"type":"object","properties":{"chatbotId":{"type":"string","minLength":1},"labelId":{"type":"string","minLength":1},"useForCorrections":{"type":"boolean"},"isRegex":{"type":"boolean"},"value":{"type":"object","additionalProperties":{"type":"string"}},"synonyms":{"type":"array","items":{"type":"object","properties":{"lang":{"type":"string"},"text":{"type":"string"}},"required":["lang","text"]}}},"required":["chatbotId","labelId"]},"EntityValueUpdate":{"type":"object","properties":{"labelId":{"type":"string","minLength":1},"useForCorrections":{"type":"boolean"},"isRegex":{"type":"boolean"}}},"EntityValueTranslation":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"chatbotId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"entityId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"labelId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"locale":{"type":"string"},"value":{"type":"string"},"synonyms":{"type":"array","items":{"type":"string"}}},"required":["id","locale"]},"EntityValueTranslationCreate":{"type":"object","properties":{"chatbotId":{"type":"string","minLength":1},"entityId":{"type":"string","minLength":1},"labelId":{"type":"string","minLength":1},"locale":{"type":"string","minLength":1},"value":{"type":"string"},"synonyms":{"type":"array","items":{"type":"string"}}},"required":["chatbotId","entityId","labelId","locale"]},"EntityValueTranslationUpdate":{"type":"object","properties":{"locale":{"type":"string","minLength":1},"value":{"type":"string"},"synonyms":{"type":"array","items":{"type":"string"}}}},"HasEntity":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"chatbotId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"labelId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"valueId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"ruleId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"}},"required":["id"]},"HasEntityCreate":{"type":"object","properties":{"chatbotId":{"type":"string","minLength":1},"labelId":{"type":"string"},"valueId":{"type":"string"},"ruleId":{"type":"string"},"location":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"timeToLive":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"variableName":{"type":"string"}},"required":["chatbotId"]},"HasEntityUpdate":{"type":"object","properties":{"labelId":{"type":"string"},"valueId":{"type":"string"},"ruleId":{"type":"string"},"location":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"timeToLive":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"variableName":{"type":"string"}}},"HasIntent":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"chatbotId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"intentId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"ruleId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"}},"required":["id"]},"HasIntentCreate":{"type":"object","properties":{"chatbotId":{"type":"string","minLength":1},"intentId":{"type":"string"},"ruleId":{"type":"string"},"location":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"timeToLive":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}},"required":["chatbotId"]},"HasIntentUpdate":{"type":"object","properties":{"intentId":{"type":"string"},"ruleId":{"type":"string"},"location":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]},"timeToLive":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"}]}}},"LibraryUse":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"kind":{"type":"string"},"organizationId":{"type":"string","nullable":true,"example":"5f0c2a9e8b3c4d0012345678"},"intentId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"entityId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"dialogId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"codeId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"}},"required":["id","kind"]},"LibraryUseCreate":{"type":"object","properties":{"kind":{"type":"string","minLength":1},"organizationId":{"type":"string","minLength":1},"intentId":{"type":"string"},"entityId":{"type":"string"},"dialogId":{"type":"string"},"codeId":{"type":"string"}},"required":["kind","organizationId"]},"LibraryUseUpdate":{"type":"object","properties":{"kind":{"type":"string","minLength":1},"intentId":{"type":"string"},"entityId":{"type":"string"},"dialogId":{"type":"string"},"codeId":{"type":"string"}}},"TakeoverButtonField":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["text","longText","email","number","select"]},"required":{"type":"boolean"},"options":{"type":"array","items":{"type":"string"}},"prefillVariable":{"type":"string"}},"required":["key","label","type","required"]},"TakeoverButton":{"type":"object","nullable":true,"properties":{"enabled":{"type":"boolean"},"label":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/TakeoverButtonField"}}},"required":["enabled","label","fields"]},"CodeSnippet":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"label":{"type":"string"},"code":{"type":"string"},"chatbotId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"takeoverButton":{"$ref":"#/components/schemas/TakeoverButton"}},"required":["id","label"]},"CodeSnippetCreate":{"type":"object","properties":{"label":{"type":"string","minLength":1},"chatbotId":{"type":"string","minLength":1},"code":{"type":"string"},"takeoverButton":{"type":"object","nullable":true,"properties":{"enabled":{"type":"boolean","default":false},"label":{"type":"string","nullable":true,"maxLength":40},"fields":{"type":"array","nullable":true,"items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":80},"type":{"type":"string","enum":["text","longText","email","number","select"]},"required":{"type":"boolean","default":false},"options":{"type":"array","nullable":true,"items":{"type":"string","minLength":1,"maxLength":80},"minItems":1,"maxItems":50},"prefillVariable":{"type":"string","nullable":true,"minLength":1,"maxLength":100}},"required":["key","label","type"]},"maxItems":20,"default":[]}}}},"required":["label","chatbotId"]},"CodeSnippetUpdate":{"type":"object","properties":{"label":{"type":"string","minLength":1},"code":{"type":"string"},"takeoverButton":{"type":"object","nullable":true,"properties":{"enabled":{"type":"boolean","default":false},"label":{"type":"string","nullable":true,"maxLength":40},"fields":{"type":"array","nullable":true,"items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[A-Za-z][A-Za-z0-9_]{0,39}$"},"label":{"type":"string","minLength":1,"maxLength":80},"type":{"type":"string","enum":["text","longText","email","number","select"]},"required":{"type":"boolean","default":false},"options":{"type":"array","nullable":true,"items":{"type":"string","minLength":1,"maxLength":80},"minItems":1,"maxItems":50},"prefillVariable":{"type":"string","nullable":true,"minLength":1,"maxLength":100}},"required":["key","label","type"]},"maxItems":20,"default":[]}}}}},"Dialog":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"label":{"type":"string"},"chatbotId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"startStateId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"}},"required":["id","label"]},"DialogCreate":{"type":"object","properties":{"label":{"type":"string","minLength":1},"chatbotId":{"type":"string","minLength":1},"startStateId":{"type":"string"},"userId":{"type":"string"},"tagNames":{"type":"array","items":{"type":"string"}}},"required":["label","chatbotId"]},"DialogUpdate":{"type":"object","properties":{"label":{"type":"string","minLength":1},"startStateId":{"type":"string"},"userId":{"type":"string"},"tagNames":{"type":"array","items":{"type":"string"}}}},"Response":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"label":{"type":"string"},"chatbotId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"dialogId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"parentId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"}},"required":["id"]},"ResponseCreate":{"type":"object","properties":{"chatbotId":{"type":"string","minLength":1},"dialogId":{"type":"string"},"isStartForId":{"type":"string"},"parentId":{"type":"string"},"bookmarkEntranceId":{"type":"string"},"bookmarkExitId":{"type":"string"},"endStateId":{"type":"string"},"label":{"type":"string"},"quickReplies":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}},"responsePriority":{"type":"string"},"tags":{"type":"object","additionalProperties":{"nullable":true}},"code":{"type":"string"},"ifNoResponseFound":{"type":"object","additionalProperties":{"nullable":true}},"responseContextLabel":{"type":"string"},"takeover":{"type":"string"},"usedDatasources":{"type":"array","items":{"nullable":true}},"type":{"type":"string"},"codeActive":{"type":"boolean"},"inputDisabled":{"type":"boolean"},"useAllDatasources":{"type":"string"},"gptPrompt":{"type":"string"},"gptMaxAnswerCharacters":{"type":"number"},"useKnowledgeBase":{"type":"boolean"},"eagerBookmark":{"type":"boolean"},"selectedExternalAPI":{"type":"string"},"authorization":{"type":"string"}},"required":["chatbotId"]},"ResponseUpdate":{"type":"object","properties":{"dialogId":{"type":"string"},"isStartForId":{"type":"string"},"parentId":{"type":"string"},"bookmarkEntranceId":{"type":"string"},"bookmarkExitId":{"type":"string"},"endStateId":{"type":"string"},"label":{"type":"string"},"quickReplies":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}},"responsePriority":{"type":"string"},"tags":{"type":"object","additionalProperties":{"nullable":true}},"code":{"type":"string"},"ifNoResponseFound":{"type":"object","additionalProperties":{"nullable":true}},"responseContextLabel":{"type":"string"},"takeover":{"type":"string"},"usedDatasources":{"type":"array","items":{"nullable":true}},"type":{"type":"string"},"codeActive":{"type":"boolean"},"inputDisabled":{"type":"boolean"},"useAllDatasources":{"type":"string"},"gptPrompt":{"type":"string"},"gptMaxAnswerCharacters":{"type":"number"},"useKnowledgeBase":{"type":"boolean"},"eagerBookmark":{"type":"boolean"},"selectedExternalAPI":{"type":"string"},"authorization":{"type":"string"}}},"ResponseMessage":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"type":{"type":"string"},"text":{"type":"string"},"lang":{"type":"string"},"index":{"type":"number"},"chatbotId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"responseId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"}},"required":["id","type"]},"ResponseMessageCreate":{"type":"object","properties":{"type":{"type":"string","minLength":1},"chatbotId":{"type":"string","minLength":1},"responseId":{"type":"string"},"text":{"type":"string"},"lang":{"type":"string"},"url":{"type":"string"},"image":{"type":"string"},"bookmarkName":{"type":"string"},"index":{"type":"number"},"elements":{"type":"object","additionalProperties":{"nullable":true}}},"required":["type","chatbotId"]},"ResponseMessageUpdate":{"type":"object","properties":{"type":{"type":"string","minLength":1},"responseId":{"type":"string"},"text":{"type":"string"},"lang":{"type":"string"},"url":{"type":"string"},"image":{"type":"string"},"bookmarkName":{"type":"string"},"index":{"type":"number"},"elements":{"type":"object","additionalProperties":{"nullable":true}}}},"ResponseRule":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"chatbotId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"responseId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"}},"required":["id"]},"ResponseRuleCreate":{"type":"object","properties":{"chatbotId":{"type":"string","minLength":1},"responseId":{"type":"string"}},"required":["chatbotId"]},"ResponseRuleUpdate":{"type":"object","properties":{"responseId":{"type":"string"}}},"State":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"label":{"type":"string"},"chatbotId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"}},"required":["id","label"]},"StateCreate":{"type":"object","properties":{"label":{"type":"string","minLength":1},"chatbotId":{"type":"string","minLength":1},"createdAt":{"type":"string","nullable":true}},"required":["label","chatbotId"]},"StateUpdate":{"type":"object","properties":{"label":{"type":"string","minLength":1},"createdAt":{"type":"string","nullable":true}}},"Bookmark":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"label":{"type":"string"},"chatbotId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"}},"required":["id","label"]},"BookmarkCreate":{"type":"object","properties":{"label":{"type":"string","minLength":1},"chatbotId":{"type":"string","minLength":1}},"required":["label","chatbotId"]},"BookmarkUpdate":{"type":"object","properties":{"label":{"type":"string","minLength":1}}},"DataSource":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"title":{"type":"string"},"source":{"type":"string"},"chatbotId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"API_KEY":{"type":"string","description":"Masked: only the last 5 characters"}},"required":["id"]},"DataSourceCreate":{"type":"object","properties":{"title":{"type":"string","minLength":1},"source":{"type":"string","minLength":1},"chatbotId":{"type":"string","minLength":1},"URL":{"type":"string"},"PDF":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"forceReindex":{"type":"boolean"},"API_KEY":{"type":"string"},"language":{"type":"string"},"update":{"type":"string"},"LANGUAGE":{"type":"string"},"SUB_DOMAIN":{"type":"string"},"SECTION_ID":{"type":"string"},"FILTERS":{"type":"string"}},"required":["title","source","chatbotId"]},"DataSourceUpdate":{"type":"object","properties":{"title":{"type":"string","minLength":1},"URL":{"type":"string"},"PDF":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"forceReindex":{"type":"boolean"},"API_KEY":{"type":"string"},"language":{"type":"string"},"update":{"type":"string"},"LANGUAGE":{"type":"string"},"SUB_DOMAIN":{"type":"string"},"SECTION_ID":{"type":"string"},"FILTERS":{"type":"string"}}},"KnowledgeBase":{"type":"object","nullable":true,"properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"chatbotId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"apiKey":{"type":"string"},"indexManagedBy":{"type":"string"},"primaryLanguage":{"type":"string"},"languageMode":{"type":"string"},"embeddingProvider":{"type":"string"},"embeddingLLM":{"type":"string"}},"required":["id"]},"KnowledgeBaseCreate":{"type":"object","properties":{"chatbotId":{"type":"string","minLength":1},"apiKey":{"type":"string"},"indexManagedBy":{"type":"string"},"primaryLanguage":{"type":"string"},"languageMode":{"type":"string"},"embeddingProvider":{"type":"string"},"embeddingLLM":{"type":"string"},"serviceName":{"type":"string"},"isKnowledgeBaseEnabled":{"type":"boolean"},"answerLLM":{"type":"string"},"generativeCheckLLM":{"type":"string"},"contextLLM":{"type":"string"},"promptLLM":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}}]},"contextualizerPrompt":{"type":"string"},"contextualizerTargetLanguage":{"type":"string"}},"required":["chatbotId"]},"KnowledgeBaseUpdate":{"type":"object","properties":{"apiKey":{"type":"string"},"indexManagedBy":{"type":"string"},"primaryLanguage":{"type":"string"},"languageMode":{"type":"string"},"embeddingProvider":{"type":"string"},"embeddingLLM":{"type":"string"},"serviceName":{"type":"string"},"isKnowledgeBaseEnabled":{"type":"boolean"},"answerLLM":{"type":"string"},"generativeCheckLLM":{"type":"string"},"contextLLM":{"type":"string"},"promptLLM":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}}]},"contextualizerPrompt":{"type":"string"},"contextualizerTargetLanguage":{"type":"string"}}},"Integration":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"chatbotId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"integrationDefinitionId":{"type":"string"},"properties":{"type":"object","additionalProperties":{"nullable":true}},"active":{"type":"boolean"}},"required":["id"]},"IntegrationCreate":{"type":"object","properties":{"chatbotId":{"type":"string","minLength":1},"integrationDefinitionId":{"type":"string"},"properties":{"type":"object","additionalProperties":{"nullable":true}},"active":{"type":"boolean"}},"required":["chatbotId"]},"IntegrationUpdate":{"type":"object","properties":{"integrationDefinitionId":{"type":"string"},"properties":{"type":"object","additionalProperties":{"nullable":true}},"active":{"type":"boolean"}}},"IntegrationDefinition":{"type":"object","properties":{"name":{"type":"string"},"adminOnly":{"type":"boolean"},"iconUrl":{"type":"string"},"properties":{"nullable":true}},"required":["name"]},"SessionHeartbeat":{"type":"object","nullable":true,"properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"sessionId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"time":{"type":"string"},"nextBeat":{"type":"string"}},"required":["id"]},"Session":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"identifier":{"type":"string"},"platform":{"type":"string"},"chatbotId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"takeover":{"type":"object","additionalProperties":{"nullable":true}},"tags":{"type":"array","items":{"type":"string"}},"locale":{"type":"string"},"lastSeen":{"type":"string"}},"required":["id"]},"SessionWithHeartbeat":{"allOf":[{"$ref":"#/components/schemas/Session"},{"type":"object","properties":{"heartbeat":{"$ref":"#/components/schemas/SessionHeartbeat"}},"required":["heartbeat"]}]},"TakeoverMessage":{"type":"object","properties":{"message":{"type":"object","properties":{"environment":{"type":"string"},"chatbotId":{"type":"string"},"userId":{"type":"string"},"response":{"type":"object","properties":{"data":{"type":"array","items":{"nullable":true}}},"required":["data"]}},"required":["environment","chatbotId","userId","response"]}},"required":["message"]},"TakeoverDialogField":{"type":"object","properties":{"key":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","enum":["text","longText","email","number","select"]},"required":{"type":"boolean"},"options":{"type":"array","items":{"type":"string"}},"prefill":{"anyOf":[{"type":"string"},{"type":"number"}]}},"required":["key","label","type","required"]},"TakeoverFunctionRun":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"snippetId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"buttonLabel":{"type":"string"},"userId":{"type":"string","nullable":true,"example":"5f0c2a9e8b3c4d0012345678"},"userName":{"type":"string","nullable":true},"state":{"type":"string","enum":["running","success","failed"]},"message":{"type":"string","nullable":true},"link":{"type":"string","nullable":true},"createdAt":{"type":"string","format":"date-time"},"finishedAt":{"type":"string","nullable":true,"format":"date-time"}},"required":["id","snippetId","buttonLabel","userId","userName","state","message","link","createdAt","finishedAt"]},"TakeoverButtons":{"type":"object","properties":{"buttons":{"type":"array","items":{"type":"object","properties":{"snippetId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"label":{"type":"string"},"fields":{"type":"array","items":{"$ref":"#/components/schemas/TakeoverDialogField"}}},"required":["snippetId","label","fields"]}},"runs":{"type":"array","items":{"$ref":"#/components/schemas/TakeoverFunctionRun"}}},"required":["buttons","runs"]},"TakeoverButtonRunBody":{"type":"object","properties":{"values":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}}}},"Message":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"type":{"type":"string"},"session":{"type":"string"},"chatbotId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"data":{"type":"array","items":{"nullable":true}},"ignoreForUnanswered":{"type":"boolean","nullable":true}},"required":["id"]},"SessionCreate":{"type":"object","properties":{"identifier":{"type":"string","minLength":1},"platform":{"type":"string","minLength":1},"chatbotId":{"type":"string","minLength":1},"takeover":{"type":"object","additionalProperties":{"nullable":true}},"tags":{"type":"array","items":{"type":"string"}},"locale":{"type":"string"},"userLocale":{"type":"string"},"lastSeen":{"type":"string","nullable":true},"notes":{"type":"string"},"archived":{"type":"string"},"takenOverById":{"type":"string"},"takeoverHistory":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}}},"required":["identifier","platform","chatbotId"]},"SessionUpdate":{"type":"object","properties":{"takeover":{"type":"object","additionalProperties":{"nullable":true}},"tags":{"type":"array","items":{"type":"string"}},"locale":{"type":"string"},"userLocale":{"type":"string"},"lastSeen":{"type":"string","nullable":true},"notes":{"type":"string"},"archived":{"type":"string"},"takenOverById":{"type":"string"},"takeoverHistory":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}}}},"SessionHeartbeatWrite":{"type":"object","properties":{"sessionId":{"type":"string"},"time":{"type":"string","nullable":true},"nextBeat":{"type":"string","nullable":true}}},"CustomChart":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"chatbotId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"label":{"type":"string"},"subtitle":{"type":"string"},"kind":{"type":"string"},"countMessages":{"type":"boolean"},"tagsToTrack":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"color":{"type":"string"}},"required":["name"]}}},"required":["id"]},"CustomChartCreate":{"type":"object","properties":{"chatbotId":{"type":"string","minLength":1},"label":{"type":"string"},"subtitle":{"type":"string"},"kind":{"type":"string"},"countMessages":{"type":"boolean"},"tagsToTrack":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"color":{"type":"string"}},"required":["name"]}}},"required":["chatbotId"]},"CustomChartUpdate":{"type":"object","properties":{"label":{"type":"string"},"subtitle":{"type":"string"},"kind":{"type":"string"},"countMessages":{"type":"boolean"},"tagsToTrack":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"color":{"type":"string"}},"required":["name"]}}}},"ChatbotIssue":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"chatbotId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"kind":{"type":"string"},"target":{"type":"string"},"info":{"type":"object","additionalProperties":{"nullable":true}},"lastOccurred":{"type":"string"},"acknowledged":{"type":"boolean"}},"required":["id"]},"ChatbotIssueCreate":{"type":"object","properties":{"chatbotId":{"type":"string","minLength":1},"kind":{"type":"string"},"target":{"type":"string"},"info":{"type":"object","additionalProperties":{"nullable":true}},"lastOccurred":{"type":"string","nullable":true},"acknowledged":{"type":"boolean"},"acknowledgedAt":{"type":"string","nullable":true}},"required":["chatbotId"]},"ChatbotIssueUpdate":{"type":"object","properties":{"kind":{"type":"string"},"target":{"type":"string"},"info":{"type":"object","additionalProperties":{"nullable":true}},"lastOccurred":{"type":"string","nullable":true},"acknowledged":{"type":"boolean"},"acknowledgedAt":{"type":"string","nullable":true}}},"ChatbotTag":{"type":"object","properties":{"id":{"type":"string"},"chatbotId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"tag":{"type":"string"},"autoGenerated":{"anyOf":[{"type":"boolean"},{"type":"string"}]}},"required":["id"]},"ChatbotTagCreate":{"type":"object","properties":{"chatbotId":{"type":"string","minLength":1},"tag":{"type":"string"},"autoGenerated":{"type":"boolean"}},"required":["chatbotId"]},"ChatbotTagUpdate":{"type":"object","properties":{"tag":{"type":"string"},"autoGenerated":{"type":"boolean"}}},"ErrorCreate":{"type":"object","properties":{"chatbotId":{"type":"string","minLength":1},"text":{"type":"string","minLength":1},"production":{"type":"boolean"},"runtime":{"type":"boolean"},"created":{"type":"number"}},"required":["chatbotId","text"]},"ErrorUpdate":{"type":"object","properties":{"text":{"type":"string","minLength":1},"production":{"type":"boolean"},"runtime":{"type":"boolean"},"created":{"type":"number"}}},"ChangeLog":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"className":{"type":"string"},"methodName":{"type":"string"},"chatbotId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"organizationId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"userId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"instanceId":{"type":"string"},"instanceName":{"type":"string","nullable":true}},"required":["id"]},"ChangeLogDetail":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"chatbotId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"organizationId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"}},"required":["id"]},"ExportSettings":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"chatbotId":{"type":"string"},"frequency":{"type":"string"},"endpoint_id":{"type":"string"},"type":{"type":"string"},"active":{"type":"boolean"},"last_exported_at":{"type":"string"}},"required":["id","chatbotId","frequency","endpoint_id"]},"ExportSettingsCreate":{"type":"object","properties":{"chatbotId":{"type":"string","minLength":1},"frequency":{"type":"string","minLength":1},"endpoint_id":{"type":"string","minLength":1},"type":{"type":"string"},"active":{"type":"boolean"},"last_exported_at":{"type":"string","nullable":true}},"required":["chatbotId","frequency","endpoint_id"]},"ExportSettingsUpdate":{"type":"object","properties":{"frequency":{"type":"string","minLength":1},"endpoint_id":{"type":"string","minLength":1},"type":{"type":"string"},"active":{"type":"boolean"},"last_exported_at":{"type":"string","nullable":true}}},"Testcase":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"name":{"type":"string"},"language":{"type":"string"},"chatbotId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"messages":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}},"enabled":{"type":"boolean"}},"required":["id","name","language"]},"TestcaseCreate":{"type":"object","properties":{"name":{"type":"string","minLength":1},"language":{"type":"string","minLength":1},"chatbotId":{"type":"string","minLength":1},"messages":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}},"enabled":{"type":"boolean"}},"required":["name","language","chatbotId"]},"TestrunStarted":{"type":"object","properties":{"status":{"type":"number"},"message":{"type":"string"},"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"}},"required":["status","message","id"]},"TestcaseRunAll":{"type":"object","properties":{"environment":{"type":"string"},"chatbotId":{"type":"string"},"ids":{"type":"array","items":{"type":"string"}}}},"TestcaseUpdate":{"type":"object","properties":{"name":{"type":"string","minLength":1},"language":{"type":"string","minLength":1},"messages":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}},"enabled":{"type":"boolean"}}},"TestcaseRun":{"type":"object","properties":{"environment":{"type":"string"}}},"Organization":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"name":{"type":"string"},"activatedFeatures":{"type":"object","additionalProperties":{"nullable":true}}},"required":["id","name"]},"OrganizationCreate":{"type":"object","properties":{"name":{"type":"string","minLength":1},"activatedFeatures":{"type":"object","additionalProperties":{"nullable":true}}},"required":["name"]},"OrganizationUpdate":{"type":"object","properties":{"name":{"type":"string","minLength":1},"activatedFeatures":{"type":"object","additionalProperties":{"nullable":true}}}},"RoleAssignment":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"roleName":{"type":"string"},"userId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"chatbotId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"organizationId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"}},"required":["id","roleName"]},"User":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"name":{"type":"string"},"email":{"type":"string"},"language":{"type":"string"}},"required":["id","email"]},"UserCreate":{"type":"object","properties":{"name":{"type":"string","minLength":1},"email":{"type":"string","format":"email"},"password":{"type":"string","minLength":8},"filters":{"type":"object","additionalProperties":{"nullable":true}},"shouldVerify":{"type":"boolean"},"language":{"type":"string","minLength":1},"newMessageSound":{"type":"boolean"},"newTakeoverSound":{"type":"boolean"}},"required":["email","password"]},"UserUpdate":{"type":"object","properties":{"name":{"type":"string","minLength":1},"email":{"type":"string","format":"email"},"password":{"type":"string","minLength":8},"filters":{"type":"object","additionalProperties":{"nullable":true}},"shouldVerify":{"type":"boolean"},"language":{"type":"string","minLength":1},"newMessageSound":{"type":"boolean"},"newTakeoverSound":{"type":"boolean"}}},"RoleAssignmentCreate":{"type":"object","properties":{"roleName":{"type":"string","minLength":1},"userId":{"type":"string","minLength":1},"chatbotId":{"type":"string","nullable":true,"minLength":1},"organizationId":{"type":"string","nullable":true,"minLength":1}},"required":["roleName","userId"]},"RoleAssignmentUpdate":{"type":"object","properties":{"roleName":{"type":"string","minLength":1}},"required":["roleName"]},"Billing":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"chatbotId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"maxManualVersions":{"type":"number"},"maxAutosaveVersions":{"type":"number"}},"required":["id"]},"BillingWrite":{"type":"object","properties":{"maxManualVersions":{"type":"number"},"maxAutosaveVersions":{"type":"number"},"chatbotId":{"type":"string"}}},"BillingUpdate":{"type":"object","properties":{"maxManualVersions":{"type":"number"},"maxAutosaveVersions":{"type":"number"},"chatbotId":{"type":"string"}}},"UserEventRecord":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"type":{"type":"string"},"userId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"event":{"type":"object","additionalProperties":{"nullable":true}},"createdAt":{"type":"string"}},"required":["id","type","userId"]},"UserEventCreate":{"type":"object","properties":{"type":{"type":"string","minLength":1},"userId":{"type":"string","minLength":1},"event":{"type":"object","additionalProperties":{"nullable":true}},"createdAt":{"type":"string","nullable":true}},"required":["type","userId"]},"UserEventUpdate":{"type":"object","properties":{"type":{"type":"string","minLength":1},"event":{"type":"object","additionalProperties":{"nullable":true}},"createdAt":{"type":"string","nullable":true}}},"FeatureFlag":{"type":"object","properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"feature":{"type":"string"},"flag":{"type":"string"},"chatbots":{"type":"array","items":{"type":"string"}},"users":{"type":"array","items":{"type":"string"}}},"required":["id","feature"]},"FeatureFlagCreate":{"type":"object","properties":{"feature":{"type":"string","minLength":1},"flag":{"type":"string","minLength":1,"default":"false"},"chatbots":{"type":"array","items":{"type":"string"}},"users":{"type":"array","items":{"type":"string"}}},"required":["feature"]},"FeatureFlagUpdate":{"type":"object","properties":{"feature":{"type":"string","minLength":1},"flag":{"type":"string","minLength":1},"chatbots":{"type":"array","items":{"type":"string"}},"users":{"type":"array","items":{"type":"string"}}}}},"parameters":{}},"paths":{"/v1/demo_url":{"get":{"tags":["Chatbot"],"summary":"The demo page URL the widget preview links to (public, plain text)","responses":{"200":{"description":"`DEMO_URL`","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/v1/chatbots":{"get":{"tags":["Chatbot"],"summary":"List chatbots the caller can see","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Chatbots","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Chatbot"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Chatbot"],"summary":"Create a chatbot, with its start state and token","security":[{"jwt":[]}],"description":"Requires: `organization-admin` on the organisation.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ChatbotCreate"},{"type":"object","properties":{"chatbot_status":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"trainingStatus":{"type":"string","nullable":true},"locale":{"type":"string","nullable":true},"defaultLocale":{"type":"string","nullable":true},"treshold":{"type":"number","nullable":true},"contextTtl":{"type":"number","nullable":true},"welcome":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"welcomeCommand":{"type":"boolean","nullable":true},"junk":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"junkCommand":{"type":"boolean","nullable":true},"errorMessage":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"errorCommand":{"type":"boolean","nullable":true},"token":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"status_development":{"type":"string","nullable":true},"status_production":{"type":"string","nullable":true},"publishStatus":{"type":"string","nullable":true},"publishError":{"type":"string","nullable":true},"engineRunning":{"type":"boolean","nullable":true},"widget":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"environmentVariables":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"nlpSettings":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"locales":{"type":"array","nullable":true,"items":{"type":"string"}},"allowedOrigins":{"type":"array","nullable":true,"items":{"type":"string"}},"anonymizeAfterMinutes":{"type":"number","nullable":true},"messageTtl":{"type":"number","nullable":true},"metadataFieldsToPurge":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"chat_exports":{"type":"array","nullable":true,"items":{"type":"object","additionalProperties":{"nullable":true}}},"LLMContextualizer":{"type":"string","nullable":true},"monitoringProbeText":{"type":"string","nullable":true},"indexUpgrade":{"type":"string","nullable":true},"timeMessage":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"timeMessageTime":{"type":"number","nullable":true},"timeCommand":{"type":"boolean","nullable":true},"takeoverMessage":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"takeoverCommand":{"type":"boolean","nullable":true},"whitelistUris":{"type":"array","nullable":true,"items":{"type":"string"}},"responderUrl":{"type":"string","nullable":true},"alwaysOn":{"type":"boolean","nullable":true},"GenerativeAnswerCheck":{"type":"boolean","nullable":true},"dialogTags":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]}}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Chatbot"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/with-integration-definition-id":{"get":{"tags":["Chatbot"],"summary":"Chatbots (visible to the caller) with an integration of a given definition","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string"},"required":false,"name":"integrationDefinitionId","in":"query"}],"responses":{"200":{"description":"`{ id, organizationId, integrations }` per chatbot"},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}":{"get":{"tags":["Chatbot"],"summary":"Get a chatbot","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"}],"responses":{"200":{"description":"The chatbot","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Chatbot"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Chatbot"],"summary":"Update a chatbot","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ChatbotUpdate"},{"type":"object","properties":{"name":{"type":"string","nullable":true,"minLength":1},"chatbot_status":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"trainingStatus":{"type":"string","nullable":true},"locale":{"type":"string","nullable":true},"defaultLocale":{"type":"string","nullable":true},"treshold":{"type":"number","nullable":true},"contextTtl":{"type":"number","nullable":true},"welcome":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"welcomeCommand":{"type":"boolean","nullable":true},"junk":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"junkCommand":{"type":"boolean","nullable":true},"errorMessage":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"errorCommand":{"type":"boolean","nullable":true},"token":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"status_development":{"type":"string","nullable":true},"status_production":{"type":"string","nullable":true},"publishStatus":{"type":"string","nullable":true},"publishError":{"type":"string","nullable":true},"engineRunning":{"type":"boolean","nullable":true},"widget":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"environmentVariables":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"nlpSettings":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"locales":{"type":"array","nullable":true,"items":{"type":"string"}},"allowedOrigins":{"type":"array","nullable":true,"items":{"type":"string"}},"anonymizeAfterMinutes":{"type":"number","nullable":true},"messageTtl":{"type":"number","nullable":true},"metadataFieldsToPurge":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"chat_exports":{"type":"array","nullable":true,"items":{"type":"object","additionalProperties":{"nullable":true}}},"LLMContextualizer":{"type":"string","nullable":true},"monitoringProbeText":{"type":"string","nullable":true},"indexUpgrade":{"type":"string","nullable":true},"timeMessage":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"timeMessageTime":{"type":"number","nullable":true},"timeCommand":{"type":"boolean","nullable":true},"takeoverMessage":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"takeoverCommand":{"type":"boolean","nullable":true},"whitelistUris":{"type":"array","nullable":true,"items":{"type":"string"}},"responderUrl":{"type":"string","nullable":true},"alwaysOn":{"type":"boolean","nullable":true},"GenerativeAnswerCheck":{"type":"boolean","nullable":true},"dialogTags":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Chatbot"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Chatbot"],"summary":"Update a chatbot (PUT, merges like PATCH)","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ChatbotUpdate"},{"type":"object","properties":{"name":{"type":"string","nullable":true,"minLength":1},"chatbot_status":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"trainingStatus":{"type":"string","nullable":true},"locale":{"type":"string","nullable":true},"defaultLocale":{"type":"string","nullable":true},"treshold":{"type":"number","nullable":true},"contextTtl":{"type":"number","nullable":true},"welcome":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"welcomeCommand":{"type":"boolean","nullable":true},"junk":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"junkCommand":{"type":"boolean","nullable":true},"errorMessage":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"errorCommand":{"type":"boolean","nullable":true},"token":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"status_development":{"type":"string","nullable":true},"status_production":{"type":"string","nullable":true},"publishStatus":{"type":"string","nullable":true},"publishError":{"type":"string","nullable":true},"engineRunning":{"type":"boolean","nullable":true},"widget":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"environmentVariables":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"nlpSettings":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"locales":{"type":"array","nullable":true,"items":{"type":"string"}},"allowedOrigins":{"type":"array","nullable":true,"items":{"type":"string"}},"anonymizeAfterMinutes":{"type":"number","nullable":true},"messageTtl":{"type":"number","nullable":true},"metadataFieldsToPurge":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"chat_exports":{"type":"array","nullable":true,"items":{"type":"object","additionalProperties":{"nullable":true}}},"LLMContextualizer":{"type":"string","nullable":true},"monitoringProbeText":{"type":"string","nullable":true},"indexUpgrade":{"type":"string","nullable":true},"timeMessage":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"timeMessageTime":{"type":"number","nullable":true},"timeCommand":{"type":"boolean","nullable":true},"takeoverMessage":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"takeoverCommand":{"type":"boolean","nullable":true},"whitelistUris":{"type":"array","nullable":true,"items":{"type":"string"}},"responderUrl":{"type":"string","nullable":true},"alwaysOn":{"type":"boolean","nullable":true},"GenerativeAnswerCheck":{"type":"boolean","nullable":true},"dialogTags":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Chatbot"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Chatbot"],"summary":"Delete a chatbot and everything that belongs to it","security":[{"jwt":[]}],"description":"Requires: `organization-admin` on the organisation.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}/export":{"get":{"tags":["Chatbot transfer"],"summary":"Export the chatbot as a .chatbot file","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"}],"responses":{"200":{"description":"The export"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}/export-full":{"get":{"tags":["Chatbot transfer"],"summary":"Export the chatbot including datasources and knowledge bases","security":[{"jwt":[]}],"description":"Requires: oswald-admin.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"}],"responses":{"200":{"description":"The export"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}/copy":{"post":{"tags":["Chatbot transfer"],"summary":"Copy the chatbot within its organisation","security":[{"jwt":[]}],"description":"Requires: oswald-admin.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"}],"responses":{"200":{"description":"The new chatbot id","content":{"application/json":{"schema":{"type":"string"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/import/{organizationId}":{"post":{"tags":["Chatbot transfer"],"summary":"Import a .chatbot file into an organisation","security":[{"jwt":[]}],"description":"Requires: `organization-admin` on the organisation.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"organizationId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ChatbotExport"},{"type":"object","properties":{"id":{"anyOf":[{"type":"string"},{"type":"number"},{"nullable":true}]}}}]}}}},"responses":{"200":{"description":"The new chatbot id","content":{"application/json":{"schema":{"type":"string"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/import-full/{organizationId}":{"post":{"tags":["Chatbot transfer"],"summary":"Import a full export into an organisation","security":[{"jwt":[]}],"description":"Requires: oswald-admin.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"organizationId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ChatbotExport"},{"type":"object","properties":{"id":{"anyOf":[{"type":"string"},{"type":"number"},{"nullable":true}]}}}]}}}},"responses":{"200":{"description":"The new chatbot id","content":{"application/json":{"schema":{"type":"string"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}/restore":{"post":{"tags":["Chatbot transfer"],"summary":"Replace the chatbot's content with an export (keeps id, name, token, roles)","security":[{"jwt":[]}],"description":"Requires: `chatbot-admin` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ChatbotExport"},{"type":"object","properties":{},"required":["id"]}]}}}},"responses":{"200":{"description":"The restored chatbot"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}/preview-import":{"post":{"tags":["Chatbot transfer"],"summary":"Preview how an import would map onto this chatbot","security":[{"jwt":[]}],"description":"Requires: `chatbot-admin` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"usedDatasourceTitles":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"dialogs":{"type":"array","nullable":true,"items":{"type":"object","additionalProperties":{"nullable":true}}}}}}}},"responses":{"200":{"description":"The preview"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}/secrets":{"post":{"tags":["Chatbot operations"],"summary":"Store the chatbot's secret environment variables (encrypted)","security":[{"jwt":[]}],"description":"The body is the secrets object itself; `null` clears them. Returns the key names.\n\nRequires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}}}}},"responses":{"200":{"description":"Key names","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"tags":["Chatbot operations"],"summary":"Names of the stored secrets (`null` if none were ever stored)","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"}],"responses":{"200":{"description":"Key names","content":{"application/json":{"schema":{"type":"array","nullable":true,"items":{"type":"string"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}/move-to-production":{"post":{"tags":["Chatbot operations"],"summary":"Publish the chatbot (background job)","security":[{"jwt":[]}],"description":"Requires: `chatbot-admin` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"}],"responses":{"200":{"description":"Queued","content":{"application/json":{"schema":{"type":"object","properties":{"jobId":{"type":"string"}},"required":["jobId"]}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}/publish-widget":{"post":{"tags":["Chatbot operations"],"summary":"Publish only the widget settings to production","security":[{"jwt":[]}],"description":"Requires: `chatbot-admin` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"}],"responses":{"204":{"description":"Published"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}/token":{"get":{"tags":["Chatbot operations"],"summary":"The chatbot's token (generated on first use)","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"}],"responses":{"200":{"description":"The token","content":{"application/json":{"schema":{"type":"string"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}/widget-script":{"get":{"tags":["Chatbot operations"],"summary":"The `<script>` snippet that embeds the widget","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"}],"responses":{"200":{"description":"The snippet","content":{"application/json":{"schema":{"type":"string"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}/get-relation-count":{"get":{"tags":["Chatbot operations"],"summary":"Counts of a related collection, grouped per parent id","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"relation","in":"query"},{"schema":{"type":"string"},"required":false,"name":"parent","in":"query"},{"schema":{"type":"string"},"required":false,"name":"locale","in":"query"},{"schema":{"type":"string"},"required":false,"name":"localeProp","in":"query"}],"responses":{"200":{"description":"Count per parent id","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"number"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}/add-tag":{"post":{"tags":["Chatbot operations"],"summary":"Add a manual session tag to the chatbot","security":[{"jwt":[]}],"description":"`editor` or `support`.\n\nRequires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1}},"required":["name"]}}}},"responses":{"200":{"description":"Added","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}/bookmarks":{"get":{"tags":["Chatbot operations"],"summary":"The chatbot's bookmarks","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"},{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"The chatbot's bookmarks"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}/states":{"get":{"tags":["Chatbot operations"],"summary":"The chatbot's states","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"},{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"The chatbot's states"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}/integrations":{"get":{"tags":["Chatbot operations"],"summary":"The chatbot's integrations","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"},{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"The chatbot's integrations"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}/roles":{"get":{"tags":["Chatbot operations"],"summary":"Role assignments on the chatbot, with their users","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"},{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Role assignments on the chatbot, with their users"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}/api-keys":{"get":{"tags":["Chatbot API keys"],"summary":"The chatbot's API keys, newest first (never the key itself)","security":[{"jwt":[]}],"description":"Requires: `chatbot-admin` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"}],"responses":{"200":{"description":"API keys","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ChatbotApiKey"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Chatbot API keys"],"summary":"Create an API key","security":[{"jwt":[]}],"description":"The plaintext `key` is in this response only; it cannot be retrieved afterwards. Send it as `X-Api-Key` to message-api `/api/v1/external/chats/...`.\n\nRequires: `chatbot-admin` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ChatbotApiKeyCreate"},{"type":"object","properties":{}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatbotApiKeyCreated"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}/api-keys/{keyId}":{"delete":{"tags":["Chatbot API keys"],"summary":"Revoke an API key","security":[{"jwt":[]}],"description":"Soft revoke: the key stops working at once and stays listed as revoked.\n\nRequires: `chatbot-admin` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"},{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"keyId","in":"path"}],"responses":{"200":{"description":"Revoked","content":{"application/json":{"schema":{"type":"object","properties":{"count":{"type":"number","enum":[1]}},"required":["count"]}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}/translate":{"post":{"tags":["Chatbot translation"],"summary":"Translate dialogs, entities and/or sentences in the background","security":[{"jwt":[]}],"description":"Poll `GET /v1/translation-status/{id}` with the returned id.\n\nRequires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string"},"required":false,"name":"type","in":"query"}],"requestBody":{"description":"","required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string","nullable":true,"minLength":1},"to":{"type":"string","nullable":true,"minLength":1},"type":{"type":"string","nullable":true,"enum":["dialogs","entities","intents"]}}}}}},"responses":{"200":{"description":"Translation id","content":{"application/json":{"schema":{"type":"string"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{originId}/copy-sentences-by-label/{targetId}":{"post":{"tags":["Chatbot translation"],"summary":"Copy sentences into the target's intents with the same label","security":[{"jwt":[]}],"description":"Requires: oswald-admin.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"originId","in":"path"},{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"targetId","in":"path"}],"responses":{"200":{"description":"The copied sentences per intent"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}/train":{"post":{"tags":["Chatbot training"],"summary":"Queue the chatbot for training","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"}],"responses":{"200":{"description":"The raw update result"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}/acknowledge-all-issues":{"post":{"tags":["Chatbot training"],"summary":"Acknowledge all of the chatbot's issues","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"}],"responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}/status":{"get":{"tags":["Chatbot training"],"summary":"Training status per locale","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"lang","in":"query"}],"responses":{"200":{"description":"The status"},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}/confusion-matrix":{"get":{"tags":["Chatbot training"],"summary":"Confusion matrix of the latest training for a locale","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"locale","in":"query"},{"schema":{"type":"string"},"required":false,"name":"nlpDate","in":"query"}],"responses":{"200":{"description":"The matrix"},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}/export-messages":{"post":{"tags":["Chatbot training"],"summary":"Export a month's messages to a download link (background job)","security":[{"jwt":[]}],"description":"Requires: `chatbot-admin` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"}],"responses":{"200":{"description":"The chatbot with the new `chat_exports` entry"},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}/runtime-errors":{"get":{"tags":["Chatbot training"],"summary":"Runtime errors raised by the chatbot, paged","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"page","in":"query"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"locale","in":"query"}],"responses":{"200":{"description":"`{ totalPages, errors }`"},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}/explain-intent":{"post":{"tags":["Chatbot training"],"summary":"How much each word of a text contributes to each intent score","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"}],"responses":{"200":{"description":"`{ maxScore, scores }`"},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}/export-latest-messages":{"get":{"tags":["Chatbot training"],"summary":"The latest 10,000 production messages as CSV","security":[{"jwt":[]}],"description":"Requires: `gdpr-access` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"}],"responses":{"200":{"description":"CSV (semicolon-separated)"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}/matching-dialogs":{"get":{"tags":["Chatbot training"],"summary":"Dialogs whose responses match a text search","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"search","in":"query"}],"responses":{"200":{"description":"Dialogs with `matchingResponses`"},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}/unanswered":{"post":{"tags":["Chatbot training"],"summary":"Unanswered and low-scoring messages","security":[{"jwt":[]}],"description":"Requires: `gdpr-access` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"array","nullable":true,"items":{"type":"string"}},"maxScore":{"type":"number","nullable":true},"locale":{"type":"string","nullable":true},"from":{"type":"string","nullable":true},"to":{"type":"string","nullable":true},"hideAutoResolved":{"type":"boolean","nullable":true},"hideArchived":{"type":"boolean","nullable":true},"limit":{"type":"number","nullable":true},"skip":{"type":"number","nullable":true}}}}}},"responses":{"200":{"description":"The messages"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}/export-unanswered":{"get":{"tags":["Chatbot training"],"summary":"Unanswered messages as CSV","security":[{"jwt":[]}],"description":"Requires: `gdpr-access` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"},{"schema":{"type":"string","description":"The unanswered options, as a JSON string"},"required":false,"name":"options","in":"query"}],"responses":{"200":{"description":"CSV, as a JSON string"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}/statistics":{"get":{"tags":["Chatbot training"],"summary":"Usage statistics","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"lang","in":"query"},{"schema":{"type":"string"},"required":false,"name":"nocache","in":"query"},{"schema":{"type":"string"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string"},"required":false,"name":"tags","in":"query"},{"schema":{"type":"string"},"required":false,"name":"allTags","in":"query"}],"responses":{"200":{"description":"The statistics"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}/create-version":{"post":{"tags":["ChatbotVersion"],"summary":"Snapshot the chatbot as a new version","security":[{"jwt":[]}],"description":"Requires: `chatbot-admin` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"}],"responses":{"200":{"description":"The version record"},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}/download-version/{versionId}":{"get":{"tags":["ChatbotVersion"],"summary":"The stored export of a version, as a JSON string","security":[{"jwt":[]}],"description":"Requires: `chatbot-admin` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"},{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"versionId","in":"path"}],"responses":{"200":{"description":"The export as a string"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbots/{chatbotId}/restore-version/{versionId}":{"get":{"tags":["ChatbotVersion"],"summary":"Restore the chatbot to a version","security":[{"jwt":[]}],"description":"Requires: `chatbot-admin` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"},{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"versionId","in":"path"}],"responses":{"200":{"description":"The restored chatbot"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbot-versions":{"get":{"tags":["ChatbotVersion"],"summary":"List chatbot versions (not scoped to visible chatbots, as live)","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Versions","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ChatbotVersion"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["ChatbotVersion"],"summary":"Create a chatbot version record","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ChatbotVersionCreate"},{"type":"object","properties":{"name":{"type":"string","nullable":true},"fileId":{"type":"string","nullable":true},"label":{"type":"string","nullable":true},"stats":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]}}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatbotVersion"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbot-versions/{chatbotVersionId}":{"get":{"tags":["ChatbotVersion"],"summary":"Get a chatbot version","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotVersionId","in":"path"}],"responses":{"200":{"description":"The version","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatbotVersion"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["ChatbotVersion"],"summary":"Update a chatbot version record","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotVersionId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ChatbotVersionUpdate"},{"type":"object","properties":{"name":{"type":"string","nullable":true},"fileId":{"type":"string","nullable":true},"label":{"type":"string","nullable":true},"stats":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatbotVersion"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["ChatbotVersion"],"summary":"Delete a chatbot version and its stored file","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotVersionId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/widget-templates":{"get":{"tags":["WidgetTemplate"],"summary":"List the widget templates with their CSS","security":[{"jwt":[]}],"description":"Requires: any logged-in user.","responses":{"200":{"description":"`{ id, name, hostCss, widgetCss }` per template"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/translation-status/{id}":{"get":{"tags":["Translation"],"summary":"Status of a background translation (public)","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"`started` or `done`","content":{"application/json":{"schema":{"type":"string"}}}}}}},"/v1/intents":{"get":{"tags":["Intent"],"summary":"List intents on chatbots the caller can see","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"intents","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Intent"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Intent"],"summary":"Create a intent","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/IntentCreate"},{"type":"object","properties":{"parentIntentId":{"type":"string","nullable":true}}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Intent"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/intents/{chatbotId}/search":{"get":{"tags":["Intent"],"summary":"Intent ids matching a text, by label or by sentence","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"},{"schema":{"type":"string","description":"JSON: `{ searchText, lang? }`"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Intent ids","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/intents/global":{"get":{"tags":["Intent"],"summary":"Global intents, shared with every chatbot","security":[{"jwt":[]}],"description":"Requires: any logged-in user.","responses":{"200":{"description":"Intents"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/intents/copy-to-chatbot":{"post":{"tags":["Intent"],"summary":"Copy an intent (with its sentences) into another chatbot","security":[{"jwt":[]}],"description":"`{ itemId, chatbotId }`. `editor` on the target and `viewer` on the source (or a shared library).\n\nRequires: `editor` on the chatbot.","responses":{"200":{"description":"`{ created }`, or `{ status: 500, message }`"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/intents/{intentId}":{"get":{"tags":["Intent"],"summary":"Get a intent","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"intentId","in":"path"}],"responses":{"200":{"description":"The intent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Intent"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Intent"],"summary":"Update a intent","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"intentId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/IntentUpdate"},{"type":"object","properties":{"label":{"type":"string","nullable":true,"minLength":1},"parentIntentId":{"type":"string","nullable":true}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Intent"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Intent"],"summary":"Delete a intent","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"intentId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/intents/{intentId}/export-sentences":{"get":{"tags":["Intent"],"summary":"The intent's sentences in a language, one per line","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"intentId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"lang","in":"query"}],"responses":{"200":{"description":"Sentences","content":{"application/json":{"schema":{"type":"string"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/intents/{intentId}/dependents":{"get":{"tags":["Intent"],"summary":"Responses whose rules use this intent","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"intentId","in":"path"}],"responses":{"200":{"description":"Responses","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/intents/{intentId}/merge-into/{otherIntentId}":{"post":{"tags":["Intent"],"summary":"Move this intent's sentences and rule links to another intent, then delete it","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"intentId","in":"path"},{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"otherIntentId","in":"path"}],"responses":{"200":{"description":"Merged","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/intents/{chatbotId}/export":{"get":{"tags":["Intent"],"summary":"The chatbot's intents and sentences as CSV","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"lang","in":"query"}],"responses":{"200":{"description":"CSV","content":{"application/json":{"schema":{"type":"string"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/intents/{chatbotId}/import":{"post":{"tags":["Intent"],"summary":"Replace all the chatbot's intents and sentences with a CSV upload","security":[{"jwt":[]}],"description":"Multipart: `file` (`Intents,Sentences,Locale`, header row first) and `language` (the default locale).\n\nRequires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"}],"responses":{"200":{"description":"Created","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"intent":{"$ref":"#/components/schemas/Intent"},"sentences":{"type":"object","properties":{}}},"required":["intent","sentences"]}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/intents/{intentId}/replace-sentences":{"post":{"tags":["Intent"],"summary":"Replace the intent's sentences in a language from a CSV upload","security":[{"jwt":[]}],"description":"Multipart: `file` and `language`.\n\nRequires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"intentId","in":"path"}],"responses":{"200":{"description":"Replaced","content":{"application/json":{"schema":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sentences":{"get":{"tags":["Sentence"],"summary":"List sentences on chatbots the caller can see","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"sentences","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Sentence"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Sentence"],"summary":"Create a sentence","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/SentenceCreate"},{"type":"object","properties":{"intentId":{"type":"string","nullable":true}}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sentence"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sentences/{sentenceId}":{"get":{"tags":["Sentence"],"summary":"Get a sentence","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"sentenceId","in":"path"}],"responses":{"200":{"description":"The sentence","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sentence"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Sentence"],"summary":"Update a sentence","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"sentenceId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/SentenceUpdate"},{"type":"object","properties":{"text":{"type":"string","nullable":true,"minLength":1},"lang":{"type":"string","nullable":true,"minLength":1},"intentId":{"type":"string","nullable":true}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Sentence"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Sentence"],"summary":"Delete a sentence","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"sentenceId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/entity-labels":{"get":{"tags":["EntityLabel"],"summary":"List entity labels on chatbots the caller can see","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"entity labels","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EntityLabel"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["EntityLabel"],"summary":"Create a entity label","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/EntityLabelCreate"},{"type":"object","properties":{"kind":{"type":"string","nullable":true},"useForCorrections":{"type":"boolean","nullable":true}}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityLabel"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/entity-labels/global":{"get":{"tags":["EntityLabel"],"summary":"Global entity labels, shared with every chatbot","security":[{"jwt":[]}],"description":"Requires: any logged-in user.","responses":{"200":{"description":"Labels"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/entity-labels/copy-to-chatbot":{"post":{"tags":["EntityLabel"],"summary":"Copy an entity label (with its values) into another chatbot","security":[{"jwt":[]}],"description":"`{ itemId, chatbotId }`. `editor` on the target and `viewer` on the source (or a shared library).\n\nRequires: `editor` on the chatbot.","responses":{"200":{"description":"`{ created }`, or `{ status: 500, message }`"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/entity-labels/{entityLabelId}/dependents":{"get":{"tags":["EntityLabel"],"summary":"Responses whose rules use this label","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"entityLabelId","in":"path"}],"responses":{"200":{"description":"Responses","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/entity-labels/{entityLabelId}":{"get":{"tags":["EntityLabel"],"summary":"Get a entity label","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"entityLabelId","in":"path"}],"responses":{"200":{"description":"The entity label","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityLabel"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["EntityLabel"],"summary":"Update a entity label","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"entityLabelId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/EntityLabelUpdate"},{"type":"object","properties":{"label":{"type":"string","nullable":true,"minLength":1},"kind":{"type":"string","nullable":true},"useForCorrections":{"type":"boolean","nullable":true}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityLabel"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["EntityLabel"],"summary":"Delete a entity label","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"entityLabelId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/entity-labels/{entityLabelId}/translate":{"post":{"tags":["EntityLabel"],"summary":"Machine-translate the label's values (background)","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"entityLabelId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string","minLength":1},"to":{"type":"string","minLength":1}},"required":["from","to"]}}}},"responses":{"200":{"description":"Translation id","content":{"application/json":{"schema":{"type":"string"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/entity-labels/{chatbotId}/export":{"get":{"tags":["EntityLabel"],"summary":"The chatbot's entity labels and values as CSV","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"lang","in":"query"}],"responses":{"200":{"description":"CSV","content":{"application/json":{"schema":{"type":"string"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/entity-labels/{chatbotId}/import":{"post":{"tags":["EntityLabel"],"summary":"Import entity labels and values from a CSV upload (`file`)","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotId","in":"path"}],"responses":{"200":{"description":"The import result"},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/entity-values":{"get":{"tags":["EntityValue"],"summary":"List entity values on chatbots the caller can see","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"entity values","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EntityValue"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["EntityValue"],"summary":"Create a entity value","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/EntityValueCreate"},{"type":"object","properties":{"useForCorrections":{"type":"boolean","nullable":true},"isRegex":{"type":"boolean","nullable":true},"value":{"anyOf":[{"type":"object","additionalProperties":{"type":"string"}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"synonyms":{"type":"array","nullable":true,"items":{"type":"object","properties":{"lang":{"type":"string"},"text":{"type":"string"}},"required":["lang","text"]}}}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityValue"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/entity-values/{entityValueId}/dependents":{"get":{"tags":["EntityValue"],"summary":"Responses whose rules use this value","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"entityValueId","in":"path"}],"responses":{"200":{"description":"Responses","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/entity-values/{entityValueId}":{"get":{"tags":["EntityValue"],"summary":"Get a entity value","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"entityValueId","in":"path"}],"responses":{"200":{"description":"The entity value","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityValue"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["EntityValue"],"summary":"Update a entity value","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"entityValueId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/EntityValueUpdate"},{"type":"object","properties":{"labelId":{"type":"string","nullable":true,"minLength":1},"useForCorrections":{"type":"boolean","nullable":true},"isRegex":{"type":"boolean","nullable":true}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityValue"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["EntityValue"],"summary":"Update a entity value (PUT, merges like PATCH)","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"entityValueId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/EntityValueUpdate"},{"type":"object","properties":{"labelId":{"type":"string","nullable":true,"minLength":1},"useForCorrections":{"type":"boolean","nullable":true},"isRegex":{"type":"boolean","nullable":true}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityValue"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["EntityValue"],"summary":"Delete a entity value","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"entityValueId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/entity-value-translations":{"get":{"tags":["EntityValueTranslation"],"summary":"List entity value translations on chatbots the caller can see","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"entity value translations","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/EntityValueTranslation"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["EntityValueTranslation"],"summary":"Create a entity value translation","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/EntityValueTranslationCreate"},{"type":"object","properties":{"value":{"type":"string","nullable":true},"synonyms":{"type":"array","nullable":true,"items":{"type":"string"}}}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityValueTranslation"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/entity-value-translations/{entityValueTranslationId}":{"get":{"tags":["EntityValueTranslation"],"summary":"Get a entity value translation","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"entityValueTranslationId","in":"path"}],"responses":{"200":{"description":"The entity value translation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityValueTranslation"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["EntityValueTranslation"],"summary":"Update a entity value translation","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"entityValueTranslationId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/EntityValueTranslationUpdate"},{"type":"object","properties":{"locale":{"type":"string","nullable":true,"minLength":1},"value":{"type":"string","nullable":true},"synonyms":{"type":"array","nullable":true,"items":{"type":"string"}}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityValueTranslation"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["EntityValueTranslation"],"summary":"Update a entity value translation (PUT, merges like PATCH)","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"entityValueTranslationId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/EntityValueTranslationUpdate"},{"type":"object","properties":{"locale":{"type":"string","nullable":true,"minLength":1},"value":{"type":"string","nullable":true},"synonyms":{"type":"array","nullable":true,"items":{"type":"string"}}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityValueTranslation"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["EntityValueTranslation"],"summary":"Delete a entity value translation","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"entityValueTranslationId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/has-entities":{"get":{"tags":["HasEntity"],"summary":"List entity conditions on chatbots the caller can see","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"entity conditions","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/HasEntity"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["HasEntity"],"summary":"Create a entity condition","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/HasEntityCreate"},{"type":"object","properties":{"labelId":{"type":"string","nullable":true},"valueId":{"type":"string","nullable":true},"ruleId":{"type":"string","nullable":true},"location":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"timeToLive":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"variableName":{"type":"string","nullable":true}}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HasEntity"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/has-entities/{hasEntityId}":{"get":{"tags":["HasEntity"],"summary":"Get a entity condition","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"hasEntityId","in":"path"}],"responses":{"200":{"description":"The entity condition","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HasEntity"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["HasEntity"],"summary":"Update a entity condition","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"hasEntityId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/HasEntityUpdate"},{"type":"object","properties":{"labelId":{"type":"string","nullable":true},"valueId":{"type":"string","nullable":true},"ruleId":{"type":"string","nullable":true},"location":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"timeToLive":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"variableName":{"type":"string","nullable":true}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HasEntity"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["HasEntity"],"summary":"Update a entity condition (PUT, merges like PATCH)","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"hasEntityId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/HasEntityUpdate"},{"type":"object","properties":{"labelId":{"type":"string","nullable":true},"valueId":{"type":"string","nullable":true},"ruleId":{"type":"string","nullable":true},"location":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"timeToLive":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"variableName":{"type":"string","nullable":true}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HasEntity"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["HasEntity"],"summary":"Delete a entity condition","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"hasEntityId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/has-intents":{"get":{"tags":["HasIntent"],"summary":"List intent conditions on chatbots the caller can see","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"intent conditions","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/HasIntent"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["HasIntent"],"summary":"Create a intent condition","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/HasIntentCreate"},{"type":"object","properties":{"intentId":{"type":"string","nullable":true},"ruleId":{"type":"string","nullable":true},"location":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"timeToLive":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]}}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HasIntent"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/has-intents/{hasIntentId}":{"get":{"tags":["HasIntent"],"summary":"Get a intent condition","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"hasIntentId","in":"path"}],"responses":{"200":{"description":"The intent condition","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HasIntent"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["HasIntent"],"summary":"Update a intent condition","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"hasIntentId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/HasIntentUpdate"},{"type":"object","properties":{"intentId":{"type":"string","nullable":true},"ruleId":{"type":"string","nullable":true},"location":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"timeToLive":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HasIntent"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["HasIntent"],"summary":"Update a intent condition (PUT, merges like PATCH)","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"hasIntentId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/HasIntentUpdate"},{"type":"object","properties":{"intentId":{"type":"string","nullable":true},"ruleId":{"type":"string","nullable":true},"location":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]},"timeToLive":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"nullable":true}]}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HasIntent"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["HasIntent"],"summary":"Delete a intent condition","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"hasIntentId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/library-uses":{"get":{"tags":["LibraryUse"],"summary":"Library entries of the caller's organisations, plus the shared ones","security":[{"jwt":[]}],"description":"Requires: any logged-in user.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Entries","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LibraryUse"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["LibraryUse"],"summary":"Add an item to an organisation library","security":[{"jwt":[]}],"description":"Requires: `organization-editor` on the organisation.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/LibraryUseCreate"},{"type":"object","properties":{"intentId":{"type":"string","nullable":true},"entityId":{"type":"string","nullable":true},"dialogId":{"type":"string","nullable":true},"codeId":{"type":"string","nullable":true}}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LibraryUse"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/library-uses/{libraryUseId}":{"get":{"tags":["LibraryUse"],"summary":"Get a library entry","security":[{"jwt":[]}],"description":"Requires: any role in the organisation.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"libraryUseId","in":"path"}],"responses":{"200":{"description":"The entry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LibraryUse"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["LibraryUse"],"summary":"Update a library entry","security":[{"jwt":[]}],"description":"Requires: `organization-editor` on the organisation.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"libraryUseId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/LibraryUseUpdate"},{"type":"object","properties":{"kind":{"type":"string","nullable":true,"minLength":1},"intentId":{"type":"string","nullable":true},"entityId":{"type":"string","nullable":true},"dialogId":{"type":"string","nullable":true},"codeId":{"type":"string","nullable":true}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LibraryUse"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["LibraryUse"],"summary":"Remove a library entry","security":[{"jwt":[]}],"description":"Requires: `organization-editor` on the organisation.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"libraryUseId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/code-snippets":{"get":{"tags":["CodeSnippet"],"summary":"List code snippets on chatbots the caller can see","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"code snippets","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CodeSnippet"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["CodeSnippet"],"summary":"Create a code snippet","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/CodeSnippetCreate"},{"type":"object","properties":{"code":{"type":"string","nullable":true}}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeSnippet"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/code-snippets/copy-to-chatbot":{"post":{"tags":["CodeSnippet"],"summary":"Copy a code snippet into another chatbot","security":[{"jwt":[]}],"description":"`{ itemId, chatbotId }`. `editor` on the target and `viewer` on the source (or a shared library).\n\nRequires: `editor` on the chatbot.","responses":{"200":{"description":"`{ created }`, or `{ status: 500, message }`"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/code-snippets/{codeSnippetId}":{"get":{"tags":["CodeSnippet"],"summary":"Get a code snippet","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"codeSnippetId","in":"path"}],"responses":{"200":{"description":"The code snippet","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeSnippet"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["CodeSnippet"],"summary":"Update a code snippet","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"codeSnippetId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/CodeSnippetUpdate"},{"type":"object","properties":{"label":{"type":"string","nullable":true,"minLength":1},"code":{"type":"string","nullable":true}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodeSnippet"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["CodeSnippet"],"summary":"Delete a code snippet","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"codeSnippetId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/code-snippets/{codeSnippetId}/dependents":{"get":{"tags":["CodeSnippet"],"summary":"Responses whose code imports this snippet","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"codeSnippetId","in":"path"}],"responses":{"200":{"description":"Responses","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/dialogs":{"get":{"tags":["Dialog"],"summary":"List dialogs on chatbots the caller can see","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"dialogs","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Dialog"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Dialog"],"summary":"Create a dialog","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/DialogCreate"},{"type":"object","properties":{"startStateId":{"type":"string","nullable":true},"userId":{"type":"string","nullable":true},"tagNames":{"type":"array","nullable":true,"items":{"type":"string"}}}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Dialog"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/dialogs/{dialogId}":{"get":{"tags":["Dialog"],"summary":"Get a dialog","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"dialogId","in":"path"}],"responses":{"200":{"description":"The dialog","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Dialog"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Dialog"],"summary":"Update a dialog","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"dialogId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/DialogUpdate"},{"type":"object","properties":{"label":{"type":"string","nullable":true,"minLength":1},"startStateId":{"type":"string","nullable":true},"userId":{"type":"string","nullable":true},"tagNames":{"type":"array","nullable":true,"items":{"type":"string"}}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Dialog"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Dialog"],"summary":"Delete a dialog","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"dialogId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/dialogs/{dialogId}/dependents":{"get":{"tags":["Dialog"],"summary":"Responses in other dialogs that jump into this one","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"dialogId","in":"path"}],"responses":{"200":{"description":"Responses","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Response"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/dialogs/{dialogId}/responses":{"get":{"tags":["Dialog"],"summary":"The dialog's responses","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"dialogId","in":"path"},{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Responses","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Response"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/dialogs/{dialogId}/export":{"get":{"tags":["Dialog"],"summary":"The dialog with its whole response tree (.dialog file)","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"dialogId","in":"path"}],"responses":{"200":{"description":"The export"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/dialogs/{dialogId}/translate":{"post":{"tags":["Dialog"],"summary":"Machine-translate the dialog's texts (background)","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"dialogId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string"},"required":false,"name":"to","in":"query"}],"requestBody":{"description":"","required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string","nullable":true,"minLength":1},"to":{"type":"string","nullable":true,"minLength":1}}}}}},"responses":{"200":{"description":"Translation id","content":{"application/json":{"schema":{"type":"string"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/responses":{"get":{"tags":["Response"],"summary":"List responses on chatbots the caller can see","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"responses","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Response"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Response"],"summary":"Create a response","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ResponseCreate"},{"type":"object","properties":{"dialogId":{"type":"string","nullable":true},"isStartForId":{"type":"string","nullable":true},"parentId":{"type":"string","nullable":true},"bookmarkEntranceId":{"type":"string","nullable":true},"bookmarkExitId":{"type":"string","nullable":true},"endStateId":{"type":"string","nullable":true},"label":{"type":"string","nullable":true},"quickReplies":{"type":"array","nullable":true,"items":{"type":"object","additionalProperties":{"nullable":true}}},"responsePriority":{"type":"string","nullable":true},"tags":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"code":{"type":"string","nullable":true},"ifNoResponseFound":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"responseContextLabel":{"type":"string","nullable":true},"takeover":{"type":"string","nullable":true},"usedDatasources":{"type":"array","nullable":true,"items":{"nullable":true}},"type":{"type":"string","nullable":true},"codeActive":{"type":"boolean","nullable":true},"inputDisabled":{"type":"boolean","nullable":true},"useAllDatasources":{"type":"string","nullable":true},"gptPrompt":{"type":"string","nullable":true},"gptMaxAnswerCharacters":{"type":"number","nullable":true},"useKnowledgeBase":{"type":"boolean","nullable":true},"eagerBookmark":{"type":"boolean","nullable":true},"selectedExternalAPI":{"type":"string","nullable":true},"authorization":{"type":"string","nullable":true}}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Response"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/responses/{responseId}":{"get":{"tags":["Response"],"summary":"Get a response","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"responseId","in":"path"}],"responses":{"200":{"description":"The response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Response"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Response"],"summary":"Update a response","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"responseId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ResponseUpdate"},{"type":"object","properties":{"dialogId":{"type":"string","nullable":true},"isStartForId":{"type":"string","nullable":true},"parentId":{"type":"string","nullable":true},"bookmarkEntranceId":{"type":"string","nullable":true},"bookmarkExitId":{"type":"string","nullable":true},"endStateId":{"type":"string","nullable":true},"label":{"type":"string","nullable":true},"quickReplies":{"type":"array","nullable":true,"items":{"type":"object","additionalProperties":{"nullable":true}}},"responsePriority":{"type":"string","nullable":true},"tags":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"code":{"type":"string","nullable":true},"ifNoResponseFound":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"responseContextLabel":{"type":"string","nullable":true},"takeover":{"type":"string","nullable":true},"usedDatasources":{"type":"array","nullable":true,"items":{"nullable":true}},"type":{"type":"string","nullable":true},"codeActive":{"type":"boolean","nullable":true},"inputDisabled":{"type":"boolean","nullable":true},"useAllDatasources":{"type":"string","nullable":true},"gptPrompt":{"type":"string","nullable":true},"gptMaxAnswerCharacters":{"type":"number","nullable":true},"useKnowledgeBase":{"type":"boolean","nullable":true},"eagerBookmark":{"type":"boolean","nullable":true},"selectedExternalAPI":{"type":"string","nullable":true},"authorization":{"type":"string","nullable":true}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Response"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Response"],"summary":"Delete a response","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"responseId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/responses/{responseId}/dependents":{"get":{"tags":["Response"],"summary":"Responses outside this subtree that jump into it through a bookmark","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"responseId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"selfOnly","in":"query"}],"responses":{"200":{"description":"Responses","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/response-messages":{"get":{"tags":["ResponseMessage"],"summary":"List response messages on chatbots the caller can see","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"response messages","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ResponseMessage"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["ResponseMessage"],"summary":"Create a response message","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ResponseMessageCreate"},{"type":"object","properties":{"responseId":{"type":"string","nullable":true},"text":{"type":"string","nullable":true},"lang":{"type":"string","nullable":true},"url":{"type":"string","nullable":true},"image":{"type":"string","nullable":true},"bookmarkName":{"type":"string","nullable":true},"index":{"type":"number","nullable":true},"elements":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]}}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseMessage"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/response-messages/{responseMessageId}":{"get":{"tags":["ResponseMessage"],"summary":"Get a response message","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"responseMessageId","in":"path"}],"responses":{"200":{"description":"The response message","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseMessage"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["ResponseMessage"],"summary":"Update a response message","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"responseMessageId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ResponseMessageUpdate"},{"type":"object","properties":{"type":{"type":"string","nullable":true,"minLength":1},"responseId":{"type":"string","nullable":true},"text":{"type":"string","nullable":true},"lang":{"type":"string","nullable":true},"url":{"type":"string","nullable":true},"image":{"type":"string","nullable":true},"bookmarkName":{"type":"string","nullable":true},"index":{"type":"number","nullable":true},"elements":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseMessage"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["ResponseMessage"],"summary":"Update a response message (PUT, merges like PATCH)","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"responseMessageId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ResponseMessageUpdate"},{"type":"object","properties":{"type":{"type":"string","nullable":true,"minLength":1},"responseId":{"type":"string","nullable":true},"text":{"type":"string","nullable":true},"lang":{"type":"string","nullable":true},"url":{"type":"string","nullable":true},"image":{"type":"string","nullable":true},"bookmarkName":{"type":"string","nullable":true},"index":{"type":"number","nullable":true},"elements":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseMessage"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["ResponseMessage"],"summary":"Delete a response message","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"responseMessageId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/response-rules":{"get":{"tags":["ResponseRule"],"summary":"List response rules on chatbots the caller can see","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"response rules","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ResponseRule"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["ResponseRule"],"summary":"Create a response rule","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ResponseRuleCreate"},{"type":"object","properties":{"responseId":{"type":"string","nullable":true}}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseRule"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/response-rules/{responseRuleId}":{"get":{"tags":["ResponseRule"],"summary":"Get a response rule","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"responseRuleId","in":"path"}],"responses":{"200":{"description":"The response rule","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseRule"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["ResponseRule"],"summary":"Update a response rule","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"responseRuleId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ResponseRuleUpdate"},{"type":"object","properties":{"responseId":{"type":"string","nullable":true}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseRule"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["ResponseRule"],"summary":"Update a response rule (PUT, merges like PATCH)","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"responseRuleId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ResponseRuleUpdate"},{"type":"object","properties":{"responseId":{"type":"string","nullable":true}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponseRule"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["ResponseRule"],"summary":"Delete a response rule","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"responseRuleId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/states":{"get":{"tags":["State"],"summary":"List states on chatbots the caller can see","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"states","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/State"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["State"],"summary":"Create a state","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/StateCreate"},{"type":"object","properties":{}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/State"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/states/{stateId}":{"get":{"tags":["State"],"summary":"Get a state","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"stateId","in":"path"}],"responses":{"200":{"description":"The state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/State"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["State"],"summary":"Update a state","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"stateId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/StateUpdate"},{"type":"object","properties":{"label":{"type":"string","nullable":true,"minLength":1}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/State"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["State"],"summary":"Delete a state","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"stateId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/states/{stateId}/dependents":{"get":{"tags":["State"],"summary":"Responses that start a dialog starting in this state, or end in it","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"stateId","in":"path"}],"responses":{"200":{"description":"Responses","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/bookmarks":{"get":{"tags":["Bookmark"],"summary":"List bookmarks on chatbots the caller can see","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"bookmarks","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Bookmark"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Bookmark"],"summary":"Create a bookmark","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BookmarkCreate"},{"type":"object","properties":{}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Bookmark"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/bookmarks/{bookmarkId}":{"get":{"tags":["Bookmark"],"summary":"Get a bookmark","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"bookmarkId","in":"path"}],"responses":{"200":{"description":"The bookmark","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Bookmark"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Bookmark"],"summary":"Update a bookmark","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"bookmarkId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BookmarkUpdate"},{"type":"object","properties":{"label":{"type":"string","nullable":true,"minLength":1}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Bookmark"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Bookmark"],"summary":"Delete a bookmark","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"bookmarkId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/bookmarks/{bookmarkId}/dependents":{"get":{"tags":["Bookmark"],"summary":"Responses that exit through this bookmark","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"bookmarkId","in":"path"}],"responses":{"200":{"description":"Responses","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/data-sources":{"get":{"tags":["DataSource"],"summary":"List data sources on chatbots the caller can see","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"data sources","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DataSource"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["DataSource"],"summary":"Create a data source","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/DataSourceCreate"},{"type":"object","properties":{"URL":{"type":"string","nullable":true},"PDF":{"type":"string","nullable":true},"tags":{"type":"array","nullable":true,"items":{"type":"string"}},"forceReindex":{"type":"boolean","nullable":true},"API_KEY":{"type":"string","nullable":true},"language":{"type":"string","nullable":true},"update":{"type":"string","nullable":true},"LANGUAGE":{"type":"string","nullable":true},"SUB_DOMAIN":{"type":"string","nullable":true},"SECTION_ID":{"type":"string","nullable":true},"FILTERS":{"type":"string","nullable":true}}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataSource"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/data-sources/{dataSourceId}":{"get":{"tags":["DataSource"],"summary":"Get a data source","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"dataSourceId","in":"path"}],"responses":{"200":{"description":"The data source","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataSource"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["DataSource"],"summary":"Update a data source","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"dataSourceId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/DataSourceUpdate"},{"type":"object","properties":{"title":{"type":"string","nullable":true,"minLength":1},"URL":{"type":"string","nullable":true},"PDF":{"type":"string","nullable":true},"tags":{"type":"array","nullable":true,"items":{"type":"string"}},"forceReindex":{"type":"boolean","nullable":true},"API_KEY":{"type":"string","nullable":true},"language":{"type":"string","nullable":true},"update":{"type":"string","nullable":true},"LANGUAGE":{"type":"string","nullable":true},"SUB_DOMAIN":{"type":"string","nullable":true},"SECTION_ID":{"type":"string","nullable":true},"FILTERS":{"type":"string","nullable":true}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataSource"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["DataSource"],"summary":"Update a data source (PUT, merges like PATCH)","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"dataSourceId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/DataSourceUpdate"},{"type":"object","properties":{"title":{"type":"string","nullable":true,"minLength":1},"URL":{"type":"string","nullable":true},"PDF":{"type":"string","nullable":true},"tags":{"type":"array","nullable":true,"items":{"type":"string"}},"forceReindex":{"type":"boolean","nullable":true},"API_KEY":{"type":"string","nullable":true},"language":{"type":"string","nullable":true},"update":{"type":"string","nullable":true},"LANGUAGE":{"type":"string","nullable":true},"SUB_DOMAIN":{"type":"string","nullable":true},"SECTION_ID":{"type":"string","nullable":true},"FILTERS":{"type":"string","nullable":true}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataSource"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["DataSource"],"summary":"Delete a data source","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"dataSourceId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["DataSource webhook"],"summary":"Add or update items","description":"Authenticated by the data source's own key in the `apikey` header, not a login.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"dataSourceId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"content":{"type":"string"}}}}},"required":["data"]}}}},"responses":{"200":{"description":"Done"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/data-sources/{dataSourceId}/insert":{"post":{"tags":["DataSource webhook"],"summary":"Add or update items","description":"Authenticated by the data source's own key in the `apikey` header, not a login.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"dataSourceId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"content":{"type":"string"}}}}},"required":["data"]}}}},"responses":{"200":{"description":"Done"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/data-sources/{dataSourceId}/drop":{"post":{"tags":["DataSource webhook"],"summary":"Mark every item for deletion","description":"Authenticated by the data source's own key in the `apikey` header, not a login.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"dataSourceId","in":"path"}],"responses":{"200":{"description":"Done"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/data-sources/{dataSourceId}/delete":{"post":{"tags":["DataSource webhook"],"summary":"Mark items for deletion by id","description":"Authenticated by the data source's own key in the `apikey` header, not a login.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"dataSourceId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"}}},"required":["ids"]}}}},"responses":{"200":{"description":"Done"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/data-sources/{dataSourceId}/get":{"post":{"tags":["DataSource webhook"],"summary":"The source with its items","description":"Authenticated by the data source's own key in the `apikey` header, not a login.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"dataSourceId","in":"path"}],"responses":{"200":{"description":"Done"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/data-sources/{dataSourceId}/deletedatasource":{"post":{"tags":["DataSource"],"summary":"Flag the source for deletion by the cronjob","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"dataSourceId","in":"path"}],"responses":{"200":{"description":"`{ data }` (the update result)"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/data-sources/{dataSourceId}/dependents":{"get":{"tags":["DataSource"],"summary":"Responses that use this data source","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"dataSourceId","in":"path"}],"responses":{"200":{"description":"Responses","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/data-sources/{dataSourceId}/candeletedatasource":{"post":{"tags":["DataSource"],"summary":"Labels of the dialogs that use the source","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"dataSourceId","in":"path"}],"responses":{"200":{"description":"Dialog labels","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"string"}}},"required":["data"]}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/knowledge-bases":{"get":{"tags":["KnowledgeBase"],"summary":"The chatbot's knowledge base, or null","security":[{"jwt":[]}],"description":"The chatbot comes from `filter[where][chatbotId]` or `?chatbotId=`.\n\nRequires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"The knowledge base","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBase"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["KnowledgeBase"],"summary":"Create the chatbot's knowledge base","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/KnowledgeBaseCreate"},{"type":"object","properties":{"apiKey":{"type":"string","nullable":true},"indexManagedBy":{"type":"string","nullable":true},"primaryLanguage":{"type":"string","nullable":true},"languageMode":{"type":"string","nullable":true},"embeddingProvider":{"type":"string","nullable":true},"embeddingLLM":{"type":"string","nullable":true},"serviceName":{"type":"string","nullable":true},"isKnowledgeBaseEnabled":{"type":"boolean","nullable":true},"answerLLM":{"type":"string","nullable":true},"generativeCheckLLM":{"type":"string","nullable":true},"contextLLM":{"type":"string","nullable":true},"promptLLM":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"nullable":true}]},"contextualizerPrompt":{"type":"string","nullable":true},"contextualizerTargetLanguage":{"type":"string","nullable":true}}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBase"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/knowledge-bases/{knowledgeBaseId}":{"get":{"tags":["KnowledgeBase"],"summary":"Get a knowledge base (API key unmasked, as live)","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"knowledgeBaseId","in":"path"}],"responses":{"200":{"description":"The knowledge base","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBase"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["KnowledgeBase"],"summary":"Update a knowledge base","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"knowledgeBaseId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/KnowledgeBaseUpdate"},{"type":"object","properties":{"apiKey":{"type":"string","nullable":true},"indexManagedBy":{"type":"string","nullable":true},"primaryLanguage":{"type":"string","nullable":true},"languageMode":{"type":"string","nullable":true},"embeddingProvider":{"type":"string","nullable":true},"embeddingLLM":{"type":"string","nullable":true},"serviceName":{"type":"string","nullable":true},"isKnowledgeBaseEnabled":{"type":"boolean","nullable":true},"answerLLM":{"type":"string","nullable":true},"generativeCheckLLM":{"type":"string","nullable":true},"contextLLM":{"type":"string","nullable":true},"promptLLM":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"nullable":true}]},"contextualizerPrompt":{"type":"string","nullable":true},"contextualizerTargetLanguage":{"type":"string","nullable":true}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBase"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["KnowledgeBase"],"summary":"Update a knowledge base (PUT, merges like PATCH)","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"knowledgeBaseId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/KnowledgeBaseUpdate"},{"type":"object","properties":{"apiKey":{"type":"string","nullable":true},"indexManagedBy":{"type":"string","nullable":true},"primaryLanguage":{"type":"string","nullable":true},"languageMode":{"type":"string","nullable":true},"embeddingProvider":{"type":"string","nullable":true},"embeddingLLM":{"type":"string","nullable":true},"serviceName":{"type":"string","nullable":true},"isKnowledgeBaseEnabled":{"type":"boolean","nullable":true},"answerLLM":{"type":"string","nullable":true},"generativeCheckLLM":{"type":"string","nullable":true},"contextLLM":{"type":"string","nullable":true},"promptLLM":{"anyOf":[{"type":"string"},{"type":"object","additionalProperties":{"nullable":true}},{"nullable":true}]},"contextualizerPrompt":{"type":"string","nullable":true},"contextualizerTargetLanguage":{"type":"string","nullable":true}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeBase"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["KnowledgeBase"],"summary":"Delete a knowledge base","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"knowledgeBaseId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/knowledge-bases/{knowledgeBaseId}/upgrade-search-index":{"post":{"tags":["KnowledgeBase"],"summary":"Queue a search index rebuild (`{ targetVersion?: 1 | 2 | 3 }`, default 3)","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"knowledgeBaseId","in":"path"}],"responses":{"200":{"description":"Queued","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}},"required":["message"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations":{"get":{"tags":["Integration"],"summary":"List integrations on chatbots the caller can see","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"integrations","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Integration"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Integration"],"summary":"Create a integration","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/IntegrationCreate"},{"type":"object","properties":{"integrationDefinitionId":{"type":"string","nullable":true},"properties":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"active":{"type":"boolean","nullable":true}}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Integration"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/{integrationId}":{"get":{"tags":["Integration"],"summary":"Get a integration","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"integrationId","in":"path"}],"responses":{"200":{"description":"The integration","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Integration"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Integration"],"summary":"Update a integration","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"integrationId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/IntegrationUpdate"},{"type":"object","properties":{"integrationDefinitionId":{"type":"string","nullable":true},"properties":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"active":{"type":"boolean","nullable":true}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Integration"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Integration"],"summary":"Delete a integration","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"integrationId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/{integrationId}/payconiq/connect":{"post":{"tags":["Integration"],"summary":"Store the Payconiq API key (encrypted)","security":[{"jwt":[]}],"description":"Requires: `chatbot-admin` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"integrationId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"apiKey":{"type":"string"}},"required":["apiKey"]}}}},"responses":{"200":{"description":"The key ending","content":{"application/json":{"schema":{"type":"object","properties":{"keyEnding":{"type":"string","nullable":true}},"required":["keyEnding"]}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/{integrationId}/openai/connect":{"post":{"tags":["Integration"],"summary":"Store the OpenAI API key (encrypted)","security":[{"jwt":[]}],"description":"Requires: `chatbot-admin` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"integrationId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"api_key":{"type":"string"}},"required":["api_key"]}}}},"responses":{"200":{"description":"The key ending","content":{"application/json":{"schema":{"type":"object","properties":{"keyEnding":{"type":"string","nullable":true}},"required":["keyEnding"]}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/{integrationId}/set-generic-api-key":{"post":{"tags":["Integration"],"summary":"Store any named API key (encrypted)","security":[{"jwt":[]}],"description":"Requires: `chatbot-admin` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"integrationId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string"},"keyname":{"type":"string"}},"required":["key","keyname"]}}}},"responses":{"200":{"description":"`{ <keyname>_key_ending }`"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/{integrationId}/360dialog/connect":{"post":{"tags":["Integration"],"summary":"Store the 360dialog key and point its webhook at the chatbot","security":[{"jwt":[]}],"description":"Requires: `chatbot-admin` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"integrationId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"apiKey":{"type":"string"}},"required":["apiKey"]}}}},"responses":{"200":{"description":"`{ keyEnding }`, or the 360dialog error"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/{integrationId}/publish":{"post":{"tags":["Integration"],"summary":"Copy the integration to production","security":[{"jwt":[]}],"description":"Requires: `chatbot-admin` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"integrationId","in":"path"}],"responses":{"200":{"description":"Published","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"}},"required":["status"]}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/{integrationId}/facebook/connect":{"post":{"tags":["Integration"],"summary":"Connect a Facebook page","security":[{"jwt":[]}],"description":"Requires: `chatbot-admin` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"integrationId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"pageId":{"type":"string"},"pageAccessToken":{"type":"string"},"userAccessToken":{"type":"string"}},"required":["pageId","pageAccessToken","userAccessToken"]}}}},"responses":{"200":{"description":"Connected","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"}},"required":["status"]}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/{integrationId}/facebook/disconnect":{"post":{"tags":["Integration"],"summary":"Disconnect the Facebook page","security":[{"jwt":[]}],"description":"Requires: `chatbot-admin` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"integrationId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"pageId":{"type":"string"},"pageAccessToken":{"type":"string"}},"required":["pageId","pageAccessToken"]}}}},"responses":{"200":{"description":"Disconnected","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"}},"required":["status"]}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integrations/{integrationId}/facebook/profile":{"post":{"tags":["Integration"],"summary":"Update the Messenger profile (greeting, get started)","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"integrationId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"pageId":{"type":"string"},"pageAccessToken":{"type":"string"},"profile":{"type":"object","additionalProperties":{"nullable":true}}},"required":["pageId","pageAccessToken","profile"]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string"}},"required":["status"]}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integration-definitions":{"get":{"tags":["IntegrationDefinition"],"summary":"List integration types","security":[{"jwt":[]}],"description":"Requires: any logged-in user.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Types","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/IntegrationDefinition"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/integration-definitions/{name}":{"get":{"tags":["IntegrationDefinition"],"summary":"Get an integration type by name","security":[{"jwt":[]}],"description":"Requires: any logged-in user.","parameters":[{"schema":{"type":"string"},"required":true,"name":"name","in":"path"}],"responses":{"200":{"description":"The type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationDefinition"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sessions":{"get":{"tags":["Session"],"summary":"List sessions (with heartbeat) on chatbots the caller can see","security":[{"jwt":[]}],"description":"Requires: `gdpr-access` on the chatbot.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Sessions","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SessionWithHeartbeat"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Session"],"summary":"Create a session","security":[{"jwt":[]}],"description":"Requires: `support` on the chatbot.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/SessionCreate"},{"type":"object","properties":{"takeover":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"tags":{"type":"array","nullable":true,"items":{"type":"string"}},"locale":{"type":"string","nullable":true},"userLocale":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true},"archived":{"type":"string","nullable":true},"takenOverById":{"type":"string","nullable":true},"takeoverHistory":{"type":"array","nullable":true,"items":{"type":"object","additionalProperties":{"nullable":true}}}}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Session"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sessions/current-takeover-requests":{"get":{"tags":["Session"],"summary":"Count live sessions with an active, requested or suggested takeover, per state","security":[{"jwt":[]}],"description":"Requires: `gdpr-access` on the chatbot.","parameters":[{"schema":{"type":"string","description":"Comma-separated chatbot ids"},"required":false,"name":"chatbotIds","in":"query"},{"schema":{"type":"string"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string","description":"Comma-separated locales"},"required":false,"name":"locales","in":"query"}],"responses":{"200":{"description":"Counts per takeover state","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"type":"number"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sessions/tags":{"get":{"tags":["Session"],"summary":"Tags of the given chatbots","security":[{"jwt":[]}],"description":"Requires: `gdpr-access` on the chatbot.","parameters":[{"schema":{"type":"string","description":"Comma-separated chatbot ids"},"required":false,"name":"chatbotIds","in":"query"}],"responses":{"200":{"description":"Tags","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sessions/chatbots/{chatbotId}/data":{"get":{"tags":["Session"],"summary":"A chatbot's sessions between two dates (GDPR export)","security":[{"jwt":[]}],"description":"Requires: `gdpr-access` on the chatbot.","parameters":[{"schema":{"type":"string"},"required":true,"name":"chatbotId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"startDate","in":"query"},{"schema":{"type":"string"},"required":false,"name":"endDate","in":"query"}],"responses":{"200":{"description":"Sessions"},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sessions/{sessionId}/takeover-message":{"post":{"tags":["Session"],"summary":"Send an agent's message into the conversation","security":[{"jwt":[]}],"description":"Requires: `gdpr-access` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"sessionId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/TakeoverMessage"},{"type":"object","properties":{}}]}}}},"responses":{"200":{"description":"\"message sent\"","content":{"application/json":{"schema":{"type":"string"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sessions/{sessionId}/takeover-buttons":{"get":{"tags":["Session"],"summary":"The conversation's takeover function buttons (prefilled) and its last 50 runs; a coder may use a test conversation","security":[{"jwt":[]}],"description":"Requires: `support` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"sessionId","in":"path"}],"responses":{"200":{"description":"Buttons and runs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TakeoverButtons"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sessions/{sessionId}/takeover-buttons/{snippetId}/run":{"post":{"tags":["Session"],"summary":"Run a takeover function button; answers 202 with the running record; a coder may run on a test conversation","security":[{"jwt":[]}],"description":"Requires: `support` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"sessionId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"snippetId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/TakeoverButtonRunBody"},{"type":"object","properties":{"values":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]}}}]}}}},"responses":{"202":{"description":"The running record","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TakeoverFunctionRun"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"Service unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sessions/{sessionId}/upload-takeover-file":{"post":{"tags":["Session"],"summary":"Send a file (multipart `file`) into the conversation","security":[{"jwt":[]}],"description":"Requires: `gdpr-access` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"sessionId","in":"path"}],"responses":{"200":{"description":"The takeover message","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sessions/{sessionId}":{"get":{"tags":["Session"],"summary":"Get a session with its heartbeat","security":[{"jwt":[]}],"description":"Requires: `gdpr-access` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"sessionId","in":"path"}],"responses":{"200":{"description":"The session","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionWithHeartbeat"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Session"],"summary":"Update a session","security":[{"jwt":[]}],"description":"Requires: `support` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"sessionId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/SessionUpdate"},{"type":"object","properties":{"takeover":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"tags":{"type":"array","nullable":true,"items":{"type":"string"}},"locale":{"type":"string","nullable":true},"userLocale":{"type":"string","nullable":true},"notes":{"type":"string","nullable":true},"archived":{"type":"string","nullable":true},"takenOverById":{"type":"string","nullable":true},"takeoverHistory":{"type":"array","nullable":true,"items":{"type":"object","additionalProperties":{"nullable":true}}}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Session"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Session"],"summary":"Delete a session","security":[{"jwt":[]}],"description":"Requires: `support` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"sessionId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sessions/{sessionId}/chatbots/{chatbotId}/data":{"get":{"tags":["Session"],"summary":"A session's messages (GDPR export)","security":[{"jwt":[]}],"description":"Requires: `gdpr-access` on the chatbot.","parameters":[{"schema":{"type":"string"},"required":true,"name":"sessionId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"chatbotId","in":"path"}],"responses":{"200":{"description":"Messages"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sessions/{sessionId}/set-context":{"post":{"tags":["Session"],"summary":"Replace the session's engine context (body) and resume the session","security":[{"jwt":[]}],"description":"Requires: `gdpr-access` on the chatbot.","parameters":[{"schema":{"type":"string"},"required":true,"name":"sessionId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"environment","in":"query"}],"responses":{"200":{"description":"The new context","content":{"application/json":{"schema":{"type":"object","properties":{"context":{"nullable":true},"newMessage":{"nullable":true}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sessions/{sessionId}/get-files":{"get":{"tags":["Session"],"summary":"Files the engine stored for the session (the chatbot's GCS integration)","security":[{"jwt":[]}],"description":"Requires: `gdpr-access` on the chatbot.","parameters":[{"schema":{"type":"string"},"required":true,"name":"sessionId","in":"path"},{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":false,"name":"chatbotId","in":"query"}],"responses":{"200":{"description":"Files"},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sessions/{sessionId}/download-file":{"get":{"tags":["Session"],"summary":"A one-minute download link as plain text (`[]` without a storage integration)","security":[{"jwt":[]}],"description":"Requires: `gdpr-access` on the chatbot.","parameters":[{"schema":{"type":"string"},"required":true,"name":"sessionId","in":"path"},{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":false,"name":"chatbotId","in":"query"},{"schema":{"type":"string"},"required":false,"name":"filename","in":"query"}],"responses":{"200":{"description":"The link"},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/sessions/{sessionId}/chat-transcription":{"post":{"tags":["Session"],"summary":"Email the conversation as a PDF (`{email, username}`)","security":[{"jwt":[]}],"description":"Requires: `gdpr-access` on the chatbot.","parameters":[{"schema":{"type":"string"},"required":true,"name":"sessionId","in":"path"}],"responses":{"200":{"description":"The PDF name","content":{"application/json":{"schema":{"type":"object","properties":{"pdf":{"type":"string"}},"required":["pdf"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"405":{"description":"The `emailChatTranscription` feature is off"}}}},"/v1/session-heartbeats":{"get":{"tags":["SessionHeartbeat"],"summary":"List the heartbeats of sessions the caller can read","security":[{"jwt":[]}],"description":"Requires: `gdpr-access` on the chatbot.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Heartbeats","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SessionHeartbeat"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["SessionHeartbeat"],"summary":"Create a heartbeat","security":[{"jwt":[]}],"description":"Requires: `support` on the chatbot.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/SessionHeartbeatWrite"},{"type":"object","properties":{"sessionId":{"type":"string","nullable":true}}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionHeartbeat"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/session-heartbeats/{sessionHeartbeatId}":{"get":{"tags":["SessionHeartbeat"],"summary":"Get a heartbeat","security":[{"jwt":[]}],"description":"Requires: `gdpr-access` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"sessionHeartbeatId","in":"path"}],"responses":{"200":{"description":"The heartbeat","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionHeartbeat"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["SessionHeartbeat"],"summary":"Update a heartbeat","security":[{"jwt":[]}],"description":"Requires: `support` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"sessionHeartbeatId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/SessionHeartbeatWrite"},{"type":"object","properties":{"sessionId":{"type":"string","nullable":true}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SessionHeartbeat"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["SessionHeartbeat"],"summary":"Delete a heartbeat","security":[{"jwt":[]}],"description":"Requires: `support` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"sessionHeartbeatId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/messages":{"get":{"tags":["Message"],"summary":"List messages on chatbots the caller can see","security":[{"jwt":[]}],"description":"Requires: `gdpr-access` on the chatbot.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Messages","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Message"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/messages/{messageId}":{"get":{"tags":["Message"],"summary":"Get a message","security":[{"jwt":[]}],"description":"Requires: `gdpr-access` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"messageId","in":"path"}],"responses":{"200":{"description":"The message","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/messages/{messageId}/ignore-for-unanswered":{"post":{"tags":["Message"],"summary":"Exclude the message from (or return it to) the unanswered list","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"messageId","in":"path"}],"responses":{"200":{"description":"The message","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/messages/{messageId}/ignoreForUnanswered":{"post":{"tags":["Message"],"summary":"Exclude the message from (or return it to) the unanswered list","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"messageId","in":"path"}],"responses":{"200":{"description":"The message","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Message"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/custom-charts":{"get":{"tags":["CustomChart"],"summary":"List custom charts on chatbots the caller can see","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"custom charts","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CustomChart"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["CustomChart"],"summary":"Create a custom chart","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/CustomChartCreate"},{"type":"object","properties":{"label":{"type":"string","nullable":true},"subtitle":{"type":"string","nullable":true},"kind":{"type":"string","nullable":true},"countMessages":{"type":"boolean","nullable":true},"tagsToTrack":{"type":"array","nullable":true,"items":{"type":"object","properties":{"name":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"color":{"type":"string"}},"required":["name"]}}}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomChart"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/custom-charts/{customChartId}":{"get":{"tags":["CustomChart"],"summary":"Get a custom chart","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"customChartId","in":"path"}],"responses":{"200":{"description":"The custom chart","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomChart"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["CustomChart"],"summary":"Update a custom chart","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"customChartId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/CustomChartUpdate"},{"type":"object","properties":{"label":{"type":"string","nullable":true},"subtitle":{"type":"string","nullable":true},"kind":{"type":"string","nullable":true},"countMessages":{"type":"boolean","nullable":true},"tagsToTrack":{"type":"array","nullable":true,"items":{"type":"object","properties":{"name":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"color":{"type":"string"}},"required":["name"]}}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomChart"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["CustomChart"],"summary":"Delete a custom chart","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"customChartId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/custom-charts/{customChartId}/statistics":{"get":{"tags":["CustomChart"],"summary":"The chart's counts per tag group (cached)","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"customChartId","in":"path"},{"schema":{"type":"string","description":"Locale (live wire name)"},"required":false,"name":"lang","in":"query"},{"schema":{"type":"string"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string","description":"Comma-separated general tag filter"},"required":false,"name":"tags","in":"query"},{"schema":{"type":"string","description":"`true`: sessions need all `tags`"},"required":false,"name":"allTags","in":"query"},{"schema":{"type":"string","description":"`true`: skip the cached result"},"required":false,"name":"nocache","in":"query"}],"responses":{"200":{"description":"Counts (or per-day / per-hour buckets) per group","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"nullable":true}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbot-issues":{"get":{"tags":["ChatbotIssue"],"summary":"List chatbot issues on chatbots the caller can see","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"chatbot issues","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ChatbotIssue"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["ChatbotIssue"],"summary":"Create a chatbot issue","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ChatbotIssueCreate"},{"type":"object","properties":{"kind":{"type":"string","nullable":true},"target":{"type":"string","nullable":true},"info":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"acknowledged":{"type":"boolean","nullable":true}}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatbotIssue"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbot-issues/count":{"get":{"tags":["ChatbotIssue"],"summary":"Count issues matching a LoopBack `where` (not scoped by chatbot, as live)","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string"},"required":false,"name":"where","in":"query"}],"responses":{"200":{"description":"The count","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbot-issues/{chatbotIssueId}":{"get":{"tags":["ChatbotIssue"],"summary":"Get a chatbot issue","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotIssueId","in":"path"}],"responses":{"200":{"description":"The chatbot issue","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatbotIssue"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["ChatbotIssue"],"summary":"Update a chatbot issue","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotIssueId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ChatbotIssueUpdate"},{"type":"object","properties":{"kind":{"type":"string","nullable":true},"target":{"type":"string","nullable":true},"info":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"acknowledged":{"type":"boolean","nullable":true}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatbotIssue"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["ChatbotIssue"],"summary":"Delete a chatbot issue","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotIssueId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbot-tags":{"get":{"tags":["ChatbotTag"],"summary":"List chatbot tags on chatbots the caller can see","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"chatbot tags","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ChatbotTag"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["ChatbotTag"],"summary":"Create a chatbot tag","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ChatbotTagCreate"},{"type":"object","properties":{"tag":{"type":"string","nullable":true},"autoGenerated":{"type":"boolean","nullable":true}}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatbotTag"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chatbot-tags/{chatbotTagId}":{"get":{"tags":["ChatbotTag"],"summary":"Get a chatbot tag","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotTagId","in":"path"}],"responses":{"200":{"description":"The chatbot tag","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatbotTag"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["ChatbotTag"],"summary":"Update a chatbot tag","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotTagId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ChatbotTagUpdate"},{"type":"object","properties":{"tag":{"type":"string","nullable":true},"autoGenerated":{"type":"boolean","nullable":true}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatbotTag"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["ChatbotTag"],"summary":"Delete a chatbot tag","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"chatbotTagId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/errors":{"get":{"tags":["Error"],"summary":"List errors on chatbots the caller can see","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"errors","content":{"application/json":{"schema":{"type":"array","items":{"allOf":[{"$ref":"#/components/schemas/Error"},{"properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"chatbotId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"text":{"type":"string"},"production":{"type":"boolean"},"runtime":{"type":"boolean"},"created":{"type":"number"}},"required":["id"]}]}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Error"],"summary":"Create a error","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorCreate"},{"type":"object","properties":{"production":{"type":"boolean","nullable":true},"runtime":{"type":"boolean","nullable":true},"created":{"type":"number","nullable":true}}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"chatbotId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"text":{"type":"string"},"production":{"type":"boolean"},"runtime":{"type":"boolean"},"created":{"type":"number"}},"required":["id"]}]}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/errors/{appErrorId}":{"get":{"tags":["Error"],"summary":"Get a error","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"appErrorId","in":"path"}],"responses":{"200":{"description":"The error","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"chatbotId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"text":{"type":"string"},"production":{"type":"boolean"},"runtime":{"type":"boolean"},"created":{"type":"number"}},"required":["id"]}]}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Error"],"summary":"Update a error","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"appErrorId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ErrorUpdate"},{"type":"object","properties":{"text":{"type":"string","nullable":true,"minLength":1},"production":{"type":"boolean","nullable":true},"runtime":{"type":"boolean","nullable":true},"created":{"type":"number","nullable":true}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Error"},{"properties":{"id":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"chatbotId":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"text":{"type":"string"},"production":{"type":"boolean"},"runtime":{"type":"boolean"},"created":{"type":"number"}},"required":["id"]}]}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Error"],"summary":"Delete a error","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"appErrorId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/change-logs":{"get":{"tags":["ChangeLog"],"summary":"List the change log entrys of chatbots and organisations the caller can see","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Entries","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ChangeLog"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/change-logs/{changeLogId}":{"get":{"tags":["ChangeLog"],"summary":"Get a change log entry","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"changeLogId","in":"path"}],"responses":{"200":{"description":"The entry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeLog"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/change-log-details":{"get":{"tags":["ChangeLogDetail"],"summary":"List the change log details of chatbots and organisations the caller can see","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Entries","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ChangeLogDetail"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/change-log-details/{changeLogDetailId}":{"get":{"tags":["ChangeLogDetail"],"summary":"Get a change log detail","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"changeLogDetailId","in":"path"}],"responses":{"200":{"description":"The entry","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeLogDetail"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/export-settings":{"get":{"tags":["ExportSettings"],"summary":"List export settings on chatbots the caller can see","security":[{"jwt":[]}],"description":"Requires: `chatbot-admin` on the chatbot.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"export settings","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ExportSettings"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["ExportSettings"],"summary":"Create a export setting","security":[{"jwt":[]}],"description":"Requires: `chatbot-admin` on the chatbot.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ExportSettingsCreate"},{"type":"object","properties":{"type":{"type":"string","nullable":true},"active":{"type":"boolean","nullable":true}}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportSettings"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/export-settings/{exportSettingsId}":{"get":{"tags":["ExportSettings"],"summary":"Get a export setting","security":[{"jwt":[]}],"description":"Requires: `chatbot-admin` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"exportSettingsId","in":"path"}],"responses":{"200":{"description":"The export setting","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportSettings"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["ExportSettings"],"summary":"Update a export setting","security":[{"jwt":[]}],"description":"Requires: `chatbot-admin` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"exportSettingsId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ExportSettingsUpdate"},{"type":"object","properties":{"frequency":{"type":"string","nullable":true,"minLength":1},"endpoint_id":{"type":"string","nullable":true,"minLength":1},"type":{"type":"string","nullable":true},"active":{"type":"boolean","nullable":true}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExportSettings"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["ExportSettings"],"summary":"Delete a export setting","security":[{"jwt":[]}],"description":"Requires: `chatbot-admin` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"exportSettingsId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/testBot/{chatbotId}":{"post":{"tags":["Chatbot"],"summary":"Send a test message (`{message, id, environment, locale}`) or `{event}` to the bot","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string"},"required":true,"name":"chatbotId","in":"path"}],"responses":{"200":{"description":"The bot's reply, or a `{status, code, error}` failure"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/testcases":{"get":{"tags":["Testcase"],"summary":"List testcases on chatbots the caller can see","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"testcases","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Testcase"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Testcase"],"summary":"Create a testcase","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/TestcaseCreate"},{"type":"object","properties":{"messages":{"type":"array","nullable":true,"items":{"type":"object","additionalProperties":{"nullable":true}}},"enabled":{"type":"boolean","nullable":true}}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Testcase"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/testcases/run":{"post":{"tags":["Testcase"],"summary":"Run several of a chatbot's testcases (in the background)","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/TestcaseRunAll"},{"type":"object","properties":{"environment":{"type":"string","nullable":true},"chatbotId":{"type":"string","nullable":true},"ids":{"type":"array","nullable":true,"items":{"type":"string"}}}}]}}}},"responses":{"200":{"description":"The run","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestrunStarted"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/testcases/status/{runId}":{"get":{"tags":["Testcase"],"summary":"Poll a run (the stored `Testrun`, or `null`)","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string"},"required":true,"name":"runId","in":"path"}],"responses":{"200":{"description":"The run, or null"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/testcases/{testcaseId}":{"get":{"tags":["Testcase"],"summary":"Get a testcase","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"testcaseId","in":"path"}],"responses":{"200":{"description":"The testcase","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Testcase"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Testcase"],"summary":"Update a testcase","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"testcaseId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/TestcaseUpdate"},{"type":"object","properties":{"name":{"type":"string","nullable":true,"minLength":1},"language":{"type":"string","nullable":true,"minLength":1},"messages":{"type":"array","nullable":true,"items":{"type":"object","additionalProperties":{"nullable":true}}},"enabled":{"type":"boolean","nullable":true}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Testcase"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Testcase"],"summary":"Delete a testcase","security":[{"jwt":[]}],"description":"Requires: `editor` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"testcaseId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/testcases/{testcaseId}/run":{"post":{"tags":["Testcase"],"summary":"Run one testcase (in the background)","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string"},"required":true,"name":"testcaseId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/TestcaseRun"},{"type":"object","properties":{"environment":{"type":"string","nullable":true}}}]}}}},"responses":{"200":{"description":"The run","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestrunStarted"}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations":{"get":{"tags":["Organization"],"summary":"The caller's organisations","security":[{"jwt":[]}],"description":"Requires: any logged-in user.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Organisations","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Organization"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Organization"],"summary":"Create an organisation","security":[{"jwt":[]}],"description":"Requires: oswald-admin.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OrganizationCreate"},{"type":"object","properties":{"activatedFeatures":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]}}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}":{"get":{"tags":["Organization"],"summary":"Get an organisation","security":[{"jwt":[]}],"description":"Requires: any role in the organisation.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"organizationId","in":"path"}],"responses":{"200":{"description":"The organisation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"tags":["Organization"],"summary":"Replace an organisation","security":[{"jwt":[]}],"description":"Requires: `organization-admin` on the organisation.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"organizationId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OrganizationCreate"},{"type":"object","properties":{"activatedFeatures":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Organization"],"summary":"Update an organisation","security":[{"jwt":[]}],"description":"Requires: `organization-admin` on the organisation.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"organizationId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/OrganizationUpdate"},{"type":"object","properties":{"name":{"type":"string","nullable":true,"minLength":1},"activatedFeatures":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Organization"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Organization"],"summary":"Delete an organisation with its chatbots and role assignments","security":[{"jwt":[]}],"description":"Requires: oswald-admin.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"organizationId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/takeoverfilter":{"get":{"tags":["Organization"],"summary":"Tags and locales for the takeover filters","security":[{"jwt":[]}],"description":"Requires: any role in the organisation.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"organizationId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"chatbotIds","in":"query"}],"responses":{"200":{"description":"Filters","content":{"application/json":{"schema":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"string"}},"locales":{"type":"array","items":{"type":"string"}}},"required":["tags","locales"]}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/changelogfilter":{"get":{"tags":["Organization"],"summary":"Users, methods and models for the change-log filters","security":[{"jwt":[]}],"description":"Requires: any role in the organisation.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"organizationId","in":"path"}],"responses":{"200":{"description":"`{ users, methods, classes }`"},"400":{"description":"Bad request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organizations/{organizationId}/roles":{"get":{"tags":["Organization"],"summary":"The organisation's role assignments","security":[{"jwt":[]}],"description":"Requires: any role in the organisation.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"organizationId","in":"path"}],"responses":{"200":{"description":"Roles","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RoleAssignment"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/users/login":{"post":{"tags":["User"],"summary":"Log in (public). Returns the token as `id`, or an MFA step","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"},"password":{"type":"string","minLength":1}},"required":["email","password"]}}}},"responses":{"200":{"description":"`{ id, userId, ttl, created }` (+ `mfa`, or `secret`/`qr`)"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/users/reset":{"post":{"tags":["User"],"summary":"Request a password reset email (public)","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"}},"required":["email"]}}}},"responses":{"204":{"description":"Sent if the address exists"},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/users/reset-password":{"post":{"tags":["User"],"summary":"Set a new password with the emailed reset token (public; the token is the auth)","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"newPassword":{"type":"string","minLength":1}},"required":["newPassword"]}}}},"responses":{"204":{"description":"Password set"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/users":{"get":{"tags":["User"],"summary":"List users (oswald-admin; others only by exact `email`)","security":[{"jwt":[]}],"description":"Requires: any logged-in user.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Users","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/User"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["User"],"summary":"Create a user","security":[{"jwt":[]}],"description":"Requires: oswald-admin.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/UserCreate"},{"type":"object","properties":{"name":{"type":"string","nullable":true,"minLength":1},"filters":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"shouldVerify":{"type":"boolean","nullable":true},"language":{"type":"string","nullable":true,"minLength":1},"newMessageSound":{"type":"boolean","nullable":true},"newTakeoverSound":{"type":"boolean","nullable":true}}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/users/find-by-email":{"get":{"tags":["User"],"summary":"Find a user by email","security":[{"jwt":[]}],"description":"Requires: any logged-in user.","parameters":[{"schema":{"type":"string"},"required":false,"name":"email","in":"query"}],"responses":{"200":{"description":"The user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/users/{userId}/roles":{"get":{"tags":["User"],"summary":"The user's role assignments","security":[{"jwt":[]}],"description":"Requires: any logged-in user.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"userId","in":"path"}],"responses":{"200":{"description":"Roles","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RoleAssignment"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/users/{userId}":{"get":{"tags":["User"],"summary":"Get a user","security":[{"jwt":[]}],"description":"Requires: any logged-in user.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"userId","in":"path"}],"responses":{"200":{"description":"The user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["User"],"summary":"Update a user","security":[{"jwt":[]}],"description":"Requires: the user `{userId}` themselves, or oswald-admin.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"userId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/UserUpdate"},{"type":"object","properties":{"name":{"type":"string","nullable":true,"minLength":1},"email":{"type":"string","nullable":true,"format":"email"},"password":{"type":"string","nullable":true,"minLength":8},"filters":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]},"shouldVerify":{"type":"boolean","nullable":true},"language":{"type":"string","nullable":true,"minLength":1},"newMessageSound":{"type":"boolean","nullable":true},"newTakeoverSound":{"type":"boolean","nullable":true}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["User"],"summary":"Delete a user","security":[{"jwt":[]}],"description":"Requires: the user `{userId}` themselves, or oswald-admin.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"userId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/users/{userId}/mfa/validate":{"post":{"tags":["User"],"summary":"Check an MFA code (public: the second login step); with `secret`, set MFA up","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"userId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"code":{"type":"string","minLength":1},"secret":{"type":"string"}},"required":["code"]}}}},"responses":{"200":{"description":"Whether the code is valid","content":{"application/json":{"schema":{"type":"boolean"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/users/{userId}/events":{"post":{"tags":["User"],"summary":"Log a user event","security":[{"jwt":[]}],"description":"Requires: `viewer` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"userId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","minLength":1}},"required":["type"]}}}},"responses":{"200":{"description":"The stored event"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/users/change-password":{"post":{"tags":["User"],"summary":"Change the caller's own password","security":[{"jwt":[]}],"description":"Requires: any logged-in user.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"oldPassword":{"type":"string","minLength":1},"newPassword":{"type":"string","minLength":1}},"required":["oldPassword","newPassword"]}}}},"responses":{"204":{"description":"Changed"},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/role-assignments":{"get":{"tags":["RoleAssignment"],"summary":"Organisation role assignments in the caller's organisations","security":[{"jwt":[]}],"description":"Requires: any logged-in user.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Assignments","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/RoleAssignment"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["RoleAssignment"],"summary":"Assign a role","security":[{"jwt":[]}],"description":"`chatbot-admin` on the chatbot, or `organization-admin` on the organisation.\n\nRequires: `chatbot-admin` on the chatbot.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleAssignmentCreate"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleAssignment"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/role-assignments/{roleAssignmentId}":{"get":{"tags":["RoleAssignment"],"summary":"Get a role assignment","security":[{"jwt":[]}],"description":"Requires: any role in the organisation.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"roleAssignmentId","in":"path"}],"responses":{"200":{"description":"The assignment","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleAssignment"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["RoleAssignment"],"summary":"Change the role","security":[{"jwt":[]}],"description":"`chatbot-admin` on the chatbot, or `organization-admin` on the organisation.\n\nRequires: `chatbot-admin` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"roleAssignmentId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/RoleAssignmentUpdate"},{"type":"object","properties":{}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleAssignment"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["RoleAssignment"],"summary":"Remove a role assignment","security":[{"jwt":[]}],"description":"`chatbot-admin` on the chatbot, or `organization-admin` on the organisation.\n\nRequires: `chatbot-admin` on the chatbot.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"roleAssignmentId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/role-assignments/{roleAssignmentId}/user":{"get":{"tags":["RoleAssignment"],"summary":"The user a role is assigned to","security":[{"jwt":[]}],"description":"Requires: any role in the organisation.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"roleAssignmentId","in":"path"}],"responses":{"200":{"description":"The user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/User"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/billings":{"get":{"tags":["Billing"],"summary":"List","security":[{"jwt":[]}],"description":"Requires: oswald-admin.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Records","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Billing"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Billing"],"summary":"Create","security":[{"jwt":[]}],"description":"Requires: oswald-admin.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BillingWrite"},{"type":"object","properties":{"maxManualVersions":{"type":"number","nullable":true},"maxAutosaveVersions":{"type":"number","nullable":true},"chatbotId":{"type":"string","nullable":true}}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Billing"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/billings/{billingId}":{"get":{"tags":["Billing"],"summary":"Get one","security":[{"jwt":[]}],"description":"Requires: oswald-admin.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"billingId","in":"path"}],"responses":{"200":{"description":"The record","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Billing"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["Billing"],"summary":"Update","security":[{"jwt":[]}],"description":"Requires: oswald-admin.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"billingId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/BillingUpdate"},{"type":"object","properties":{"maxManualVersions":{"type":"number","nullable":true},"maxAutosaveVersions":{"type":"number","nullable":true},"chatbotId":{"type":"string","nullable":true}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Billing"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["Billing"],"summary":"Delete","security":[{"jwt":[]}],"description":"Requires: oswald-admin.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"billingId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/user-events":{"get":{"tags":["UserEvent"],"summary":"List the caller's events (all, for an oswald-admin)","security":[{"jwt":[]}],"description":"Requires: any logged-in user.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Events","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserEventRecord"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["UserEvent"],"summary":"Log an event for the caller","security":[{"jwt":[]}],"description":"Requires: any logged-in user.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/UserEventCreate"},{"type":"object","properties":{"event":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]}}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserEventRecord"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/user-events/{userEventId}":{"get":{"tags":["UserEvent"],"summary":"Get one of the caller’s events","security":[{"jwt":[]}],"description":"Requires: any logged-in user.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"userEventId","in":"path"}],"responses":{"200":{"description":"The event","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserEventRecord"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["UserEvent"],"summary":"Update an event","security":[{"jwt":[]}],"description":"Requires: oswald-admin.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"userEventId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/UserEventUpdate"},{"type":"object","properties":{"type":{"type":"string","nullable":true,"minLength":1},"event":{"anyOf":[{"type":"object","additionalProperties":{"nullable":true}},{"type":"array","items":{"nullable":true}},{"nullable":true}]}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserEventRecord"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["UserEvent"],"summary":"Delete an event","security":[{"jwt":[]}],"description":"Requires: oswald-admin.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"userEventId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/feature-flags":{"get":{"tags":["FeatureFlag"],"summary":"List","security":[{"jwt":[]}],"description":"Requires: any logged-in user.","parameters":[{"schema":{"type":"string","description":"LoopBack filter: JSON (`{\"where\":{…},\"order\":\"name ASC\",\"limit\":10}`) or brackets (`filter[where][name]=x`)"},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"Records","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FeatureFlag"}}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["FeatureFlag"],"summary":"Create","security":[{"jwt":[]}],"description":"Requires: oswald-admin.","requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/FeatureFlagCreate"},{"type":"object","properties":{"chatbots":{"type":"array","nullable":true,"items":{"type":"string"}},"users":{"type":"array","nullable":true,"items":{"type":"string"}}}}]}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeatureFlag"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/feature-flags/{featureFlagId}":{"get":{"tags":["FeatureFlag"],"summary":"Get one","security":[{"jwt":[]}],"description":"Requires: any logged-in user.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"featureFlagId","in":"path"}],"responses":{"200":{"description":"The record","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeatureFlag"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"tags":["FeatureFlag"],"summary":"Update","security":[{"jwt":[]}],"description":"Requires: oswald-admin.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"featureFlagId","in":"path"}],"requestBody":{"description":"","required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/FeatureFlagUpdate"},{"type":"object","properties":{"feature":{"type":"string","nullable":true,"minLength":1},"flag":{"type":"string","nullable":true,"minLength":1},"chatbots":{"type":"array","nullable":true,"items":{"type":"string"}},"users":{"type":"array","nullable":true,"items":{"type":"string"}}}}]}}}},"responses":{"200":{"description":"Updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeatureFlag"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"tags":["FeatureFlag"],"summary":"Delete","security":[{"jwt":[]}],"description":"Requires: oswald-admin.","parameters":[{"schema":{"type":"string","example":"5f0c2a9e8b3c4d0012345678"},"required":true,"name":"featureFlagId","in":"path"}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Count"}}}},"401":{"description":"Not logged in","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}