# Models

## The UpdateChatbotPayloadDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateChatbotPayloadDto":{"type":"object","properties":{"name":{"type":"string","description":"The new name of the chatbot."},"timeZone":{"type":"string","description":"The new timezone of the chatbot."}}}}}}
```

## The UpdateChatbotRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateChatbotRequestDto":{"type":"object","properties":{"updateChatbot":{"description":"The object containing the fields to be updated.","allOf":[{"$ref":"#/components/schemas/UpdateChatbotPayloadDto"}]}},"required":["updateChatbot"]},"UpdateChatbotPayloadDto":{"type":"object","properties":{"name":{"type":"string","description":"The new name of the chatbot."},"timeZone":{"type":"string","description":"The new timezone of the chatbot."}}}}}}
```

## The BotEdition object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"BotEdition":{"type":"number","enum":[0,1,2,3,-1],"description":"The edition of the bot.\n\n- `0`: ENTERPRISE\n- `1`: VOICE_AGENT_GO_TEMPLATE\n- `2`: VOICE_AGENT_GO\n- `3`: AI_ASSISTANT"}}}}
```

## The ChatbotDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ChatbotDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the chatbot."},"name":{"type":"string","description":"The name of the chatbot."},"workspaceId":{"type":"string","description":"The ID of the workspace this chatbot belongs to."},"type":{"type":"string","description":"The type of the chatbot."},"created":{"type":"string","description":"The creation timestamp of the chatbot."},"updated":{"type":"string","description":"The last update timestamp of the chatbot."},"enabled":{"type":"boolean","description":"Indicates whether the chatbot is enabled."},"timeZone":{"type":"string","description":"The timezone of the chatbot."},"edition":{"description":"The edition of the bot.\n\n- `0`: ENTERPRISE\n- `1`: VOICE_AGENT_GO_TEMPLATE\n- `2`: VOICE_AGENT_GO\n- `3`: AI_ASSISTANT","allOf":[{"$ref":"#/components/schemas/BotEdition"}]}},"required":["name","workspaceId","type","created","updated","enabled","timeZone","edition"]},"BotEdition":{"type":"number","enum":[0,1,2,3,-1],"description":"The edition of the bot.\n\n- `0`: ENTERPRISE\n- `1`: VOICE_AGENT_GO_TEMPLATE\n- `2`: VOICE_AGENT_GO\n- `3`: AI_ASSISTANT"}}}}
```

## The ChatbotResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ChatbotResponseDto":{"type":"object","properties":{"chatbot":{"description":"The chatbot object.","allOf":[{"$ref":"#/components/schemas/ChatbotDto"}]},"error":{"type":"string","description":"Optional error message."}}},"ChatbotDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the chatbot."},"name":{"type":"string","description":"The name of the chatbot."},"workspaceId":{"type":"string","description":"The ID of the workspace this chatbot belongs to."},"type":{"type":"string","description":"The type of the chatbot."},"created":{"type":"string","description":"The creation timestamp of the chatbot."},"updated":{"type":"string","description":"The last update timestamp of the chatbot."},"enabled":{"type":"boolean","description":"Indicates whether the chatbot is enabled."},"timeZone":{"type":"string","description":"The timezone of the chatbot."},"edition":{"description":"The edition of the bot.\n\n- `0`: ENTERPRISE\n- `1`: VOICE_AGENT_GO_TEMPLATE\n- `2`: VOICE_AGENT_GO\n- `3`: AI_ASSISTANT","allOf":[{"$ref":"#/components/schemas/BotEdition"}]}},"required":["name","workspaceId","type","created","updated","enabled","timeZone","edition"]},"BotEdition":{"type":"number","enum":[0,1,2,3,-1],"description":"The edition of the bot.\n\n- `0`: ENTERPRISE\n- `1`: VOICE_AGENT_GO_TEMPLATE\n- `2`: VOICE_AGENT_GO\n- `3`: AI_ASSISTANT"}}}}
```

## The BucketDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"BucketDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the bucket."},"name":{"type":"string","description":"The name of the bucket."},"created":{"type":"string","description":"The creation timestamp of the bucket."},"updated":{"type":"string","description":"The last update timestamp of the bucket."}},"required":["id","name","created","updated"]}}}}
```

## The GetChatbotResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"GetChatbotResponseDto":{"type":"object","properties":{"chatbot":{"description":"The retrieved chatbot.","allOf":[{"$ref":"#/components/schemas/ChatbotDto"}]},"buckets":{"description":"A list of buckets associated with the chatbot.","type":"array","items":{"$ref":"#/components/schemas/BucketDto"}},"error":{"type":"string","description":"Optional error message."}},"required":["buckets"]},"ChatbotDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the chatbot."},"name":{"type":"string","description":"The name of the chatbot."},"workspaceId":{"type":"string","description":"The ID of the workspace this chatbot belongs to."},"type":{"type":"string","description":"The type of the chatbot."},"created":{"type":"string","description":"The creation timestamp of the chatbot."},"updated":{"type":"string","description":"The last update timestamp of the chatbot."},"enabled":{"type":"boolean","description":"Indicates whether the chatbot is enabled."},"timeZone":{"type":"string","description":"The timezone of the chatbot."},"edition":{"description":"The edition of the bot.\n\n- `0`: ENTERPRISE\n- `1`: VOICE_AGENT_GO_TEMPLATE\n- `2`: VOICE_AGENT_GO\n- `3`: AI_ASSISTANT","allOf":[{"$ref":"#/components/schemas/BotEdition"}]}},"required":["name","workspaceId","type","created","updated","enabled","timeZone","edition"]},"BotEdition":{"type":"number","enum":[0,1,2,3,-1],"description":"The edition of the bot.\n\n- `0`: ENTERPRISE\n- `1`: VOICE_AGENT_GO_TEMPLATE\n- `2`: VOICE_AGENT_GO\n- `3`: AI_ASSISTANT"},"BucketDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the bucket."},"name":{"type":"string","description":"The name of the bucket."},"created":{"type":"string","description":"The creation timestamp of the bucket."},"updated":{"type":"string","description":"The last update timestamp of the bucket."}},"required":["id","name","created","updated"]}}}}
```

## The ApiKeyResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ApiKeyResponseDto":{"type":"object","properties":{"apiKey":{"type":"string","description":"The generated API key. Only fully displayed upon creation."},"error":{"type":"string","description":"Optional error message."}}}}}}
```

## The WhatsAppTemplateDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"WhatsAppTemplateDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the template."},"name":{"type":"string","description":"The name of the template."},"category":{"type":"string","description":"The category of the template (e.g., UTILITY, MARKETING)."},"rejectReason":{"type":"string","description":"The reason for rejection, if the template was rejected."},"created":{"type":"string","description":"Timestamp of when the template was created."},"updated":{"type":"string","description":"Timestamp of when the template was last updated."},"translations":{"type":"object","description":"An object containing translations for different languages.","additionalProperties":{"$ref":"#/components/schemas/WhatsAppTemplateTranslationsDto"}}},"required":["id","name","category","created","updated","translations"]},"WhatsAppTemplateTranslationsDto":{"type":"object","properties":{"bodyText":{"type":"string","description":"The body text of the translation."},"buttonType":{"type":"string","description":"The type of buttons."},"buttons":{"description":"The buttons attached to the template.","type":"array","items":{"$ref":"#/components/schemas/WhatsAppTemplateTranslationsButtonDto"}},"createdAt":{"type":"string","description":"Timestamp of creation."},"footerText":{"type":"string","description":"The text in the footer."},"headerMediaType":{"type":"string","description":"The media type of the header (e.g., \"TEXT\")."},"headerText":{"type":"string","description":"The text in the header."},"headerType":{"type":"string","description":"The type of the header."},"language":{"type":"string","description":"The language code (ISO 639-1)."},"rejectReason":{"type":"string","description":"The reason for rejection, if applicable."},"status":{"type":"string","description":"The status of the translation (e.g., \"APPROVED\")."},"templateId":{"type":"string","description":"The ID of the template at Meta."},"updatedAt":{"type":"string","description":"Timestamp of the last update."}},"required":["bodyText","buttons","createdAt","footerText","headerMediaType","headerText","headerType","language","rejectReason","status","templateId","updatedAt"]},"WhatsAppTemplateTranslationsButtonDto":{"type":"object","properties":{"type":{"type":"string","description":"The type of the button (e.g., QUICK_REPLY, URL, PHONE_NUMBER)."},"text":{"type":"string","description":"The display text of the button."},"url":{"type":"string","description":"The URL to open when the button is clicked (for URL type buttons)."},"phoneNumber":{"type":"string","description":"The phone number to call when the button is clicked (for PHONE_NUMBER type buttons)."}},"required":["type","text"]}}}}
```

## The WhatsAppTemplateResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"WhatsAppTemplateResponseDto":{"type":"object","properties":{"template":{"description":"The WhatsApp template.","allOf":[{"$ref":"#/components/schemas/WhatsAppTemplateDto"}]},"error":{"type":"string","description":"Optional error message."}}},"WhatsAppTemplateDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the template."},"name":{"type":"string","description":"The name of the template."},"category":{"type":"string","description":"The category of the template (e.g., UTILITY, MARKETING)."},"rejectReason":{"type":"string","description":"The reason for rejection, if the template was rejected."},"created":{"type":"string","description":"Timestamp of when the template was created."},"updated":{"type":"string","description":"Timestamp of when the template was last updated."},"translations":{"type":"object","description":"An object containing translations for different languages.","additionalProperties":{"$ref":"#/components/schemas/WhatsAppTemplateTranslationsDto"}}},"required":["id","name","category","created","updated","translations"]},"WhatsAppTemplateTranslationsDto":{"type":"object","properties":{"bodyText":{"type":"string","description":"The body text of the translation."},"buttonType":{"type":"string","description":"The type of buttons."},"buttons":{"description":"The buttons attached to the template.","type":"array","items":{"$ref":"#/components/schemas/WhatsAppTemplateTranslationsButtonDto"}},"createdAt":{"type":"string","description":"Timestamp of creation."},"footerText":{"type":"string","description":"The text in the footer."},"headerMediaType":{"type":"string","description":"The media type of the header (e.g., \"TEXT\")."},"headerText":{"type":"string","description":"The text in the header."},"headerType":{"type":"string","description":"The type of the header."},"language":{"type":"string","description":"The language code (ISO 639-1)."},"rejectReason":{"type":"string","description":"The reason for rejection, if applicable."},"status":{"type":"string","description":"The status of the translation (e.g., \"APPROVED\")."},"templateId":{"type":"string","description":"The ID of the template at Meta."},"updatedAt":{"type":"string","description":"Timestamp of the last update."}},"required":["bodyText","buttons","createdAt","footerText","headerMediaType","headerText","headerType","language","rejectReason","status","templateId","updatedAt"]},"WhatsAppTemplateTranslationsButtonDto":{"type":"object","properties":{"type":{"type":"string","description":"The type of the button (e.g., QUICK_REPLY, URL, PHONE_NUMBER)."},"text":{"type":"string","description":"The display text of the button."},"url":{"type":"string","description":"The URL to open when the button is clicked (for URL type buttons)."},"phoneNumber":{"type":"string","description":"The phone number to call when the button is clicked (for PHONE_NUMBER type buttons)."}},"required":["type","text"]}}}}
```

## The CreateWhatsAppTemplateRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateWhatsAppTemplateRequestDto":{"type":"object","properties":{"channelId":{"type":"string","description":"The ID of the channel for which the template is created."},"name":{"type":"string","description":"The name of the template."},"category":{"type":"string","description":"The category of the template (e.g., \"UTILITY\", \"MARKETING\")."},"translations":{"type":"object","description":"The template translations as key-value pairs (language code -> translation).","additionalProperties":{"$ref":"#/components/schemas/WhatsAppTemplateTranslationsCreateDto"}}},"required":["channelId","name","category","translations"]},"WhatsAppTemplateTranslationsCreateDto":{"type":"object","properties":{"bodyText":{"type":"string","description":"The body text of the template. Supports placeholders like {{1}}."},"buttons":{"description":"The buttons to attach to the template.","type":"array","items":{"$ref":"#/components/schemas/WhatsAppTemplateTranslationsButtonDto"}},"footerText":{"type":"string","description":"The text to display in the footer."},"headerText":{"type":"string","description":"The text to display in the header."},"headerType":{"type":"string","description":"The type of the header (e.g., TEXT, IMAGE, VIDEO, DOCUMENT)."},"language":{"type":"string","description":"The language code (ISO 639-1) for this translation."}},"required":["bodyText","buttons","footerText","headerText","headerType","language"]},"WhatsAppTemplateTranslationsButtonDto":{"type":"object","properties":{"type":{"type":"string","description":"The type of the button (e.g., QUICK_REPLY, URL, PHONE_NUMBER)."},"text":{"type":"string","description":"The display text of the button."},"url":{"type":"string","description":"The URL to open when the button is clicked (for URL type buttons)."},"phoneNumber":{"type":"string","description":"The phone number to call when the button is clicked (for PHONE_NUMBER type buttons)."}},"required":["type","text"]}}}}
```

## The AddChatbotUserRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"AddChatbotUserRequestDto":{"type":"object","properties":{"userId":{"type":"string","description":"The ID of the user to be added."}},"required":["userId"]}}}}
```

## The AddChatbotUserResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"AddChatbotUserResponseDto":{"type":"object","properties":{"added":{"type":"boolean","description":"Indicates whether the user was successfully added."},"error":{"type":"string","description":"Optional error message."}}}}}}
```

## The RemoveChatbotUserResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"RemoveChatbotUserResponseDto":{"type":"object","properties":{"removed":{"type":"boolean","description":"Indicates whether the user was successfully removed."},"error":{"type":"string","description":"Optional error message."}}}}}}
```

## The ChatbotUserDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ChatbotUserDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the user."},"name":{"type":"string","description":"The display name of the user."},"email":{"type":"string","description":"The email address of the user."},"added":{"type":"string","description":"Timestamp of when the user was added to the chatbot."},"roles":{"description":"The list of roles assigned to the user.","type":"array","items":{"type":"string"}}},"required":["id","name","email","added","roles"]}}}}
```

## The ListChatbotUsersResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListChatbotUsersResponseDto":{"type":"object","properties":{"users":{"description":"The list of users associated with the chatbot.","type":"array","items":{"$ref":"#/components/schemas/ChatbotUserDto"}},"error":{"type":"string","description":"Optional error message."}},"required":["users"]},"ChatbotUserDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the user."},"name":{"type":"string","description":"The display name of the user."},"email":{"type":"string","description":"The email address of the user."},"added":{"type":"string","description":"Timestamp of when the user was added to the chatbot."},"roles":{"description":"The list of roles assigned to the user.","type":"array","items":{"type":"string"}}},"required":["id","name","email","added","roles"]}}}}
```

## The GrantChatbotRoleRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"GrantChatbotRoleRequestDto":{"type":"object","properties":{"role":{"type":"string","description":"The role to be assigned.","enum":["ChatbotAdmin","ChatbotOwner","ChatbotEditor","ChatbotMember","InboxAdmin","InboxUser","ExternalInboxUser","StatisticsViewer"]},"params":{"type":"object","description":"Additional parameters for the role assignment.","additionalProperties":{"type":"string"}}},"required":["role","params"]}}}}
```

## The PermissionDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"PermissionDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the permission."},"resource":{"type":"string","description":"The resource ID the permission applies to, if scoped."}},"required":["name"]}}}}
```

## The GrantChatbotRoleResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"GrantChatbotRoleResponseDto":{"type":"object","properties":{"permissions":{"description":"The resulting list of permissions after the role assignment.","type":"array","items":{"$ref":"#/components/schemas/PermissionDto"}},"error":{"type":"string","description":"Optional error message."}},"required":["permissions"]},"PermissionDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the permission."},"resource":{"type":"string","description":"The resource ID the permission applies to, if scoped."}},"required":["name"]}}}}
```

## The RevokeChatbotRoleRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"RevokeChatbotRoleRequestDto":{"type":"object","properties":{"params":{"type":"object","description":"Additional parameters that must match those of the assignment.","additionalProperties":{"type":"string"}}},"required":["params"]}}}}
```

## The RevokeChatbotRoleResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"RevokeChatbotRoleResponseDto":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates whether the role was successfully revoked."},"error":{"type":"string","description":"Optional error message."}},"required":["success"]}}}}
```

## The CreateFaqRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateFaqRequestDto":{"type":"object","properties":{"name":{"type":"string","description":"The question or name of the new FAQ."}},"required":["name"]}}}}
```

## The FaqStepDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"FaqStepDto":{"type":"object","properties":{"stepId":{"type":"string","description":"The ID of the step to which the FAQ belongs."},"flowId":{"type":"string","description":"The ID of the flow to which the FAQ belongs."}},"required":["stepId","flowId"]}}}}
```

## The FaqDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"FaqDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the FAQ."},"created":{"type":"string","description":"The creation timestamp of the FAQ."},"updated":{"type":"string","description":"The last update timestamp of the FAQ."},"name":{"type":"string","description":"The question or name of the FAQ."},"intentId":{"type":"string","description":"The ID of the associated intent."},"stepId":{"type":"string","description":"The ID of the associated step."},"hasMessages":{"type":"boolean","description":"Indicates whether the associated step contains message elements."},"step":{"description":"The step and flow information for the FAQ.","allOf":[{"$ref":"#/components/schemas/FaqStepDto"}]}},"required":["id","created","updated","name","intentId","stepId","hasMessages","step"]},"FaqStepDto":{"type":"object","properties":{"stepId":{"type":"string","description":"The ID of the step to which the FAQ belongs."},"flowId":{"type":"string","description":"The ID of the flow to which the FAQ belongs."}},"required":["stepId","flowId"]}}}}
```

## The FaqResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"FaqResponseDto":{"type":"object","properties":{"faq":{"description":"The FAQ object.","allOf":[{"$ref":"#/components/schemas/FaqDto"}]},"error":{"type":"string","description":"Optional error message."}}},"FaqDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the FAQ."},"created":{"type":"string","description":"The creation timestamp of the FAQ."},"updated":{"type":"string","description":"The last update timestamp of the FAQ."},"name":{"type":"string","description":"The question or name of the FAQ."},"intentId":{"type":"string","description":"The ID of the associated intent."},"stepId":{"type":"string","description":"The ID of the associated step."},"hasMessages":{"type":"boolean","description":"Indicates whether the associated step contains message elements."},"step":{"description":"The step and flow information for the FAQ.","allOf":[{"$ref":"#/components/schemas/FaqStepDto"}]}},"required":["id","created","updated","name","intentId","stepId","hasMessages","step"]},"FaqStepDto":{"type":"object","properties":{"stepId":{"type":"string","description":"The ID of the step to which the FAQ belongs."},"flowId":{"type":"string","description":"The ID of the flow to which the FAQ belongs."}},"required":["stepId","flowId"]}}}}
```

## The ListFaqsResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListFaqsResponseDto":{"type":"object","properties":{"faqs":{"description":"A list of FAQs.","type":"array","items":{"$ref":"#/components/schemas/FaqDto"}},"error":{"type":"string","description":"Optional error message."}},"required":["faqs"]},"FaqDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the FAQ."},"created":{"type":"string","description":"The creation timestamp of the FAQ."},"updated":{"type":"string","description":"The last update timestamp of the FAQ."},"name":{"type":"string","description":"The question or name of the FAQ."},"intentId":{"type":"string","description":"The ID of the associated intent."},"stepId":{"type":"string","description":"The ID of the associated step."},"hasMessages":{"type":"boolean","description":"Indicates whether the associated step contains message elements."},"step":{"description":"The step and flow information for the FAQ.","allOf":[{"$ref":"#/components/schemas/FaqStepDto"}]}},"required":["id","created","updated","name","intentId","stepId","hasMessages","step"]},"FaqStepDto":{"type":"object","properties":{"stepId":{"type":"string","description":"The ID of the step to which the FAQ belongs."},"flowId":{"type":"string","description":"The ID of the flow to which the FAQ belongs."}},"required":["stepId","flowId"]}}}}
```

## The UpdateFaqRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateFaqRequestDto":{"type":"object","properties":{"name":{"type":"string","description":"The new name of the FAQ."}},"required":["name"]}}}}
```

## The DeleteFaqResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"DeleteFaqResponseDto":{"type":"object","properties":{"deleted":{"type":"boolean","description":"Indicates whether the deletion process was successful."},"error":{"type":"string","description":"Optional error message."}},"required":["deleted"]}}}}
```

## The ExampleEntityDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ExampleEntityDto":{"type":"object","properties":{"entityId":{"type":"string","description":"The Id of the entity."},"value":{"type":"string","description":"The value of the entitiy"},"start":{"type":"number","description":"The position on which the entity starts."},"end":{"type":"number","description":"The position on which the entity ends."}},"required":["entityId","value","start","end"]}}}}
```

## The ExampleStatus object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ExampleStatus":{"type":"number","enum":[0,1,2,3,-1],"description":"The status of the example.\n\n- `0`: PENDING\n- `1`: INDEXING\n- `2`: INDEXED\n- `3`: ERROR"}}}}
```

## The ExampleDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ExampleDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the example."},"text":{"type":"string","description":"The text of the example."},"created":{"type":"string","description":"The creation timestamp of the example."},"updated":{"type":"string","description":"The last update timestamp of the example."},"language":{"type":"string","description":"The language of the example."},"intentId":{"type":"string","description":"The ID of the intent this example belongs to."},"error":{"type":"boolean","description":"Indicates if there was an error with the example."},"predictionScore":{"type":"number","description":"The prediction score of the example."},"entityIds":{"description":"A list of entity IDs associated with this example.","type":"array","items":{"type":"string"}},"entities":{"description":"A list of entities found in this example.","type":"array","items":{"$ref":"#/components/schemas/ExampleEntityDto"}},"translatedExampleIds":{"description":"A list of IDs of translated examples.","type":"array","items":{"type":"string"}},"status":{"description":"The status of the example.\n\n- `0`: PENDING\n- `1`: INDEXING\n- `2`: INDEXED\n- `3`: ERROR","allOf":[{"$ref":"#/components/schemas/ExampleStatus"}]},"vector":{"description":"The vector representation of the example.","type":"array","items":{"type":"number"}},"conversationId":{"type":"string","description":"The ID of the conversation this example belongs to."}},"required":["id","text","created","updated","language","intentId","error","entityIds","entities","translatedExampleIds","status","vector"]},"ExampleEntityDto":{"type":"object","properties":{"entityId":{"type":"string","description":"The Id of the entity."},"value":{"type":"string","description":"The value of the entitiy"},"start":{"type":"number","description":"The position on which the entity starts."},"end":{"type":"number","description":"The position on which the entity ends."}},"required":["entityId","value","start","end"]},"ExampleStatus":{"type":"number","enum":[0,1,2,3,-1],"description":"The status of the example.\n\n- `0`: PENDING\n- `1`: INDEXING\n- `2`: INDEXED\n- `3`: ERROR"}}}}
```

## The ListExamplesResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListExamplesResponseDto":{"type":"object","properties":{"pageToken":{"type":"string","description":"The date of the latest fetched example."},"error":{"type":"string","description":"Optional error message."}},"required":["pageToken","examples"]}}}}
```

## The CreateExampleRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateExampleRequestDto":{"type":"object","properties":{"intentId":{"type":"string","description":"The ID of the Intent to which this example is assigned."},"text":{"type":"string","description":"The text of the training example."},"language":{"type":"string","description":"The language of the example."},"entityIds":{"description":"A list of entity Id's that are marked in this example.","default":[],"type":"array","items":{"type":"string"}},"entities":{"description":"The entities marked in this example.","default":[],"type":"array","items":{"$ref":"#/components/schemas/ExampleEntityDto"}},"translate":{"type":"boolean","description":"Indicates whether the example should be translated into other languages."},"conversationId":{"type":"string","description":"Optional ID of the conversation from which the example originated."}},"required":["intentId","text","entityIds","entities"]},"ExampleEntityDto":{"type":"object","properties":{"entityId":{"type":"string","description":"The Id of the entity."},"value":{"type":"string","description":"The value of the entitiy"},"start":{"type":"number","description":"The position on which the entity starts."},"end":{"type":"number","description":"The position on which the entity ends."}},"required":["entityId","value","start","end"]}}}}
```

## The ExampleResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ExampleResponseDto":{"type":"object","properties":{"error":{"type":"string","description":"Optional error message."}},"required":["example"]}}}}
```

## The UpdateExampleRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateExampleRequestDto":{"type":"object","properties":{"text":{"type":"string","description":"The updated text of the training example."},"entityIds":{"default":[],"type":"array","items":{"type":"string"}},"entities":{"default":[],"type":"array","items":{"$ref":"#/components/schemas/ExampleEntityDto"}},"status":{"description":"Sets the indexing status of the example.\n\n- `0`: EXAMPLE_STATUS_PENDING\n- `1`: EXAMPLE_STATUS_INDEXING\n- `2`: EXAMPLE_STATUS_INDEXED\n- `3`: EXAMPLE_STATUS_ERROR","allOf":[{"$ref":"#/components/schemas/ExampleStatus"}]},"vector":{"description":"The manually set vector for this example.","default":[],"type":"array","items":{"type":"number"}}},"required":["text","entityIds","entities","vector"]},"ExampleEntityDto":{"type":"object","properties":{"entityId":{"type":"string","description":"The Id of the entity."},"value":{"type":"string","description":"The value of the entitiy"},"start":{"type":"number","description":"The position on which the entity starts."},"end":{"type":"number","description":"The position on which the entity ends."}},"required":["entityId","value","start","end"]},"ExampleStatus":{"type":"number","enum":[0,1,2,3,-1],"description":"The status of the example.\n\n- `0`: PENDING\n- `1`: INDEXING\n- `2`: INDEXED\n- `3`: ERROR"}}}}
```

## The DeleteExampleResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"DeleteExampleResponseDto":{"type":"object","properties":{"deleted":{"type":"boolean","description":"Indicates whether the deletion was successful."},"error":{"type":"string","description":"Optional error message."}},"required":["deleted"]}}}}
```

## The ActorDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ActorDto":{"type":"object","properties":{"type":{"type":"string","description":"The type of the actor."},"flowId":{"type":"string","description":"The ID of the flow that the trigger step resides in."},"stepId":{"type":"string","description":"The ID of the step that is triggered by the intent."}},"required":["type","flowId","stepId"]}}}}
```

## The IntentDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"IntentDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the intent."},"name":{"type":"string","description":"The name of the intent."},"created":{"type":"string","description":"The creation timestamp of the intent."},"updated":{"type":"string","description":"The last update timestamp of the intent."},"confidenceScore":{"type":"number","minimum":0,"maximum":1,"description":"The minimum confidence score (0.0-1.0) required for this intent to be triggered."},"state":{"type":"string","description":"The training status of the intent."},"trainingRequired":{"type":"boolean","description":"Indicates whether retraining is required after changes."},"actor":{"description":"Defines which action (e.g., which flow) is executed when the intent is recognized.","allOf":[{"$ref":"#/components/schemas/ActorDto"}]}},"required":["name","created","updated","confidenceScore","state","trainingRequired","actor"]},"ActorDto":{"type":"object","properties":{"type":{"type":"string","description":"The type of the actor."},"flowId":{"type":"string","description":"The ID of the flow that the trigger step resides in."},"stepId":{"type":"string","description":"The ID of the step that is triggered by the intent."}},"required":["type","flowId","stepId"]}}}}
```

## The ListIntentsResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListIntentsResponseDto":{"type":"object","properties":{"intents":{"description":"A list of intents.","type":"array","items":{"$ref":"#/components/schemas/IntentDto"}},"error":{"type":"string","description":"Optional error message."}},"required":["intents"]},"IntentDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the intent."},"name":{"type":"string","description":"The name of the intent."},"created":{"type":"string","description":"The creation timestamp of the intent."},"updated":{"type":"string","description":"The last update timestamp of the intent."},"confidenceScore":{"type":"number","minimum":0,"maximum":1,"description":"The minimum confidence score (0.0-1.0) required for this intent to be triggered."},"state":{"type":"string","description":"The training status of the intent."},"trainingRequired":{"type":"boolean","description":"Indicates whether retraining is required after changes."},"actor":{"description":"Defines which action (e.g., which flow) is executed when the intent is recognized.","allOf":[{"$ref":"#/components/schemas/ActorDto"}]}},"required":["name","created","updated","confidenceScore","state","trainingRequired","actor"]},"ActorDto":{"type":"object","properties":{"type":{"type":"string","description":"The type of the actor."},"flowId":{"type":"string","description":"The ID of the flow that the trigger step resides in."},"stepId":{"type":"string","description":"The ID of the step that is triggered by the intent."}},"required":["type","flowId","stepId"]}}}}
```

## The IntentResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"IntentResponseDto":{"type":"object","properties":{"intent":{"description":"The intent object.","allOf":[{"$ref":"#/components/schemas/IntentDto"}]},"error":{"type":"string","description":"Optional error message."}}},"IntentDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the intent."},"name":{"type":"string","description":"The name of the intent."},"created":{"type":"string","description":"The creation timestamp of the intent."},"updated":{"type":"string","description":"The last update timestamp of the intent."},"confidenceScore":{"type":"number","minimum":0,"maximum":1,"description":"The minimum confidence score (0.0-1.0) required for this intent to be triggered."},"state":{"type":"string","description":"The training status of the intent."},"trainingRequired":{"type":"boolean","description":"Indicates whether retraining is required after changes."},"actor":{"description":"Defines which action (e.g., which flow) is executed when the intent is recognized.","allOf":[{"$ref":"#/components/schemas/ActorDto"}]}},"required":["name","created","updated","confidenceScore","state","trainingRequired","actor"]},"ActorDto":{"type":"object","properties":{"type":{"type":"string","description":"The type of the actor."},"flowId":{"type":"string","description":"The ID of the flow that the trigger step resides in."},"stepId":{"type":"string","description":"The ID of the step that is triggered by the intent."}},"required":["type","flowId","stepId"]}}}}
```

## The CreateIntentRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateIntentRequestDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the new intent."},"confidenceScore":{"type":"number","minimum":0,"maximum":1,"description":"The required minimum confidence score (0.0-1.0)."},"actor":{"description":"The action to be executed.","nullable":true,"allOf":[{"$ref":"#/components/schemas/ActorDto"}]}},"required":["name","confidenceScore","actor"]},"ActorDto":{"type":"object","properties":{"type":{"type":"string","description":"The type of the actor."},"flowId":{"type":"string","description":"The ID of the flow that the trigger step resides in."},"stepId":{"type":"string","description":"The ID of the step that is triggered by the intent."}},"required":["type","flowId","stepId"]}}}}
```

## The UpdateIntentRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateIntentRequestDto":{"type":"object","properties":{"name":{"type":"string","description":"The new name for the intent."},"confidenceScore":{"type":"number","minimum":0,"maximum":1,"description":"The new confidence score for the intent."},"trainingRequired":{"type":"boolean","description":"Whether the intent requires training."},"actor":{"description":"The new actor for the intent.","allOf":[{"$ref":"#/components/schemas/ActorDto"}]}}},"ActorDto":{"type":"object","properties":{"type":{"type":"string","description":"The type of the actor."},"flowId":{"type":"string","description":"The ID of the flow that the trigger step resides in."},"stepId":{"type":"string","description":"The ID of the step that is triggered by the intent."}},"required":["type","flowId","stepId"]}}}}
```

## The DeleteIntentResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"DeleteIntentResponseDto":{"type":"object","properties":{"deleted":{"type":"boolean","description":"Indicates whether the deletion was successful."},"error":{"type":"string","description":"Optional error message."}},"required":["deleted"]}}}}
```

## The TriggerActorDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"TriggerActorDto":{"type":"object","properties":{"flowId":{"type":"string","description":"The ID of the Flow that the step resides in."},"stepId":{"type":"string","description":"The ID of the step that is triggered."}},"required":["flowId","stepId"]}}}}
```

## The TriggerDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"TriggerDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the trigger."},"created":{"type":"string","description":"Creation timestamp (ISO format)."},"updated":{"type":"string","description":"Last updated timestamp (ISO format)."},"event":{"type":"string","description":"The event that triggers the action."},"payload":{"type":"string","description":"An optional payload required for triggering the event."},"actor":{"description":"Defines which action (e.g., which Flow) will be executed.","allOf":[{"$ref":"#/components/schemas/TriggerActorDto"}]}},"required":["id","created","updated","event","actor"]},"TriggerActorDto":{"type":"object","properties":{"flowId":{"type":"string","description":"The ID of the Flow that the step resides in."},"stepId":{"type":"string","description":"The ID of the step that is triggered."}},"required":["flowId","stepId"]}}}}
```

## The ListTriggersResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListTriggersResponseDto":{"type":"object","properties":{"triggers":{"description":"A list of triggers for the chatbot.","type":"array","items":{"$ref":"#/components/schemas/TriggerDto"}},"error":{"type":"string","description":"Optional error message."}},"required":["triggers"]},"TriggerDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the trigger."},"created":{"type":"string","description":"Creation timestamp (ISO format)."},"updated":{"type":"string","description":"Last updated timestamp (ISO format)."},"event":{"type":"string","description":"The event that triggers the action."},"payload":{"type":"string","description":"An optional payload required for triggering the event."},"actor":{"description":"Defines which action (e.g., which Flow) will be executed.","allOf":[{"$ref":"#/components/schemas/TriggerActorDto"}]}},"required":["id","created","updated","event","actor"]},"TriggerActorDto":{"type":"object","properties":{"flowId":{"type":"string","description":"The ID of the Flow that the step resides in."},"stepId":{"type":"string","description":"The ID of the step that is triggered."}},"required":["flowId","stepId"]}}}}
```

## The StepGridDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepGridDto":{"type":"object","properties":{"x":{"type":"number","description":"X-coordinate in the flow editor."},"y":{"type":"number","description":"Y-coordinate in the flow editor."}},"required":["x","y"]}}}}
```

## The StepElementContentTextDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepElementContentTextDto":{"type":"object","properties":{"text":{"type":"object","description":"The text content, localized by language key.","additionalProperties":{"type":"string"}}},"required":["text"]}}}}
```

## The StepElementContentButtonButtonDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepElementContentButtonButtonDto":{"type":"object","properties":{"text":{"type":"object","description":"The text displayed on the button, localized.","additionalProperties":{"type":"string"}},"value":{"type":"string","description":"The value associated with the button."},"type":{"type":"string","description":"The type of button (e.g., 'redirect', 'postback')."},"payload":{"type":"string","description":"An optional payload for postback buttons."}},"required":["text","value","type"]}}}}
```

## The StepElementContentButtonDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepElementContentButtonDto":{"type":"object","properties":{"buttons":{"description":"A list of buttons to display.","type":"array","items":{"$ref":"#/components/schemas/StepElementContentButtonButtonDto"}}},"required":["buttons"]},"StepElementContentButtonButtonDto":{"type":"object","properties":{"text":{"type":"object","description":"The text displayed on the button, localized.","additionalProperties":{"type":"string"}},"value":{"type":"string","description":"The value associated with the button."},"type":{"type":"string","description":"The type of button (e.g., 'redirect', 'postback')."},"payload":{"type":"string","description":"An optional payload for postback buttons."}},"required":["text","value","type"]}}}}
```

## The StepElementContentFileDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepElementContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the file."},"bucketId":{"type":"string","description":"The ID of the bucket where the file is stored."},"objectId":{"type":"string","description":"The object ID of the file within the bucket."},"mimeType":{"type":"string","description":"The MIME type of the file."},"sizeInByte":{"type":"number","description":"The size of the file in bytes."},"fbaId":{"type":"string","description":"Facebook attachment ID (optional)."},"waaId":{"type":"string","description":"WhatsApp attachment ID (optional)."}},"required":["name","bucketId","objectId","mimeType","sizeInByte"]}}}}
```

## The StepElementContentVoiceHangupDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepElementContentVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for hanging up the voice call."},"headers":{"type":"object","description":"Custom headers to send with the hangup event.","additionalProperties":{"type":"string"}}},"required":["reason","headers"]}}}}
```

## The StepElementContentVoiceTransferDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepElementContentVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string","description":"The target for the voice transfer (e.g., a phone number)."},"reason":{"type":"string","description":"An optional reason for the voice transfer."},"headers":{"type":"object","description":"Custom headers to send with the voice transfer.","additionalProperties":{"type":"string"}}},"required":["target","headers"]}}}}
```

## The StepElementContentAgentHandoverDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepElementContentAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string","description":"An optional reason for the agent handover."},"timeoutSeconds":{"type":"number","description":"Timeout in seconds for the agent to accept the handover."},"agentId":{"type":"string","description":"The ID of the specific agent to hand over to."},"groupId":{"type":"string","description":"The ID of the agent group to hand over to."},"assignmentMethod":{"type":"string","description":"The method used for assigning the agent."}}}}}}
```

## The StepElementContentAssignVariableDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepElementContentAssignVariableDto":{"type":"object","properties":{"variableId":{"type":"string","description":"The ID of the variable to assign a value to."},"path":{"type":"string","description":"Optional JSON path within the variable to assign the value."},"value":{"type":"string","description":"The value to assign to the variable."}},"required":["variableId"]}}}}
```

## The StepElementContentUpdateTagsDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepElementContentUpdateTagsDto":{"type":"object","properties":{"method":{"type":"string","description":"The method to update tags ('add' or 'remove').","enum":["add","remove"]},"tagId":{"type":"string","description":"The ID of the tag to add or remove."}},"required":["method","tagId"]}}}}
```

## The StepElementContentSnoozeDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepElementContentSnoozeDto":{"type":"object","properties":{"seconds":{"type":"number","description":"The duration in seconds to snooze the conversation."}},"required":["seconds"]}}}}
```

## The StepElementContentUnreadDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepElementContentUnreadDto":{"type":"object","properties":{"unread":{"type":"boolean","description":"Whether to mark the conversation as unread."}},"required":["unread"]}}}}
```

## The StepElementContentWhatsAppTemplateDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepElementContentWhatsAppTemplateDto":{"type":"object","properties":{"templateId":{"type":"string","description":"The ID of the WhatsApp template to send."},"parameters":{"type":"object","description":"Parameters to populate the WhatsApp template.","additionalProperties":{"type":"string"}}},"required":["templateId","parameters"]}}}}
```

## The StepElementContentTextToSpeechDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepElementContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"object","description":"The text content for text-to-speech, localized.","additionalProperties":{"type":"string"}},"speech":{"type":"string","description":"Optional SSML speech markup."}},"required":["text"]}}}}
```

## The StepElementContentCallSettingsDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepElementContentCallSettingsDto":{"type":"object","properties":{"userInputSpeechDetectionTimeout":{"type":"number","description":"Timeout for user speech detection in milliseconds."},"dtmf":{"type":"boolean","description":"Whether DTMF (Dual-tone multi-frequency) input is enabled."},"bargeIn":{"type":"boolean","description":"Whether barge-in is enabled (user can interrupt bot)."}}}}}}
```

## The StepElementContentMetaWhatsAppTemplateHeaderDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepElementContentMetaWhatsAppTemplateHeaderDto":{"type":"object","properties":{"file":{"description":"The file used in the template header.","allOf":[{"$ref":"#/components/schemas/StepElementContentFileDto"}]},"parameters":{"description":"Parameters for the header text.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"StepElementContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the file."},"bucketId":{"type":"string","description":"The ID of the bucket where the file is stored."},"objectId":{"type":"string","description":"The object ID of the file within the bucket."},"mimeType":{"type":"string","description":"The MIME type of the file."},"sizeInByte":{"type":"number","description":"The size of the file in bytes."},"fbaId":{"type":"string","description":"Facebook attachment ID (optional)."},"waaId":{"type":"string","description":"WhatsApp attachment ID (optional)."}},"required":["name","bucketId","objectId","mimeType","sizeInByte"]}}}}
```

## The StepElementContentMetaWhatsAppTemplateButtonsDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepElementContentMetaWhatsAppTemplateButtonsDto":{"type":"object","properties":{"values":{"description":"Values for the buttons in the template.","type":"array","items":{"type":"string"}}},"required":["values"]}}}}
```

## The StepElementContentMetaWhatsAppTemplateDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepElementContentMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the Meta WhatsApp template."},"templateId":{"type":"string","description":"The ID of the Meta WhatsApp template."},"header":{"description":"Header configuration for the Meta WhatsApp template.","allOf":[{"$ref":"#/components/schemas/StepElementContentMetaWhatsAppTemplateHeaderDto"}]},"bodyParameters":{"description":"Parameters for the body of the Meta WhatsApp template.","type":"array","items":{"type":"string"}},"buttons":{"description":"Button configurations for the Meta WhatsApp template.","allOf":[{"$ref":"#/components/schemas/StepElementContentMetaWhatsAppTemplateButtonsDto"}]}},"required":["templateName","templateId","bodyParameters"]},"StepElementContentMetaWhatsAppTemplateHeaderDto":{"type":"object","properties":{"file":{"description":"The file used in the template header.","allOf":[{"$ref":"#/components/schemas/StepElementContentFileDto"}]},"parameters":{"description":"Parameters for the header text.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"StepElementContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the file."},"bucketId":{"type":"string","description":"The ID of the bucket where the file is stored."},"objectId":{"type":"string","description":"The object ID of the file within the bucket."},"mimeType":{"type":"string","description":"The MIME type of the file."},"sizeInByte":{"type":"number","description":"The size of the file in bytes."},"fbaId":{"type":"string","description":"Facebook attachment ID (optional)."},"waaId":{"type":"string","description":"WhatsApp attachment ID (optional)."}},"required":["name","bucketId","objectId","mimeType","sizeInByte"]},"StepElementContentMetaWhatsAppTemplateButtonsDto":{"type":"object","properties":{"values":{"description":"Values for the buttons in the template.","type":"array","items":{"type":"string"}}},"required":["values"]}}}}
```

## The StepElementContentNoteDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepElementContentNoteDto":{"type":"object","properties":{"note":{"type":"string","description":"A private note for internal use."}},"required":["note"]}}}}
```

## The StepElementContentChatEnd\_ConversationStatus object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepElementContentChatEnd_ConversationStatus":{"type":"number","enum":[0,1,2,3,-1],"description":"The status to set for the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED"}}}}
```

## The StepElementContentChatEndDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepElementContentChatEndDto":{"type":"object","properties":{"status":{"description":"The status to set for the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED","allOf":[{"$ref":"#/components/schemas/StepElementContentChatEnd_ConversationStatus"}]}},"required":["status"]},"StepElementContentChatEnd_ConversationStatus":{"type":"number","enum":[0,1,2,3,-1],"description":"The status to set for the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED"}}}}
```

## The StepElementContentAssignTeamDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepElementContentAssignTeamDto":{"type":"object","properties":{"teamId":{"type":"string","description":"The ID of the team to assign the conversation to."}},"required":["teamId"]}}}}
```

## The StepElementContentAssignOperatorDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepElementContentAssignOperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The ID of the operator to assign the conversation to."},"assignToLastAssigned":{"type":"boolean","description":"Whether to assign to the last assigned operator."}},"required":["assignToLastAssigned"]}}}}
```

## The StepElementContentDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepElementContentDto":{"type":"object","properties":{"text":{"description":"Text content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentTextDto"}]},"buttons":{"description":"Button content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentButtonDto"}]},"file":{"description":"File content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentFileDto"}]},"voiceHangup":{"description":"Voice hangup action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentVoiceHangupDto"}]},"voiceTransfer":{"description":"Voice transfer action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentVoiceTransferDto"}]},"agentHandover":{"description":"Agent handover action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentAgentHandoverDto"}]},"assignVariable":{"description":"Assign variable action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentAssignVariableDto"}]},"updateTags":{"description":"Update tags action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentUpdateTagsDto"}]},"snooze":{"description":"Snooze action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentSnoozeDto"}]},"unread":{"description":"Unread action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentUnreadDto"}]},"whatsappTemplate":{"description":"WhatsApp template content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentWhatsAppTemplateDto"}]},"textToSpeech":{"description":"Text-to-speech content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentTextToSpeechDto"}]},"callSettings":{"description":"Call settings for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentCallSettingsDto"}]},"metaWhatsappTemplate":{"description":"Meta WhatsApp template content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentMetaWhatsAppTemplateDto"}]},"note":{"description":"Note content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentNoteDto"}]},"chatEnd":{"description":"Chat end action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentChatEndDto"}]},"assignTeam":{"description":"Assign team action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentAssignTeamDto"}]},"assignOperator":{"description":"Assign operator action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentAssignOperatorDto"}]}}},"StepElementContentTextDto":{"type":"object","properties":{"text":{"type":"object","description":"The text content, localized by language key.","additionalProperties":{"type":"string"}}},"required":["text"]},"StepElementContentButtonDto":{"type":"object","properties":{"buttons":{"description":"A list of buttons to display.","type":"array","items":{"$ref":"#/components/schemas/StepElementContentButtonButtonDto"}}},"required":["buttons"]},"StepElementContentButtonButtonDto":{"type":"object","properties":{"text":{"type":"object","description":"The text displayed on the button, localized.","additionalProperties":{"type":"string"}},"value":{"type":"string","description":"The value associated with the button."},"type":{"type":"string","description":"The type of button (e.g., 'redirect', 'postback')."},"payload":{"type":"string","description":"An optional payload for postback buttons."}},"required":["text","value","type"]},"StepElementContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the file."},"bucketId":{"type":"string","description":"The ID of the bucket where the file is stored."},"objectId":{"type":"string","description":"The object ID of the file within the bucket."},"mimeType":{"type":"string","description":"The MIME type of the file."},"sizeInByte":{"type":"number","description":"The size of the file in bytes."},"fbaId":{"type":"string","description":"Facebook attachment ID (optional)."},"waaId":{"type":"string","description":"WhatsApp attachment ID (optional)."}},"required":["name","bucketId","objectId","mimeType","sizeInByte"]},"StepElementContentVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for hanging up the voice call."},"headers":{"type":"object","description":"Custom headers to send with the hangup event.","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"StepElementContentVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string","description":"The target for the voice transfer (e.g., a phone number)."},"reason":{"type":"string","description":"An optional reason for the voice transfer."},"headers":{"type":"object","description":"Custom headers to send with the voice transfer.","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"StepElementContentAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string","description":"An optional reason for the agent handover."},"timeoutSeconds":{"type":"number","description":"Timeout in seconds for the agent to accept the handover."},"agentId":{"type":"string","description":"The ID of the specific agent to hand over to."},"groupId":{"type":"string","description":"The ID of the agent group to hand over to."},"assignmentMethod":{"type":"string","description":"The method used for assigning the agent."}}},"StepElementContentAssignVariableDto":{"type":"object","properties":{"variableId":{"type":"string","description":"The ID of the variable to assign a value to."},"path":{"type":"string","description":"Optional JSON path within the variable to assign the value."},"value":{"type":"string","description":"The value to assign to the variable."}},"required":["variableId"]},"StepElementContentUpdateTagsDto":{"type":"object","properties":{"method":{"type":"string","description":"The method to update tags ('add' or 'remove').","enum":["add","remove"]},"tagId":{"type":"string","description":"The ID of the tag to add or remove."}},"required":["method","tagId"]},"StepElementContentSnoozeDto":{"type":"object","properties":{"seconds":{"type":"number","description":"The duration in seconds to snooze the conversation."}},"required":["seconds"]},"StepElementContentUnreadDto":{"type":"object","properties":{"unread":{"type":"boolean","description":"Whether to mark the conversation as unread."}},"required":["unread"]},"StepElementContentWhatsAppTemplateDto":{"type":"object","properties":{"templateId":{"type":"string","description":"The ID of the WhatsApp template to send."},"parameters":{"type":"object","description":"Parameters to populate the WhatsApp template.","additionalProperties":{"type":"string"}}},"required":["templateId","parameters"]},"StepElementContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"object","description":"The text content for text-to-speech, localized.","additionalProperties":{"type":"string"}},"speech":{"type":"string","description":"Optional SSML speech markup."}},"required":["text"]},"StepElementContentCallSettingsDto":{"type":"object","properties":{"userInputSpeechDetectionTimeout":{"type":"number","description":"Timeout for user speech detection in milliseconds."},"dtmf":{"type":"boolean","description":"Whether DTMF (Dual-tone multi-frequency) input is enabled."},"bargeIn":{"type":"boolean","description":"Whether barge-in is enabled (user can interrupt bot)."}}},"StepElementContentMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the Meta WhatsApp template."},"templateId":{"type":"string","description":"The ID of the Meta WhatsApp template."},"header":{"description":"Header configuration for the Meta WhatsApp template.","allOf":[{"$ref":"#/components/schemas/StepElementContentMetaWhatsAppTemplateHeaderDto"}]},"bodyParameters":{"description":"Parameters for the body of the Meta WhatsApp template.","type":"array","items":{"type":"string"}},"buttons":{"description":"Button configurations for the Meta WhatsApp template.","allOf":[{"$ref":"#/components/schemas/StepElementContentMetaWhatsAppTemplateButtonsDto"}]}},"required":["templateName","templateId","bodyParameters"]},"StepElementContentMetaWhatsAppTemplateHeaderDto":{"type":"object","properties":{"file":{"description":"The file used in the template header.","allOf":[{"$ref":"#/components/schemas/StepElementContentFileDto"}]},"parameters":{"description":"Parameters for the header text.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"StepElementContentMetaWhatsAppTemplateButtonsDto":{"type":"object","properties":{"values":{"description":"Values for the buttons in the template.","type":"array","items":{"type":"string"}}},"required":["values"]},"StepElementContentNoteDto":{"type":"object","properties":{"note":{"type":"string","description":"A private note for internal use."}},"required":["note"]},"StepElementContentChatEndDto":{"type":"object","properties":{"status":{"description":"The status to set for the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED","allOf":[{"$ref":"#/components/schemas/StepElementContentChatEnd_ConversationStatus"}]}},"required":["status"]},"StepElementContentChatEnd_ConversationStatus":{"type":"number","enum":[0,1,2,3,-1],"description":"The status to set for the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED"},"StepElementContentAssignTeamDto":{"type":"object","properties":{"teamId":{"type":"string","description":"The ID of the team to assign the conversation to."}},"required":["teamId"]},"StepElementContentAssignOperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The ID of the operator to assign the conversation to."},"assignToLastAssigned":{"type":"boolean","description":"Whether to assign to the last assigned operator."}},"required":["assignToLastAssigned"]}}}}
```

## The StepElementDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepElementDto":{"type":"object","properties":{"type":{"type":"string","description":"The type of the step element (e.g., 'text', 'buttons')."},"content":{"description":"The content of the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentDto"}]}},"required":["type","content"]},"StepElementContentDto":{"type":"object","properties":{"text":{"description":"Text content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentTextDto"}]},"buttons":{"description":"Button content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentButtonDto"}]},"file":{"description":"File content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentFileDto"}]},"voiceHangup":{"description":"Voice hangup action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentVoiceHangupDto"}]},"voiceTransfer":{"description":"Voice transfer action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentVoiceTransferDto"}]},"agentHandover":{"description":"Agent handover action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentAgentHandoverDto"}]},"assignVariable":{"description":"Assign variable action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentAssignVariableDto"}]},"updateTags":{"description":"Update tags action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentUpdateTagsDto"}]},"snooze":{"description":"Snooze action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentSnoozeDto"}]},"unread":{"description":"Unread action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentUnreadDto"}]},"whatsappTemplate":{"description":"WhatsApp template content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentWhatsAppTemplateDto"}]},"textToSpeech":{"description":"Text-to-speech content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentTextToSpeechDto"}]},"callSettings":{"description":"Call settings for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentCallSettingsDto"}]},"metaWhatsappTemplate":{"description":"Meta WhatsApp template content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentMetaWhatsAppTemplateDto"}]},"note":{"description":"Note content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentNoteDto"}]},"chatEnd":{"description":"Chat end action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentChatEndDto"}]},"assignTeam":{"description":"Assign team action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentAssignTeamDto"}]},"assignOperator":{"description":"Assign operator action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentAssignOperatorDto"}]}}},"StepElementContentTextDto":{"type":"object","properties":{"text":{"type":"object","description":"The text content, localized by language key.","additionalProperties":{"type":"string"}}},"required":["text"]},"StepElementContentButtonDto":{"type":"object","properties":{"buttons":{"description":"A list of buttons to display.","type":"array","items":{"$ref":"#/components/schemas/StepElementContentButtonButtonDto"}}},"required":["buttons"]},"StepElementContentButtonButtonDto":{"type":"object","properties":{"text":{"type":"object","description":"The text displayed on the button, localized.","additionalProperties":{"type":"string"}},"value":{"type":"string","description":"The value associated with the button."},"type":{"type":"string","description":"The type of button (e.g., 'redirect', 'postback')."},"payload":{"type":"string","description":"An optional payload for postback buttons."}},"required":["text","value","type"]},"StepElementContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the file."},"bucketId":{"type":"string","description":"The ID of the bucket where the file is stored."},"objectId":{"type":"string","description":"The object ID of the file within the bucket."},"mimeType":{"type":"string","description":"The MIME type of the file."},"sizeInByte":{"type":"number","description":"The size of the file in bytes."},"fbaId":{"type":"string","description":"Facebook attachment ID (optional)."},"waaId":{"type":"string","description":"WhatsApp attachment ID (optional)."}},"required":["name","bucketId","objectId","mimeType","sizeInByte"]},"StepElementContentVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for hanging up the voice call."},"headers":{"type":"object","description":"Custom headers to send with the hangup event.","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"StepElementContentVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string","description":"The target for the voice transfer (e.g., a phone number)."},"reason":{"type":"string","description":"An optional reason for the voice transfer."},"headers":{"type":"object","description":"Custom headers to send with the voice transfer.","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"StepElementContentAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string","description":"An optional reason for the agent handover."},"timeoutSeconds":{"type":"number","description":"Timeout in seconds for the agent to accept the handover."},"agentId":{"type":"string","description":"The ID of the specific agent to hand over to."},"groupId":{"type":"string","description":"The ID of the agent group to hand over to."},"assignmentMethod":{"type":"string","description":"The method used for assigning the agent."}}},"StepElementContentAssignVariableDto":{"type":"object","properties":{"variableId":{"type":"string","description":"The ID of the variable to assign a value to."},"path":{"type":"string","description":"Optional JSON path within the variable to assign the value."},"value":{"type":"string","description":"The value to assign to the variable."}},"required":["variableId"]},"StepElementContentUpdateTagsDto":{"type":"object","properties":{"method":{"type":"string","description":"The method to update tags ('add' or 'remove').","enum":["add","remove"]},"tagId":{"type":"string","description":"The ID of the tag to add or remove."}},"required":["method","tagId"]},"StepElementContentSnoozeDto":{"type":"object","properties":{"seconds":{"type":"number","description":"The duration in seconds to snooze the conversation."}},"required":["seconds"]},"StepElementContentUnreadDto":{"type":"object","properties":{"unread":{"type":"boolean","description":"Whether to mark the conversation as unread."}},"required":["unread"]},"StepElementContentWhatsAppTemplateDto":{"type":"object","properties":{"templateId":{"type":"string","description":"The ID of the WhatsApp template to send."},"parameters":{"type":"object","description":"Parameters to populate the WhatsApp template.","additionalProperties":{"type":"string"}}},"required":["templateId","parameters"]},"StepElementContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"object","description":"The text content for text-to-speech, localized.","additionalProperties":{"type":"string"}},"speech":{"type":"string","description":"Optional SSML speech markup."}},"required":["text"]},"StepElementContentCallSettingsDto":{"type":"object","properties":{"userInputSpeechDetectionTimeout":{"type":"number","description":"Timeout for user speech detection in milliseconds."},"dtmf":{"type":"boolean","description":"Whether DTMF (Dual-tone multi-frequency) input is enabled."},"bargeIn":{"type":"boolean","description":"Whether barge-in is enabled (user can interrupt bot)."}}},"StepElementContentMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the Meta WhatsApp template."},"templateId":{"type":"string","description":"The ID of the Meta WhatsApp template."},"header":{"description":"Header configuration for the Meta WhatsApp template.","allOf":[{"$ref":"#/components/schemas/StepElementContentMetaWhatsAppTemplateHeaderDto"}]},"bodyParameters":{"description":"Parameters for the body of the Meta WhatsApp template.","type":"array","items":{"type":"string"}},"buttons":{"description":"Button configurations for the Meta WhatsApp template.","allOf":[{"$ref":"#/components/schemas/StepElementContentMetaWhatsAppTemplateButtonsDto"}]}},"required":["templateName","templateId","bodyParameters"]},"StepElementContentMetaWhatsAppTemplateHeaderDto":{"type":"object","properties":{"file":{"description":"The file used in the template header.","allOf":[{"$ref":"#/components/schemas/StepElementContentFileDto"}]},"parameters":{"description":"Parameters for the header text.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"StepElementContentMetaWhatsAppTemplateButtonsDto":{"type":"object","properties":{"values":{"description":"Values for the buttons in the template.","type":"array","items":{"type":"string"}}},"required":["values"]},"StepElementContentNoteDto":{"type":"object","properties":{"note":{"type":"string","description":"A private note for internal use."}},"required":["note"]},"StepElementContentChatEndDto":{"type":"object","properties":{"status":{"description":"The status to set for the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED","allOf":[{"$ref":"#/components/schemas/StepElementContentChatEnd_ConversationStatus"}]}},"required":["status"]},"StepElementContentChatEnd_ConversationStatus":{"type":"number","enum":[0,1,2,3,-1],"description":"The status to set for the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED"},"StepElementContentAssignTeamDto":{"type":"object","properties":{"teamId":{"type":"string","description":"The ID of the team to assign the conversation to."}},"required":["teamId"]},"StepElementContentAssignOperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The ID of the operator to assign the conversation to."},"assignToLastAssigned":{"type":"boolean","description":"Whether to assign to the last assigned operator."}},"required":["assignToLastAssigned"]}}}}
```

## The StepIntentDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepIntentDto":{"type":"object","properties":{"intentId":{"type":"string","description":"The ID of the associated intent."}},"required":["intentId"]}}}}
```

## The StepDelayDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepDelayDto":{"type":"object","properties":{"seconds":{"type":"number","description":"The waiting time in seconds."}},"required":["seconds"]}}}}
```

## The StepSplitRedirectsDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepSplitRedirectsDto":{"type":"object","properties":{"a":{"type":"string","description":"The step ID for redirect A."},"b":{"type":"string","description":"The step ID for redirect B."}},"required":["a","b"]}}}}
```

## The StepSplitDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepSplitDto":{"type":"object","properties":{"a":{"type":"number","description":"Percentage for exit A."},"b":{"type":"number","description":"Percentage for exit B."},"sameRedirect":{"type":"boolean","description":"Indicates whether both exits should lead to the same destination."},"redirects":{"description":"The redirect configurations for split A and B.","allOf":[{"$ref":"#/components/schemas/StepSplitRedirectsDto"}]}},"required":["a","b","sameRedirect","redirects"]},"StepSplitRedirectsDto":{"type":"object","properties":{"a":{"type":"string","description":"The step ID for redirect A."},"b":{"type":"string","description":"The step ID for redirect B."}},"required":["a","b"]}}}}
```

## The StepConditionRedirectsDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepConditionRedirectsDto":{"type":"object","properties":{"t":{"type":"string","description":"The step ID to redirect to if the condition is true."},"f":{"type":"string","description":"The step ID to redirect to if the condition is false."}},"required":["t","f"]}}}}
```

## The StepConditionConditionDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepConditionConditionDto":{"type":"object","properties":{"valueLeft":{"type":"string","description":"The left-hand side value for the condition."},"operator":{"type":"string","description":"The operator for the condition (e.g., '==', '>', '<')."},"valueRight":{"type":"string","description":"The right-hand side value for the condition."},"group":{"type":"number","description":"The group number for logical grouping of conditions."}},"required":["valueLeft","operator","valueRight","group"]}}}}
```

## The StepConditionDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepConditionDto":{"type":"object","properties":{"redirects":{"description":"The redirect configurations based on condition outcome.","allOf":[{"$ref":"#/components/schemas/StepConditionRedirectsDto"}]},"conditions":{"description":"A list of conditions to evaluate.","type":"array","items":{"$ref":"#/components/schemas/StepConditionConditionDto"}}},"required":["redirects","conditions"]},"StepConditionRedirectsDto":{"type":"object","properties":{"t":{"type":"string","description":"The step ID to redirect to if the condition is true."},"f":{"type":"string","description":"The step ID to redirect to if the condition is false."}},"required":["t","f"]},"StepConditionConditionDto":{"type":"object","properties":{"valueLeft":{"type":"string","description":"The left-hand side value for the condition."},"operator":{"type":"string","description":"The operator for the condition (e.g., '==', '>', '<')."},"valueRight":{"type":"string","description":"The right-hand side value for the condition."},"group":{"type":"number","description":"The group number for logical grouping of conditions."}},"required":["valueLeft","operator","valueRight","group"]}}}}
```

## The StepFlowDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepFlowDto":{"type":"object","properties":{"outlets":{"type":"object","description":"Outlets of the flow, mapping names to step IDs.","additionalProperties":{"$ref":"#/components/schemas/StepFlowOutletDto"}},"flowId":{"type":"string","description":"The ID of the flow to execute."},"entryStepId":{"type":"string","description":"The ID of the entry step within the flow."},"redirects":{"type":"object","description":"Redirects based on flow outcomes.","additionalProperties":{"type":"string"}}},"required":["outlets","flowId","entryStepId","redirects"]},"StepFlowOutletDto":{"type":"object","properties":{"stepId":{"type":"string","description":"The ID of the step this outlet points to."},"name":{"type":"string","description":"The name of the flow outlet."}},"required":["stepId","name"]}}}}
```

## The StepTriggerDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepTriggerDto":{"type":"object","properties":{"triggerId":{"type":"string","description":"The unique identifier of the trigger."},"event":{"type":"string","description":"The triggering event."},"payload":{"type":"string","description":"An optional payload value required for triggering."}},"required":["triggerId","event"]}}}}
```

## The StepContextIntentDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepContextIntentDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the intent."},"intentId":{"type":"string","description":"The ID of the intent."},"redirect":{"type":"string","description":"The step ID to redirect to if this intent is matched."}},"required":["name","intentId"]}}}}
```

## The StepContextDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepContextDto":{"type":"object","properties":{"intents":{"description":"A list of intents to consider in this context.","type":"array","items":{"$ref":"#/components/schemas/StepContextIntentDto"}},"fallbackRedirect":{"type":"string","description":"The step ID to redirect to if no intent is matched."}},"required":["intents"]},"StepContextIntentDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the intent."},"intentId":{"type":"string","description":"The ID of the intent."},"redirect":{"type":"string","description":"The step ID to redirect to if this intent is matched."}},"required":["name","intentId"]}}}}
```

## The StepAppDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepAppDto":{"type":"object","properties":{"appId":{"type":"string","description":"The ID of the app to integrate."},"moduleId":{"type":"string","description":"The ID of the module within the app to execute."},"paramsJson":{"type":"string","format":"json","description":"Parameters for the app module in JSON format."}},"required":["appId","moduleId","paramsJson"]}}}}
```

## The StepEntityDetectionExampleDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepEntityDetectionExampleDto":{"type":"object","properties":{"value":{"type":"string","description":"The example input value."},"result":{"type":"string","description":"The expected result of entity detection for the example."}},"required":["value","result"]}}}}
```

## The StepEntityDetectionDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepEntityDetectionDto":{"type":"object","properties":{"outputVariableId":{"type":"string","description":"The ID of the variable to store the detected entities."},"outputVariablePath":{"type":"string","description":"Optional JSON path within the output variable."},"prompt":{"type":"string","description":"The prompt for entity detection."}},"required":["outputVariableId","prompt","examples"]}}}}
```

## The StepRunPromptDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepRunPromptDto":{"type":"object","properties":{"outputVariableId":{"type":"string","description":"The ID of the variable to store the prompt's output."},"outputVariablePath":{"type":"string","description":"Optional JSON path within the output variable."},"prompt":{"type":"string","description":"The prompt to run."},"includeConversationHistory":{"type":"boolean","description":"Whether to include conversation history in the prompt."},"useRag":{"type":"boolean","description":"Whether to use RAG (Retrieval Augmented Generation)."},"includeNotes":{"type":"boolean","description":"Whether to use notes in prompt context."},"knowledgeGroupIds":{"description":"List of knowledge group IDs for RAG.","type":"array","items":{"type":"string"}},"ragContextMessages":{"type":"number","description":"Number of context messages for RAG."},"contextMessageCount":{"type":"number","description":"Number of messages to include in the context."}},"required":["outputVariableId","prompt","knowledgeGroupIds"]}}}}
```

## The StepLeadAiConversationOutletDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepLeadAiConversationOutletDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the conversation outlet."},"description":{"type":"string","description":"A description of what this outlet does."},"redirect":{"type":"string","description":"The step ID to redirect to when this outlet is triggered."}},"required":["name","description"]}}}}
```

## The StepLeadAiConversationToolDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepLeadAiConversationToolDto":{"type":"object","properties":{"appId":{"type":"string","description":"The ID of the app associated with the tool."},"moduleId":{"type":"string","description":"The ID of the module within the app."},"description":{"type":"string","description":"A description of what the tool does."},"name":{"type":"string","pattern":"/^[a-zA-Z][a-zA-Z0-9_]*$/","description":"The name of the tool."}},"required":["appId","moduleId","description","name"]}}}}
```

## The StepLeadAiConversationDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepLeadAiConversationDto":{"type":"object","properties":{"prompt":{"type":"string","description":"The initial prompt for the AI conversation."},"context":{"type":"string","description":"Additional context for the AI conversation."},"maxIterations":{"type":"number","description":"The maximum number of iterations for the AI conversation."},"ragContextMessages":{"type":"number","description":"Number of context messages for RAG."},"includeConversationHistory":{"type":"boolean","description":"Whether to include conversation history."},"outlets":{"description":"Outlets for different conversation paths.","type":"array","items":{"$ref":"#/components/schemas/StepLeadAiConversationOutletDto"}},"tools":{"description":"Tools available to the AI during the conversation.","type":"array","items":{"$ref":"#/components/schemas/StepLeadAiConversationToolDto"}},"useRag":{"type":"boolean","description":"Whether to use RAG (Retrieval Augmented Generation)."},"delayMin":{"type":"number","description":"Minimum delay in seconds before the next AI response."},"delayMax":{"type":"number","description":"Maximum delay in seconds before the next AI response."},"delay":{"type":"boolean","description":"Whether to apply a delay before the next AI response."},"knowledgeGroupIds":{"description":"List of knowledge group IDs for RAG.","type":"array","items":{"type":"string"}},"contextMessageCount":{"type":"number","description":"Number of messages to include in the context."}},"required":["prompt","maxIterations","outlets","tools","knowledgeGroupIds"]},"StepLeadAiConversationOutletDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the conversation outlet."},"description":{"type":"string","description":"A description of what this outlet does."},"redirect":{"type":"string","description":"The step ID to redirect to when this outlet is triggered."}},"required":["name","description"]},"StepLeadAiConversationToolDto":{"type":"object","properties":{"appId":{"type":"string","description":"The ID of the app associated with the tool."},"moduleId":{"type":"string","description":"The ID of the module within the app."},"description":{"type":"string","description":"A description of what the tool does."},"name":{"type":"string","pattern":"/^[a-zA-Z][a-zA-Z0-9_]*$/","description":"The name of the tool."}},"required":["appId","moduleId","description","name"]}}}}
```

## The StepContactDataDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepContactDataDto":{"type":"object","properties":{"values":{"type":"string","description":"The values to set for contact data."}},"required":["values"]}}}}
```

## The StepAiConfigDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepAiConfigDto":{"type":"object","properties":{"model":{"type":"number","description":"The AI model to use.\n\n- `1`: GEMINI_25_FLASH","enum":[1]},"thinkingBudget":{"type":"number","description":"Budget for the \"thinking\" process in tokens."},"seed":{"type":"number","description":"Seed for reproducible results."},"topP":{"type":"number","description":"Top-P value for generation."},"temperature":{"type":"number","description":"Temperature for generation creativity."}},"required":["model"]}}}}
```

## The StepDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the step."},"name":{"type":"string","description":"The name of the step."},"created":{"type":"string","description":"The creation timestamp of the step."},"updated":{"type":"string","description":"The last update timestamp of the step."},"type":{"type":"string","description":"The type of the step (e.g., 'start', 'message', 'condition')."},"grid":{"description":"Grid coordinates for visual placement in the editor.","allOf":[{"$ref":"#/components/schemas/StepGridDto"}]},"elements":{"description":"A list of elements within this step.","type":"array","items":{"$ref":"#/components/schemas/StepElementDto"}},"intent":{"description":"Optional intent configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepIntentDto"}]},"delay":{"description":"Optional delay configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepDelayDto"}]},"split":{"description":"Optional split configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepSplitDto"}]},"condition":{"description":"Optional condition configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepConditionDto"}]},"flow":{"description":"Optional flow execution configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepFlowDto"}]},"trigger":{"description":"Optional trigger configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepTriggerDto"}]},"redirect":{"type":"string","description":"Optional step ID to redirect to."},"userInput":{"type":"string","description":"Optional user input prompt."},"userInputRequired":{"type":"boolean","description":"Whether user input is required for this step."},"context":{"description":"Optional context configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepContextDto"}]},"app":{"description":"Optional app integration configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepAppDto"}]},"description":{"type":"string","description":"An optional description for the step."},"entityDetection":{"description":"Optional entity detection configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepEntityDetectionDto"}]},"userInputIsSensitive":{"type":"boolean","description":"Whether user input in this step is sensitive."},"runPrompt":{"description":"Optional run prompt configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepRunPromptDto"}]},"leadAiConversation":{"description":"Optional Lead AI conversation configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepLeadAiConversationDto"}]},"contactData":{"description":"Optional contact data configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepContactDataDto"}]},"aiConfig":{"description":"Optional AI configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepAiConfigDto"}]}},"required":["id","name","created","updated","type","grid","elements"]},"StepGridDto":{"type":"object","properties":{"x":{"type":"number","description":"X-coordinate in the flow editor."},"y":{"type":"number","description":"Y-coordinate in the flow editor."}},"required":["x","y"]},"StepElementDto":{"type":"object","properties":{"type":{"type":"string","description":"The type of the step element (e.g., 'text', 'buttons')."},"content":{"description":"The content of the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentDto"}]}},"required":["type","content"]},"StepElementContentDto":{"type":"object","properties":{"text":{"description":"Text content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentTextDto"}]},"buttons":{"description":"Button content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentButtonDto"}]},"file":{"description":"File content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentFileDto"}]},"voiceHangup":{"description":"Voice hangup action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentVoiceHangupDto"}]},"voiceTransfer":{"description":"Voice transfer action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentVoiceTransferDto"}]},"agentHandover":{"description":"Agent handover action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentAgentHandoverDto"}]},"assignVariable":{"description":"Assign variable action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentAssignVariableDto"}]},"updateTags":{"description":"Update tags action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentUpdateTagsDto"}]},"snooze":{"description":"Snooze action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentSnoozeDto"}]},"unread":{"description":"Unread action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentUnreadDto"}]},"whatsappTemplate":{"description":"WhatsApp template content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentWhatsAppTemplateDto"}]},"textToSpeech":{"description":"Text-to-speech content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentTextToSpeechDto"}]},"callSettings":{"description":"Call settings for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentCallSettingsDto"}]},"metaWhatsappTemplate":{"description":"Meta WhatsApp template content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentMetaWhatsAppTemplateDto"}]},"note":{"description":"Note content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentNoteDto"}]},"chatEnd":{"description":"Chat end action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentChatEndDto"}]},"assignTeam":{"description":"Assign team action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentAssignTeamDto"}]},"assignOperator":{"description":"Assign operator action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentAssignOperatorDto"}]}}},"StepElementContentTextDto":{"type":"object","properties":{"text":{"type":"object","description":"The text content, localized by language key.","additionalProperties":{"type":"string"}}},"required":["text"]},"StepElementContentButtonDto":{"type":"object","properties":{"buttons":{"description":"A list of buttons to display.","type":"array","items":{"$ref":"#/components/schemas/StepElementContentButtonButtonDto"}}},"required":["buttons"]},"StepElementContentButtonButtonDto":{"type":"object","properties":{"text":{"type":"object","description":"The text displayed on the button, localized.","additionalProperties":{"type":"string"}},"value":{"type":"string","description":"The value associated with the button."},"type":{"type":"string","description":"The type of button (e.g., 'redirect', 'postback')."},"payload":{"type":"string","description":"An optional payload for postback buttons."}},"required":["text","value","type"]},"StepElementContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the file."},"bucketId":{"type":"string","description":"The ID of the bucket where the file is stored."},"objectId":{"type":"string","description":"The object ID of the file within the bucket."},"mimeType":{"type":"string","description":"The MIME type of the file."},"sizeInByte":{"type":"number","description":"The size of the file in bytes."},"fbaId":{"type":"string","description":"Facebook attachment ID (optional)."},"waaId":{"type":"string","description":"WhatsApp attachment ID (optional)."}},"required":["name","bucketId","objectId","mimeType","sizeInByte"]},"StepElementContentVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for hanging up the voice call."},"headers":{"type":"object","description":"Custom headers to send with the hangup event.","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"StepElementContentVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string","description":"The target for the voice transfer (e.g., a phone number)."},"reason":{"type":"string","description":"An optional reason for the voice transfer."},"headers":{"type":"object","description":"Custom headers to send with the voice transfer.","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"StepElementContentAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string","description":"An optional reason for the agent handover."},"timeoutSeconds":{"type":"number","description":"Timeout in seconds for the agent to accept the handover."},"agentId":{"type":"string","description":"The ID of the specific agent to hand over to."},"groupId":{"type":"string","description":"The ID of the agent group to hand over to."},"assignmentMethod":{"type":"string","description":"The method used for assigning the agent."}}},"StepElementContentAssignVariableDto":{"type":"object","properties":{"variableId":{"type":"string","description":"The ID of the variable to assign a value to."},"path":{"type":"string","description":"Optional JSON path within the variable to assign the value."},"value":{"type":"string","description":"The value to assign to the variable."}},"required":["variableId"]},"StepElementContentUpdateTagsDto":{"type":"object","properties":{"method":{"type":"string","description":"The method to update tags ('add' or 'remove').","enum":["add","remove"]},"tagId":{"type":"string","description":"The ID of the tag to add or remove."}},"required":["method","tagId"]},"StepElementContentSnoozeDto":{"type":"object","properties":{"seconds":{"type":"number","description":"The duration in seconds to snooze the conversation."}},"required":["seconds"]},"StepElementContentUnreadDto":{"type":"object","properties":{"unread":{"type":"boolean","description":"Whether to mark the conversation as unread."}},"required":["unread"]},"StepElementContentWhatsAppTemplateDto":{"type":"object","properties":{"templateId":{"type":"string","description":"The ID of the WhatsApp template to send."},"parameters":{"type":"object","description":"Parameters to populate the WhatsApp template.","additionalProperties":{"type":"string"}}},"required":["templateId","parameters"]},"StepElementContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"object","description":"The text content for text-to-speech, localized.","additionalProperties":{"type":"string"}},"speech":{"type":"string","description":"Optional SSML speech markup."}},"required":["text"]},"StepElementContentCallSettingsDto":{"type":"object","properties":{"userInputSpeechDetectionTimeout":{"type":"number","description":"Timeout for user speech detection in milliseconds."},"dtmf":{"type":"boolean","description":"Whether DTMF (Dual-tone multi-frequency) input is enabled."},"bargeIn":{"type":"boolean","description":"Whether barge-in is enabled (user can interrupt bot)."}}},"StepElementContentMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the Meta WhatsApp template."},"templateId":{"type":"string","description":"The ID of the Meta WhatsApp template."},"header":{"description":"Header configuration for the Meta WhatsApp template.","allOf":[{"$ref":"#/components/schemas/StepElementContentMetaWhatsAppTemplateHeaderDto"}]},"bodyParameters":{"description":"Parameters for the body of the Meta WhatsApp template.","type":"array","items":{"type":"string"}},"buttons":{"description":"Button configurations for the Meta WhatsApp template.","allOf":[{"$ref":"#/components/schemas/StepElementContentMetaWhatsAppTemplateButtonsDto"}]}},"required":["templateName","templateId","bodyParameters"]},"StepElementContentMetaWhatsAppTemplateHeaderDto":{"type":"object","properties":{"file":{"description":"The file used in the template header.","allOf":[{"$ref":"#/components/schemas/StepElementContentFileDto"}]},"parameters":{"description":"Parameters for the header text.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"StepElementContentMetaWhatsAppTemplateButtonsDto":{"type":"object","properties":{"values":{"description":"Values for the buttons in the template.","type":"array","items":{"type":"string"}}},"required":["values"]},"StepElementContentNoteDto":{"type":"object","properties":{"note":{"type":"string","description":"A private note for internal use."}},"required":["note"]},"StepElementContentChatEndDto":{"type":"object","properties":{"status":{"description":"The status to set for the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED","allOf":[{"$ref":"#/components/schemas/StepElementContentChatEnd_ConversationStatus"}]}},"required":["status"]},"StepElementContentChatEnd_ConversationStatus":{"type":"number","enum":[0,1,2,3,-1],"description":"The status to set for the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED"},"StepElementContentAssignTeamDto":{"type":"object","properties":{"teamId":{"type":"string","description":"The ID of the team to assign the conversation to."}},"required":["teamId"]},"StepElementContentAssignOperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The ID of the operator to assign the conversation to."},"assignToLastAssigned":{"type":"boolean","description":"Whether to assign to the last assigned operator."}},"required":["assignToLastAssigned"]},"StepIntentDto":{"type":"object","properties":{"intentId":{"type":"string","description":"The ID of the associated intent."}},"required":["intentId"]},"StepDelayDto":{"type":"object","properties":{"seconds":{"type":"number","description":"The waiting time in seconds."}},"required":["seconds"]},"StepSplitDto":{"type":"object","properties":{"a":{"type":"number","description":"Percentage for exit A."},"b":{"type":"number","description":"Percentage for exit B."},"sameRedirect":{"type":"boolean","description":"Indicates whether both exits should lead to the same destination."},"redirects":{"description":"The redirect configurations for split A and B.","allOf":[{"$ref":"#/components/schemas/StepSplitRedirectsDto"}]}},"required":["a","b","sameRedirect","redirects"]},"StepSplitRedirectsDto":{"type":"object","properties":{"a":{"type":"string","description":"The step ID for redirect A."},"b":{"type":"string","description":"The step ID for redirect B."}},"required":["a","b"]},"StepConditionDto":{"type":"object","properties":{"redirects":{"description":"The redirect configurations based on condition outcome.","allOf":[{"$ref":"#/components/schemas/StepConditionRedirectsDto"}]},"conditions":{"description":"A list of conditions to evaluate.","type":"array","items":{"$ref":"#/components/schemas/StepConditionConditionDto"}}},"required":["redirects","conditions"]},"StepConditionRedirectsDto":{"type":"object","properties":{"t":{"type":"string","description":"The step ID to redirect to if the condition is true."},"f":{"type":"string","description":"The step ID to redirect to if the condition is false."}},"required":["t","f"]},"StepConditionConditionDto":{"type":"object","properties":{"valueLeft":{"type":"string","description":"The left-hand side value for the condition."},"operator":{"type":"string","description":"The operator for the condition (e.g., '==', '>', '<')."},"valueRight":{"type":"string","description":"The right-hand side value for the condition."},"group":{"type":"number","description":"The group number for logical grouping of conditions."}},"required":["valueLeft","operator","valueRight","group"]},"StepFlowDto":{"type":"object","properties":{"outlets":{"type":"object","description":"Outlets of the flow, mapping names to step IDs.","additionalProperties":{"$ref":"#/components/schemas/StepFlowOutletDto"}},"flowId":{"type":"string","description":"The ID of the flow to execute."},"entryStepId":{"type":"string","description":"The ID of the entry step within the flow."},"redirects":{"type":"object","description":"Redirects based on flow outcomes.","additionalProperties":{"type":"string"}}},"required":["outlets","flowId","entryStepId","redirects"]},"StepFlowOutletDto":{"type":"object","properties":{"stepId":{"type":"string","description":"The ID of the step this outlet points to."},"name":{"type":"string","description":"The name of the flow outlet."}},"required":["stepId","name"]},"StepTriggerDto":{"type":"object","properties":{"triggerId":{"type":"string","description":"The unique identifier of the trigger."},"event":{"type":"string","description":"The triggering event."},"payload":{"type":"string","description":"An optional payload value required for triggering."}},"required":["triggerId","event"]},"StepContextDto":{"type":"object","properties":{"intents":{"description":"A list of intents to consider in this context.","type":"array","items":{"$ref":"#/components/schemas/StepContextIntentDto"}},"fallbackRedirect":{"type":"string","description":"The step ID to redirect to if no intent is matched."}},"required":["intents"]},"StepContextIntentDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the intent."},"intentId":{"type":"string","description":"The ID of the intent."},"redirect":{"type":"string","description":"The step ID to redirect to if this intent is matched."}},"required":["name","intentId"]},"StepAppDto":{"type":"object","properties":{"appId":{"type":"string","description":"The ID of the app to integrate."},"moduleId":{"type":"string","description":"The ID of the module within the app to execute."},"paramsJson":{"type":"string","format":"json","description":"Parameters for the app module in JSON format."}},"required":["appId","moduleId","paramsJson"]},"StepEntityDetectionDto":{"type":"object","properties":{"outputVariableId":{"type":"string","description":"The ID of the variable to store the detected entities."},"outputVariablePath":{"type":"string","description":"Optional JSON path within the output variable."},"prompt":{"type":"string","description":"The prompt for entity detection."}},"required":["outputVariableId","prompt","examples"]},"StepRunPromptDto":{"type":"object","properties":{"outputVariableId":{"type":"string","description":"The ID of the variable to store the prompt's output."},"outputVariablePath":{"type":"string","description":"Optional JSON path within the output variable."},"prompt":{"type":"string","description":"The prompt to run."},"includeConversationHistory":{"type":"boolean","description":"Whether to include conversation history in the prompt."},"useRag":{"type":"boolean","description":"Whether to use RAG (Retrieval Augmented Generation)."},"includeNotes":{"type":"boolean","description":"Whether to use notes in prompt context."},"knowledgeGroupIds":{"description":"List of knowledge group IDs for RAG.","type":"array","items":{"type":"string"}},"ragContextMessages":{"type":"number","description":"Number of context messages for RAG."},"contextMessageCount":{"type":"number","description":"Number of messages to include in the context."}},"required":["outputVariableId","prompt","knowledgeGroupIds"]},"StepLeadAiConversationDto":{"type":"object","properties":{"prompt":{"type":"string","description":"The initial prompt for the AI conversation."},"context":{"type":"string","description":"Additional context for the AI conversation."},"maxIterations":{"type":"number","description":"The maximum number of iterations for the AI conversation."},"ragContextMessages":{"type":"number","description":"Number of context messages for RAG."},"includeConversationHistory":{"type":"boolean","description":"Whether to include conversation history."},"outlets":{"description":"Outlets for different conversation paths.","type":"array","items":{"$ref":"#/components/schemas/StepLeadAiConversationOutletDto"}},"tools":{"description":"Tools available to the AI during the conversation.","type":"array","items":{"$ref":"#/components/schemas/StepLeadAiConversationToolDto"}},"useRag":{"type":"boolean","description":"Whether to use RAG (Retrieval Augmented Generation)."},"delayMin":{"type":"number","description":"Minimum delay in seconds before the next AI response."},"delayMax":{"type":"number","description":"Maximum delay in seconds before the next AI response."},"delay":{"type":"boolean","description":"Whether to apply a delay before the next AI response."},"knowledgeGroupIds":{"description":"List of knowledge group IDs for RAG.","type":"array","items":{"type":"string"}},"contextMessageCount":{"type":"number","description":"Number of messages to include in the context."}},"required":["prompt","maxIterations","outlets","tools","knowledgeGroupIds"]},"StepLeadAiConversationOutletDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the conversation outlet."},"description":{"type":"string","description":"A description of what this outlet does."},"redirect":{"type":"string","description":"The step ID to redirect to when this outlet is triggered."}},"required":["name","description"]},"StepLeadAiConversationToolDto":{"type":"object","properties":{"appId":{"type":"string","description":"The ID of the app associated with the tool."},"moduleId":{"type":"string","description":"The ID of the module within the app."},"description":{"type":"string","description":"A description of what the tool does."},"name":{"type":"string","pattern":"/^[a-zA-Z][a-zA-Z0-9_]*$/","description":"The name of the tool."}},"required":["appId","moduleId","description","name"]},"StepContactDataDto":{"type":"object","properties":{"values":{"type":"string","description":"The values to set for contact data."}},"required":["values"]},"StepAiConfigDto":{"type":"object","properties":{"model":{"type":"number","description":"The AI model to use.\n\n- `1`: GEMINI_25_FLASH","enum":[1]},"thinkingBudget":{"type":"number","description":"Budget for the \"thinking\" process in tokens."},"seed":{"type":"number","description":"Seed for reproducible results."},"topP":{"type":"number","description":"Top-P value for generation."},"temperature":{"type":"number","description":"Temperature for generation creativity."}},"required":["model"]}}}}
```

## The ListStepsResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListStepsResponseDto":{"type":"object","properties":{"steps":{"description":"A list of steps.","type":"array","items":{"$ref":"#/components/schemas/StepDto"}},"error":{"type":"string","description":"Optional error message."}},"required":["steps"]},"StepDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the step."},"name":{"type":"string","description":"The name of the step."},"created":{"type":"string","description":"The creation timestamp of the step."},"updated":{"type":"string","description":"The last update timestamp of the step."},"type":{"type":"string","description":"The type of the step (e.g., 'start', 'message', 'condition')."},"grid":{"description":"Grid coordinates for visual placement in the editor.","allOf":[{"$ref":"#/components/schemas/StepGridDto"}]},"elements":{"description":"A list of elements within this step.","type":"array","items":{"$ref":"#/components/schemas/StepElementDto"}},"intent":{"description":"Optional intent configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepIntentDto"}]},"delay":{"description":"Optional delay configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepDelayDto"}]},"split":{"description":"Optional split configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepSplitDto"}]},"condition":{"description":"Optional condition configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepConditionDto"}]},"flow":{"description":"Optional flow execution configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepFlowDto"}]},"trigger":{"description":"Optional trigger configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepTriggerDto"}]},"redirect":{"type":"string","description":"Optional step ID to redirect to."},"userInput":{"type":"string","description":"Optional user input prompt."},"userInputRequired":{"type":"boolean","description":"Whether user input is required for this step."},"context":{"description":"Optional context configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepContextDto"}]},"app":{"description":"Optional app integration configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepAppDto"}]},"description":{"type":"string","description":"An optional description for the step."},"entityDetection":{"description":"Optional entity detection configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepEntityDetectionDto"}]},"userInputIsSensitive":{"type":"boolean","description":"Whether user input in this step is sensitive."},"runPrompt":{"description":"Optional run prompt configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepRunPromptDto"}]},"leadAiConversation":{"description":"Optional Lead AI conversation configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepLeadAiConversationDto"}]},"contactData":{"description":"Optional contact data configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepContactDataDto"}]},"aiConfig":{"description":"Optional AI configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepAiConfigDto"}]}},"required":["id","name","created","updated","type","grid","elements"]},"StepGridDto":{"type":"object","properties":{"x":{"type":"number","description":"X-coordinate in the flow editor."},"y":{"type":"number","description":"Y-coordinate in the flow editor."}},"required":["x","y"]},"StepElementDto":{"type":"object","properties":{"type":{"type":"string","description":"The type of the step element (e.g., 'text', 'buttons')."},"content":{"description":"The content of the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentDto"}]}},"required":["type","content"]},"StepElementContentDto":{"type":"object","properties":{"text":{"description":"Text content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentTextDto"}]},"buttons":{"description":"Button content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentButtonDto"}]},"file":{"description":"File content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentFileDto"}]},"voiceHangup":{"description":"Voice hangup action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentVoiceHangupDto"}]},"voiceTransfer":{"description":"Voice transfer action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentVoiceTransferDto"}]},"agentHandover":{"description":"Agent handover action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentAgentHandoverDto"}]},"assignVariable":{"description":"Assign variable action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentAssignVariableDto"}]},"updateTags":{"description":"Update tags action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentUpdateTagsDto"}]},"snooze":{"description":"Snooze action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentSnoozeDto"}]},"unread":{"description":"Unread action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentUnreadDto"}]},"whatsappTemplate":{"description":"WhatsApp template content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentWhatsAppTemplateDto"}]},"textToSpeech":{"description":"Text-to-speech content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentTextToSpeechDto"}]},"callSettings":{"description":"Call settings for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentCallSettingsDto"}]},"metaWhatsappTemplate":{"description":"Meta WhatsApp template content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentMetaWhatsAppTemplateDto"}]},"note":{"description":"Note content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentNoteDto"}]},"chatEnd":{"description":"Chat end action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentChatEndDto"}]},"assignTeam":{"description":"Assign team action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentAssignTeamDto"}]},"assignOperator":{"description":"Assign operator action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentAssignOperatorDto"}]}}},"StepElementContentTextDto":{"type":"object","properties":{"text":{"type":"object","description":"The text content, localized by language key.","additionalProperties":{"type":"string"}}},"required":["text"]},"StepElementContentButtonDto":{"type":"object","properties":{"buttons":{"description":"A list of buttons to display.","type":"array","items":{"$ref":"#/components/schemas/StepElementContentButtonButtonDto"}}},"required":["buttons"]},"StepElementContentButtonButtonDto":{"type":"object","properties":{"text":{"type":"object","description":"The text displayed on the button, localized.","additionalProperties":{"type":"string"}},"value":{"type":"string","description":"The value associated with the button."},"type":{"type":"string","description":"The type of button (e.g., 'redirect', 'postback')."},"payload":{"type":"string","description":"An optional payload for postback buttons."}},"required":["text","value","type"]},"StepElementContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the file."},"bucketId":{"type":"string","description":"The ID of the bucket where the file is stored."},"objectId":{"type":"string","description":"The object ID of the file within the bucket."},"mimeType":{"type":"string","description":"The MIME type of the file."},"sizeInByte":{"type":"number","description":"The size of the file in bytes."},"fbaId":{"type":"string","description":"Facebook attachment ID (optional)."},"waaId":{"type":"string","description":"WhatsApp attachment ID (optional)."}},"required":["name","bucketId","objectId","mimeType","sizeInByte"]},"StepElementContentVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for hanging up the voice call."},"headers":{"type":"object","description":"Custom headers to send with the hangup event.","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"StepElementContentVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string","description":"The target for the voice transfer (e.g., a phone number)."},"reason":{"type":"string","description":"An optional reason for the voice transfer."},"headers":{"type":"object","description":"Custom headers to send with the voice transfer.","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"StepElementContentAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string","description":"An optional reason for the agent handover."},"timeoutSeconds":{"type":"number","description":"Timeout in seconds for the agent to accept the handover."},"agentId":{"type":"string","description":"The ID of the specific agent to hand over to."},"groupId":{"type":"string","description":"The ID of the agent group to hand over to."},"assignmentMethod":{"type":"string","description":"The method used for assigning the agent."}}},"StepElementContentAssignVariableDto":{"type":"object","properties":{"variableId":{"type":"string","description":"The ID of the variable to assign a value to."},"path":{"type":"string","description":"Optional JSON path within the variable to assign the value."},"value":{"type":"string","description":"The value to assign to the variable."}},"required":["variableId"]},"StepElementContentUpdateTagsDto":{"type":"object","properties":{"method":{"type":"string","description":"The method to update tags ('add' or 'remove').","enum":["add","remove"]},"tagId":{"type":"string","description":"The ID of the tag to add or remove."}},"required":["method","tagId"]},"StepElementContentSnoozeDto":{"type":"object","properties":{"seconds":{"type":"number","description":"The duration in seconds to snooze the conversation."}},"required":["seconds"]},"StepElementContentUnreadDto":{"type":"object","properties":{"unread":{"type":"boolean","description":"Whether to mark the conversation as unread."}},"required":["unread"]},"StepElementContentWhatsAppTemplateDto":{"type":"object","properties":{"templateId":{"type":"string","description":"The ID of the WhatsApp template to send."},"parameters":{"type":"object","description":"Parameters to populate the WhatsApp template.","additionalProperties":{"type":"string"}}},"required":["templateId","parameters"]},"StepElementContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"object","description":"The text content for text-to-speech, localized.","additionalProperties":{"type":"string"}},"speech":{"type":"string","description":"Optional SSML speech markup."}},"required":["text"]},"StepElementContentCallSettingsDto":{"type":"object","properties":{"userInputSpeechDetectionTimeout":{"type":"number","description":"Timeout for user speech detection in milliseconds."},"dtmf":{"type":"boolean","description":"Whether DTMF (Dual-tone multi-frequency) input is enabled."},"bargeIn":{"type":"boolean","description":"Whether barge-in is enabled (user can interrupt bot)."}}},"StepElementContentMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the Meta WhatsApp template."},"templateId":{"type":"string","description":"The ID of the Meta WhatsApp template."},"header":{"description":"Header configuration for the Meta WhatsApp template.","allOf":[{"$ref":"#/components/schemas/StepElementContentMetaWhatsAppTemplateHeaderDto"}]},"bodyParameters":{"description":"Parameters for the body of the Meta WhatsApp template.","type":"array","items":{"type":"string"}},"buttons":{"description":"Button configurations for the Meta WhatsApp template.","allOf":[{"$ref":"#/components/schemas/StepElementContentMetaWhatsAppTemplateButtonsDto"}]}},"required":["templateName","templateId","bodyParameters"]},"StepElementContentMetaWhatsAppTemplateHeaderDto":{"type":"object","properties":{"file":{"description":"The file used in the template header.","allOf":[{"$ref":"#/components/schemas/StepElementContentFileDto"}]},"parameters":{"description":"Parameters for the header text.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"StepElementContentMetaWhatsAppTemplateButtonsDto":{"type":"object","properties":{"values":{"description":"Values for the buttons in the template.","type":"array","items":{"type":"string"}}},"required":["values"]},"StepElementContentNoteDto":{"type":"object","properties":{"note":{"type":"string","description":"A private note for internal use."}},"required":["note"]},"StepElementContentChatEndDto":{"type":"object","properties":{"status":{"description":"The status to set for the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED","allOf":[{"$ref":"#/components/schemas/StepElementContentChatEnd_ConversationStatus"}]}},"required":["status"]},"StepElementContentChatEnd_ConversationStatus":{"type":"number","enum":[0,1,2,3,-1],"description":"The status to set for the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED"},"StepElementContentAssignTeamDto":{"type":"object","properties":{"teamId":{"type":"string","description":"The ID of the team to assign the conversation to."}},"required":["teamId"]},"StepElementContentAssignOperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The ID of the operator to assign the conversation to."},"assignToLastAssigned":{"type":"boolean","description":"Whether to assign to the last assigned operator."}},"required":["assignToLastAssigned"]},"StepIntentDto":{"type":"object","properties":{"intentId":{"type":"string","description":"The ID of the associated intent."}},"required":["intentId"]},"StepDelayDto":{"type":"object","properties":{"seconds":{"type":"number","description":"The waiting time in seconds."}},"required":["seconds"]},"StepSplitDto":{"type":"object","properties":{"a":{"type":"number","description":"Percentage for exit A."},"b":{"type":"number","description":"Percentage for exit B."},"sameRedirect":{"type":"boolean","description":"Indicates whether both exits should lead to the same destination."},"redirects":{"description":"The redirect configurations for split A and B.","allOf":[{"$ref":"#/components/schemas/StepSplitRedirectsDto"}]}},"required":["a","b","sameRedirect","redirects"]},"StepSplitRedirectsDto":{"type":"object","properties":{"a":{"type":"string","description":"The step ID for redirect A."},"b":{"type":"string","description":"The step ID for redirect B."}},"required":["a","b"]},"StepConditionDto":{"type":"object","properties":{"redirects":{"description":"The redirect configurations based on condition outcome.","allOf":[{"$ref":"#/components/schemas/StepConditionRedirectsDto"}]},"conditions":{"description":"A list of conditions to evaluate.","type":"array","items":{"$ref":"#/components/schemas/StepConditionConditionDto"}}},"required":["redirects","conditions"]},"StepConditionRedirectsDto":{"type":"object","properties":{"t":{"type":"string","description":"The step ID to redirect to if the condition is true."},"f":{"type":"string","description":"The step ID to redirect to if the condition is false."}},"required":["t","f"]},"StepConditionConditionDto":{"type":"object","properties":{"valueLeft":{"type":"string","description":"The left-hand side value for the condition."},"operator":{"type":"string","description":"The operator for the condition (e.g., '==', '>', '<')."},"valueRight":{"type":"string","description":"The right-hand side value for the condition."},"group":{"type":"number","description":"The group number for logical grouping of conditions."}},"required":["valueLeft","operator","valueRight","group"]},"StepFlowDto":{"type":"object","properties":{"outlets":{"type":"object","description":"Outlets of the flow, mapping names to step IDs.","additionalProperties":{"$ref":"#/components/schemas/StepFlowOutletDto"}},"flowId":{"type":"string","description":"The ID of the flow to execute."},"entryStepId":{"type":"string","description":"The ID of the entry step within the flow."},"redirects":{"type":"object","description":"Redirects based on flow outcomes.","additionalProperties":{"type":"string"}}},"required":["outlets","flowId","entryStepId","redirects"]},"StepFlowOutletDto":{"type":"object","properties":{"stepId":{"type":"string","description":"The ID of the step this outlet points to."},"name":{"type":"string","description":"The name of the flow outlet."}},"required":["stepId","name"]},"StepTriggerDto":{"type":"object","properties":{"triggerId":{"type":"string","description":"The unique identifier of the trigger."},"event":{"type":"string","description":"The triggering event."},"payload":{"type":"string","description":"An optional payload value required for triggering."}},"required":["triggerId","event"]},"StepContextDto":{"type":"object","properties":{"intents":{"description":"A list of intents to consider in this context.","type":"array","items":{"$ref":"#/components/schemas/StepContextIntentDto"}},"fallbackRedirect":{"type":"string","description":"The step ID to redirect to if no intent is matched."}},"required":["intents"]},"StepContextIntentDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the intent."},"intentId":{"type":"string","description":"The ID of the intent."},"redirect":{"type":"string","description":"The step ID to redirect to if this intent is matched."}},"required":["name","intentId"]},"StepAppDto":{"type":"object","properties":{"appId":{"type":"string","description":"The ID of the app to integrate."},"moduleId":{"type":"string","description":"The ID of the module within the app to execute."},"paramsJson":{"type":"string","format":"json","description":"Parameters for the app module in JSON format."}},"required":["appId","moduleId","paramsJson"]},"StepEntityDetectionDto":{"type":"object","properties":{"outputVariableId":{"type":"string","description":"The ID of the variable to store the detected entities."},"outputVariablePath":{"type":"string","description":"Optional JSON path within the output variable."},"prompt":{"type":"string","description":"The prompt for entity detection."}},"required":["outputVariableId","prompt","examples"]},"StepRunPromptDto":{"type":"object","properties":{"outputVariableId":{"type":"string","description":"The ID of the variable to store the prompt's output."},"outputVariablePath":{"type":"string","description":"Optional JSON path within the output variable."},"prompt":{"type":"string","description":"The prompt to run."},"includeConversationHistory":{"type":"boolean","description":"Whether to include conversation history in the prompt."},"useRag":{"type":"boolean","description":"Whether to use RAG (Retrieval Augmented Generation)."},"includeNotes":{"type":"boolean","description":"Whether to use notes in prompt context."},"knowledgeGroupIds":{"description":"List of knowledge group IDs for RAG.","type":"array","items":{"type":"string"}},"ragContextMessages":{"type":"number","description":"Number of context messages for RAG."},"contextMessageCount":{"type":"number","description":"Number of messages to include in the context."}},"required":["outputVariableId","prompt","knowledgeGroupIds"]},"StepLeadAiConversationDto":{"type":"object","properties":{"prompt":{"type":"string","description":"The initial prompt for the AI conversation."},"context":{"type":"string","description":"Additional context for the AI conversation."},"maxIterations":{"type":"number","description":"The maximum number of iterations for the AI conversation."},"ragContextMessages":{"type":"number","description":"Number of context messages for RAG."},"includeConversationHistory":{"type":"boolean","description":"Whether to include conversation history."},"outlets":{"description":"Outlets for different conversation paths.","type":"array","items":{"$ref":"#/components/schemas/StepLeadAiConversationOutletDto"}},"tools":{"description":"Tools available to the AI during the conversation.","type":"array","items":{"$ref":"#/components/schemas/StepLeadAiConversationToolDto"}},"useRag":{"type":"boolean","description":"Whether to use RAG (Retrieval Augmented Generation)."},"delayMin":{"type":"number","description":"Minimum delay in seconds before the next AI response."},"delayMax":{"type":"number","description":"Maximum delay in seconds before the next AI response."},"delay":{"type":"boolean","description":"Whether to apply a delay before the next AI response."},"knowledgeGroupIds":{"description":"List of knowledge group IDs for RAG.","type":"array","items":{"type":"string"}},"contextMessageCount":{"type":"number","description":"Number of messages to include in the context."}},"required":["prompt","maxIterations","outlets","tools","knowledgeGroupIds"]},"StepLeadAiConversationOutletDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the conversation outlet."},"description":{"type":"string","description":"A description of what this outlet does."},"redirect":{"type":"string","description":"The step ID to redirect to when this outlet is triggered."}},"required":["name","description"]},"StepLeadAiConversationToolDto":{"type":"object","properties":{"appId":{"type":"string","description":"The ID of the app associated with the tool."},"moduleId":{"type":"string","description":"The ID of the module within the app."},"description":{"type":"string","description":"A description of what the tool does."},"name":{"type":"string","pattern":"/^[a-zA-Z][a-zA-Z0-9_]*$/","description":"The name of the tool."}},"required":["appId","moduleId","description","name"]},"StepContactDataDto":{"type":"object","properties":{"values":{"type":"string","description":"The values to set for contact data."}},"required":["values"]},"StepAiConfigDto":{"type":"object","properties":{"model":{"type":"number","description":"The AI model to use.\n\n- `1`: GEMINI_25_FLASH","enum":[1]},"thinkingBudget":{"type":"number","description":"Budget for the \"thinking\" process in tokens."},"seed":{"type":"number","description":"Seed for reproducible results."},"topP":{"type":"number","description":"Top-P value for generation."},"temperature":{"type":"number","description":"Temperature for generation creativity."}},"required":["model"]}}}}
```

## The GetStepResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"GetStepResponseDto":{"type":"object","properties":{"step":{"description":"The retrieved step.","allOf":[{"$ref":"#/components/schemas/StepDto"}]},"error":{"type":"string","description":"Optional error message."}}},"StepDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the step."},"name":{"type":"string","description":"The name of the step."},"created":{"type":"string","description":"The creation timestamp of the step."},"updated":{"type":"string","description":"The last update timestamp of the step."},"type":{"type":"string","description":"The type of the step (e.g., 'start', 'message', 'condition')."},"grid":{"description":"Grid coordinates for visual placement in the editor.","allOf":[{"$ref":"#/components/schemas/StepGridDto"}]},"elements":{"description":"A list of elements within this step.","type":"array","items":{"$ref":"#/components/schemas/StepElementDto"}},"intent":{"description":"Optional intent configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepIntentDto"}]},"delay":{"description":"Optional delay configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepDelayDto"}]},"split":{"description":"Optional split configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepSplitDto"}]},"condition":{"description":"Optional condition configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepConditionDto"}]},"flow":{"description":"Optional flow execution configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepFlowDto"}]},"trigger":{"description":"Optional trigger configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepTriggerDto"}]},"redirect":{"type":"string","description":"Optional step ID to redirect to."},"userInput":{"type":"string","description":"Optional user input prompt."},"userInputRequired":{"type":"boolean","description":"Whether user input is required for this step."},"context":{"description":"Optional context configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepContextDto"}]},"app":{"description":"Optional app integration configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepAppDto"}]},"description":{"type":"string","description":"An optional description for the step."},"entityDetection":{"description":"Optional entity detection configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepEntityDetectionDto"}]},"userInputIsSensitive":{"type":"boolean","description":"Whether user input in this step is sensitive."},"runPrompt":{"description":"Optional run prompt configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepRunPromptDto"}]},"leadAiConversation":{"description":"Optional Lead AI conversation configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepLeadAiConversationDto"}]},"contactData":{"description":"Optional contact data configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepContactDataDto"}]},"aiConfig":{"description":"Optional AI configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepAiConfigDto"}]}},"required":["id","name","created","updated","type","grid","elements"]},"StepGridDto":{"type":"object","properties":{"x":{"type":"number","description":"X-coordinate in the flow editor."},"y":{"type":"number","description":"Y-coordinate in the flow editor."}},"required":["x","y"]},"StepElementDto":{"type":"object","properties":{"type":{"type":"string","description":"The type of the step element (e.g., 'text', 'buttons')."},"content":{"description":"The content of the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentDto"}]}},"required":["type","content"]},"StepElementContentDto":{"type":"object","properties":{"text":{"description":"Text content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentTextDto"}]},"buttons":{"description":"Button content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentButtonDto"}]},"file":{"description":"File content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentFileDto"}]},"voiceHangup":{"description":"Voice hangup action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentVoiceHangupDto"}]},"voiceTransfer":{"description":"Voice transfer action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentVoiceTransferDto"}]},"agentHandover":{"description":"Agent handover action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentAgentHandoverDto"}]},"assignVariable":{"description":"Assign variable action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentAssignVariableDto"}]},"updateTags":{"description":"Update tags action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentUpdateTagsDto"}]},"snooze":{"description":"Snooze action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentSnoozeDto"}]},"unread":{"description":"Unread action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentUnreadDto"}]},"whatsappTemplate":{"description":"WhatsApp template content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentWhatsAppTemplateDto"}]},"textToSpeech":{"description":"Text-to-speech content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentTextToSpeechDto"}]},"callSettings":{"description":"Call settings for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentCallSettingsDto"}]},"metaWhatsappTemplate":{"description":"Meta WhatsApp template content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentMetaWhatsAppTemplateDto"}]},"note":{"description":"Note content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentNoteDto"}]},"chatEnd":{"description":"Chat end action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentChatEndDto"}]},"assignTeam":{"description":"Assign team action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentAssignTeamDto"}]},"assignOperator":{"description":"Assign operator action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentAssignOperatorDto"}]}}},"StepElementContentTextDto":{"type":"object","properties":{"text":{"type":"object","description":"The text content, localized by language key.","additionalProperties":{"type":"string"}}},"required":["text"]},"StepElementContentButtonDto":{"type":"object","properties":{"buttons":{"description":"A list of buttons to display.","type":"array","items":{"$ref":"#/components/schemas/StepElementContentButtonButtonDto"}}},"required":["buttons"]},"StepElementContentButtonButtonDto":{"type":"object","properties":{"text":{"type":"object","description":"The text displayed on the button, localized.","additionalProperties":{"type":"string"}},"value":{"type":"string","description":"The value associated with the button."},"type":{"type":"string","description":"The type of button (e.g., 'redirect', 'postback')."},"payload":{"type":"string","description":"An optional payload for postback buttons."}},"required":["text","value","type"]},"StepElementContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the file."},"bucketId":{"type":"string","description":"The ID of the bucket where the file is stored."},"objectId":{"type":"string","description":"The object ID of the file within the bucket."},"mimeType":{"type":"string","description":"The MIME type of the file."},"sizeInByte":{"type":"number","description":"The size of the file in bytes."},"fbaId":{"type":"string","description":"Facebook attachment ID (optional)."},"waaId":{"type":"string","description":"WhatsApp attachment ID (optional)."}},"required":["name","bucketId","objectId","mimeType","sizeInByte"]},"StepElementContentVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for hanging up the voice call."},"headers":{"type":"object","description":"Custom headers to send with the hangup event.","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"StepElementContentVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string","description":"The target for the voice transfer (e.g., a phone number)."},"reason":{"type":"string","description":"An optional reason for the voice transfer."},"headers":{"type":"object","description":"Custom headers to send with the voice transfer.","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"StepElementContentAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string","description":"An optional reason for the agent handover."},"timeoutSeconds":{"type":"number","description":"Timeout in seconds for the agent to accept the handover."},"agentId":{"type":"string","description":"The ID of the specific agent to hand over to."},"groupId":{"type":"string","description":"The ID of the agent group to hand over to."},"assignmentMethod":{"type":"string","description":"The method used for assigning the agent."}}},"StepElementContentAssignVariableDto":{"type":"object","properties":{"variableId":{"type":"string","description":"The ID of the variable to assign a value to."},"path":{"type":"string","description":"Optional JSON path within the variable to assign the value."},"value":{"type":"string","description":"The value to assign to the variable."}},"required":["variableId"]},"StepElementContentUpdateTagsDto":{"type":"object","properties":{"method":{"type":"string","description":"The method to update tags ('add' or 'remove').","enum":["add","remove"]},"tagId":{"type":"string","description":"The ID of the tag to add or remove."}},"required":["method","tagId"]},"StepElementContentSnoozeDto":{"type":"object","properties":{"seconds":{"type":"number","description":"The duration in seconds to snooze the conversation."}},"required":["seconds"]},"StepElementContentUnreadDto":{"type":"object","properties":{"unread":{"type":"boolean","description":"Whether to mark the conversation as unread."}},"required":["unread"]},"StepElementContentWhatsAppTemplateDto":{"type":"object","properties":{"templateId":{"type":"string","description":"The ID of the WhatsApp template to send."},"parameters":{"type":"object","description":"Parameters to populate the WhatsApp template.","additionalProperties":{"type":"string"}}},"required":["templateId","parameters"]},"StepElementContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"object","description":"The text content for text-to-speech, localized.","additionalProperties":{"type":"string"}},"speech":{"type":"string","description":"Optional SSML speech markup."}},"required":["text"]},"StepElementContentCallSettingsDto":{"type":"object","properties":{"userInputSpeechDetectionTimeout":{"type":"number","description":"Timeout for user speech detection in milliseconds."},"dtmf":{"type":"boolean","description":"Whether DTMF (Dual-tone multi-frequency) input is enabled."},"bargeIn":{"type":"boolean","description":"Whether barge-in is enabled (user can interrupt bot)."}}},"StepElementContentMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the Meta WhatsApp template."},"templateId":{"type":"string","description":"The ID of the Meta WhatsApp template."},"header":{"description":"Header configuration for the Meta WhatsApp template.","allOf":[{"$ref":"#/components/schemas/StepElementContentMetaWhatsAppTemplateHeaderDto"}]},"bodyParameters":{"description":"Parameters for the body of the Meta WhatsApp template.","type":"array","items":{"type":"string"}},"buttons":{"description":"Button configurations for the Meta WhatsApp template.","allOf":[{"$ref":"#/components/schemas/StepElementContentMetaWhatsAppTemplateButtonsDto"}]}},"required":["templateName","templateId","bodyParameters"]},"StepElementContentMetaWhatsAppTemplateHeaderDto":{"type":"object","properties":{"file":{"description":"The file used in the template header.","allOf":[{"$ref":"#/components/schemas/StepElementContentFileDto"}]},"parameters":{"description":"Parameters for the header text.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"StepElementContentMetaWhatsAppTemplateButtonsDto":{"type":"object","properties":{"values":{"description":"Values for the buttons in the template.","type":"array","items":{"type":"string"}}},"required":["values"]},"StepElementContentNoteDto":{"type":"object","properties":{"note":{"type":"string","description":"A private note for internal use."}},"required":["note"]},"StepElementContentChatEndDto":{"type":"object","properties":{"status":{"description":"The status to set for the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED","allOf":[{"$ref":"#/components/schemas/StepElementContentChatEnd_ConversationStatus"}]}},"required":["status"]},"StepElementContentChatEnd_ConversationStatus":{"type":"number","enum":[0,1,2,3,-1],"description":"The status to set for the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED"},"StepElementContentAssignTeamDto":{"type":"object","properties":{"teamId":{"type":"string","description":"The ID of the team to assign the conversation to."}},"required":["teamId"]},"StepElementContentAssignOperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The ID of the operator to assign the conversation to."},"assignToLastAssigned":{"type":"boolean","description":"Whether to assign to the last assigned operator."}},"required":["assignToLastAssigned"]},"StepIntentDto":{"type":"object","properties":{"intentId":{"type":"string","description":"The ID of the associated intent."}},"required":["intentId"]},"StepDelayDto":{"type":"object","properties":{"seconds":{"type":"number","description":"The waiting time in seconds."}},"required":["seconds"]},"StepSplitDto":{"type":"object","properties":{"a":{"type":"number","description":"Percentage for exit A."},"b":{"type":"number","description":"Percentage for exit B."},"sameRedirect":{"type":"boolean","description":"Indicates whether both exits should lead to the same destination."},"redirects":{"description":"The redirect configurations for split A and B.","allOf":[{"$ref":"#/components/schemas/StepSplitRedirectsDto"}]}},"required":["a","b","sameRedirect","redirects"]},"StepSplitRedirectsDto":{"type":"object","properties":{"a":{"type":"string","description":"The step ID for redirect A."},"b":{"type":"string","description":"The step ID for redirect B."}},"required":["a","b"]},"StepConditionDto":{"type":"object","properties":{"redirects":{"description":"The redirect configurations based on condition outcome.","allOf":[{"$ref":"#/components/schemas/StepConditionRedirectsDto"}]},"conditions":{"description":"A list of conditions to evaluate.","type":"array","items":{"$ref":"#/components/schemas/StepConditionConditionDto"}}},"required":["redirects","conditions"]},"StepConditionRedirectsDto":{"type":"object","properties":{"t":{"type":"string","description":"The step ID to redirect to if the condition is true."},"f":{"type":"string","description":"The step ID to redirect to if the condition is false."}},"required":["t","f"]},"StepConditionConditionDto":{"type":"object","properties":{"valueLeft":{"type":"string","description":"The left-hand side value for the condition."},"operator":{"type":"string","description":"The operator for the condition (e.g., '==', '>', '<')."},"valueRight":{"type":"string","description":"The right-hand side value for the condition."},"group":{"type":"number","description":"The group number for logical grouping of conditions."}},"required":["valueLeft","operator","valueRight","group"]},"StepFlowDto":{"type":"object","properties":{"outlets":{"type":"object","description":"Outlets of the flow, mapping names to step IDs.","additionalProperties":{"$ref":"#/components/schemas/StepFlowOutletDto"}},"flowId":{"type":"string","description":"The ID of the flow to execute."},"entryStepId":{"type":"string","description":"The ID of the entry step within the flow."},"redirects":{"type":"object","description":"Redirects based on flow outcomes.","additionalProperties":{"type":"string"}}},"required":["outlets","flowId","entryStepId","redirects"]},"StepFlowOutletDto":{"type":"object","properties":{"stepId":{"type":"string","description":"The ID of the step this outlet points to."},"name":{"type":"string","description":"The name of the flow outlet."}},"required":["stepId","name"]},"StepTriggerDto":{"type":"object","properties":{"triggerId":{"type":"string","description":"The unique identifier of the trigger."},"event":{"type":"string","description":"The triggering event."},"payload":{"type":"string","description":"An optional payload value required for triggering."}},"required":["triggerId","event"]},"StepContextDto":{"type":"object","properties":{"intents":{"description":"A list of intents to consider in this context.","type":"array","items":{"$ref":"#/components/schemas/StepContextIntentDto"}},"fallbackRedirect":{"type":"string","description":"The step ID to redirect to if no intent is matched."}},"required":["intents"]},"StepContextIntentDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the intent."},"intentId":{"type":"string","description":"The ID of the intent."},"redirect":{"type":"string","description":"The step ID to redirect to if this intent is matched."}},"required":["name","intentId"]},"StepAppDto":{"type":"object","properties":{"appId":{"type":"string","description":"The ID of the app to integrate."},"moduleId":{"type":"string","description":"The ID of the module within the app to execute."},"paramsJson":{"type":"string","format":"json","description":"Parameters for the app module in JSON format."}},"required":["appId","moduleId","paramsJson"]},"StepEntityDetectionDto":{"type":"object","properties":{"outputVariableId":{"type":"string","description":"The ID of the variable to store the detected entities."},"outputVariablePath":{"type":"string","description":"Optional JSON path within the output variable."},"prompt":{"type":"string","description":"The prompt for entity detection."}},"required":["outputVariableId","prompt","examples"]},"StepRunPromptDto":{"type":"object","properties":{"outputVariableId":{"type":"string","description":"The ID of the variable to store the prompt's output."},"outputVariablePath":{"type":"string","description":"Optional JSON path within the output variable."},"prompt":{"type":"string","description":"The prompt to run."},"includeConversationHistory":{"type":"boolean","description":"Whether to include conversation history in the prompt."},"useRag":{"type":"boolean","description":"Whether to use RAG (Retrieval Augmented Generation)."},"includeNotes":{"type":"boolean","description":"Whether to use notes in prompt context."},"knowledgeGroupIds":{"description":"List of knowledge group IDs for RAG.","type":"array","items":{"type":"string"}},"ragContextMessages":{"type":"number","description":"Number of context messages for RAG."},"contextMessageCount":{"type":"number","description":"Number of messages to include in the context."}},"required":["outputVariableId","prompt","knowledgeGroupIds"]},"StepLeadAiConversationDto":{"type":"object","properties":{"prompt":{"type":"string","description":"The initial prompt for the AI conversation."},"context":{"type":"string","description":"Additional context for the AI conversation."},"maxIterations":{"type":"number","description":"The maximum number of iterations for the AI conversation."},"ragContextMessages":{"type":"number","description":"Number of context messages for RAG."},"includeConversationHistory":{"type":"boolean","description":"Whether to include conversation history."},"outlets":{"description":"Outlets for different conversation paths.","type":"array","items":{"$ref":"#/components/schemas/StepLeadAiConversationOutletDto"}},"tools":{"description":"Tools available to the AI during the conversation.","type":"array","items":{"$ref":"#/components/schemas/StepLeadAiConversationToolDto"}},"useRag":{"type":"boolean","description":"Whether to use RAG (Retrieval Augmented Generation)."},"delayMin":{"type":"number","description":"Minimum delay in seconds before the next AI response."},"delayMax":{"type":"number","description":"Maximum delay in seconds before the next AI response."},"delay":{"type":"boolean","description":"Whether to apply a delay before the next AI response."},"knowledgeGroupIds":{"description":"List of knowledge group IDs for RAG.","type":"array","items":{"type":"string"}},"contextMessageCount":{"type":"number","description":"Number of messages to include in the context."}},"required":["prompt","maxIterations","outlets","tools","knowledgeGroupIds"]},"StepLeadAiConversationOutletDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the conversation outlet."},"description":{"type":"string","description":"A description of what this outlet does."},"redirect":{"type":"string","description":"The step ID to redirect to when this outlet is triggered."}},"required":["name","description"]},"StepLeadAiConversationToolDto":{"type":"object","properties":{"appId":{"type":"string","description":"The ID of the app associated with the tool."},"moduleId":{"type":"string","description":"The ID of the module within the app."},"description":{"type":"string","description":"A description of what the tool does."},"name":{"type":"string","pattern":"/^[a-zA-Z][a-zA-Z0-9_]*$/","description":"The name of the tool."}},"required":["appId","moduleId","description","name"]},"StepContactDataDto":{"type":"object","properties":{"values":{"type":"string","description":"The values to set for contact data."}},"required":["values"]},"StepAiConfigDto":{"type":"object","properties":{"model":{"type":"number","description":"The AI model to use.\n\n- `1`: GEMINI_25_FLASH","enum":[1]},"thinkingBudget":{"type":"number","description":"Budget for the \"thinking\" process in tokens."},"seed":{"type":"number","description":"Seed for reproducible results."},"topP":{"type":"number","description":"Top-P value for generation."},"temperature":{"type":"number","description":"Temperature for generation creativity."}},"required":["model"]}}}}
```

## The UpdateOrCreateStepTriggerDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateOrCreateStepTriggerDto":{"type":"object","properties":{"event":{"type":"string","description":"The triggering event."},"payload":{"type":"string","description":"An optional payload value required for triggering."}},"required":["event"]}}}}
```

## The StepConversationDataDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepConversationDataDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the conversation."},"language":{"type":"string","description":"The language of the conversation."}},"required":["name","language"]}}}}
```

## The CreateStepRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateStepRequestDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the step."},"type":{"type":"string","description":"The type of the step."},"grid":{"description":"Grid coordinates for visual placement.","allOf":[{"$ref":"#/components/schemas/StepGridDto"}]},"elements":{"description":"A list of elements to include in the step.","default":[],"type":"array","items":{"$ref":"#/components/schemas/StepElementDto"}},"delay":{"description":"Optional delay configuration.","allOf":[{"$ref":"#/components/schemas/StepDelayDto"}]},"split":{"description":"Optional split configuration.","allOf":[{"$ref":"#/components/schemas/StepSplitDto"}]},"condition":{"description":"Optional condition configuration.","allOf":[{"$ref":"#/components/schemas/StepConditionDto"}]},"trigger":{"description":"Optional trigger configuration.","allOf":[{"$ref":"#/components/schemas/UpdateOrCreateStepTriggerDto"}]},"redirect":{"type":"string","description":"Optional step ID to redirect to."},"context":{"description":"Optional context configuration.","allOf":[{"$ref":"#/components/schemas/StepContextDto"}]},"app":{"description":"Optional app integration configuration.","allOf":[{"$ref":"#/components/schemas/StepAppDto"}]},"entityDetection":{"description":"Optional entity detection configuration.","allOf":[{"$ref":"#/components/schemas/StepEntityDetectionDto"}]},"description":{"type":"string","description":"An optional description for the step."},"flow":{"description":"Optional flow execution configuration.","allOf":[{"$ref":"#/components/schemas/StepFlowDto"}]},"runPrompt":{"description":"Optional run prompt configuration.","allOf":[{"$ref":"#/components/schemas/StepRunPromptDto"}]},"leadAiConversation":{"description":"Optional Lead AI conversation configuration.","allOf":[{"$ref":"#/components/schemas/StepLeadAiConversationDto"}]},"contactData":{"description":"Optional contact data configuration.","allOf":[{"$ref":"#/components/schemas/StepContactDataDto"}]},"aiConfig":{"description":"Optional AI configuration.","allOf":[{"$ref":"#/components/schemas/StepAiConfigDto"}]},"conversationData":{"description":"Optional conversation data.","allOf":[{"$ref":"#/components/schemas/StepConversationDataDto"}]}},"required":["name","type","grid","elements"]},"StepGridDto":{"type":"object","properties":{"x":{"type":"number","description":"X-coordinate in the flow editor."},"y":{"type":"number","description":"Y-coordinate in the flow editor."}},"required":["x","y"]},"StepElementDto":{"type":"object","properties":{"type":{"type":"string","description":"The type of the step element (e.g., 'text', 'buttons')."},"content":{"description":"The content of the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentDto"}]}},"required":["type","content"]},"StepElementContentDto":{"type":"object","properties":{"text":{"description":"Text content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentTextDto"}]},"buttons":{"description":"Button content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentButtonDto"}]},"file":{"description":"File content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentFileDto"}]},"voiceHangup":{"description":"Voice hangup action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentVoiceHangupDto"}]},"voiceTransfer":{"description":"Voice transfer action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentVoiceTransferDto"}]},"agentHandover":{"description":"Agent handover action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentAgentHandoverDto"}]},"assignVariable":{"description":"Assign variable action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentAssignVariableDto"}]},"updateTags":{"description":"Update tags action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentUpdateTagsDto"}]},"snooze":{"description":"Snooze action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentSnoozeDto"}]},"unread":{"description":"Unread action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentUnreadDto"}]},"whatsappTemplate":{"description":"WhatsApp template content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentWhatsAppTemplateDto"}]},"textToSpeech":{"description":"Text-to-speech content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentTextToSpeechDto"}]},"callSettings":{"description":"Call settings for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentCallSettingsDto"}]},"metaWhatsappTemplate":{"description":"Meta WhatsApp template content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentMetaWhatsAppTemplateDto"}]},"note":{"description":"Note content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentNoteDto"}]},"chatEnd":{"description":"Chat end action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentChatEndDto"}]},"assignTeam":{"description":"Assign team action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentAssignTeamDto"}]},"assignOperator":{"description":"Assign operator action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentAssignOperatorDto"}]}}},"StepElementContentTextDto":{"type":"object","properties":{"text":{"type":"object","description":"The text content, localized by language key.","additionalProperties":{"type":"string"}}},"required":["text"]},"StepElementContentButtonDto":{"type":"object","properties":{"buttons":{"description":"A list of buttons to display.","type":"array","items":{"$ref":"#/components/schemas/StepElementContentButtonButtonDto"}}},"required":["buttons"]},"StepElementContentButtonButtonDto":{"type":"object","properties":{"text":{"type":"object","description":"The text displayed on the button, localized.","additionalProperties":{"type":"string"}},"value":{"type":"string","description":"The value associated with the button."},"type":{"type":"string","description":"The type of button (e.g., 'redirect', 'postback')."},"payload":{"type":"string","description":"An optional payload for postback buttons."}},"required":["text","value","type"]},"StepElementContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the file."},"bucketId":{"type":"string","description":"The ID of the bucket where the file is stored."},"objectId":{"type":"string","description":"The object ID of the file within the bucket."},"mimeType":{"type":"string","description":"The MIME type of the file."},"sizeInByte":{"type":"number","description":"The size of the file in bytes."},"fbaId":{"type":"string","description":"Facebook attachment ID (optional)."},"waaId":{"type":"string","description":"WhatsApp attachment ID (optional)."}},"required":["name","bucketId","objectId","mimeType","sizeInByte"]},"StepElementContentVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for hanging up the voice call."},"headers":{"type":"object","description":"Custom headers to send with the hangup event.","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"StepElementContentVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string","description":"The target for the voice transfer (e.g., a phone number)."},"reason":{"type":"string","description":"An optional reason for the voice transfer."},"headers":{"type":"object","description":"Custom headers to send with the voice transfer.","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"StepElementContentAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string","description":"An optional reason for the agent handover."},"timeoutSeconds":{"type":"number","description":"Timeout in seconds for the agent to accept the handover."},"agentId":{"type":"string","description":"The ID of the specific agent to hand over to."},"groupId":{"type":"string","description":"The ID of the agent group to hand over to."},"assignmentMethod":{"type":"string","description":"The method used for assigning the agent."}}},"StepElementContentAssignVariableDto":{"type":"object","properties":{"variableId":{"type":"string","description":"The ID of the variable to assign a value to."},"path":{"type":"string","description":"Optional JSON path within the variable to assign the value."},"value":{"type":"string","description":"The value to assign to the variable."}},"required":["variableId"]},"StepElementContentUpdateTagsDto":{"type":"object","properties":{"method":{"type":"string","description":"The method to update tags ('add' or 'remove').","enum":["add","remove"]},"tagId":{"type":"string","description":"The ID of the tag to add or remove."}},"required":["method","tagId"]},"StepElementContentSnoozeDto":{"type":"object","properties":{"seconds":{"type":"number","description":"The duration in seconds to snooze the conversation."}},"required":["seconds"]},"StepElementContentUnreadDto":{"type":"object","properties":{"unread":{"type":"boolean","description":"Whether to mark the conversation as unread."}},"required":["unread"]},"StepElementContentWhatsAppTemplateDto":{"type":"object","properties":{"templateId":{"type":"string","description":"The ID of the WhatsApp template to send."},"parameters":{"type":"object","description":"Parameters to populate the WhatsApp template.","additionalProperties":{"type":"string"}}},"required":["templateId","parameters"]},"StepElementContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"object","description":"The text content for text-to-speech, localized.","additionalProperties":{"type":"string"}},"speech":{"type":"string","description":"Optional SSML speech markup."}},"required":["text"]},"StepElementContentCallSettingsDto":{"type":"object","properties":{"userInputSpeechDetectionTimeout":{"type":"number","description":"Timeout for user speech detection in milliseconds."},"dtmf":{"type":"boolean","description":"Whether DTMF (Dual-tone multi-frequency) input is enabled."},"bargeIn":{"type":"boolean","description":"Whether barge-in is enabled (user can interrupt bot)."}}},"StepElementContentMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the Meta WhatsApp template."},"templateId":{"type":"string","description":"The ID of the Meta WhatsApp template."},"header":{"description":"Header configuration for the Meta WhatsApp template.","allOf":[{"$ref":"#/components/schemas/StepElementContentMetaWhatsAppTemplateHeaderDto"}]},"bodyParameters":{"description":"Parameters for the body of the Meta WhatsApp template.","type":"array","items":{"type":"string"}},"buttons":{"description":"Button configurations for the Meta WhatsApp template.","allOf":[{"$ref":"#/components/schemas/StepElementContentMetaWhatsAppTemplateButtonsDto"}]}},"required":["templateName","templateId","bodyParameters"]},"StepElementContentMetaWhatsAppTemplateHeaderDto":{"type":"object","properties":{"file":{"description":"The file used in the template header.","allOf":[{"$ref":"#/components/schemas/StepElementContentFileDto"}]},"parameters":{"description":"Parameters for the header text.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"StepElementContentMetaWhatsAppTemplateButtonsDto":{"type":"object","properties":{"values":{"description":"Values for the buttons in the template.","type":"array","items":{"type":"string"}}},"required":["values"]},"StepElementContentNoteDto":{"type":"object","properties":{"note":{"type":"string","description":"A private note for internal use."}},"required":["note"]},"StepElementContentChatEndDto":{"type":"object","properties":{"status":{"description":"The status to set for the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED","allOf":[{"$ref":"#/components/schemas/StepElementContentChatEnd_ConversationStatus"}]}},"required":["status"]},"StepElementContentChatEnd_ConversationStatus":{"type":"number","enum":[0,1,2,3,-1],"description":"The status to set for the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED"},"StepElementContentAssignTeamDto":{"type":"object","properties":{"teamId":{"type":"string","description":"The ID of the team to assign the conversation to."}},"required":["teamId"]},"StepElementContentAssignOperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The ID of the operator to assign the conversation to."},"assignToLastAssigned":{"type":"boolean","description":"Whether to assign to the last assigned operator."}},"required":["assignToLastAssigned"]},"StepDelayDto":{"type":"object","properties":{"seconds":{"type":"number","description":"The waiting time in seconds."}},"required":["seconds"]},"StepSplitDto":{"type":"object","properties":{"a":{"type":"number","description":"Percentage for exit A."},"b":{"type":"number","description":"Percentage for exit B."},"sameRedirect":{"type":"boolean","description":"Indicates whether both exits should lead to the same destination."},"redirects":{"description":"The redirect configurations for split A and B.","allOf":[{"$ref":"#/components/schemas/StepSplitRedirectsDto"}]}},"required":["a","b","sameRedirect","redirects"]},"StepSplitRedirectsDto":{"type":"object","properties":{"a":{"type":"string","description":"The step ID for redirect A."},"b":{"type":"string","description":"The step ID for redirect B."}},"required":["a","b"]},"StepConditionDto":{"type":"object","properties":{"redirects":{"description":"The redirect configurations based on condition outcome.","allOf":[{"$ref":"#/components/schemas/StepConditionRedirectsDto"}]},"conditions":{"description":"A list of conditions to evaluate.","type":"array","items":{"$ref":"#/components/schemas/StepConditionConditionDto"}}},"required":["redirects","conditions"]},"StepConditionRedirectsDto":{"type":"object","properties":{"t":{"type":"string","description":"The step ID to redirect to if the condition is true."},"f":{"type":"string","description":"The step ID to redirect to if the condition is false."}},"required":["t","f"]},"StepConditionConditionDto":{"type":"object","properties":{"valueLeft":{"type":"string","description":"The left-hand side value for the condition."},"operator":{"type":"string","description":"The operator for the condition (e.g., '==', '>', '<')."},"valueRight":{"type":"string","description":"The right-hand side value for the condition."},"group":{"type":"number","description":"The group number for logical grouping of conditions."}},"required":["valueLeft","operator","valueRight","group"]},"UpdateOrCreateStepTriggerDto":{"type":"object","properties":{"event":{"type":"string","description":"The triggering event."},"payload":{"type":"string","description":"An optional payload value required for triggering."}},"required":["event"]},"StepContextDto":{"type":"object","properties":{"intents":{"description":"A list of intents to consider in this context.","type":"array","items":{"$ref":"#/components/schemas/StepContextIntentDto"}},"fallbackRedirect":{"type":"string","description":"The step ID to redirect to if no intent is matched."}},"required":["intents"]},"StepContextIntentDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the intent."},"intentId":{"type":"string","description":"The ID of the intent."},"redirect":{"type":"string","description":"The step ID to redirect to if this intent is matched."}},"required":["name","intentId"]},"StepAppDto":{"type":"object","properties":{"appId":{"type":"string","description":"The ID of the app to integrate."},"moduleId":{"type":"string","description":"The ID of the module within the app to execute."},"paramsJson":{"type":"string","format":"json","description":"Parameters for the app module in JSON format."}},"required":["appId","moduleId","paramsJson"]},"StepEntityDetectionDto":{"type":"object","properties":{"outputVariableId":{"type":"string","description":"The ID of the variable to store the detected entities."},"outputVariablePath":{"type":"string","description":"Optional JSON path within the output variable."},"prompt":{"type":"string","description":"The prompt for entity detection."}},"required":["outputVariableId","prompt","examples"]},"StepFlowDto":{"type":"object","properties":{"outlets":{"type":"object","description":"Outlets of the flow, mapping names to step IDs.","additionalProperties":{"$ref":"#/components/schemas/StepFlowOutletDto"}},"flowId":{"type":"string","description":"The ID of the flow to execute."},"entryStepId":{"type":"string","description":"The ID of the entry step within the flow."},"redirects":{"type":"object","description":"Redirects based on flow outcomes.","additionalProperties":{"type":"string"}}},"required":["outlets","flowId","entryStepId","redirects"]},"StepFlowOutletDto":{"type":"object","properties":{"stepId":{"type":"string","description":"The ID of the step this outlet points to."},"name":{"type":"string","description":"The name of the flow outlet."}},"required":["stepId","name"]},"StepRunPromptDto":{"type":"object","properties":{"outputVariableId":{"type":"string","description":"The ID of the variable to store the prompt's output."},"outputVariablePath":{"type":"string","description":"Optional JSON path within the output variable."},"prompt":{"type":"string","description":"The prompt to run."},"includeConversationHistory":{"type":"boolean","description":"Whether to include conversation history in the prompt."},"useRag":{"type":"boolean","description":"Whether to use RAG (Retrieval Augmented Generation)."},"includeNotes":{"type":"boolean","description":"Whether to use notes in prompt context."},"knowledgeGroupIds":{"description":"List of knowledge group IDs for RAG.","type":"array","items":{"type":"string"}},"ragContextMessages":{"type":"number","description":"Number of context messages for RAG."},"contextMessageCount":{"type":"number","description":"Number of messages to include in the context."}},"required":["outputVariableId","prompt","knowledgeGroupIds"]},"StepLeadAiConversationDto":{"type":"object","properties":{"prompt":{"type":"string","description":"The initial prompt for the AI conversation."},"context":{"type":"string","description":"Additional context for the AI conversation."},"maxIterations":{"type":"number","description":"The maximum number of iterations for the AI conversation."},"ragContextMessages":{"type":"number","description":"Number of context messages for RAG."},"includeConversationHistory":{"type":"boolean","description":"Whether to include conversation history."},"outlets":{"description":"Outlets for different conversation paths.","type":"array","items":{"$ref":"#/components/schemas/StepLeadAiConversationOutletDto"}},"tools":{"description":"Tools available to the AI during the conversation.","type":"array","items":{"$ref":"#/components/schemas/StepLeadAiConversationToolDto"}},"useRag":{"type":"boolean","description":"Whether to use RAG (Retrieval Augmented Generation)."},"delayMin":{"type":"number","description":"Minimum delay in seconds before the next AI response."},"delayMax":{"type":"number","description":"Maximum delay in seconds before the next AI response."},"delay":{"type":"boolean","description":"Whether to apply a delay before the next AI response."},"knowledgeGroupIds":{"description":"List of knowledge group IDs for RAG.","type":"array","items":{"type":"string"}},"contextMessageCount":{"type":"number","description":"Number of messages to include in the context."}},"required":["prompt","maxIterations","outlets","tools","knowledgeGroupIds"]},"StepLeadAiConversationOutletDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the conversation outlet."},"description":{"type":"string","description":"A description of what this outlet does."},"redirect":{"type":"string","description":"The step ID to redirect to when this outlet is triggered."}},"required":["name","description"]},"StepLeadAiConversationToolDto":{"type":"object","properties":{"appId":{"type":"string","description":"The ID of the app associated with the tool."},"moduleId":{"type":"string","description":"The ID of the module within the app."},"description":{"type":"string","description":"A description of what the tool does."},"name":{"type":"string","pattern":"/^[a-zA-Z][a-zA-Z0-9_]*$/","description":"The name of the tool."}},"required":["appId","moduleId","description","name"]},"StepContactDataDto":{"type":"object","properties":{"values":{"type":"string","description":"The values to set for contact data."}},"required":["values"]},"StepAiConfigDto":{"type":"object","properties":{"model":{"type":"number","description":"The AI model to use.\n\n- `1`: GEMINI_25_FLASH","enum":[1]},"thinkingBudget":{"type":"number","description":"Budget for the \"thinking\" process in tokens."},"seed":{"type":"number","description":"Seed for reproducible results."},"topP":{"type":"number","description":"Top-P value for generation."},"temperature":{"type":"number","description":"Temperature for generation creativity."}},"required":["model"]},"StepConversationDataDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the conversation."},"language":{"type":"string","description":"The language of the conversation."}},"required":["name","language"]}}}}
```

## The StepResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepResponseDto":{"type":"object","properties":{"step":{"description":"The retrieved step.","allOf":[{"$ref":"#/components/schemas/StepDto"}]}}},"StepDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the step."},"name":{"type":"string","description":"The name of the step."},"created":{"type":"string","description":"The creation timestamp of the step."},"updated":{"type":"string","description":"The last update timestamp of the step."},"type":{"type":"string","description":"The type of the step (e.g., 'start', 'message', 'condition')."},"grid":{"description":"Grid coordinates for visual placement in the editor.","allOf":[{"$ref":"#/components/schemas/StepGridDto"}]},"elements":{"description":"A list of elements within this step.","type":"array","items":{"$ref":"#/components/schemas/StepElementDto"}},"intent":{"description":"Optional intent configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepIntentDto"}]},"delay":{"description":"Optional delay configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepDelayDto"}]},"split":{"description":"Optional split configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepSplitDto"}]},"condition":{"description":"Optional condition configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepConditionDto"}]},"flow":{"description":"Optional flow execution configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepFlowDto"}]},"trigger":{"description":"Optional trigger configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepTriggerDto"}]},"redirect":{"type":"string","description":"Optional step ID to redirect to."},"userInput":{"type":"string","description":"Optional user input prompt."},"userInputRequired":{"type":"boolean","description":"Whether user input is required for this step."},"context":{"description":"Optional context configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepContextDto"}]},"app":{"description":"Optional app integration configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepAppDto"}]},"description":{"type":"string","description":"An optional description for the step."},"entityDetection":{"description":"Optional entity detection configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepEntityDetectionDto"}]},"userInputIsSensitive":{"type":"boolean","description":"Whether user input in this step is sensitive."},"runPrompt":{"description":"Optional run prompt configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepRunPromptDto"}]},"leadAiConversation":{"description":"Optional Lead AI conversation configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepLeadAiConversationDto"}]},"contactData":{"description":"Optional contact data configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepContactDataDto"}]},"aiConfig":{"description":"Optional AI configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepAiConfigDto"}]}},"required":["id","name","created","updated","type","grid","elements"]},"StepGridDto":{"type":"object","properties":{"x":{"type":"number","description":"X-coordinate in the flow editor."},"y":{"type":"number","description":"Y-coordinate in the flow editor."}},"required":["x","y"]},"StepElementDto":{"type":"object","properties":{"type":{"type":"string","description":"The type of the step element (e.g., 'text', 'buttons')."},"content":{"description":"The content of the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentDto"}]}},"required":["type","content"]},"StepElementContentDto":{"type":"object","properties":{"text":{"description":"Text content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentTextDto"}]},"buttons":{"description":"Button content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentButtonDto"}]},"file":{"description":"File content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentFileDto"}]},"voiceHangup":{"description":"Voice hangup action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentVoiceHangupDto"}]},"voiceTransfer":{"description":"Voice transfer action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentVoiceTransferDto"}]},"agentHandover":{"description":"Agent handover action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentAgentHandoverDto"}]},"assignVariable":{"description":"Assign variable action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentAssignVariableDto"}]},"updateTags":{"description":"Update tags action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentUpdateTagsDto"}]},"snooze":{"description":"Snooze action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentSnoozeDto"}]},"unread":{"description":"Unread action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentUnreadDto"}]},"whatsappTemplate":{"description":"WhatsApp template content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentWhatsAppTemplateDto"}]},"textToSpeech":{"description":"Text-to-speech content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentTextToSpeechDto"}]},"callSettings":{"description":"Call settings for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentCallSettingsDto"}]},"metaWhatsappTemplate":{"description":"Meta WhatsApp template content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentMetaWhatsAppTemplateDto"}]},"note":{"description":"Note content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentNoteDto"}]},"chatEnd":{"description":"Chat end action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentChatEndDto"}]},"assignTeam":{"description":"Assign team action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentAssignTeamDto"}]},"assignOperator":{"description":"Assign operator action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentAssignOperatorDto"}]}}},"StepElementContentTextDto":{"type":"object","properties":{"text":{"type":"object","description":"The text content, localized by language key.","additionalProperties":{"type":"string"}}},"required":["text"]},"StepElementContentButtonDto":{"type":"object","properties":{"buttons":{"description":"A list of buttons to display.","type":"array","items":{"$ref":"#/components/schemas/StepElementContentButtonButtonDto"}}},"required":["buttons"]},"StepElementContentButtonButtonDto":{"type":"object","properties":{"text":{"type":"object","description":"The text displayed on the button, localized.","additionalProperties":{"type":"string"}},"value":{"type":"string","description":"The value associated with the button."},"type":{"type":"string","description":"The type of button (e.g., 'redirect', 'postback')."},"payload":{"type":"string","description":"An optional payload for postback buttons."}},"required":["text","value","type"]},"StepElementContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the file."},"bucketId":{"type":"string","description":"The ID of the bucket where the file is stored."},"objectId":{"type":"string","description":"The object ID of the file within the bucket."},"mimeType":{"type":"string","description":"The MIME type of the file."},"sizeInByte":{"type":"number","description":"The size of the file in bytes."},"fbaId":{"type":"string","description":"Facebook attachment ID (optional)."},"waaId":{"type":"string","description":"WhatsApp attachment ID (optional)."}},"required":["name","bucketId","objectId","mimeType","sizeInByte"]},"StepElementContentVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for hanging up the voice call."},"headers":{"type":"object","description":"Custom headers to send with the hangup event.","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"StepElementContentVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string","description":"The target for the voice transfer (e.g., a phone number)."},"reason":{"type":"string","description":"An optional reason for the voice transfer."},"headers":{"type":"object","description":"Custom headers to send with the voice transfer.","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"StepElementContentAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string","description":"An optional reason for the agent handover."},"timeoutSeconds":{"type":"number","description":"Timeout in seconds for the agent to accept the handover."},"agentId":{"type":"string","description":"The ID of the specific agent to hand over to."},"groupId":{"type":"string","description":"The ID of the agent group to hand over to."},"assignmentMethod":{"type":"string","description":"The method used for assigning the agent."}}},"StepElementContentAssignVariableDto":{"type":"object","properties":{"variableId":{"type":"string","description":"The ID of the variable to assign a value to."},"path":{"type":"string","description":"Optional JSON path within the variable to assign the value."},"value":{"type":"string","description":"The value to assign to the variable."}},"required":["variableId"]},"StepElementContentUpdateTagsDto":{"type":"object","properties":{"method":{"type":"string","description":"The method to update tags ('add' or 'remove').","enum":["add","remove"]},"tagId":{"type":"string","description":"The ID of the tag to add or remove."}},"required":["method","tagId"]},"StepElementContentSnoozeDto":{"type":"object","properties":{"seconds":{"type":"number","description":"The duration in seconds to snooze the conversation."}},"required":["seconds"]},"StepElementContentUnreadDto":{"type":"object","properties":{"unread":{"type":"boolean","description":"Whether to mark the conversation as unread."}},"required":["unread"]},"StepElementContentWhatsAppTemplateDto":{"type":"object","properties":{"templateId":{"type":"string","description":"The ID of the WhatsApp template to send."},"parameters":{"type":"object","description":"Parameters to populate the WhatsApp template.","additionalProperties":{"type":"string"}}},"required":["templateId","parameters"]},"StepElementContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"object","description":"The text content for text-to-speech, localized.","additionalProperties":{"type":"string"}},"speech":{"type":"string","description":"Optional SSML speech markup."}},"required":["text"]},"StepElementContentCallSettingsDto":{"type":"object","properties":{"userInputSpeechDetectionTimeout":{"type":"number","description":"Timeout for user speech detection in milliseconds."},"dtmf":{"type":"boolean","description":"Whether DTMF (Dual-tone multi-frequency) input is enabled."},"bargeIn":{"type":"boolean","description":"Whether barge-in is enabled (user can interrupt bot)."}}},"StepElementContentMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the Meta WhatsApp template."},"templateId":{"type":"string","description":"The ID of the Meta WhatsApp template."},"header":{"description":"Header configuration for the Meta WhatsApp template.","allOf":[{"$ref":"#/components/schemas/StepElementContentMetaWhatsAppTemplateHeaderDto"}]},"bodyParameters":{"description":"Parameters for the body of the Meta WhatsApp template.","type":"array","items":{"type":"string"}},"buttons":{"description":"Button configurations for the Meta WhatsApp template.","allOf":[{"$ref":"#/components/schemas/StepElementContentMetaWhatsAppTemplateButtonsDto"}]}},"required":["templateName","templateId","bodyParameters"]},"StepElementContentMetaWhatsAppTemplateHeaderDto":{"type":"object","properties":{"file":{"description":"The file used in the template header.","allOf":[{"$ref":"#/components/schemas/StepElementContentFileDto"}]},"parameters":{"description":"Parameters for the header text.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"StepElementContentMetaWhatsAppTemplateButtonsDto":{"type":"object","properties":{"values":{"description":"Values for the buttons in the template.","type":"array","items":{"type":"string"}}},"required":["values"]},"StepElementContentNoteDto":{"type":"object","properties":{"note":{"type":"string","description":"A private note for internal use."}},"required":["note"]},"StepElementContentChatEndDto":{"type":"object","properties":{"status":{"description":"The status to set for the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED","allOf":[{"$ref":"#/components/schemas/StepElementContentChatEnd_ConversationStatus"}]}},"required":["status"]},"StepElementContentChatEnd_ConversationStatus":{"type":"number","enum":[0,1,2,3,-1],"description":"The status to set for the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED"},"StepElementContentAssignTeamDto":{"type":"object","properties":{"teamId":{"type":"string","description":"The ID of the team to assign the conversation to."}},"required":["teamId"]},"StepElementContentAssignOperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The ID of the operator to assign the conversation to."},"assignToLastAssigned":{"type":"boolean","description":"Whether to assign to the last assigned operator."}},"required":["assignToLastAssigned"]},"StepIntentDto":{"type":"object","properties":{"intentId":{"type":"string","description":"The ID of the associated intent."}},"required":["intentId"]},"StepDelayDto":{"type":"object","properties":{"seconds":{"type":"number","description":"The waiting time in seconds."}},"required":["seconds"]},"StepSplitDto":{"type":"object","properties":{"a":{"type":"number","description":"Percentage for exit A."},"b":{"type":"number","description":"Percentage for exit B."},"sameRedirect":{"type":"boolean","description":"Indicates whether both exits should lead to the same destination."},"redirects":{"description":"The redirect configurations for split A and B.","allOf":[{"$ref":"#/components/schemas/StepSplitRedirectsDto"}]}},"required":["a","b","sameRedirect","redirects"]},"StepSplitRedirectsDto":{"type":"object","properties":{"a":{"type":"string","description":"The step ID for redirect A."},"b":{"type":"string","description":"The step ID for redirect B."}},"required":["a","b"]},"StepConditionDto":{"type":"object","properties":{"redirects":{"description":"The redirect configurations based on condition outcome.","allOf":[{"$ref":"#/components/schemas/StepConditionRedirectsDto"}]},"conditions":{"description":"A list of conditions to evaluate.","type":"array","items":{"$ref":"#/components/schemas/StepConditionConditionDto"}}},"required":["redirects","conditions"]},"StepConditionRedirectsDto":{"type":"object","properties":{"t":{"type":"string","description":"The step ID to redirect to if the condition is true."},"f":{"type":"string","description":"The step ID to redirect to if the condition is false."}},"required":["t","f"]},"StepConditionConditionDto":{"type":"object","properties":{"valueLeft":{"type":"string","description":"The left-hand side value for the condition."},"operator":{"type":"string","description":"The operator for the condition (e.g., '==', '>', '<')."},"valueRight":{"type":"string","description":"The right-hand side value for the condition."},"group":{"type":"number","description":"The group number for logical grouping of conditions."}},"required":["valueLeft","operator","valueRight","group"]},"StepFlowDto":{"type":"object","properties":{"outlets":{"type":"object","description":"Outlets of the flow, mapping names to step IDs.","additionalProperties":{"$ref":"#/components/schemas/StepFlowOutletDto"}},"flowId":{"type":"string","description":"The ID of the flow to execute."},"entryStepId":{"type":"string","description":"The ID of the entry step within the flow."},"redirects":{"type":"object","description":"Redirects based on flow outcomes.","additionalProperties":{"type":"string"}}},"required":["outlets","flowId","entryStepId","redirects"]},"StepFlowOutletDto":{"type":"object","properties":{"stepId":{"type":"string","description":"The ID of the step this outlet points to."},"name":{"type":"string","description":"The name of the flow outlet."}},"required":["stepId","name"]},"StepTriggerDto":{"type":"object","properties":{"triggerId":{"type":"string","description":"The unique identifier of the trigger."},"event":{"type":"string","description":"The triggering event."},"payload":{"type":"string","description":"An optional payload value required for triggering."}},"required":["triggerId","event"]},"StepContextDto":{"type":"object","properties":{"intents":{"description":"A list of intents to consider in this context.","type":"array","items":{"$ref":"#/components/schemas/StepContextIntentDto"}},"fallbackRedirect":{"type":"string","description":"The step ID to redirect to if no intent is matched."}},"required":["intents"]},"StepContextIntentDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the intent."},"intentId":{"type":"string","description":"The ID of the intent."},"redirect":{"type":"string","description":"The step ID to redirect to if this intent is matched."}},"required":["name","intentId"]},"StepAppDto":{"type":"object","properties":{"appId":{"type":"string","description":"The ID of the app to integrate."},"moduleId":{"type":"string","description":"The ID of the module within the app to execute."},"paramsJson":{"type":"string","format":"json","description":"Parameters for the app module in JSON format."}},"required":["appId","moduleId","paramsJson"]},"StepEntityDetectionDto":{"type":"object","properties":{"outputVariableId":{"type":"string","description":"The ID of the variable to store the detected entities."},"outputVariablePath":{"type":"string","description":"Optional JSON path within the output variable."},"prompt":{"type":"string","description":"The prompt for entity detection."}},"required":["outputVariableId","prompt","examples"]},"StepRunPromptDto":{"type":"object","properties":{"outputVariableId":{"type":"string","description":"The ID of the variable to store the prompt's output."},"outputVariablePath":{"type":"string","description":"Optional JSON path within the output variable."},"prompt":{"type":"string","description":"The prompt to run."},"includeConversationHistory":{"type":"boolean","description":"Whether to include conversation history in the prompt."},"useRag":{"type":"boolean","description":"Whether to use RAG (Retrieval Augmented Generation)."},"includeNotes":{"type":"boolean","description":"Whether to use notes in prompt context."},"knowledgeGroupIds":{"description":"List of knowledge group IDs for RAG.","type":"array","items":{"type":"string"}},"ragContextMessages":{"type":"number","description":"Number of context messages for RAG."},"contextMessageCount":{"type":"number","description":"Number of messages to include in the context."}},"required":["outputVariableId","prompt","knowledgeGroupIds"]},"StepLeadAiConversationDto":{"type":"object","properties":{"prompt":{"type":"string","description":"The initial prompt for the AI conversation."},"context":{"type":"string","description":"Additional context for the AI conversation."},"maxIterations":{"type":"number","description":"The maximum number of iterations for the AI conversation."},"ragContextMessages":{"type":"number","description":"Number of context messages for RAG."},"includeConversationHistory":{"type":"boolean","description":"Whether to include conversation history."},"outlets":{"description":"Outlets for different conversation paths.","type":"array","items":{"$ref":"#/components/schemas/StepLeadAiConversationOutletDto"}},"tools":{"description":"Tools available to the AI during the conversation.","type":"array","items":{"$ref":"#/components/schemas/StepLeadAiConversationToolDto"}},"useRag":{"type":"boolean","description":"Whether to use RAG (Retrieval Augmented Generation)."},"delayMin":{"type":"number","description":"Minimum delay in seconds before the next AI response."},"delayMax":{"type":"number","description":"Maximum delay in seconds before the next AI response."},"delay":{"type":"boolean","description":"Whether to apply a delay before the next AI response."},"knowledgeGroupIds":{"description":"List of knowledge group IDs for RAG.","type":"array","items":{"type":"string"}},"contextMessageCount":{"type":"number","description":"Number of messages to include in the context."}},"required":["prompt","maxIterations","outlets","tools","knowledgeGroupIds"]},"StepLeadAiConversationOutletDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the conversation outlet."},"description":{"type":"string","description":"A description of what this outlet does."},"redirect":{"type":"string","description":"The step ID to redirect to when this outlet is triggered."}},"required":["name","description"]},"StepLeadAiConversationToolDto":{"type":"object","properties":{"appId":{"type":"string","description":"The ID of the app associated with the tool."},"moduleId":{"type":"string","description":"The ID of the module within the app."},"description":{"type":"string","description":"A description of what the tool does."},"name":{"type":"string","pattern":"/^[a-zA-Z][a-zA-Z0-9_]*$/","description":"The name of the tool."}},"required":["appId","moduleId","description","name"]},"StepContactDataDto":{"type":"object","properties":{"values":{"type":"string","description":"The values to set for contact data."}},"required":["values"]},"StepAiConfigDto":{"type":"object","properties":{"model":{"type":"number","description":"The AI model to use.\n\n- `1`: GEMINI_25_FLASH","enum":[1]},"thinkingBudget":{"type":"number","description":"Budget for the \"thinking\" process in tokens."},"seed":{"type":"number","description":"Seed for reproducible results."},"topP":{"type":"number","description":"Top-P value for generation."},"temperature":{"type":"number","description":"Temperature for generation creativity."}},"required":["model"]}}}}
```

## The UpdateStepRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateStepRequestDto":{"type":"object","properties":{"name":{"type":"string","description":"The new name of the step."},"grid":{"description":"New grid coordinates for visual placement.","allOf":[{"$ref":"#/components/schemas/StepGridDto"}]},"elements":{"description":"A list of elements to update in the step.","default":[],"type":"array","items":{"$ref":"#/components/schemas/StepElementDto"}},"delay":{"description":"Optional delay configuration.","allOf":[{"$ref":"#/components/schemas/StepDelayDto"}]},"split":{"description":"Optional split configuration.","allOf":[{"$ref":"#/components/schemas/StepSplitDto"}]},"condition":{"description":"Optional condition configuration.","allOf":[{"$ref":"#/components/schemas/StepConditionDto"}]},"flow":{"description":"Optional flow execution configuration.","allOf":[{"$ref":"#/components/schemas/StepFlowDto"}]},"trigger":{"description":"Optional trigger configuration.","allOf":[{"$ref":"#/components/schemas/UpdateOrCreateStepTriggerDto"}]},"redirect":{"type":"string","description":"Optional step ID to redirect to."},"userInput":{"type":"string","description":"Optional user input redirect."},"userInputRequired":{"type":"boolean","description":"Whether user input is required for this step."},"context":{"description":"Optional context configuration.","allOf":[{"$ref":"#/components/schemas/StepContextDto"}]},"app":{"description":"Optional app integration configuration.","allOf":[{"$ref":"#/components/schemas/StepAppDto"}]},"entityDetection":{"description":"Optional entity detection configuration.","allOf":[{"$ref":"#/components/schemas/StepEntityDetectionDto"}]},"description":{"type":"string","description":"An optional description for the step."},"userInputIsSensitive":{"type":"boolean","description":"Whether user input in this step is sensitive."},"runPrompt":{"description":"Optional run prompt configuration.","allOf":[{"$ref":"#/components/schemas/StepRunPromptDto"}]},"leadAiConversation":{"description":"Optional Lead AI conversation configuration.","allOf":[{"$ref":"#/components/schemas/StepLeadAiConversationDto"}]},"intent":{"description":"Optional intent configuration for the step.","allOf":[{"$ref":"#/components/schemas/StepIntentDto"}]},"contactData":{"description":"Optional contact data configuration.","allOf":[{"$ref":"#/components/schemas/StepContactDataDto"}]},"aiConfig":{"description":"Optional AI configuration.","allOf":[{"$ref":"#/components/schemas/StepAiConfigDto"}]},"conversationData":{"description":"Optional conversation data.","allOf":[{"$ref":"#/components/schemas/StepConversationDataDto"}]}},"required":["elements"]},"StepGridDto":{"type":"object","properties":{"x":{"type":"number","description":"X-coordinate in the flow editor."},"y":{"type":"number","description":"Y-coordinate in the flow editor."}},"required":["x","y"]},"StepElementDto":{"type":"object","properties":{"type":{"type":"string","description":"The type of the step element (e.g., 'text', 'buttons')."},"content":{"description":"The content of the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentDto"}]}},"required":["type","content"]},"StepElementContentDto":{"type":"object","properties":{"text":{"description":"Text content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentTextDto"}]},"buttons":{"description":"Button content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentButtonDto"}]},"file":{"description":"File content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentFileDto"}]},"voiceHangup":{"description":"Voice hangup action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentVoiceHangupDto"}]},"voiceTransfer":{"description":"Voice transfer action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentVoiceTransferDto"}]},"agentHandover":{"description":"Agent handover action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentAgentHandoverDto"}]},"assignVariable":{"description":"Assign variable action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentAssignVariableDto"}]},"updateTags":{"description":"Update tags action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentUpdateTagsDto"}]},"snooze":{"description":"Snooze action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentSnoozeDto"}]},"unread":{"description":"Unread action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentUnreadDto"}]},"whatsappTemplate":{"description":"WhatsApp template content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentWhatsAppTemplateDto"}]},"textToSpeech":{"description":"Text-to-speech content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentTextToSpeechDto"}]},"callSettings":{"description":"Call settings for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentCallSettingsDto"}]},"metaWhatsappTemplate":{"description":"Meta WhatsApp template content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentMetaWhatsAppTemplateDto"}]},"note":{"description":"Note content for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentNoteDto"}]},"chatEnd":{"description":"Chat end action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentChatEndDto"}]},"assignTeam":{"description":"Assign team action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentAssignTeamDto"}]},"assignOperator":{"description":"Assign operator action for the step element.","allOf":[{"$ref":"#/components/schemas/StepElementContentAssignOperatorDto"}]}}},"StepElementContentTextDto":{"type":"object","properties":{"text":{"type":"object","description":"The text content, localized by language key.","additionalProperties":{"type":"string"}}},"required":["text"]},"StepElementContentButtonDto":{"type":"object","properties":{"buttons":{"description":"A list of buttons to display.","type":"array","items":{"$ref":"#/components/schemas/StepElementContentButtonButtonDto"}}},"required":["buttons"]},"StepElementContentButtonButtonDto":{"type":"object","properties":{"text":{"type":"object","description":"The text displayed on the button, localized.","additionalProperties":{"type":"string"}},"value":{"type":"string","description":"The value associated with the button."},"type":{"type":"string","description":"The type of button (e.g., 'redirect', 'postback')."},"payload":{"type":"string","description":"An optional payload for postback buttons."}},"required":["text","value","type"]},"StepElementContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the file."},"bucketId":{"type":"string","description":"The ID of the bucket where the file is stored."},"objectId":{"type":"string","description":"The object ID of the file within the bucket."},"mimeType":{"type":"string","description":"The MIME type of the file."},"sizeInByte":{"type":"number","description":"The size of the file in bytes."},"fbaId":{"type":"string","description":"Facebook attachment ID (optional)."},"waaId":{"type":"string","description":"WhatsApp attachment ID (optional)."}},"required":["name","bucketId","objectId","mimeType","sizeInByte"]},"StepElementContentVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for hanging up the voice call."},"headers":{"type":"object","description":"Custom headers to send with the hangup event.","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"StepElementContentVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string","description":"The target for the voice transfer (e.g., a phone number)."},"reason":{"type":"string","description":"An optional reason for the voice transfer."},"headers":{"type":"object","description":"Custom headers to send with the voice transfer.","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"StepElementContentAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string","description":"An optional reason for the agent handover."},"timeoutSeconds":{"type":"number","description":"Timeout in seconds for the agent to accept the handover."},"agentId":{"type":"string","description":"The ID of the specific agent to hand over to."},"groupId":{"type":"string","description":"The ID of the agent group to hand over to."},"assignmentMethod":{"type":"string","description":"The method used for assigning the agent."}}},"StepElementContentAssignVariableDto":{"type":"object","properties":{"variableId":{"type":"string","description":"The ID of the variable to assign a value to."},"path":{"type":"string","description":"Optional JSON path within the variable to assign the value."},"value":{"type":"string","description":"The value to assign to the variable."}},"required":["variableId"]},"StepElementContentUpdateTagsDto":{"type":"object","properties":{"method":{"type":"string","description":"The method to update tags ('add' or 'remove').","enum":["add","remove"]},"tagId":{"type":"string","description":"The ID of the tag to add or remove."}},"required":["method","tagId"]},"StepElementContentSnoozeDto":{"type":"object","properties":{"seconds":{"type":"number","description":"The duration in seconds to snooze the conversation."}},"required":["seconds"]},"StepElementContentUnreadDto":{"type":"object","properties":{"unread":{"type":"boolean","description":"Whether to mark the conversation as unread."}},"required":["unread"]},"StepElementContentWhatsAppTemplateDto":{"type":"object","properties":{"templateId":{"type":"string","description":"The ID of the WhatsApp template to send."},"parameters":{"type":"object","description":"Parameters to populate the WhatsApp template.","additionalProperties":{"type":"string"}}},"required":["templateId","parameters"]},"StepElementContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"object","description":"The text content for text-to-speech, localized.","additionalProperties":{"type":"string"}},"speech":{"type":"string","description":"Optional SSML speech markup."}},"required":["text"]},"StepElementContentCallSettingsDto":{"type":"object","properties":{"userInputSpeechDetectionTimeout":{"type":"number","description":"Timeout for user speech detection in milliseconds."},"dtmf":{"type":"boolean","description":"Whether DTMF (Dual-tone multi-frequency) input is enabled."},"bargeIn":{"type":"boolean","description":"Whether barge-in is enabled (user can interrupt bot)."}}},"StepElementContentMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the Meta WhatsApp template."},"templateId":{"type":"string","description":"The ID of the Meta WhatsApp template."},"header":{"description":"Header configuration for the Meta WhatsApp template.","allOf":[{"$ref":"#/components/schemas/StepElementContentMetaWhatsAppTemplateHeaderDto"}]},"bodyParameters":{"description":"Parameters for the body of the Meta WhatsApp template.","type":"array","items":{"type":"string"}},"buttons":{"description":"Button configurations for the Meta WhatsApp template.","allOf":[{"$ref":"#/components/schemas/StepElementContentMetaWhatsAppTemplateButtonsDto"}]}},"required":["templateName","templateId","bodyParameters"]},"StepElementContentMetaWhatsAppTemplateHeaderDto":{"type":"object","properties":{"file":{"description":"The file used in the template header.","allOf":[{"$ref":"#/components/schemas/StepElementContentFileDto"}]},"parameters":{"description":"Parameters for the header text.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"StepElementContentMetaWhatsAppTemplateButtonsDto":{"type":"object","properties":{"values":{"description":"Values for the buttons in the template.","type":"array","items":{"type":"string"}}},"required":["values"]},"StepElementContentNoteDto":{"type":"object","properties":{"note":{"type":"string","description":"A private note for internal use."}},"required":["note"]},"StepElementContentChatEndDto":{"type":"object","properties":{"status":{"description":"The status to set for the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED","allOf":[{"$ref":"#/components/schemas/StepElementContentChatEnd_ConversationStatus"}]}},"required":["status"]},"StepElementContentChatEnd_ConversationStatus":{"type":"number","enum":[0,1,2,3,-1],"description":"The status to set for the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED"},"StepElementContentAssignTeamDto":{"type":"object","properties":{"teamId":{"type":"string","description":"The ID of the team to assign the conversation to."}},"required":["teamId"]},"StepElementContentAssignOperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The ID of the operator to assign the conversation to."},"assignToLastAssigned":{"type":"boolean","description":"Whether to assign to the last assigned operator."}},"required":["assignToLastAssigned"]},"StepDelayDto":{"type":"object","properties":{"seconds":{"type":"number","description":"The waiting time in seconds."}},"required":["seconds"]},"StepSplitDto":{"type":"object","properties":{"a":{"type":"number","description":"Percentage for exit A."},"b":{"type":"number","description":"Percentage for exit B."},"sameRedirect":{"type":"boolean","description":"Indicates whether both exits should lead to the same destination."},"redirects":{"description":"The redirect configurations for split A and B.","allOf":[{"$ref":"#/components/schemas/StepSplitRedirectsDto"}]}},"required":["a","b","sameRedirect","redirects"]},"StepSplitRedirectsDto":{"type":"object","properties":{"a":{"type":"string","description":"The step ID for redirect A."},"b":{"type":"string","description":"The step ID for redirect B."}},"required":["a","b"]},"StepConditionDto":{"type":"object","properties":{"redirects":{"description":"The redirect configurations based on condition outcome.","allOf":[{"$ref":"#/components/schemas/StepConditionRedirectsDto"}]},"conditions":{"description":"A list of conditions to evaluate.","type":"array","items":{"$ref":"#/components/schemas/StepConditionConditionDto"}}},"required":["redirects","conditions"]},"StepConditionRedirectsDto":{"type":"object","properties":{"t":{"type":"string","description":"The step ID to redirect to if the condition is true."},"f":{"type":"string","description":"The step ID to redirect to if the condition is false."}},"required":["t","f"]},"StepConditionConditionDto":{"type":"object","properties":{"valueLeft":{"type":"string","description":"The left-hand side value for the condition."},"operator":{"type":"string","description":"The operator for the condition (e.g., '==', '>', '<')."},"valueRight":{"type":"string","description":"The right-hand side value for the condition."},"group":{"type":"number","description":"The group number for logical grouping of conditions."}},"required":["valueLeft","operator","valueRight","group"]},"StepFlowDto":{"type":"object","properties":{"outlets":{"type":"object","description":"Outlets of the flow, mapping names to step IDs.","additionalProperties":{"$ref":"#/components/schemas/StepFlowOutletDto"}},"flowId":{"type":"string","description":"The ID of the flow to execute."},"entryStepId":{"type":"string","description":"The ID of the entry step within the flow."},"redirects":{"type":"object","description":"Redirects based on flow outcomes.","additionalProperties":{"type":"string"}}},"required":["outlets","flowId","entryStepId","redirects"]},"StepFlowOutletDto":{"type":"object","properties":{"stepId":{"type":"string","description":"The ID of the step this outlet points to."},"name":{"type":"string","description":"The name of the flow outlet."}},"required":["stepId","name"]},"UpdateOrCreateStepTriggerDto":{"type":"object","properties":{"event":{"type":"string","description":"The triggering event."},"payload":{"type":"string","description":"An optional payload value required for triggering."}},"required":["event"]},"StepContextDto":{"type":"object","properties":{"intents":{"description":"A list of intents to consider in this context.","type":"array","items":{"$ref":"#/components/schemas/StepContextIntentDto"}},"fallbackRedirect":{"type":"string","description":"The step ID to redirect to if no intent is matched."}},"required":["intents"]},"StepContextIntentDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the intent."},"intentId":{"type":"string","description":"The ID of the intent."},"redirect":{"type":"string","description":"The step ID to redirect to if this intent is matched."}},"required":["name","intentId"]},"StepAppDto":{"type":"object","properties":{"appId":{"type":"string","description":"The ID of the app to integrate."},"moduleId":{"type":"string","description":"The ID of the module within the app to execute."},"paramsJson":{"type":"string","format":"json","description":"Parameters for the app module in JSON format."}},"required":["appId","moduleId","paramsJson"]},"StepEntityDetectionDto":{"type":"object","properties":{"outputVariableId":{"type":"string","description":"The ID of the variable to store the detected entities."},"outputVariablePath":{"type":"string","description":"Optional JSON path within the output variable."},"prompt":{"type":"string","description":"The prompt for entity detection."}},"required":["outputVariableId","prompt","examples"]},"StepRunPromptDto":{"type":"object","properties":{"outputVariableId":{"type":"string","description":"The ID of the variable to store the prompt's output."},"outputVariablePath":{"type":"string","description":"Optional JSON path within the output variable."},"prompt":{"type":"string","description":"The prompt to run."},"includeConversationHistory":{"type":"boolean","description":"Whether to include conversation history in the prompt."},"useRag":{"type":"boolean","description":"Whether to use RAG (Retrieval Augmented Generation)."},"includeNotes":{"type":"boolean","description":"Whether to use notes in prompt context."},"knowledgeGroupIds":{"description":"List of knowledge group IDs for RAG.","type":"array","items":{"type":"string"}},"ragContextMessages":{"type":"number","description":"Number of context messages for RAG."},"contextMessageCount":{"type":"number","description":"Number of messages to include in the context."}},"required":["outputVariableId","prompt","knowledgeGroupIds"]},"StepLeadAiConversationDto":{"type":"object","properties":{"prompt":{"type":"string","description":"The initial prompt for the AI conversation."},"context":{"type":"string","description":"Additional context for the AI conversation."},"maxIterations":{"type":"number","description":"The maximum number of iterations for the AI conversation."},"ragContextMessages":{"type":"number","description":"Number of context messages for RAG."},"includeConversationHistory":{"type":"boolean","description":"Whether to include conversation history."},"outlets":{"description":"Outlets for different conversation paths.","type":"array","items":{"$ref":"#/components/schemas/StepLeadAiConversationOutletDto"}},"tools":{"description":"Tools available to the AI during the conversation.","type":"array","items":{"$ref":"#/components/schemas/StepLeadAiConversationToolDto"}},"useRag":{"type":"boolean","description":"Whether to use RAG (Retrieval Augmented Generation)."},"delayMin":{"type":"number","description":"Minimum delay in seconds before the next AI response."},"delayMax":{"type":"number","description":"Maximum delay in seconds before the next AI response."},"delay":{"type":"boolean","description":"Whether to apply a delay before the next AI response."},"knowledgeGroupIds":{"description":"List of knowledge group IDs for RAG.","type":"array","items":{"type":"string"}},"contextMessageCount":{"type":"number","description":"Number of messages to include in the context."}},"required":["prompt","maxIterations","outlets","tools","knowledgeGroupIds"]},"StepLeadAiConversationOutletDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the conversation outlet."},"description":{"type":"string","description":"A description of what this outlet does."},"redirect":{"type":"string","description":"The step ID to redirect to when this outlet is triggered."}},"required":["name","description"]},"StepLeadAiConversationToolDto":{"type":"object","properties":{"appId":{"type":"string","description":"The ID of the app associated with the tool."},"moduleId":{"type":"string","description":"The ID of the module within the app."},"description":{"type":"string","description":"A description of what the tool does."},"name":{"type":"string","pattern":"/^[a-zA-Z][a-zA-Z0-9_]*$/","description":"The name of the tool."}},"required":["appId","moduleId","description","name"]},"StepIntentDto":{"type":"object","properties":{"intentId":{"type":"string","description":"The ID of the associated intent."}},"required":["intentId"]},"StepContactDataDto":{"type":"object","properties":{"values":{"type":"string","description":"The values to set for contact data."}},"required":["values"]},"StepAiConfigDto":{"type":"object","properties":{"model":{"type":"number","description":"The AI model to use.\n\n- `1`: GEMINI_25_FLASH","enum":[1]},"thinkingBudget":{"type":"number","description":"Budget for the \"thinking\" process in tokens."},"seed":{"type":"number","description":"Seed for reproducible results."},"topP":{"type":"number","description":"Top-P value for generation."},"temperature":{"type":"number","description":"Temperature for generation creativity."}},"required":["model"]},"StepConversationDataDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the conversation."},"language":{"type":"string","description":"The language of the conversation."}},"required":["name","language"]}}}}
```

## The DeleteStepResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"DeleteStepResponseDto":{"type":"object","properties":{"deleted":{"type":"boolean","description":"Indicates if the step was successfully deleted."},"error":{"type":"string","description":"Optional error message."}},"required":["deleted"]}}}}
```

## The CompositionSettingsDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CompositionSettingsDto":{"type":"object","properties":{"combineComponents":{"type":"string","description":"How to combine components."},"requireExactOverlap":{"type":"string","description":"Whether to require exact overlap."},"returnLongestOverlap":{"type":"string","description":"Whether to return the longest overlap."},"separateComponents":{"type":"string","description":"How to separate components."}},"required":["combineComponents","requireExactOverlap","returnLongestOverlap","separateComponents"]}}}}
```

## The ListComponentSynonymDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListComponentSynonymDto":{"type":"object","properties":{"language":{"type":"string","description":"The language code for the synonyms."},"values":{"description":"A list of synonymous values.","type":"array","items":{"type":"string"}}},"required":["language","values"]}}}}
```

## The ListComponentListEntryDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListComponentListEntryDto":{"type":"object","properties":{"listKey":{"type":"string","description":"The key for this list entry."},"synonyms":{"description":"A list of synonyms for this entry.","type":"array","items":{"$ref":"#/components/schemas/ListComponentSynonymDto"}}},"required":["listKey","synonyms"]},"ListComponentSynonymDto":{"type":"object","properties":{"language":{"type":"string","description":"The language code for the synonyms."},"values":{"description":"A list of synonymous values.","type":"array","items":{"type":"string"}}},"required":["language","values"]}}}}
```

## The ListComponentDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListComponentDto":{"type":"object","properties":{"sublists":{"description":"A list of sublists for the entity.","type":"array","items":{"$ref":"#/components/schemas/ListComponentListEntryDto"}}},"required":["sublists"]},"ListComponentListEntryDto":{"type":"object","properties":{"listKey":{"type":"string","description":"The key for this list entry."},"synonyms":{"description":"A list of synonyms for this entry.","type":"array","items":{"$ref":"#/components/schemas/ListComponentSynonymDto"}}},"required":["listKey","synonyms"]},"ListComponentSynonymDto":{"type":"object","properties":{"language":{"type":"string","description":"The language code for the synonyms."},"values":{"description":"A list of synonymous values.","type":"array","items":{"type":"string"}}},"required":["language","values"]}}}}
```

## The PrebuiltsComponentDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"PrebuiltsComponentDto":{"type":"object","properties":{"category":{"type":"string","description":"Category of the predefined entity."}},"required":["category"]}}}}
```

## The RegexComponentExpressionDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"RegexComponentExpressionDto":{"type":"object","properties":{"regexKey":{"type":"string","description":"The key for this regular expression."},"language":{"type":"string","description":"The language code for this regular expression."},"regexPattern":{"type":"string","description":"The regular expression pattern."}},"required":["regexKey","language","regexPattern"]}}}}
```

## The RegexComponentDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"RegexComponentDto":{"type":"object","properties":{"expressions":{"description":"A list of regular expressions for the entity.","type":"array","items":{"$ref":"#/components/schemas/RegexComponentExpressionDto"}}},"required":["expressions"]},"RegexComponentExpressionDto":{"type":"object","properties":{"regexKey":{"type":"string","description":"The key for this regular expression."},"language":{"type":"string","description":"The language code for this regular expression."},"regexPattern":{"type":"string","description":"The regular expression pattern."}},"required":["regexKey","language","regexPattern"]}}}}
```

## The EntityDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"EntityDto":{"type":"object","properties":{"category":{"type":"string","description":"The category or name of the entity."},"compositionSettings":{"description":"Settings for how entity components are combined.","allOf":[{"$ref":"#/components/schemas/CompositionSettingsDto"}]},"list":{"description":"List component for the entity.","allOf":[{"$ref":"#/components/schemas/ListComponentDto"}]},"prebuilts":{"description":"Pre-built components for the entity.","type":"array","items":{"$ref":"#/components/schemas/PrebuiltsComponentDto"}},"regex":{"description":"Regex component for the entity.","allOf":[{"$ref":"#/components/schemas/RegexComponentDto"}]},"requiredComponents":{"description":"A list of required component keys.","type":"array","items":{"type":"string"}},"id":{"type":"string","description":"The unique identifier of the entity."},"created":{"type":"string","description":"The creation timestamp of the entity."},"updated":{"type":"string","description":"The last update timestamp of the entity."},"editable":{"type":"boolean","description":"Indicates whether the entity is editable."},"enabled":{"type":"boolean","description":"Indicates whether the entity is enabled."},"variableId":{"type":"string","description":"The ID of the variable associated with this entity."}},"required":["category","prebuilts","requiredComponents","id","created","updated","editable","enabled","variableId"]},"CompositionSettingsDto":{"type":"object","properties":{"combineComponents":{"type":"string","description":"How to combine components."},"requireExactOverlap":{"type":"string","description":"Whether to require exact overlap."},"returnLongestOverlap":{"type":"string","description":"Whether to return the longest overlap."},"separateComponents":{"type":"string","description":"How to separate components."}},"required":["combineComponents","requireExactOverlap","returnLongestOverlap","separateComponents"]},"ListComponentDto":{"type":"object","properties":{"sublists":{"description":"A list of sublists for the entity.","type":"array","items":{"$ref":"#/components/schemas/ListComponentListEntryDto"}}},"required":["sublists"]},"ListComponentListEntryDto":{"type":"object","properties":{"listKey":{"type":"string","description":"The key for this list entry."},"synonyms":{"description":"A list of synonyms for this entry.","type":"array","items":{"$ref":"#/components/schemas/ListComponentSynonymDto"}}},"required":["listKey","synonyms"]},"ListComponentSynonymDto":{"type":"object","properties":{"language":{"type":"string","description":"The language code for the synonyms."},"values":{"description":"A list of synonymous values.","type":"array","items":{"type":"string"}}},"required":["language","values"]},"PrebuiltsComponentDto":{"type":"object","properties":{"category":{"type":"string","description":"Category of the predefined entity."}},"required":["category"]},"RegexComponentDto":{"type":"object","properties":{"expressions":{"description":"A list of regular expressions for the entity.","type":"array","items":{"$ref":"#/components/schemas/RegexComponentExpressionDto"}}},"required":["expressions"]},"RegexComponentExpressionDto":{"type":"object","properties":{"regexKey":{"type":"string","description":"The key for this regular expression."},"language":{"type":"string","description":"The language code for this regular expression."},"regexPattern":{"type":"string","description":"The regular expression pattern."}},"required":["regexKey","language","regexPattern"]}}}}
```

## The ListEntitiesResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListEntitiesResponseDto":{"type":"object","properties":{"entities":{"description":"A list of entities.","type":"array","items":{"$ref":"#/components/schemas/EntityDto"}},"error":{"type":"string","description":"Optional error message."}},"required":["entities"]},"EntityDto":{"type":"object","properties":{"category":{"type":"string","description":"The category or name of the entity."},"compositionSettings":{"description":"Settings for how entity components are combined.","allOf":[{"$ref":"#/components/schemas/CompositionSettingsDto"}]},"list":{"description":"List component for the entity.","allOf":[{"$ref":"#/components/schemas/ListComponentDto"}]},"prebuilts":{"description":"Pre-built components for the entity.","type":"array","items":{"$ref":"#/components/schemas/PrebuiltsComponentDto"}},"regex":{"description":"Regex component for the entity.","allOf":[{"$ref":"#/components/schemas/RegexComponentDto"}]},"requiredComponents":{"description":"A list of required component keys.","type":"array","items":{"type":"string"}},"id":{"type":"string","description":"The unique identifier of the entity."},"created":{"type":"string","description":"The creation timestamp of the entity."},"updated":{"type":"string","description":"The last update timestamp of the entity."},"editable":{"type":"boolean","description":"Indicates whether the entity is editable."},"enabled":{"type":"boolean","description":"Indicates whether the entity is enabled."},"variableId":{"type":"string","description":"The ID of the variable associated with this entity."}},"required":["category","prebuilts","requiredComponents","id","created","updated","editable","enabled","variableId"]},"CompositionSettingsDto":{"type":"object","properties":{"combineComponents":{"type":"string","description":"How to combine components."},"requireExactOverlap":{"type":"string","description":"Whether to require exact overlap."},"returnLongestOverlap":{"type":"string","description":"Whether to return the longest overlap."},"separateComponents":{"type":"string","description":"How to separate components."}},"required":["combineComponents","requireExactOverlap","returnLongestOverlap","separateComponents"]},"ListComponentDto":{"type":"object","properties":{"sublists":{"description":"A list of sublists for the entity.","type":"array","items":{"$ref":"#/components/schemas/ListComponentListEntryDto"}}},"required":["sublists"]},"ListComponentListEntryDto":{"type":"object","properties":{"listKey":{"type":"string","description":"The key for this list entry."},"synonyms":{"description":"A list of synonyms for this entry.","type":"array","items":{"$ref":"#/components/schemas/ListComponentSynonymDto"}}},"required":["listKey","synonyms"]},"ListComponentSynonymDto":{"type":"object","properties":{"language":{"type":"string","description":"The language code for the synonyms."},"values":{"description":"A list of synonymous values.","type":"array","items":{"type":"string"}}},"required":["language","values"]},"PrebuiltsComponentDto":{"type":"object","properties":{"category":{"type":"string","description":"Category of the predefined entity."}},"required":["category"]},"RegexComponentDto":{"type":"object","properties":{"expressions":{"description":"A list of regular expressions for the entity.","type":"array","items":{"$ref":"#/components/schemas/RegexComponentExpressionDto"}}},"required":["expressions"]},"RegexComponentExpressionDto":{"type":"object","properties":{"regexKey":{"type":"string","description":"The key for this regular expression."},"language":{"type":"string","description":"The language code for this regular expression."},"regexPattern":{"type":"string","description":"The regular expression pattern."}},"required":["regexKey","language","regexPattern"]}}}}
```

## The EntityResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"EntityResponseDto":{"type":"object","properties":{"entity":{"description":"The retrieved entity.","allOf":[{"$ref":"#/components/schemas/EntityDto"}]},"error":{"type":"string","description":"Optional error message."}}},"EntityDto":{"type":"object","properties":{"category":{"type":"string","description":"The category or name of the entity."},"compositionSettings":{"description":"Settings for how entity components are combined.","allOf":[{"$ref":"#/components/schemas/CompositionSettingsDto"}]},"list":{"description":"List component for the entity.","allOf":[{"$ref":"#/components/schemas/ListComponentDto"}]},"prebuilts":{"description":"Pre-built components for the entity.","type":"array","items":{"$ref":"#/components/schemas/PrebuiltsComponentDto"}},"regex":{"description":"Regex component for the entity.","allOf":[{"$ref":"#/components/schemas/RegexComponentDto"}]},"requiredComponents":{"description":"A list of required component keys.","type":"array","items":{"type":"string"}},"id":{"type":"string","description":"The unique identifier of the entity."},"created":{"type":"string","description":"The creation timestamp of the entity."},"updated":{"type":"string","description":"The last update timestamp of the entity."},"editable":{"type":"boolean","description":"Indicates whether the entity is editable."},"enabled":{"type":"boolean","description":"Indicates whether the entity is enabled."},"variableId":{"type":"string","description":"The ID of the variable associated with this entity."}},"required":["category","prebuilts","requiredComponents","id","created","updated","editable","enabled","variableId"]},"CompositionSettingsDto":{"type":"object","properties":{"combineComponents":{"type":"string","description":"How to combine components."},"requireExactOverlap":{"type":"string","description":"Whether to require exact overlap."},"returnLongestOverlap":{"type":"string","description":"Whether to return the longest overlap."},"separateComponents":{"type":"string","description":"How to separate components."}},"required":["combineComponents","requireExactOverlap","returnLongestOverlap","separateComponents"]},"ListComponentDto":{"type":"object","properties":{"sublists":{"description":"A list of sublists for the entity.","type":"array","items":{"$ref":"#/components/schemas/ListComponentListEntryDto"}}},"required":["sublists"]},"ListComponentListEntryDto":{"type":"object","properties":{"listKey":{"type":"string","description":"The key for this list entry."},"synonyms":{"description":"A list of synonyms for this entry.","type":"array","items":{"$ref":"#/components/schemas/ListComponentSynonymDto"}}},"required":["listKey","synonyms"]},"ListComponentSynonymDto":{"type":"object","properties":{"language":{"type":"string","description":"The language code for the synonyms."},"values":{"description":"A list of synonymous values.","type":"array","items":{"type":"string"}}},"required":["language","values"]},"PrebuiltsComponentDto":{"type":"object","properties":{"category":{"type":"string","description":"Category of the predefined entity."}},"required":["category"]},"RegexComponentDto":{"type":"object","properties":{"expressions":{"description":"A list of regular expressions for the entity.","type":"array","items":{"$ref":"#/components/schemas/RegexComponentExpressionDto"}}},"required":["expressions"]},"RegexComponentExpressionDto":{"type":"object","properties":{"regexKey":{"type":"string","description":"The key for this regular expression."},"language":{"type":"string","description":"The language code for this regular expression."},"regexPattern":{"type":"string","description":"The regular expression pattern."}},"required":["regexKey","language","regexPattern"]}}}}
```

## The EntityPayloadDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"EntityPayloadDto":{"type":"object","properties":{"category":{"type":"string","description":"The category or name of the entity."},"compositionSettings":{"description":"Settings for how entity components are combined.","allOf":[{"$ref":"#/components/schemas/CompositionSettingsDto"}]},"list":{"description":"List component for the entity.","allOf":[{"$ref":"#/components/schemas/ListComponentDto"}]},"prebuilts":{"description":"Pre-built components for the entity.","type":"array","items":{"$ref":"#/components/schemas/PrebuiltsComponentDto"}},"regex":{"description":"Regex component for the entity.","allOf":[{"$ref":"#/components/schemas/RegexComponentDto"}]},"requiredComponents":{"description":"A list of required component keys.","type":"array","items":{"type":"string"}}},"required":["category","prebuilts","requiredComponents"]},"CompositionSettingsDto":{"type":"object","properties":{"combineComponents":{"type":"string","description":"How to combine components."},"requireExactOverlap":{"type":"string","description":"Whether to require exact overlap."},"returnLongestOverlap":{"type":"string","description":"Whether to return the longest overlap."},"separateComponents":{"type":"string","description":"How to separate components."}},"required":["combineComponents","requireExactOverlap","returnLongestOverlap","separateComponents"]},"ListComponentDto":{"type":"object","properties":{"sublists":{"description":"A list of sublists for the entity.","type":"array","items":{"$ref":"#/components/schemas/ListComponentListEntryDto"}}},"required":["sublists"]},"ListComponentListEntryDto":{"type":"object","properties":{"listKey":{"type":"string","description":"The key for this list entry."},"synonyms":{"description":"A list of synonyms for this entry.","type":"array","items":{"$ref":"#/components/schemas/ListComponentSynonymDto"}}},"required":["listKey","synonyms"]},"ListComponentSynonymDto":{"type":"object","properties":{"language":{"type":"string","description":"The language code for the synonyms."},"values":{"description":"A list of synonymous values.","type":"array","items":{"type":"string"}}},"required":["language","values"]},"PrebuiltsComponentDto":{"type":"object","properties":{"category":{"type":"string","description":"Category of the predefined entity."}},"required":["category"]},"RegexComponentDto":{"type":"object","properties":{"expressions":{"description":"A list of regular expressions for the entity.","type":"array","items":{"$ref":"#/components/schemas/RegexComponentExpressionDto"}}},"required":["expressions"]},"RegexComponentExpressionDto":{"type":"object","properties":{"regexKey":{"type":"string","description":"The key for this regular expression."},"language":{"type":"string","description":"The language code for this regular expression."},"regexPattern":{"type":"string","description":"The regular expression pattern."}},"required":["regexKey","language","regexPattern"]}}}}
```

## The CreateEntityRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateEntityRequestDto":{"type":"object","properties":{"entity":{"description":"The entity object to be created.","allOf":[{"$ref":"#/components/schemas/EntityPayloadDto"}]}},"required":["entity"]},"EntityPayloadDto":{"type":"object","properties":{"category":{"type":"string","description":"The category or name of the entity."},"compositionSettings":{"description":"Settings for how entity components are combined.","allOf":[{"$ref":"#/components/schemas/CompositionSettingsDto"}]},"list":{"description":"List component for the entity.","allOf":[{"$ref":"#/components/schemas/ListComponentDto"}]},"prebuilts":{"description":"Pre-built components for the entity.","type":"array","items":{"$ref":"#/components/schemas/PrebuiltsComponentDto"}},"regex":{"description":"Regex component for the entity.","allOf":[{"$ref":"#/components/schemas/RegexComponentDto"}]},"requiredComponents":{"description":"A list of required component keys.","type":"array","items":{"type":"string"}}},"required":["category","prebuilts","requiredComponents"]},"CompositionSettingsDto":{"type":"object","properties":{"combineComponents":{"type":"string","description":"How to combine components."},"requireExactOverlap":{"type":"string","description":"Whether to require exact overlap."},"returnLongestOverlap":{"type":"string","description":"Whether to return the longest overlap."},"separateComponents":{"type":"string","description":"How to separate components."}},"required":["combineComponents","requireExactOverlap","returnLongestOverlap","separateComponents"]},"ListComponentDto":{"type":"object","properties":{"sublists":{"description":"A list of sublists for the entity.","type":"array","items":{"$ref":"#/components/schemas/ListComponentListEntryDto"}}},"required":["sublists"]},"ListComponentListEntryDto":{"type":"object","properties":{"listKey":{"type":"string","description":"The key for this list entry."},"synonyms":{"description":"A list of synonyms for this entry.","type":"array","items":{"$ref":"#/components/schemas/ListComponentSynonymDto"}}},"required":["listKey","synonyms"]},"ListComponentSynonymDto":{"type":"object","properties":{"language":{"type":"string","description":"The language code for the synonyms."},"values":{"description":"A list of synonymous values.","type":"array","items":{"type":"string"}}},"required":["language","values"]},"PrebuiltsComponentDto":{"type":"object","properties":{"category":{"type":"string","description":"Category of the predefined entity."}},"required":["category"]},"RegexComponentDto":{"type":"object","properties":{"expressions":{"description":"A list of regular expressions for the entity.","type":"array","items":{"$ref":"#/components/schemas/RegexComponentExpressionDto"}}},"required":["expressions"]},"RegexComponentExpressionDto":{"type":"object","properties":{"regexKey":{"type":"string","description":"The key for this regular expression."},"language":{"type":"string","description":"The language code for this regular expression."},"regexPattern":{"type":"string","description":"The regular expression pattern."}},"required":["regexKey","language","regexPattern"]}}}}
```

## The UpdateEntityRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateEntityRequestDto":{"type":"object","properties":{"entity":{"description":"The object containing the entity fields to be updated.","allOf":[{"$ref":"#/components/schemas/EntityPayloadDto"}]}},"required":["entity"]},"EntityPayloadDto":{"type":"object","properties":{"category":{"type":"string","description":"The category or name of the entity."},"compositionSettings":{"description":"Settings for how entity components are combined.","allOf":[{"$ref":"#/components/schemas/CompositionSettingsDto"}]},"list":{"description":"List component for the entity.","allOf":[{"$ref":"#/components/schemas/ListComponentDto"}]},"prebuilts":{"description":"Pre-built components for the entity.","type":"array","items":{"$ref":"#/components/schemas/PrebuiltsComponentDto"}},"regex":{"description":"Regex component for the entity.","allOf":[{"$ref":"#/components/schemas/RegexComponentDto"}]},"requiredComponents":{"description":"A list of required component keys.","type":"array","items":{"type":"string"}}},"required":["category","prebuilts","requiredComponents"]},"CompositionSettingsDto":{"type":"object","properties":{"combineComponents":{"type":"string","description":"How to combine components."},"requireExactOverlap":{"type":"string","description":"Whether to require exact overlap."},"returnLongestOverlap":{"type":"string","description":"Whether to return the longest overlap."},"separateComponents":{"type":"string","description":"How to separate components."}},"required":["combineComponents","requireExactOverlap","returnLongestOverlap","separateComponents"]},"ListComponentDto":{"type":"object","properties":{"sublists":{"description":"A list of sublists for the entity.","type":"array","items":{"$ref":"#/components/schemas/ListComponentListEntryDto"}}},"required":["sublists"]},"ListComponentListEntryDto":{"type":"object","properties":{"listKey":{"type":"string","description":"The key for this list entry."},"synonyms":{"description":"A list of synonyms for this entry.","type":"array","items":{"$ref":"#/components/schemas/ListComponentSynonymDto"}}},"required":["listKey","synonyms"]},"ListComponentSynonymDto":{"type":"object","properties":{"language":{"type":"string","description":"The language code for the synonyms."},"values":{"description":"A list of synonymous values.","type":"array","items":{"type":"string"}}},"required":["language","values"]},"PrebuiltsComponentDto":{"type":"object","properties":{"category":{"type":"string","description":"Category of the predefined entity."}},"required":["category"]},"RegexComponentDto":{"type":"object","properties":{"expressions":{"description":"A list of regular expressions for the entity.","type":"array","items":{"$ref":"#/components/schemas/RegexComponentExpressionDto"}}},"required":["expressions"]},"RegexComponentExpressionDto":{"type":"object","properties":{"regexKey":{"type":"string","description":"The key for this regular expression."},"language":{"type":"string","description":"The language code for this regular expression."},"regexPattern":{"type":"string","description":"The regular expression pattern."}},"required":["regexKey","language","regexPattern"]}}}}
```

## The SetEntityStateRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"SetEntityStateRequestDto":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Sets the entity to enabled (true) or disabled (false)."}},"required":["enabled"]}}}}
```

## The DeleteEntityResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"DeleteEntityResponseDto":{"type":"object","properties":{"deleted":{"type":"boolean","description":"Indicates whether the deletion operation was successful."},"error":{"type":"string","description":"Optional error message."}},"required":["deleted"]}}}}
```

## The FlowParentDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"FlowParentDto":{"type":"object","properties":{"flowId":{"type":"string","description":"The ID of the parent flow."},"stepId":{"type":"string","description":"The ID of the step in the parent flow that calls this sub-flow."}},"required":["flowId","stepId"]}}}}
```

## The FlowDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"FlowDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the flow."},"name":{"type":"string","description":"The name of the flow."},"created":{"type":"string","description":"The creation timestamp of the flow."},"updated":{"type":"string","description":"The last update timestamp of the flow."},"type":{"type":"string","description":"The type of the flow (e.g., \"default\", \"faq\")."},"parent":{"description":"Information about the parent flow, if this is a sub-flow.","allOf":[{"$ref":"#/components/schemas/FlowParentDto"}]},"isStandard":{"type":"boolean","description":"Indicates whether the flow is a standard flow or not."}},"required":["id","name","created","updated","type"]},"FlowParentDto":{"type":"object","properties":{"flowId":{"type":"string","description":"The ID of the parent flow."},"stepId":{"type":"string","description":"The ID of the step in the parent flow that calls this sub-flow."}},"required":["flowId","stepId"]}}}}
```

## The ListFlowsResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListFlowsResponseDto":{"type":"object","properties":{"flows":{"description":"A list of flows.","type":"array","items":{"$ref":"#/components/schemas/FlowDto"}},"error":{"type":"string","description":"Optional error message."}},"required":["flows"]},"FlowDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the flow."},"name":{"type":"string","description":"The name of the flow."},"created":{"type":"string","description":"The creation timestamp of the flow."},"updated":{"type":"string","description":"The last update timestamp of the flow."},"type":{"type":"string","description":"The type of the flow (e.g., \"default\", \"faq\")."},"parent":{"description":"Information about the parent flow, if this is a sub-flow.","allOf":[{"$ref":"#/components/schemas/FlowParentDto"}]},"isStandard":{"type":"boolean","description":"Indicates whether the flow is a standard flow or not."}},"required":["id","name","created","updated","type"]},"FlowParentDto":{"type":"object","properties":{"flowId":{"type":"string","description":"The ID of the parent flow."},"stepId":{"type":"string","description":"The ID of the step in the parent flow that calls this sub-flow."}},"required":["flowId","stepId"]}}}}
```

## The GetFlowResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"GetFlowResponseDto":{"type":"object","properties":{"flow":{"description":"The flow object.","allOf":[{"$ref":"#/components/schemas/FlowDto"}]},"error":{"type":"string","description":"Optional error message."}}},"FlowDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the flow."},"name":{"type":"string","description":"The name of the flow."},"created":{"type":"string","description":"The creation timestamp of the flow."},"updated":{"type":"string","description":"The last update timestamp of the flow."},"type":{"type":"string","description":"The type of the flow (e.g., \"default\", \"faq\")."},"parent":{"description":"Information about the parent flow, if this is a sub-flow.","allOf":[{"$ref":"#/components/schemas/FlowParentDto"}]},"isStandard":{"type":"boolean","description":"Indicates whether the flow is a standard flow or not."}},"required":["id","name","created","updated","type"]},"FlowParentDto":{"type":"object","properties":{"flowId":{"type":"string","description":"The ID of the parent flow."},"stepId":{"type":"string","description":"The ID of the step in the parent flow that calls this sub-flow."}},"required":["flowId","stepId"]}}}}
```

## The CreateFlowRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateFlowRequestDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the new flow."},"parentFlowId":{"type":"string","description":"The ID of the parent flow, if a sub-flow is being created."},"parentStepId":{"type":"string","description":"The ID of the step in the parent flow, if a sub-flow is being created."},"isStandard":{"type":"boolean","description":"Indicates whether the flow is a standard flow or not."}},"required":["name"]}}}}
```

## The FlowResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"FlowResponseDto":{"type":"object","properties":{"flow":{"description":"The flow object.","allOf":[{"$ref":"#/components/schemas/FlowDto"}]}}},"FlowDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the flow."},"name":{"type":"string","description":"The name of the flow."},"created":{"type":"string","description":"The creation timestamp of the flow."},"updated":{"type":"string","description":"The last update timestamp of the flow."},"type":{"type":"string","description":"The type of the flow (e.g., \"default\", \"faq\")."},"parent":{"description":"Information about the parent flow, if this is a sub-flow.","allOf":[{"$ref":"#/components/schemas/FlowParentDto"}]},"isStandard":{"type":"boolean","description":"Indicates whether the flow is a standard flow or not."}},"required":["id","name","created","updated","type"]},"FlowParentDto":{"type":"object","properties":{"flowId":{"type":"string","description":"The ID of the parent flow."},"stepId":{"type":"string","description":"The ID of the step in the parent flow that calls this sub-flow."}},"required":["flowId","stepId"]}}}}
```

## The UpdateFlowRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateFlowRequestDto":{"type":"object","properties":{"name":{"type":"string","description":"The new name of the flow."},"parentFlowId":{"type":"string","description":"The new ID of the parent flow, if a sub-flow is being updated."},"parentStepId":{"type":"string","description":"The new ID of the step in the parent flow, if a sub-flow is being updated."}}}}}}
```

## The DeleteFlowResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"DeleteFlowResponseDto":{"type":"object","properties":{"deleted":{"type":"boolean","description":"Indicates whether the deletion operation was successful."}},"required":["deleted"]}}}}
```

## The LanguagesDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"LanguagesDto":{"type":"object","properties":{"updated":{"type":"string","description":"The last update timestamp for the language settings."},"languages":{"description":"A list of currently enabled language codes.","type":"array","items":{"type":"string"}},"defaultLanguage":{"type":"string","description":"The default language code for the chatbot."},"translate":{"type":"boolean","description":"Indicates whether translation mode is enabled."},"defaultCluLanguage":{"type":"string","description":"The default language for the CLU (optional)."}},"required":["updated","languages","defaultLanguage","translate"]}}}}
```

## The LanguagesResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"LanguagesResponseDto":{"type":"object","properties":{"languages":{"description":"The language settings object.","allOf":[{"$ref":"#/components/schemas/LanguagesDto"}]},"error":{"type":"string","description":"Optional error message."}}},"LanguagesDto":{"type":"object","properties":{"updated":{"type":"string","description":"The last update timestamp for the language settings."},"languages":{"description":"A list of currently enabled language codes.","type":"array","items":{"type":"string"}},"defaultLanguage":{"type":"string","description":"The default language code for the chatbot."},"translate":{"type":"boolean","description":"Indicates whether translation mode is enabled."},"defaultCluLanguage":{"type":"string","description":"The default language for the CLU (optional)."}},"required":["updated","languages","defaultLanguage","translate"]}}}}
```

## The AddLanguagesRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"AddLanguagesRequestDto":{"type":"object","properties":{"languages":{"minItems":1,"description":"A list of language codes to be added.","type":"array","items":{"type":"string"}}},"required":["languages"]}}}}
```

## The UpdateTranslationModeDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateTranslationModeDto":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Enables or disables the automatic translation mode."}},"required":["enabled"]}}}}
```

## The UpdateTranslationModeResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateTranslationModeResponseDto":{"type":"object","properties":{"enabled":{"type":"boolean","description":"The new state of the translation mode."},"error":{"type":"string","description":"Optional error message."}}}}}}
```

## The RemoveLanguagesRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"RemoveLanguagesRequestDto":{"type":"object","properties":{"languages":{"minItems":1,"description":"A list of language codes to be removed.","type":"array","items":{"type":"string"}}},"required":["languages"]}}}}
```

## The ModelStatusDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ModelStatusDto":{"type":"object","properties":{"status":{"type":"string","description":"The status of the model training/evaluation."},"percentComplete":{"type":"number","description":"The completion percentage of the process."},"startDateTime":{"type":"string","description":"The start time of the process."},"endDateTime":{"type":"string","description":"The end time of the process."}},"required":["status","percentComplete"]}}}}
```

## The ModelDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ModelDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the model."},"name":{"type":"string","description":"The name of the model."},"created":{"type":"string","description":"The creation timestamp of the model."},"updated":{"type":"string","description":"The last update timestamp of the model."},"trainingStatus":{"description":"The training status of the model.","allOf":[{"$ref":"#/components/schemas/ModelStatusDto"}]},"evaluationStatus":{"description":"The evaluation status of the model.","allOf":[{"$ref":"#/components/schemas/ModelStatusDto"}]},"estimatedEndDateTime":{"type":"string","description":"The estimated end time of the current process."},"cluJobId":{"type":"string","description":"The job ID from the CLU service."},"trainingMode":{"type":"string","description":"The training mode used for the model."},"state":{"type":"string","description":"The current state of the model."},"cluModelId":{"type":"string","description":"The model ID from the CLU service."},"lastTrainingDurationInSeconds":{"type":"number","description":"The duration of the last training in seconds."},"lastTrainedDateTime":{"type":"string","description":"The timestamp of the last training."},"expirationDate":{"type":"string","description":"The expiration date of the model."},"modelTrainingConfigVersion":{"type":"string","description":"The version of the model training configuration."},"enoughExamples":{"type":"boolean","description":"Indicates if there are enough examples for training."}},"required":["id","name","created","updated","trainingStatus","evaluationStatus","cluJobId","trainingMode","state"]},"ModelStatusDto":{"type":"object","properties":{"status":{"type":"string","description":"The status of the model training/evaluation."},"percentComplete":{"type":"number","description":"The completion percentage of the process."},"startDateTime":{"type":"string","description":"The start time of the process."},"endDateTime":{"type":"string","description":"The end time of the process."}},"required":["status","percentComplete"]}}}}
```

## The ListModelsResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListModelsResponseDto":{"type":"object","properties":{"models":{"description":"A list of models.","type":"array","items":{"$ref":"#/components/schemas/ModelDto"}},"error":{"type":"string","description":"Optional error message."}},"required":["models"]},"ModelDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the model."},"name":{"type":"string","description":"The name of the model."},"created":{"type":"string","description":"The creation timestamp of the model."},"updated":{"type":"string","description":"The last update timestamp of the model."},"trainingStatus":{"description":"The training status of the model.","allOf":[{"$ref":"#/components/schemas/ModelStatusDto"}]},"evaluationStatus":{"description":"The evaluation status of the model.","allOf":[{"$ref":"#/components/schemas/ModelStatusDto"}]},"estimatedEndDateTime":{"type":"string","description":"The estimated end time of the current process."},"cluJobId":{"type":"string","description":"The job ID from the CLU service."},"trainingMode":{"type":"string","description":"The training mode used for the model."},"state":{"type":"string","description":"The current state of the model."},"cluModelId":{"type":"string","description":"The model ID from the CLU service."},"lastTrainingDurationInSeconds":{"type":"number","description":"The duration of the last training in seconds."},"lastTrainedDateTime":{"type":"string","description":"The timestamp of the last training."},"expirationDate":{"type":"string","description":"The expiration date of the model."},"modelTrainingConfigVersion":{"type":"string","description":"The version of the model training configuration."},"enoughExamples":{"type":"boolean","description":"Indicates if there are enough examples for training."}},"required":["id","name","created","updated","trainingStatus","evaluationStatus","cluJobId","trainingMode","state"]},"ModelStatusDto":{"type":"object","properties":{"status":{"type":"string","description":"The status of the model training/evaluation."},"percentComplete":{"type":"number","description":"The completion percentage of the process."},"startDateTime":{"type":"string","description":"The start time of the process."},"endDateTime":{"type":"string","description":"The end time of the process."}},"required":["status","percentComplete"]}}}}
```

## The GetModelResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"GetModelResponseDto":{"type":"object","properties":{"model":{"description":"The retrieved model.","nullable":true,"allOf":[{"$ref":"#/components/schemas/ModelDto"}]},"error":{"type":"string","description":"Optional error message."}},"required":["model"]},"ModelDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the model."},"name":{"type":"string","description":"The name of the model."},"created":{"type":"string","description":"The creation timestamp of the model."},"updated":{"type":"string","description":"The last update timestamp of the model."},"trainingStatus":{"description":"The training status of the model.","allOf":[{"$ref":"#/components/schemas/ModelStatusDto"}]},"evaluationStatus":{"description":"The evaluation status of the model.","allOf":[{"$ref":"#/components/schemas/ModelStatusDto"}]},"estimatedEndDateTime":{"type":"string","description":"The estimated end time of the current process."},"cluJobId":{"type":"string","description":"The job ID from the CLU service."},"trainingMode":{"type":"string","description":"The training mode used for the model."},"state":{"type":"string","description":"The current state of the model."},"cluModelId":{"type":"string","description":"The model ID from the CLU service."},"lastTrainingDurationInSeconds":{"type":"number","description":"The duration of the last training in seconds."},"lastTrainedDateTime":{"type":"string","description":"The timestamp of the last training."},"expirationDate":{"type":"string","description":"The expiration date of the model."},"modelTrainingConfigVersion":{"type":"string","description":"The version of the model training configuration."},"enoughExamples":{"type":"boolean","description":"Indicates if there are enough examples for training."}},"required":["id","name","created","updated","trainingStatus","evaluationStatus","cluJobId","trainingMode","state"]},"ModelStatusDto":{"type":"object","properties":{"status":{"type":"string","description":"The status of the model training/evaluation."},"percentComplete":{"type":"number","description":"The completion percentage of the process."},"startDateTime":{"type":"string","description":"The start time of the process."},"endDateTime":{"type":"string","description":"The end time of the process."}},"required":["status","percentComplete"]}}}}
```

## The LabelsExamplesDistributionDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"LabelsExamplesDistributionDto":{"type":"object","properties":{"train":{"type":"number","description":"The number of training examples."},"test":{"type":"number","description":"The number of testing examples."}},"required":["train","test"]}}}}
```

## The EntityCluEvaluationDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"EntityCluEvaluationDto":{"type":"object","properties":{"entityName":{"type":"string","description":"The name of the entity."},"labelsDistribution":{"description":"The distribution of labels for this entity.","allOf":[{"$ref":"#/components/schemas/LabelsExamplesDistributionDto"}]},"examplesDistribution":{"description":"The distribution of examples for this entity.","allOf":[{"$ref":"#/components/schemas/LabelsExamplesDistributionDto"}]}},"required":["entityName","labelsDistribution","examplesDistribution"]},"LabelsExamplesDistributionDto":{"type":"object","properties":{"train":{"type":"number","description":"The number of training examples."},"test":{"type":"number","description":"The number of testing examples."}},"required":["train","test"]}}}}
```

## The IntentCluEvaluationDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"IntentCluEvaluationDto":{"type":"object","properties":{"intentName":{"type":"string","description":"The name of the intent."},"labelsDistribution":{"description":"The distribution of labels for this intent.","allOf":[{"$ref":"#/components/schemas/LabelsExamplesDistributionDto"}]}},"required":["intentName","labelsDistribution"]},"LabelsExamplesDistributionDto":{"type":"object","properties":{"train":{"type":"number","description":"The number of training examples."},"test":{"type":"number","description":"The number of testing examples."}},"required":["train","test"]}}}}
```

## The DistributionDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"DistributionDto":{"type":"object","properties":{"labelsDistribution":{"description":"The overall distribution of labels.","allOf":[{"$ref":"#/components/schemas/LabelsExamplesDistributionDto"}]},"entities":{"description":"The evaluation distribution for each entity.","type":"array","items":{"$ref":"#/components/schemas/EntityCluEvaluationDto"}},"intents":{"description":"The evaluation distribution for each intent.","type":"array","items":{"$ref":"#/components/schemas/IntentCluEvaluationDto"}}},"required":["labelsDistribution","entities","intents"]},"LabelsExamplesDistributionDto":{"type":"object","properties":{"train":{"type":"number","description":"The number of training examples."},"test":{"type":"number","description":"The number of testing examples."}},"required":["train","test"]},"EntityCluEvaluationDto":{"type":"object","properties":{"entityName":{"type":"string","description":"The name of the entity."},"labelsDistribution":{"description":"The distribution of labels for this entity.","allOf":[{"$ref":"#/components/schemas/LabelsExamplesDistributionDto"}]},"examplesDistribution":{"description":"The distribution of examples for this entity.","allOf":[{"$ref":"#/components/schemas/LabelsExamplesDistributionDto"}]}},"required":["entityName","labelsDistribution","examplesDistribution"]},"IntentCluEvaluationDto":{"type":"object","properties":{"intentName":{"type":"string","description":"The name of the intent."},"labelsDistribution":{"description":"The distribution of labels for this intent.","allOf":[{"$ref":"#/components/schemas/LabelsExamplesDistributionDto"}]}},"required":["intentName","labelsDistribution"]}}}}
```

## The EntitiesEvaluationDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"EntitiesEvaluationDto":{"type":"object","properties":{"confusionMatrix":{"type":"object","description":"The confusion matrix for entities.","additionalProperties":{"$ref":"#/components/schemas/ConfusionMatrixDto"}},"entities":{"type":"object","description":"The evaluation metrics for each entity.","additionalProperties":{"$ref":"#/components/schemas/EvaluationMetricsDto"}},"microF1":{"type":"number","description":"The micro F1 score."},"microPrecision":{"type":"number","description":"The micro precision score."},"microRecall":{"type":"number","description":"The micro recall score."},"macroF1":{"type":"number","description":"The macro F1 score."},"macroPrecision":{"type":"number","description":"The macro precision score."},"macroRecall":{"type":"number","description":"The macro recall score."}},"required":["confusionMatrix","entities","microF1","microPrecision","microRecall","macroF1","macroPrecision","macroRecall"]},"ConfusionMatrixDto":{"type":"object","properties":{"confusionMatrixEntries":{"description":"The entries of the confusion matrix.","type":"array","items":{"$ref":"#/components/schemas/ConfusionMatrixEntryDto"}}},"required":["confusionMatrixEntries"]},"ConfusionMatrixEntryDto":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the confusion matrix entry."},"normalizedValue":{"type":"number","description":"The normalized value of the entry."},"rawValue":{"type":"number","description":"The raw value of the entry."}},"required":["id","normalizedValue","rawValue"]},"EvaluationMetricsDto":{"type":"object","properties":{"f1":{"type":"number","description":"The F1 score."},"precision":{"type":"number","description":"The precision score."},"recall":{"type":"number","description":"The recall score."},"truePositiveCount":{"type":"number","description":"The number of true positives."},"trueNegativeCount":{"type":"number","description":"The number of true negatives."},"falsePositiveCount":{"type":"number","description":"The number of false positives."},"falseNegativeCount":{"type":"number","description":"The number of false negatives."}},"required":["f1","precision","recall","truePositiveCount","trueNegativeCount","falsePositiveCount","falseNegativeCount"]}}}}
```

## The EvaluationOptionsDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"EvaluationOptionsDto":{"type":"object","properties":{"kind":{"type":"string","description":"The kind of evaluation."},"trainingSplitPercentage":{"type":"number","description":"The percentage of data used for training."},"testSplitPercentage":{"type":"number","description":"The percentage of data used for testing."}},"required":["kind","trainingSplitPercentage","testSplitPercentage"]}}}}
```

## The IntentsEvaluationDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"IntentsEvaluationDto":{"type":"object","properties":{"confusionMatrix":{"type":"object","description":"The confusion matrix for intents.","additionalProperties":{"$ref":"#/components/schemas/ConfusionMatrixDto"}},"intents":{"type":"object","description":"The evaluation metrics for each intent.","additionalProperties":{"$ref":"#/components/schemas/EvaluationMetricsDto"}},"microF1":{"type":"number","description":"The micro F1 score."},"microPrecision":{"type":"number","description":"The micro precision score."},"microRecall":{"type":"number","description":"The micro recall score."},"macroF1":{"type":"number","description":"The macro F1 score."},"macroPrecision":{"type":"number","description":"The macro precision score."},"macroRecall":{"type":"number","description":"The macro recall score."}},"required":["confusionMatrix","intents","microF1","microPrecision","microRecall","macroF1","macroPrecision","macroRecall"]},"ConfusionMatrixDto":{"type":"object","properties":{"confusionMatrixEntries":{"description":"The entries of the confusion matrix.","type":"array","items":{"$ref":"#/components/schemas/ConfusionMatrixEntryDto"}}},"required":["confusionMatrixEntries"]},"ConfusionMatrixEntryDto":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the confusion matrix entry."},"normalizedValue":{"type":"number","description":"The normalized value of the entry."},"rawValue":{"type":"number","description":"The raw value of the entry."}},"required":["id","normalizedValue","rawValue"]},"EvaluationMetricsDto":{"type":"object","properties":{"f1":{"type":"number","description":"The F1 score."},"precision":{"type":"number","description":"The precision score."},"recall":{"type":"number","description":"The recall score."},"truePositiveCount":{"type":"number","description":"The number of true positives."},"trueNegativeCount":{"type":"number","description":"The number of true negatives."},"falsePositiveCount":{"type":"number","description":"The number of false positives."},"falseNegativeCount":{"type":"number","description":"The number of false negatives."}},"required":["f1","precision","recall","truePositiveCount","trueNegativeCount","falsePositiveCount","falseNegativeCount"]}}}}
```

## The ModelEvaluationDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ModelEvaluationDto":{"type":"object","properties":{"projectKind":{"type":"string","description":"The kind of the project."},"distribution":{"description":"The distribution of data.","allOf":[{"$ref":"#/components/schemas/DistributionDto"}]},"entitiesEvaluation":{"description":"The evaluation of entities.","allOf":[{"$ref":"#/components/schemas/EntitiesEvaluationDto"}]},"evaluationOptions":{"description":"The options used for evaluation.","allOf":[{"$ref":"#/components/schemas/EvaluationOptionsDto"}]},"intentsEvaluation":{"description":"The evaluation of intents.","allOf":[{"$ref":"#/components/schemas/IntentsEvaluationDto"}]},"modelGuidance":{"type":"object","description":"Detailed guidelines for model improvement."}},"required":["projectKind","distribution","entitiesEvaluation","evaluationOptions","intentsEvaluation","modelGuidance"]},"DistributionDto":{"type":"object","properties":{"labelsDistribution":{"description":"The overall distribution of labels.","allOf":[{"$ref":"#/components/schemas/LabelsExamplesDistributionDto"}]},"entities":{"description":"The evaluation distribution for each entity.","type":"array","items":{"$ref":"#/components/schemas/EntityCluEvaluationDto"}},"intents":{"description":"The evaluation distribution for each intent.","type":"array","items":{"$ref":"#/components/schemas/IntentCluEvaluationDto"}}},"required":["labelsDistribution","entities","intents"]},"LabelsExamplesDistributionDto":{"type":"object","properties":{"train":{"type":"number","description":"The number of training examples."},"test":{"type":"number","description":"The number of testing examples."}},"required":["train","test"]},"EntityCluEvaluationDto":{"type":"object","properties":{"entityName":{"type":"string","description":"The name of the entity."},"labelsDistribution":{"description":"The distribution of labels for this entity.","allOf":[{"$ref":"#/components/schemas/LabelsExamplesDistributionDto"}]},"examplesDistribution":{"description":"The distribution of examples for this entity.","allOf":[{"$ref":"#/components/schemas/LabelsExamplesDistributionDto"}]}},"required":["entityName","labelsDistribution","examplesDistribution"]},"IntentCluEvaluationDto":{"type":"object","properties":{"intentName":{"type":"string","description":"The name of the intent."},"labelsDistribution":{"description":"The distribution of labels for this intent.","allOf":[{"$ref":"#/components/schemas/LabelsExamplesDistributionDto"}]}},"required":["intentName","labelsDistribution"]},"EntitiesEvaluationDto":{"type":"object","properties":{"confusionMatrix":{"type":"object","description":"The confusion matrix for entities.","additionalProperties":{"$ref":"#/components/schemas/ConfusionMatrixDto"}},"entities":{"type":"object","description":"The evaluation metrics for each entity.","additionalProperties":{"$ref":"#/components/schemas/EvaluationMetricsDto"}},"microF1":{"type":"number","description":"The micro F1 score."},"microPrecision":{"type":"number","description":"The micro precision score."},"microRecall":{"type":"number","description":"The micro recall score."},"macroF1":{"type":"number","description":"The macro F1 score."},"macroPrecision":{"type":"number","description":"The macro precision score."},"macroRecall":{"type":"number","description":"The macro recall score."}},"required":["confusionMatrix","entities","microF1","microPrecision","microRecall","macroF1","macroPrecision","macroRecall"]},"ConfusionMatrixDto":{"type":"object","properties":{"confusionMatrixEntries":{"description":"The entries of the confusion matrix.","type":"array","items":{"$ref":"#/components/schemas/ConfusionMatrixEntryDto"}}},"required":["confusionMatrixEntries"]},"ConfusionMatrixEntryDto":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the confusion matrix entry."},"normalizedValue":{"type":"number","description":"The normalized value of the entry."},"rawValue":{"type":"number","description":"The raw value of the entry."}},"required":["id","normalizedValue","rawValue"]},"EvaluationMetricsDto":{"type":"object","properties":{"f1":{"type":"number","description":"The F1 score."},"precision":{"type":"number","description":"The precision score."},"recall":{"type":"number","description":"The recall score."},"truePositiveCount":{"type":"number","description":"The number of true positives."},"trueNegativeCount":{"type":"number","description":"The number of true negatives."},"falsePositiveCount":{"type":"number","description":"The number of false positives."},"falseNegativeCount":{"type":"number","description":"The number of false negatives."}},"required":["f1","precision","recall","truePositiveCount","trueNegativeCount","falsePositiveCount","falseNegativeCount"]},"EvaluationOptionsDto":{"type":"object","properties":{"kind":{"type":"string","description":"The kind of evaluation."},"trainingSplitPercentage":{"type":"number","description":"The percentage of data used for training."},"testSplitPercentage":{"type":"number","description":"The percentage of data used for testing."}},"required":["kind","trainingSplitPercentage","testSplitPercentage"]},"IntentsEvaluationDto":{"type":"object","properties":{"confusionMatrix":{"type":"object","description":"The confusion matrix for intents.","additionalProperties":{"$ref":"#/components/schemas/ConfusionMatrixDto"}},"intents":{"type":"object","description":"The evaluation metrics for each intent.","additionalProperties":{"$ref":"#/components/schemas/EvaluationMetricsDto"}},"microF1":{"type":"number","description":"The micro F1 score."},"microPrecision":{"type":"number","description":"The micro precision score."},"microRecall":{"type":"number","description":"The micro recall score."},"macroF1":{"type":"number","description":"The macro F1 score."},"macroPrecision":{"type":"number","description":"The macro precision score."},"macroRecall":{"type":"number","description":"The macro recall score."}},"required":["confusionMatrix","intents","microF1","microPrecision","microRecall","macroF1","macroPrecision","macroRecall"]}}}}
```

## The GetModelEvaluationResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"GetModelEvaluationResponseDto":{"type":"object","properties":{"evaluation":{"description":"The evaluation of the model.","allOf":[{"$ref":"#/components/schemas/ModelEvaluationDto"}]},"error":{"type":"string","description":"Optional error message."}}},"ModelEvaluationDto":{"type":"object","properties":{"projectKind":{"type":"string","description":"The kind of the project."},"distribution":{"description":"The distribution of data.","allOf":[{"$ref":"#/components/schemas/DistributionDto"}]},"entitiesEvaluation":{"description":"The evaluation of entities.","allOf":[{"$ref":"#/components/schemas/EntitiesEvaluationDto"}]},"evaluationOptions":{"description":"The options used for evaluation.","allOf":[{"$ref":"#/components/schemas/EvaluationOptionsDto"}]},"intentsEvaluation":{"description":"The evaluation of intents.","allOf":[{"$ref":"#/components/schemas/IntentsEvaluationDto"}]},"modelGuidance":{"type":"object","description":"Detailed guidelines for model improvement."}},"required":["projectKind","distribution","entitiesEvaluation","evaluationOptions","intentsEvaluation","modelGuidance"]},"DistributionDto":{"type":"object","properties":{"labelsDistribution":{"description":"The overall distribution of labels.","allOf":[{"$ref":"#/components/schemas/LabelsExamplesDistributionDto"}]},"entities":{"description":"The evaluation distribution for each entity.","type":"array","items":{"$ref":"#/components/schemas/EntityCluEvaluationDto"}},"intents":{"description":"The evaluation distribution for each intent.","type":"array","items":{"$ref":"#/components/schemas/IntentCluEvaluationDto"}}},"required":["labelsDistribution","entities","intents"]},"LabelsExamplesDistributionDto":{"type":"object","properties":{"train":{"type":"number","description":"The number of training examples."},"test":{"type":"number","description":"The number of testing examples."}},"required":["train","test"]},"EntityCluEvaluationDto":{"type":"object","properties":{"entityName":{"type":"string","description":"The name of the entity."},"labelsDistribution":{"description":"The distribution of labels for this entity.","allOf":[{"$ref":"#/components/schemas/LabelsExamplesDistributionDto"}]},"examplesDistribution":{"description":"The distribution of examples for this entity.","allOf":[{"$ref":"#/components/schemas/LabelsExamplesDistributionDto"}]}},"required":["entityName","labelsDistribution","examplesDistribution"]},"IntentCluEvaluationDto":{"type":"object","properties":{"intentName":{"type":"string","description":"The name of the intent."},"labelsDistribution":{"description":"The distribution of labels for this intent.","allOf":[{"$ref":"#/components/schemas/LabelsExamplesDistributionDto"}]}},"required":["intentName","labelsDistribution"]},"EntitiesEvaluationDto":{"type":"object","properties":{"confusionMatrix":{"type":"object","description":"The confusion matrix for entities.","additionalProperties":{"$ref":"#/components/schemas/ConfusionMatrixDto"}},"entities":{"type":"object","description":"The evaluation metrics for each entity.","additionalProperties":{"$ref":"#/components/schemas/EvaluationMetricsDto"}},"microF1":{"type":"number","description":"The micro F1 score."},"microPrecision":{"type":"number","description":"The micro precision score."},"microRecall":{"type":"number","description":"The micro recall score."},"macroF1":{"type":"number","description":"The macro F1 score."},"macroPrecision":{"type":"number","description":"The macro precision score."},"macroRecall":{"type":"number","description":"The macro recall score."}},"required":["confusionMatrix","entities","microF1","microPrecision","microRecall","macroF1","macroPrecision","macroRecall"]},"ConfusionMatrixDto":{"type":"object","properties":{"confusionMatrixEntries":{"description":"The entries of the confusion matrix.","type":"array","items":{"$ref":"#/components/schemas/ConfusionMatrixEntryDto"}}},"required":["confusionMatrixEntries"]},"ConfusionMatrixEntryDto":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the confusion matrix entry."},"normalizedValue":{"type":"number","description":"The normalized value of the entry."},"rawValue":{"type":"number","description":"The raw value of the entry."}},"required":["id","normalizedValue","rawValue"]},"EvaluationMetricsDto":{"type":"object","properties":{"f1":{"type":"number","description":"The F1 score."},"precision":{"type":"number","description":"The precision score."},"recall":{"type":"number","description":"The recall score."},"truePositiveCount":{"type":"number","description":"The number of true positives."},"trueNegativeCount":{"type":"number","description":"The number of true negatives."},"falsePositiveCount":{"type":"number","description":"The number of false positives."},"falseNegativeCount":{"type":"number","description":"The number of false negatives."}},"required":["f1","precision","recall","truePositiveCount","trueNegativeCount","falsePositiveCount","falseNegativeCount"]},"EvaluationOptionsDto":{"type":"object","properties":{"kind":{"type":"string","description":"The kind of evaluation."},"trainingSplitPercentage":{"type":"number","description":"The percentage of data used for training."},"testSplitPercentage":{"type":"number","description":"The percentage of data used for testing."}},"required":["kind","trainingSplitPercentage","testSplitPercentage"]},"IntentsEvaluationDto":{"type":"object","properties":{"confusionMatrix":{"type":"object","description":"The confusion matrix for intents.","additionalProperties":{"$ref":"#/components/schemas/ConfusionMatrixDto"}},"intents":{"type":"object","description":"The evaluation metrics for each intent.","additionalProperties":{"$ref":"#/components/schemas/EvaluationMetricsDto"}},"microF1":{"type":"number","description":"The micro F1 score."},"microPrecision":{"type":"number","description":"The micro precision score."},"microRecall":{"type":"number","description":"The micro recall score."},"macroF1":{"type":"number","description":"The macro F1 score."},"macroPrecision":{"type":"number","description":"The macro precision score."},"macroRecall":{"type":"number","description":"The macro recall score."}},"required":["confusionMatrix","intents","microF1","microPrecision","microRecall","macroF1","macroPrecision","macroRecall"]}}}}
```

## The TrainingRequiredResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"TrainingRequiredResponseDto":{"type":"object","properties":{"trainingRequired":{"type":"boolean","description":"Indicates whether retraining is required after changes to intents or examples."},"error":{"type":"string","description":"Optional error message."}},"required":["trainingRequired"]}}}}
```

## The AiFeaturesSettingsDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"AiFeaturesSettingsDto":{"type":"object","properties":{"completionEnabled":{"type":"boolean","description":"Whether chat completion is enabled."},"completionPrompt":{"type":"string","description":"The prompt used for chat completion."},"formulationEnabled":{"type":"boolean","description":"Whether chat formulation is enabled."},"formulationPrompt":{"type":"string","description":"The prompt used for chat formulation."},"summaryEnabled":{"type":"boolean","description":"Whether chat summary is enabled."},"summaryPrompt":{"type":"string","description":"The prompt used for chat summary."},"updated":{"type":"string","description":"The last time the settings were updated."},"questionAnsweringEnabled":{"type":"boolean","description":"Whether question answering is enabled."},"questionAnsweringPrompt":{"type":"string","description":"The prompt used for question answering."},"questionAnsweringAiConfig":{"description":"The Ai configuration settings.","allOf":[{"$ref":"#/components/schemas/StepAiConfigDto"}]}},"required":["completionEnabled","completionPrompt","formulationEnabled","formulationPrompt","summaryEnabled","summaryPrompt","updated","questionAnsweringEnabled","questionAnsweringPrompt"]},"StepAiConfigDto":{"type":"object","properties":{"model":{"type":"number","description":"The AI model to use.\n\n- `1`: GEMINI_25_FLASH","enum":[1]},"thinkingBudget":{"type":"number","description":"Budget for the \"thinking\" process in tokens."},"seed":{"type":"number","description":"Seed for reproducible results."},"topP":{"type":"number","description":"Top-P value for generation."},"temperature":{"type":"number","description":"Temperature for generation creativity."}},"required":["model"]}}}}
```

## The AiFeaturesSettingsResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"AiFeaturesSettingsResponseDto":{"type":"object","properties":{"settings":{"description":"The AI features settings.","allOf":[{"$ref":"#/components/schemas/AiFeaturesSettingsDto"}]},"error":{"type":"string","description":"Optional error message."}}},"AiFeaturesSettingsDto":{"type":"object","properties":{"completionEnabled":{"type":"boolean","description":"Whether chat completion is enabled."},"completionPrompt":{"type":"string","description":"The prompt used for chat completion."},"formulationEnabled":{"type":"boolean","description":"Whether chat formulation is enabled."},"formulationPrompt":{"type":"string","description":"The prompt used for chat formulation."},"summaryEnabled":{"type":"boolean","description":"Whether chat summary is enabled."},"summaryPrompt":{"type":"string","description":"The prompt used for chat summary."},"updated":{"type":"string","description":"The last time the settings were updated."},"questionAnsweringEnabled":{"type":"boolean","description":"Whether question answering is enabled."},"questionAnsweringPrompt":{"type":"string","description":"The prompt used for question answering."},"questionAnsweringAiConfig":{"description":"The Ai configuration settings.","allOf":[{"$ref":"#/components/schemas/StepAiConfigDto"}]}},"required":["completionEnabled","completionPrompt","formulationEnabled","formulationPrompt","summaryEnabled","summaryPrompt","updated","questionAnsweringEnabled","questionAnsweringPrompt"]},"StepAiConfigDto":{"type":"object","properties":{"model":{"type":"number","description":"The AI model to use.\n\n- `1`: GEMINI_25_FLASH","enum":[1]},"thinkingBudget":{"type":"number","description":"Budget for the \"thinking\" process in tokens."},"seed":{"type":"number","description":"Seed for reproducible results."},"topP":{"type":"number","description":"Top-P value for generation."},"temperature":{"type":"number","description":"Temperature for generation creativity."}},"required":["model"]}}}}
```

## The UpdateAiFeaturesSettingsDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateAiFeaturesSettingsDto":{"type":"object","properties":{"completionEnabled":{"type":"boolean","description":"Enables/disables chat completion."},"completionPrompt":{"type":"string","description":"The prompt for chat completion."},"formulationEnabled":{"type":"boolean","description":"Enables/disables chat rephrasing."},"formulationPrompt":{"type":"string","description":"The prompt for chat rephrasing."},"summaryEnabled":{"type":"boolean","description":"Enables/disables chat summarization."},"summaryPrompt":{"type":"string","description":"The prompt for chat summarization."},"questionAnsweringEnabled":{"type":"boolean","description":"Enables/disables question answering."},"questionAnsweringPrompt":{"type":"string","description":"The prompt for question answering."},"questionAnsweringAiConfig":{"description":"Specific AI configuration for question answering.","allOf":[{"$ref":"#/components/schemas/StepAiConfigDto"}]}}},"StepAiConfigDto":{"type":"object","properties":{"model":{"type":"number","description":"The AI model to use.\n\n- `1`: GEMINI_25_FLASH","enum":[1]},"thinkingBudget":{"type":"number","description":"Budget for the \"thinking\" process in tokens."},"seed":{"type":"number","description":"Seed for reproducible results."},"topP":{"type":"number","description":"Top-P value for generation."},"temperature":{"type":"number","description":"Temperature for generation creativity."}},"required":["model"]}}}}
```

## The UpdateAiFeaturesRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateAiFeaturesRequestDto":{"type":"object","properties":{"settings":{"description":"The object containing the settings to be updated.","allOf":[{"$ref":"#/components/schemas/UpdateAiFeaturesSettingsDto"}]}},"required":["settings"]},"UpdateAiFeaturesSettingsDto":{"type":"object","properties":{"completionEnabled":{"type":"boolean","description":"Enables/disables chat completion."},"completionPrompt":{"type":"string","description":"The prompt for chat completion."},"formulationEnabled":{"type":"boolean","description":"Enables/disables chat rephrasing."},"formulationPrompt":{"type":"string","description":"The prompt for chat rephrasing."},"summaryEnabled":{"type":"boolean","description":"Enables/disables chat summarization."},"summaryPrompt":{"type":"string","description":"The prompt for chat summarization."},"questionAnsweringEnabled":{"type":"boolean","description":"Enables/disables question answering."},"questionAnsweringPrompt":{"type":"string","description":"The prompt for question answering."},"questionAnsweringAiConfig":{"description":"Specific AI configuration for question answering.","allOf":[{"$ref":"#/components/schemas/StepAiConfigDto"}]}}},"StepAiConfigDto":{"type":"object","properties":{"model":{"type":"number","description":"The AI model to use.\n\n- `1`: GEMINI_25_FLASH","enum":[1]},"thinkingBudget":{"type":"number","description":"Budget for the \"thinking\" process in tokens."},"seed":{"type":"number","description":"Seed for reproducible results."},"topP":{"type":"number","description":"Top-P value for generation."},"temperature":{"type":"number","description":"Temperature for generation creativity."}},"required":["model"]}}}}
```

## The VersionStatsDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"VersionStatsDto":{"type":"object","properties":{"steps":{"type":"number","description":"The number of steps in this version."},"events":{"type":"number","description":"The number of events in this version."},"intents":{"type":"number","description":"The number of intents in this version."},"entities":{"type":"number","description":"The number of entities in this version."},"flows":{"type":"number","description":"The number of flows in this version."},"triggers":{"type":"number","description":"The number of triggers in this version."}},"required":["steps","events","intents","entities","flows","triggers"]}}}}
```

## The VersionDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"VersionDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the version."},"name":{"type":"string","description":"The display name of the version."},"created":{"type":"string","description":"Timestamp of when the version was created."},"deployed":{"type":"string","description":"Timestamp of when the version was deployed."},"modelId":{"type":"string","description":"The ID of the associated model."},"versionNumber":{"type":"string","description":"The semantic version number."},"stats":{"description":"Statistics about the version contents.","allOf":[{"$ref":"#/components/schemas/VersionStatsDto"}]},"description":{"type":"string","description":"A description of the version."},"environment":{"type":"string","description":"The environment this version is associated with.","enum":["dev","test","prod"]},"deploymentId":{"type":"string","description":"The ID of the active deployment, if any."},"hasActiveDeployment":{"type":"boolean","description":"Indicates whether the version has an active deployment."},"resettable":{"type":"boolean","description":"Indicates whether the version can be reset."}},"required":["id","name","created","deployed","modelId","versionNumber","stats","description","environment","hasActiveDeployment"]},"VersionStatsDto":{"type":"object","properties":{"steps":{"type":"number","description":"The number of steps in this version."},"events":{"type":"number","description":"The number of events in this version."},"intents":{"type":"number","description":"The number of intents in this version."},"entities":{"type":"number","description":"The number of entities in this version."},"flows":{"type":"number","description":"The number of flows in this version."},"triggers":{"type":"number","description":"The number of triggers in this version."}},"required":["steps","events","intents","entities","flows","triggers"]}}}}
```

## The ListVersionsResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListVersionsResponseDto":{"type":"object","properties":{"versions":{"description":"The list of versions.","type":"array","items":{"$ref":"#/components/schemas/VersionDto"}},"error":{"type":"string","description":"Optional error message."}},"required":["versions"]},"VersionDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the version."},"name":{"type":"string","description":"The display name of the version."},"created":{"type":"string","description":"Timestamp of when the version was created."},"deployed":{"type":"string","description":"Timestamp of when the version was deployed."},"modelId":{"type":"string","description":"The ID of the associated model."},"versionNumber":{"type":"string","description":"The semantic version number."},"stats":{"description":"Statistics about the version contents.","allOf":[{"$ref":"#/components/schemas/VersionStatsDto"}]},"description":{"type":"string","description":"A description of the version."},"environment":{"type":"string","description":"The environment this version is associated with.","enum":["dev","test","prod"]},"deploymentId":{"type":"string","description":"The ID of the active deployment, if any."},"hasActiveDeployment":{"type":"boolean","description":"Indicates whether the version has an active deployment."},"resettable":{"type":"boolean","description":"Indicates whether the version can be reset."}},"required":["id","name","created","deployed","modelId","versionNumber","stats","description","environment","hasActiveDeployment"]},"VersionStatsDto":{"type":"object","properties":{"steps":{"type":"number","description":"The number of steps in this version."},"events":{"type":"number","description":"The number of events in this version."},"intents":{"type":"number","description":"The number of intents in this version."},"entities":{"type":"number","description":"The number of entities in this version."},"flows":{"type":"number","description":"The number of flows in this version."},"triggers":{"type":"number","description":"The number of triggers in this version."}},"required":["steps","events","intents","entities","flows","triggers"]}}}}
```

## The CreateVersionRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateVersionRequestDto":{"type":"object","properties":{"description":{"type":"string","description":"An optional description for the new version."},"name":{"type":"string","description":"The name of the new version (often automatically generated)."},"environment":{"type":"string","description":"The environment for which this version is created. None being dev, as no deployment is needed.","enum":["test","prod","none"]}},"required":["name","environment"]}}}}
```

## The VersionResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"VersionResponseDto":{"type":"object","properties":{"version":{"description":"The version.","allOf":[{"$ref":"#/components/schemas/VersionDto"}]},"error":{"type":"string","description":"Optional error message."}}},"VersionDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the version."},"name":{"type":"string","description":"The display name of the version."},"created":{"type":"string","description":"Timestamp of when the version was created."},"deployed":{"type":"string","description":"Timestamp of when the version was deployed."},"modelId":{"type":"string","description":"The ID of the associated model."},"versionNumber":{"type":"string","description":"The semantic version number."},"stats":{"description":"Statistics about the version contents.","allOf":[{"$ref":"#/components/schemas/VersionStatsDto"}]},"description":{"type":"string","description":"A description of the version."},"environment":{"type":"string","description":"The environment this version is associated with.","enum":["dev","test","prod"]},"deploymentId":{"type":"string","description":"The ID of the active deployment, if any."},"hasActiveDeployment":{"type":"boolean","description":"Indicates whether the version has an active deployment."},"resettable":{"type":"boolean","description":"Indicates whether the version can be reset."}},"required":["id","name","created","deployed","modelId","versionNumber","stats","description","environment","hasActiveDeployment"]},"VersionStatsDto":{"type":"object","properties":{"steps":{"type":"number","description":"The number of steps in this version."},"events":{"type":"number","description":"The number of events in this version."},"intents":{"type":"number","description":"The number of intents in this version."},"entities":{"type":"number","description":"The number of entities in this version."},"flows":{"type":"number","description":"The number of flows in this version."},"triggers":{"type":"number","description":"The number of triggers in this version."}},"required":["steps","events","intents","entities","flows","triggers"]}}}}
```

## The DeleteVersionResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"DeleteVersionResponseDto":{"type":"object","properties":{"deleted":{"type":"boolean","description":"Indicates whether the version was successfully deleted."},"error":{"type":"string","description":"Optional error message."}}}}}}
```

## The DeployVersionRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"DeployVersionRequestDto":{"type":"object","properties":{"environment":{"type":"string","description":"The target environment for the deployment.","enum":["test","prod","dev"]}},"required":["environment"]}}}}
```

## The DeployVersionResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"DeployVersionResponseDto":{"type":"object","properties":{"started":{"type":"boolean","description":"Indicates whether the deployment was successfully started."},"error":{"type":"string","description":"Optional error message."}}}}}}
```

## The RollbackVersionComponents object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"RollbackVersionComponents":{"type":"number","enum":[0,1,-1],"description":"Components to be excluded from the rollback.\n\n- `0`: Apps\n- `1`: Settings"}}}}
```

## The RollbackVersionRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"RollbackVersionRequestDto":{"type":"object","properties":{"excludeComponents":{"type":"array","items":{"$ref":"#/components/schemas/RollbackVersionComponents"},"description":"Components to be excluded from the rollback.\n\n- `0`: Apps\n- `1`: Settings"}},"required":["excludeComponents"]},"RollbackVersionComponents":{"type":"number","enum":[0,1,-1],"description":"Components to be excluded from the rollback.\n\n- `0`: Apps\n- `1`: Settings"}}}}
```

## The RollbackVersionResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"RollbackVersionResponseDto":{"type":"object","properties":{"rolledBack":{"type":"boolean","description":"Indicates whether the rollback was successful."},"error":{"type":"string","description":"Optional error message."}}}}}}
```

## The DeploymentStatusDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"DeploymentStatusDto":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the Deployments."},"version":{"type":"string","description":"The version number that is deployed."},"deployed":{"type":"string","description":"The deployment timestamp in ISO format."},"modelId":{"type":"string","description":"The ID of the model that this version is based on."}},"required":["id","version","deployed","modelId"]}}}}
```

## The GetActiveDeploymentsStatusResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"GetActiveDeploymentsStatusResponseDto":{"type":"object","properties":{"test":{"description":"The status of the deployment in the test environment.","allOf":[{"$ref":"#/components/schemas/DeploymentStatusDto"}]},"prod":{"description":"The status of the deployment in the production environment.","allOf":[{"$ref":"#/components/schemas/DeploymentStatusDto"}]},"dev":{"description":"The status of the deployment in the development environment.","allOf":[{"$ref":"#/components/schemas/DeploymentStatusDto"}]},"error":{"type":"string","description":"An optional error message."}}},"DeploymentStatusDto":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the Deployments."},"version":{"type":"string","description":"The version number that is deployed."},"deployed":{"type":"string","description":"The deployment timestamp in ISO format."},"modelId":{"type":"string","description":"The ID of the model that this version is based on."}},"required":["id","version","deployed","modelId"]}}}}
```

## The GlobalVariableDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"GlobalVariableDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the variable."},"name":{"type":"string","description":"The programmatic name of the variable."},"defaultValue":{"type":"string","description":"The default value of the variable."},"category":{"type":"string","description":"The category of the variable (e.g., custom, entity, app)."},"label":{"type":"string","description":"The readable label of the variable."},"type":{"type":"string","description":"The data type of the variable.","enum":["string","number","boolean","object"]},"readonly":{"type":"boolean","description":"Indicates whether the variable is read-only."},"created":{"type":"string","description":"Timestamp of when the variable was created."},"updated":{"type":"string","description":"Timestamp of when the variable was last updated."},"structureJson":{"type":"string","format":"json","description":"A JSON string defining the structure for object variables."}},"required":["id","name","category","label","type","readonly","created","updated"]}}}}
```

## The ListGlobalVariablesResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListGlobalVariablesResponseDto":{"type":"object","properties":{"variables":{"description":"The list of global variables.","type":"array","items":{"$ref":"#/components/schemas/GlobalVariableDto"}},"error":{"type":"string","description":"Optional error message."}},"required":["variables"]},"GlobalVariableDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the variable."},"name":{"type":"string","description":"The programmatic name of the variable."},"defaultValue":{"type":"string","description":"The default value of the variable."},"category":{"type":"string","description":"The category of the variable (e.g., custom, entity, app)."},"label":{"type":"string","description":"The readable label of the variable."},"type":{"type":"string","description":"The data type of the variable.","enum":["string","number","boolean","object"]},"readonly":{"type":"boolean","description":"Indicates whether the variable is read-only."},"created":{"type":"string","description":"Timestamp of when the variable was created."},"updated":{"type":"string","description":"Timestamp of when the variable was last updated."},"structureJson":{"type":"string","format":"json","description":"A JSON string defining the structure for object variables."}},"required":["id","name","category","label","type","readonly","created","updated"]}}}}
```

## The GlobalVariableSubCategory object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"GlobalVariableSubCategory":{"type":"number","enum":[0,1,-1],"description":"Sets the subCategory of the variable.\n\n- `0`: GLOBAL_VARIABLE_SUB_CATEGORY_CONVERSATION\n- `1`: GLOBAL_VARIABLE_SUB_CATEGORY_CONTACT"}}}}
```

## The CreateGlobalVariableRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateGlobalVariableRequestDto":{"type":"object","properties":{"category":{"type":"string","description":"The category of the variable.","enum":["custom"]},"defaultValue":{"type":"string","description":"An optional default value for the variable."},"label":{"type":"string","description":"The human-readable label of the variable."},"type":{"type":"string","description":"The data type of the variable (e.g., \"string\", \"number\", \"boolean\", \"object\")."},"name":{"type":"string","description":"The programmatic name of the variable."},"structureJson":{"type":"string","format":"json","description":"A JSON string defining the structure for object variables."},"subCategory":{"description":"Sets the subCategory of the variable.\n\n- `0`: GLOBAL_VARIABLE_SUB_CATEGORY_CONVERSATION\n- `1`: GLOBAL_VARIABLE_SUB_CATEGORY_CONTACT","allOf":[{"$ref":"#/components/schemas/GlobalVariableSubCategory"}]}},"required":["category","label","type","name","subCategory"]},"GlobalVariableSubCategory":{"type":"number","enum":[0,1,-1],"description":"Sets the subCategory of the variable.\n\n- `0`: GLOBAL_VARIABLE_SUB_CATEGORY_CONVERSATION\n- `1`: GLOBAL_VARIABLE_SUB_CATEGORY_CONTACT"}}}}
```

## The GlobalVariableResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"GlobalVariableResponseDto":{"type":"object","properties":{"variable":{"description":"The global variable.","allOf":[{"$ref":"#/components/schemas/GlobalVariableDto"}]}}},"GlobalVariableDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the variable."},"name":{"type":"string","description":"The programmatic name of the variable."},"defaultValue":{"type":"string","description":"The default value of the variable."},"category":{"type":"string","description":"The category of the variable (e.g., custom, entity, app)."},"label":{"type":"string","description":"The readable label of the variable."},"type":{"type":"string","description":"The data type of the variable.","enum":["string","number","boolean","object"]},"readonly":{"type":"boolean","description":"Indicates whether the variable is read-only."},"created":{"type":"string","description":"Timestamp of when the variable was created."},"updated":{"type":"string","description":"Timestamp of when the variable was last updated."},"structureJson":{"type":"string","format":"json","description":"A JSON string defining the structure for object variables."}},"required":["id","name","category","label","type","readonly","created","updated"]}}}}
```

## The UpdateGlobalVariableRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateGlobalVariableRequestDto":{"type":"object","properties":{"defaultValue":{"type":"string","description":"The new default value."},"label":{"type":"string","description":"The new label."},"name":{"type":"string","description":"The new programmatic name."}}}}}}
```

## The DeleteGlobalVariableResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"DeleteGlobalVariableResponseDto":{"type":"object","properties":{"deleted":{"type":"boolean","description":"Indicates whether the variable was successfully deleted."}}}}}}
```

## The ExpressionIntentDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ExpressionIntentDto":{"type":"object","properties":{"category":{"type":"string","description":"The category/name of the intent."},"confidenceScore":{"type":"number","minimum":0,"maximum":1,"description":"The confidence score of the prediction for this intent."}},"required":["category","confidenceScore"]}}}}
```

## The ExpressionDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ExpressionDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the expression."},"created":{"type":"string","description":"The creation timestamp of the expression."},"expression":{"type":"string","description":"The original text of the user input."},"intents":{"description":"List of intents recognized for this expression.","type":"array","items":{"$ref":"#/components/schemas/ExpressionIntentDto"}},"predictedIntentId":{"type":"string","description":"The ID of the intent that was ultimately selected as the prediction."},"predictionScore":{"type":"number","minimum":0,"maximum":1,"description":"The confidence score of the top prediction."},"requiredIntentPredictionScore":{"type":"number","minimum":0,"maximum":1,"description":"The minimum required confidence score for this intent."},"topIntent":{"description":"The intent with the highest confidence.","allOf":[{"$ref":"#/components/schemas/ExpressionIntentDto"}]},"versionId":{"type":"string","description":"The version ID of the chatbot model."},"language":{"type":"string","description":"The language of the expression."},"conversationId":{"type":"string","description":"The ID of the conversation this expression belongs to."}},"required":["id","created","expression","intents","predictedIntentId","predictionScore","requiredIntentPredictionScore","topIntent","language","conversationId"]},"ExpressionIntentDto":{"type":"object","properties":{"category":{"type":"string","description":"The category/name of the intent."},"confidenceScore":{"type":"number","minimum":0,"maximum":1,"description":"The confidence score of the prediction for this intent."}},"required":["category","confidenceScore"]}}}}
```

## The ListExpressionsResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListExpressionsResponseDto":{"type":"object","properties":{"pageToken":{"type":"string","description":"The date of the latest fetched example."},"expressions":{"description":"A list of expressions.","type":"array","items":{"$ref":"#/components/schemas/ExpressionDto"}},"error":{"type":"string","description":"Optional error message."}},"required":["pageToken","expressions"]},"ExpressionDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the expression."},"created":{"type":"string","description":"The creation timestamp of the expression."},"expression":{"type":"string","description":"The original text of the user input."},"intents":{"description":"List of intents recognized for this expression.","type":"array","items":{"$ref":"#/components/schemas/ExpressionIntentDto"}},"predictedIntentId":{"type":"string","description":"The ID of the intent that was ultimately selected as the prediction."},"predictionScore":{"type":"number","minimum":0,"maximum":1,"description":"The confidence score of the top prediction."},"requiredIntentPredictionScore":{"type":"number","minimum":0,"maximum":1,"description":"The minimum required confidence score for this intent."},"topIntent":{"description":"The intent with the highest confidence.","allOf":[{"$ref":"#/components/schemas/ExpressionIntentDto"}]},"versionId":{"type":"string","description":"The version ID of the chatbot model."},"language":{"type":"string","description":"The language of the expression."},"conversationId":{"type":"string","description":"The ID of the conversation this expression belongs to."}},"required":["id","created","expression","intents","predictedIntentId","predictionScore","requiredIntentPredictionScore","topIntent","language","conversationId"]},"ExpressionIntentDto":{"type":"object","properties":{"category":{"type":"string","description":"The category/name of the intent."},"confidenceScore":{"type":"number","minimum":0,"maximum":1,"description":"The confidence score of the prediction for this intent."}},"required":["category","confidenceScore"]}}}}
```

## The GetExpressionStatsResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"GetExpressionStatsResponseDto":{"type":"object","properties":{"total":{"type":"number","description":"Total number of expressions."},"averagePredictionScore":{"type":"number","minimum":0,"maximum":1,"description":"Average confidence score of all expressions."},"totals":{"type":"object","description":"Distribution of expressions by confidence buckets.","additionalProperties":{"type":"number"}},"error":{"type":"string","description":"Optional error message."}},"required":["total","averagePredictionScore","totals"]}}}}
```

## The DeleteExpressionResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"DeleteExpressionResponseDto":{"type":"object","properties":{"deleted":{"type":"boolean","description":"Indicates whether the deletion was successful."},"error":{"type":"string","description":"Optional error message."}},"required":["deleted"]}}}}
```

## The PublicAppDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"PublicAppDto":{"type":"object","properties":{"id":{"type":"string","description":"The Id of the app."},"versionCount":{"type":"number","description":"Total number of versions for this app."},"hasApprovedVersion":{"type":"boolean","description":"Indicates whether at least one version has been approved."},"lastVersionRequested":{"type":"string","description":"Timestamp of the most recent version request (ISO format)."},"lastVersionApproved":{"type":"string","description":"Timestamp of the last approved version (ISO format)."},"name":{"type":"string","description":"Name of the app."}},"required":["id","versionCount","hasApprovedVersion","lastVersionRequested","name"]}}}}
```

## The ListApprovedPublicAppsResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListApprovedPublicAppsResponseDto":{"type":"object","properties":{"error":{"type":"string","description":"Optional error message."},"publicApps":{"description":"A list of retrieved apps.","type":"array","items":{"$ref":"#/components/schemas/PublicAppDto"}}},"required":["publicApps"]},"PublicAppDto":{"type":"object","properties":{"id":{"type":"string","description":"The Id of the app."},"versionCount":{"type":"number","description":"Total number of versions for this app."},"hasApprovedVersion":{"type":"boolean","description":"Indicates whether at least one version has been approved."},"lastVersionRequested":{"type":"string","description":"Timestamp of the most recent version request (ISO format)."},"lastVersionApproved":{"type":"string","description":"Timestamp of the last approved version (ISO format)."},"name":{"type":"string","description":"Name of the app."}},"required":["id","versionCount","hasApprovedVersion","lastVersionRequested","name"]}}}}
```

## The AppVersionReleaseState object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"AppVersionReleaseState":{"type":"number","enum":[0,1,2,3,4,-1],"description":"The state of the version.\n\n- `0`: IN_QUEUE\n- `1`: IN_PROGRESS\n- `2`: APPROVED\n- `3`: REJECTED\n- `4`: WITHDRAWN"}}}}
```

## The AppVersionDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"AppVersionDto":{"type":"object","properties":{"id":{"type":"string","description":"The Id of the app version."},"name":{"type":"string","description":"The name of the app."},"owner":{"type":"string","description":"The id of the workspace the app originates from."},"state":{"description":"The state of the version.\n\n- `0`: IN_QUEUE\n- `1`: IN_PROGRESS\n- `2`: APPROVED\n- `3`: REJECTED\n- `4`: WITHDRAWN","allOf":[{"$ref":"#/components/schemas/AppVersionReleaseState"}]},"requested":{"type":"string","description":"Timestamp of when the app versions approval was requested (ISO format)."},"inQueue":{"type":"string","description":"Timestamp of when the version entered the queue (ISO format)."},"inProgress":{"type":"string","description":"Timestamp of when the version was in progress (ISO format)."},"approved":{"type":"string","description":"Timestamp of when the version was approved (ISO format)."},"rejected":{"type":"string","description":"Timestamp of when the version was rejected (ISO format)."},"withdrawn":{"type":"string","description":"Timestamp of when the version was rejected (ISO format)."},"baseJson":{"type":"string","format":"json","description":"The base data of the app as JSON string."},"emitterUrl":{"type":"string","description":"The URL to which the Event-Emitter can send events from the app. Like when it was installed."},"readme":{"type":"string","description":"README in Markdown format."}},"required":["id","name","owner","state","requested","inQueue","inProgress","approved","rejected","withdrawn","baseJson","emitterUrl","readme"]},"AppVersionReleaseState":{"type":"number","enum":[0,1,2,3,4,-1],"description":"The state of the version.\n\n- `0`: IN_QUEUE\n- `1`: IN_PROGRESS\n- `2`: APPROVED\n- `3`: REJECTED\n- `4`: WITHDRAWN"}}}}
```

## The ListApprovedVersionsResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListApprovedVersionsResponseDto":{"type":"object","properties":{"error":{"type":"string","description":"Optional error message."},"appVersions":{"description":"A list of retrieved app versions.","type":"array","items":{"$ref":"#/components/schemas/AppVersionDto"}}},"required":["appVersions"]},"AppVersionDto":{"type":"object","properties":{"id":{"type":"string","description":"The Id of the app version."},"name":{"type":"string","description":"The name of the app."},"owner":{"type":"string","description":"The id of the workspace the app originates from."},"state":{"description":"The state of the version.\n\n- `0`: IN_QUEUE\n- `1`: IN_PROGRESS\n- `2`: APPROVED\n- `3`: REJECTED\n- `4`: WITHDRAWN","allOf":[{"$ref":"#/components/schemas/AppVersionReleaseState"}]},"requested":{"type":"string","description":"Timestamp of when the app versions approval was requested (ISO format)."},"inQueue":{"type":"string","description":"Timestamp of when the version entered the queue (ISO format)."},"inProgress":{"type":"string","description":"Timestamp of when the version was in progress (ISO format)."},"approved":{"type":"string","description":"Timestamp of when the version was approved (ISO format)."},"rejected":{"type":"string","description":"Timestamp of when the version was rejected (ISO format)."},"withdrawn":{"type":"string","description":"Timestamp of when the version was rejected (ISO format)."},"baseJson":{"type":"string","format":"json","description":"The base data of the app as JSON string."},"emitterUrl":{"type":"string","description":"The URL to which the Event-Emitter can send events from the app. Like when it was installed."},"readme":{"type":"string","description":"README in Markdown format."}},"required":["id","name","owner","state","requested","inQueue","inProgress","approved","rejected","withdrawn","baseJson","emitterUrl","readme"]},"AppVersionReleaseState":{"type":"number","enum":[0,1,2,3,4,-1],"description":"The state of the version.\n\n- `0`: IN_QUEUE\n- `1`: IN_PROGRESS\n- `2`: APPROVED\n- `3`: REJECTED\n- `4`: WITHDRAWN"}}}}
```

## The StorageObjectDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StorageObjectDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the object."},"name":{"type":"string","description":"The name/path of the object in the bucket."},"created":{"type":"string","description":"Timestamp when the object was created."},"updated":{"type":"string","description":"Timestamp when the object was last updated."},"size":{"type":"number","description":"The size of the object in bytes."},"contentType":{"type":"string","description":"The content type of the object."},"selfLink":{"type":"string","description":"The internal link to the object."},"mediaLink":{"type":"string","description":"The public media link to download the object."},"metadata":{"type":"object","description":"Custom metadata.","additionalProperties":{"type":"string"}}},"required":["id","name","created","updated","size","contentType","selfLink","metadata"]}}}}
```

## The ListObjectsResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListObjectsResponseDto":{"type":"object","properties":{"objects":{"description":"The list of objects.","type":"array","items":{"$ref":"#/components/schemas/StorageObjectDto"}},"error":{"type":"string","description":"Optional error message."}},"required":["objects"]},"StorageObjectDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the object."},"name":{"type":"string","description":"The name/path of the object in the bucket."},"created":{"type":"string","description":"Timestamp when the object was created."},"updated":{"type":"string","description":"Timestamp when the object was last updated."},"size":{"type":"number","description":"The size of the object in bytes."},"contentType":{"type":"string","description":"The content type of the object."},"selfLink":{"type":"string","description":"The internal link to the object."},"mediaLink":{"type":"string","description":"The public media link to download the object."},"metadata":{"type":"object","description":"Custom metadata.","additionalProperties":{"type":"string"}}},"required":["id","name","created","updated","size","contentType","selfLink","metadata"]}}}}
```

## The StorageObjectResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StorageObjectResponseDto":{"type":"object","properties":{"object":{"description":"The object.","nullable":true,"allOf":[{"$ref":"#/components/schemas/StorageObjectDto"}]},"error":{"type":"string","description":"Optional error message."}},"required":["object"]},"StorageObjectDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the object."},"name":{"type":"string","description":"The name/path of the object in the bucket."},"created":{"type":"string","description":"Timestamp when the object was created."},"updated":{"type":"string","description":"Timestamp when the object was last updated."},"size":{"type":"number","description":"The size of the object in bytes."},"contentType":{"type":"string","description":"The content type of the object."},"selfLink":{"type":"string","description":"The internal link to the object."},"mediaLink":{"type":"string","description":"The public media link to download the object."},"metadata":{"type":"object","description":"Custom metadata.","additionalProperties":{"type":"string"}}},"required":["id","name","created","updated","size","contentType","selfLink","metadata"]}}}}
```

## The CreateObjectDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateObjectDto":{"type":"object","properties":{"data":{"type":"string","format":"binary","description":"The file to be uploaded."},"filename":{"type":"string","description":"An optional filename. If not specified, the original name of the file will be used."},"metadata":{"type":"object","description":"Optional metadata as key-value pairs.","additionalProperties":{"type":"string"}}},"required":["data","metadata"]}}}}
```

## The DeleteObjectResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"DeleteObjectResponseDto":{"type":"object","properties":{"deleted":{"type":"boolean","description":"Indicates whether the deletion operation was successful."},"error":{"type":"string","description":"Optional error message."}},"required":["deleted"]}}}}
```

## The CreateTagRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateTagRequestDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the new tag."},"color":{"type":"string","description":"The color of the tag."}},"required":["name","color"]}}}}
```

## The TagDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"TagDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the tag."},"created":{"type":"string","description":"Timestamp when the tag was created."},"updated":{"type":"string","description":"Timestamp when the tag was last updated."},"name":{"type":"string","description":"The name of the tag."},"color":{"type":"string","pattern":"^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$","description":"The color of the tag as a hex code."}},"required":["id","created","updated","name","color"]}}}}
```

## The TagResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"TagResponseDto":{"type":"object","properties":{"tag":{"description":"The tag.","nullable":true,"allOf":[{"$ref":"#/components/schemas/TagDto"}]},"error":{"type":"string","description":"Optional error message."}},"required":["tag"]},"TagDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the tag."},"created":{"type":"string","description":"Timestamp when the tag was created."},"updated":{"type":"string","description":"Timestamp when the tag was last updated."},"name":{"type":"string","description":"The name of the tag."},"color":{"type":"string","pattern":"^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$","description":"The color of the tag as a hex code."}},"required":["id","created","updated","name","color"]}}}}
```

## The ListTagsResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListTagsResponseDto":{"type":"object","properties":{"tags":{"description":"The list of tags.","type":"array","items":{"$ref":"#/components/schemas/TagDto"}},"error":{"type":"string","description":"Optional error message."}},"required":["tags"]},"TagDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the tag."},"created":{"type":"string","description":"Timestamp when the tag was created."},"updated":{"type":"string","description":"Timestamp when the tag was last updated."},"name":{"type":"string","description":"The name of the tag."},"color":{"type":"string","pattern":"^#?([0-9A-F]{3}|[0-9A-F]{4}|[0-9A-F]{6}|[0-9A-F]{8})$","description":"The color of the tag as a hex code."}},"required":["id","created","updated","name","color"]}}}}
```

## The UpdateTagRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateTagRequestDto":{"type":"object","properties":{"name":{"type":"string","description":"The new name of the tag."},"color":{"type":"string","description":"The new color of the tag."}},"required":["name","color"]}}}}
```

## The SortDirection object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"SortDirection":{"type":"number","enum":[0,1,-1],"description":"Sort direction\n\n- `0`: ASC\n- `1`: DESC"}}}}
```

## The CreateOrUpdateViewRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateOrUpdateViewRequestDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the view."},"icon":{"type":"string","description":"The name of the icon for the view."},"tags":{"description":"A list of tag IDs for filtering.","default":[],"type":"array","items":{"type":"string"}},"unread":{"type":"boolean","description":"Display only unread conversations.","default":false},"sorting":{"type":"string","description":"Sort field (e.g., \"created\", \"updated\")."},"selfAssigned":{"type":"boolean","description":"Display only self-assigned conversations.","default":false},"open":{"type":"boolean","description":"Display open conversations.","default":true},"closed":{"type":"boolean","description":"Display closed conversations.","default":true},"inProgress":{"type":"boolean","description":"Display conversations in progress.","default":true},"sortingDirection":{"description":"Sort direction\n\n- `0`: ASC\n- `1`: DESC","default":1,"allOf":[{"$ref":"#/components/schemas/SortDirection"}]}},"required":["name","icon","tags","unread","sorting","selfAssigned","open","closed","inProgress","sortingDirection"]},"SortDirection":{"type":"number","enum":[0,1,-1],"description":"Sort direction\n\n- `0`: ASC\n- `1`: DESC"}}}}
```

## The ViewDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ViewDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the view."},"created":{"type":"string","description":"Timestamp when the view was created."},"updated":{"type":"string","description":"Timestamp when the view was last updated."},"name":{"type":"string","description":"The name of the view."},"icon":{"type":"string","description":"The name of the icon for the view."},"tags":{"description":"A list of tag IDs to filter by.","type":"array","items":{"type":"string"}},"unread":{"type":"boolean","description":"Filters only by unread conversations."},"sorting":{"type":"string","description":"The field to sort by."},"selfAssigned":{"type":"boolean","description":"Filters only by conversations assigned to the current agent."},"open":{"type":"boolean","description":"Filters by open conversations."},"closed":{"type":"boolean","description":"Filters by closed conversations."},"inProgress":{"type":"boolean","description":"Filters by conversations in progress."},"sortingDirection":{"description":"The sort direction\n\n- `0`: ASC\n- `1`: DESC","allOf":[{"$ref":"#/components/schemas/SortDirection"}]}},"required":["id","created","updated","name","icon","tags","unread","sorting","selfAssigned","open","closed","inProgress","sortingDirection"]},"SortDirection":{"type":"number","enum":[0,1,-1],"description":"Sort direction\n\n- `0`: ASC\n- `1`: DESC"}}}}
```

## The ViewResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ViewResponseDto":{"type":"object","properties":{"view":{"description":"The view.","nullable":true,"allOf":[{"$ref":"#/components/schemas/ViewDto"}]},"error":{"type":"string","description":"Optional error message."}},"required":["view"]},"ViewDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the view."},"created":{"type":"string","description":"Timestamp when the view was created."},"updated":{"type":"string","description":"Timestamp when the view was last updated."},"name":{"type":"string","description":"The name of the view."},"icon":{"type":"string","description":"The name of the icon for the view."},"tags":{"description":"A list of tag IDs to filter by.","type":"array","items":{"type":"string"}},"unread":{"type":"boolean","description":"Filters only by unread conversations."},"sorting":{"type":"string","description":"The field to sort by."},"selfAssigned":{"type":"boolean","description":"Filters only by conversations assigned to the current agent."},"open":{"type":"boolean","description":"Filters by open conversations."},"closed":{"type":"boolean","description":"Filters by closed conversations."},"inProgress":{"type":"boolean","description":"Filters by conversations in progress."},"sortingDirection":{"description":"The sort direction\n\n- `0`: ASC\n- `1`: DESC","allOf":[{"$ref":"#/components/schemas/SortDirection"}]}},"required":["id","created","updated","name","icon","tags","unread","sorting","selfAssigned","open","closed","inProgress","sortingDirection"]},"SortDirection":{"type":"number","enum":[0,1,-1],"description":"Sort direction\n\n- `0`: ASC\n- `1`: DESC"}}}}
```

## The ListViewsResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListViewsResponseDto":{"type":"object","properties":{"views":{"description":"The list of views.","type":"array","items":{"$ref":"#/components/schemas/ViewDto"}},"error":{"type":"string","description":"Optional error message."}},"required":["views"]},"ViewDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the view."},"created":{"type":"string","description":"Timestamp when the view was created."},"updated":{"type":"string","description":"Timestamp when the view was last updated."},"name":{"type":"string","description":"The name of the view."},"icon":{"type":"string","description":"The name of the icon for the view."},"tags":{"description":"A list of tag IDs to filter by.","type":"array","items":{"type":"string"}},"unread":{"type":"boolean","description":"Filters only by unread conversations."},"sorting":{"type":"string","description":"The field to sort by."},"selfAssigned":{"type":"boolean","description":"Filters only by conversations assigned to the current agent."},"open":{"type":"boolean","description":"Filters by open conversations."},"closed":{"type":"boolean","description":"Filters by closed conversations."},"inProgress":{"type":"boolean","description":"Filters by conversations in progress."},"sortingDirection":{"description":"The sort direction\n\n- `0`: ASC\n- `1`: DESC","allOf":[{"$ref":"#/components/schemas/SortDirection"}]}},"required":["id","created","updated","name","icon","tags","unread","sorting","selfAssigned","open","closed","inProgress","sortingDirection"]},"SortDirection":{"type":"number","enum":[0,1,-1],"description":"Sort direction\n\n- `0`: ASC\n- `1`: DESC"}}}}
```

## The SendMessageRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"SendMessageRequestDto":{"type":"object","properties":{"conversationId":{"type":"string","description":"The ID of the conversation in which the message is sent."},"text":{"type":"string","description":"The text content of the message. Either `text` or `attachmentRef` must be present."},"attachmentRef":{"type":"string","description":"The reference to an uploaded attachment. Either `text` or `attachmentRef` must be present."}},"required":["conversationId"]}}}}
```

## The MessagePersonaDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"MessagePersonaDto":{"type":"object","properties":{"image":{"type":"string","description":"The URL of the persona's avatar image."},"name":{"type":"string","description":"The display name of the persona."}},"required":["image","name"]}}}}
```

## The MessageContentFileDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"MessageContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, audio)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."},"caption":{"type":"string","description":"An optional caption for the file."},"transcript":{"type":"string","description":"The transcript of audio/video content."},"facebookAttachmentId":{"type":"string","description":"The Facebook attachment ID."},"whatsappAttachmentId":{"type":"string","description":"The WhatsApp attachment ID."},"instagramAttachmentId":{"type":"string","description":"The Instagram attachment ID."}},"required":["name","url","type","mimeType","size","attachmentRef"]}}}}
```

## The MessageContentButtonDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"MessageContentButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, postback)."},"value":{"type":"string","description":"The value associated with the button."},"payload":{"type":"string","description":"An optional payload for the button."}},"required":["label","type","value"]}}}}
```

## The MessageContentButtonsDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"MessageContentButtonsDto":{"type":"object","properties":{"buttons":{"description":"The list of buttons.","type":"array","items":{"$ref":"#/components/schemas/MessageContentButtonDto"}}},"required":["buttons"]},"MessageContentButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, postback)."},"value":{"type":"string","description":"The value associated with the button."},"payload":{"type":"string","description":"An optional payload for the button."}},"required":["label","type","value"]}}}}
```

## The MessageContentButtonReplyDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"MessageContentButtonReplyDto":{"type":"object","properties":{"label":{"type":"string","description":"The label of the selected button."},"value":{"type":"string","description":"The value of the selected button."},"payload":{"type":"string","description":"An optional payload from the button."},"type":{"type":"string","description":"The type of the button."},"reference":{"type":"string","description":"The reference to the original button message."}},"required":["label","value","reference"]}}}}
```

## The MessageTemplateDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"MessageTemplateDto":{"type":"object","properties":{"body":{"type":"string","description":"The body text of the template."},"header":{"type":"string","description":"The header text of the template."},"footer":{"type":"string","description":"The footer text of the template."}},"required":["body"]}}}}
```

## The MessageLocationDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"MessageLocationDto":{"type":"object","properties":{"latitude":{"type":"number","description":"The latitude coordinate."},"longitude":{"type":"number","description":"The longitude coordinate."}},"required":["latitude","longitude"]}}}}
```

## The MessageVoiceHangupDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"MessageVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for hanging up the call."},"headers":{"type":"object","description":"Custom SIP headers for the hangup.","additionalProperties":{"type":"string"}}},"required":["reason","headers"]}}}}
```

## The MessageVoiceTransferDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"MessageVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string","description":"The target phone number or SIP address for the transfer."},"reason":{"type":"string","description":"The reason for the transfer."},"headers":{"type":"object","description":"Custom SIP headers for the transfer.","additionalProperties":{"type":"string"}}},"required":["target","headers"]}}}}
```

## The MessageAgentHandoverDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"MessageAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for the handover to an agent."},"timeoutSeconds":{"type":"number","description":"Timeout in seconds before the handover expires."},"agentId":{"type":"string","description":"The ID of the specific agent to hand over to."},"groupId":{"type":"string","description":"The ID of the agent group to hand over to."},"assignmentMethod":{"type":"string","description":"The method for assigning the agent (e.g., round_robin, least_busy)."}},"required":["reason"]}}}}
```

## The MessageContentEmailDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"MessageContentEmailDto":{"type":"object","properties":{"subject":{"type":"string","description":"The subject of the email."},"body":{"type":"string","description":"The body content of the email."},"from":{"type":"string","description":"The sender email address."},"to":{"description":"The list of recipient email addresses.","type":"array","items":{"type":"string"}},"cc":{"description":"The list of CC recipient email addresses.","type":"array","items":{"type":"string"}},"bcc":{"description":"The list of BCC recipient email addresses.","type":"array","items":{"type":"string"}},"attachmentIds":{"description":"The list of attachment IDs.","type":"array","items":{"type":"string"}},"references":{"description":"The list of email references for threading.","type":"array","items":{"type":"string"}}},"required":["subject","body","from","to","cc","bcc","attachmentIds","references"]}}}}
```

## The MessageContentTextToSpeechDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"MessageContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"string","description":"The text to be converted to speech."},"speech":{"type":"string","description":"Pre-generated speech audio reference."}},"required":["text"]}}}}
```

## The MessageMetaWhatsAppTemplate\_Header\_FileDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"MessageMetaWhatsAppTemplate_Header_FileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, video)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."}},"required":["name","url","type","mimeType","size","attachmentRef"]}}}}
```

## The MessageMetaWhatsAppTemplate\_HeaderDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"MessageMetaWhatsAppTemplate_HeaderDto":{"type":"object","properties":{"file":{"description":"The file attached to the header.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_Header_FileDto"}]},"parameters":{"description":"The list of parameter values for the header placeholders.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"MessageMetaWhatsAppTemplate_Header_FileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, video)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."}},"required":["name","url","type","mimeType","size","attachmentRef"]}}}}
```

## The MessageMetaWhatsAppTemplate\_ButtonDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"MessageMetaWhatsAppTemplate_ButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, quick_reply)."},"url":{"type":"string","description":"The URL for URL-type buttons."},"value":{"type":"string","description":"The value for quick_reply-type buttons."}},"required":["label","type"]}}}}
```

## The MessageMetaWhatsAppTemplateDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"MessageMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the template on Meta."},"language":{"type":"string","description":"The language code of the template."},"bodyText":{"type":"string","description":"The body text of the message. Placeholders are in the form `{{1}}`."},"headerText":{"type":"string","description":"The text in the header (if present)."},"footerText":{"type":"string","description":"The text in the footer (if present)."},"header":{"description":"The header component, which can contain a file or text parameters.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_HeaderDto"}]},"bodyParameters":{"description":"A list of values that replace the placeholders in the `bodyText`.","type":"array","items":{"type":"string"}},"buttons":{"description":"A list of buttons attached to the message.","type":"array","items":{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_ButtonDto"}}},"required":["templateName","language","bodyText","bodyParameters","buttons"]},"MessageMetaWhatsAppTemplate_HeaderDto":{"type":"object","properties":{"file":{"description":"The file attached to the header.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_Header_FileDto"}]},"parameters":{"description":"The list of parameter values for the header placeholders.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"MessageMetaWhatsAppTemplate_Header_FileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, video)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageMetaWhatsAppTemplate_ButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, quick_reply)."},"url":{"type":"string","description":"The URL for URL-type buttons."},"value":{"type":"string","description":"The value for quick_reply-type buttons."}},"required":["label","type"]}}}}
```

## The OperatorDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"OperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The unique identifier of the operator."}},"required":["operatorId"]}}}}
```

## The ContentDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ContentDto":{"type":"object","properties":{"text":{"type":"string","description":"The text content of the message."},"file":{"description":"A file attachment.","allOf":[{"$ref":"#/components/schemas/MessageContentFileDto"}]},"buttons":{"description":"Interactive buttons for the message.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonsDto"}]},"selectedButton":{"description":"The button selected by the user.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonReplyDto"}]},"template":{"description":"A message template.","allOf":[{"$ref":"#/components/schemas/MessageTemplateDto"}]},"location":{"description":"A location shared in the message.","allOf":[{"$ref":"#/components/schemas/MessageLocationDto"}]},"voiceHangup":{"description":"Voice hangup data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceHangupDto"}]},"voiceTransfer":{"description":"Voice transfer data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceTransferDto"}]},"agentHandover":{"description":"Agent handover data.","allOf":[{"$ref":"#/components/schemas/MessageAgentHandoverDto"}]},"email":{"description":"Email content data.","allOf":[{"$ref":"#/components/schemas/MessageContentEmailDto"}]},"textToSpeech":{"description":"Text-to-speech content data.","allOf":[{"$ref":"#/components/schemas/MessageContentTextToSpeechDto"}]},"metaWhatsappTemplate":{"description":"A Meta WhatsApp template message.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplateDto"}]},"operator":{"description":"Operator data for the message.","allOf":[{"$ref":"#/components/schemas/OperatorDto"}]},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."},"leadAiId":{"type":"string","description":"The ID of the Lead AI associated with this message."}}},"MessageContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, audio)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."},"caption":{"type":"string","description":"An optional caption for the file."},"transcript":{"type":"string","description":"The transcript of audio/video content."},"facebookAttachmentId":{"type":"string","description":"The Facebook attachment ID."},"whatsappAttachmentId":{"type":"string","description":"The WhatsApp attachment ID."},"instagramAttachmentId":{"type":"string","description":"The Instagram attachment ID."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageContentButtonsDto":{"type":"object","properties":{"buttons":{"description":"The list of buttons.","type":"array","items":{"$ref":"#/components/schemas/MessageContentButtonDto"}}},"required":["buttons"]},"MessageContentButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, postback)."},"value":{"type":"string","description":"The value associated with the button."},"payload":{"type":"string","description":"An optional payload for the button."}},"required":["label","type","value"]},"MessageContentButtonReplyDto":{"type":"object","properties":{"label":{"type":"string","description":"The label of the selected button."},"value":{"type":"string","description":"The value of the selected button."},"payload":{"type":"string","description":"An optional payload from the button."},"type":{"type":"string","description":"The type of the button."},"reference":{"type":"string","description":"The reference to the original button message."}},"required":["label","value","reference"]},"MessageTemplateDto":{"type":"object","properties":{"body":{"type":"string","description":"The body text of the template."},"header":{"type":"string","description":"The header text of the template."},"footer":{"type":"string","description":"The footer text of the template."}},"required":["body"]},"MessageLocationDto":{"type":"object","properties":{"latitude":{"type":"number","description":"The latitude coordinate."},"longitude":{"type":"number","description":"The longitude coordinate."}},"required":["latitude","longitude"]},"MessageVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for hanging up the call."},"headers":{"type":"object","description":"Custom SIP headers for the hangup.","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"MessageVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string","description":"The target phone number or SIP address for the transfer."},"reason":{"type":"string","description":"The reason for the transfer."},"headers":{"type":"object","description":"Custom SIP headers for the transfer.","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"MessageAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for the handover to an agent."},"timeoutSeconds":{"type":"number","description":"Timeout in seconds before the handover expires."},"agentId":{"type":"string","description":"The ID of the specific agent to hand over to."},"groupId":{"type":"string","description":"The ID of the agent group to hand over to."},"assignmentMethod":{"type":"string","description":"The method for assigning the agent (e.g., round_robin, least_busy)."}},"required":["reason"]},"MessageContentEmailDto":{"type":"object","properties":{"subject":{"type":"string","description":"The subject of the email."},"body":{"type":"string","description":"The body content of the email."},"from":{"type":"string","description":"The sender email address."},"to":{"description":"The list of recipient email addresses.","type":"array","items":{"type":"string"}},"cc":{"description":"The list of CC recipient email addresses.","type":"array","items":{"type":"string"}},"bcc":{"description":"The list of BCC recipient email addresses.","type":"array","items":{"type":"string"}},"attachmentIds":{"description":"The list of attachment IDs.","type":"array","items":{"type":"string"}},"references":{"description":"The list of email references for threading.","type":"array","items":{"type":"string"}}},"required":["subject","body","from","to","cc","bcc","attachmentIds","references"]},"MessageContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"string","description":"The text to be converted to speech."},"speech":{"type":"string","description":"Pre-generated speech audio reference."}},"required":["text"]},"MessageMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the template on Meta."},"language":{"type":"string","description":"The language code of the template."},"bodyText":{"type":"string","description":"The body text of the message. Placeholders are in the form `{{1}}`."},"headerText":{"type":"string","description":"The text in the header (if present)."},"footerText":{"type":"string","description":"The text in the footer (if present)."},"header":{"description":"The header component, which can contain a file or text parameters.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_HeaderDto"}]},"bodyParameters":{"description":"A list of values that replace the placeholders in the `bodyText`.","type":"array","items":{"type":"string"}},"buttons":{"description":"A list of buttons attached to the message.","type":"array","items":{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_ButtonDto"}}},"required":["templateName","language","bodyText","bodyParameters","buttons"]},"MessageMetaWhatsAppTemplate_HeaderDto":{"type":"object","properties":{"file":{"description":"The file attached to the header.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_Header_FileDto"}]},"parameters":{"description":"The list of parameter values for the header placeholders.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"MessageMetaWhatsAppTemplate_Header_FileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, video)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageMetaWhatsAppTemplate_ButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, quick_reply)."},"url":{"type":"string","description":"The URL for URL-type buttons."},"value":{"type":"string","description":"The value for quick_reply-type buttons."}},"required":["label","type"]},"OperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The unique identifier of the operator."}},"required":["operatorId"]}}}}
```

## The MessageDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"MessageDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the message."},"sender":{"type":"string","description":"The sender of the message (e.g., user, bot, agent)."},"type":{"type":"string","description":"The type of message (e.g., text, file, template)."},"persona":{"description":"The persona representing the sender.","allOf":[{"$ref":"#/components/schemas/MessagePersonaDto"}]},"providerMessageId":{"type":"string","description":"The message ID from the external provider."},"status":{"type":"string","description":"The delivery status of the message."},"created":{"type":"string","description":"Timestamp when the message was created."},"processed":{"type":"string","description":"Timestamp when the message was processed."},"sent":{"type":"string","description":"Timestamp when the message was sent."},"received":{"type":"string","description":"Timestamp when the message was received by the recipient."},"read":{"type":"string","description":"Timestamp when the message was read by the recipient."},"outgoing":{"type":"boolean","description":"Whether the message is outgoing (true) or incoming (false)."},"messengerId":{"type":"string","description":"The messenger ID associated with the message."},"contextId":{"type":"string","description":"The context ID for message threading."},"content":{"description":"The content of the message.","allOf":[{"$ref":"#/components/schemas/ContentDto"}]},"tags":{"description":"The list of tags associated with the message.","type":"array","items":{"type":"string"}},"error":{"type":"string","description":"Optional error message."},"isSensitive":{"type":"boolean","description":"Whether the message contains sensitive content."},"streamGroupId":{"type":"string","description":"The stream group ID for grouped streaming messages."},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."}},"required":["id","sender","type","status","created","outgoing","content","tags"]},"MessagePersonaDto":{"type":"object","properties":{"image":{"type":"string","description":"The URL of the persona's avatar image."},"name":{"type":"string","description":"The display name of the persona."}},"required":["image","name"]},"ContentDto":{"type":"object","properties":{"text":{"type":"string","description":"The text content of the message."},"file":{"description":"A file attachment.","allOf":[{"$ref":"#/components/schemas/MessageContentFileDto"}]},"buttons":{"description":"Interactive buttons for the message.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonsDto"}]},"selectedButton":{"description":"The button selected by the user.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonReplyDto"}]},"template":{"description":"A message template.","allOf":[{"$ref":"#/components/schemas/MessageTemplateDto"}]},"location":{"description":"A location shared in the message.","allOf":[{"$ref":"#/components/schemas/MessageLocationDto"}]},"voiceHangup":{"description":"Voice hangup data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceHangupDto"}]},"voiceTransfer":{"description":"Voice transfer data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceTransferDto"}]},"agentHandover":{"description":"Agent handover data.","allOf":[{"$ref":"#/components/schemas/MessageAgentHandoverDto"}]},"email":{"description":"Email content data.","allOf":[{"$ref":"#/components/schemas/MessageContentEmailDto"}]},"textToSpeech":{"description":"Text-to-speech content data.","allOf":[{"$ref":"#/components/schemas/MessageContentTextToSpeechDto"}]},"metaWhatsappTemplate":{"description":"A Meta WhatsApp template message.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplateDto"}]},"operator":{"description":"Operator data for the message.","allOf":[{"$ref":"#/components/schemas/OperatorDto"}]},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."},"leadAiId":{"type":"string","description":"The ID of the Lead AI associated with this message."}}},"MessageContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, audio)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."},"caption":{"type":"string","description":"An optional caption for the file."},"transcript":{"type":"string","description":"The transcript of audio/video content."},"facebookAttachmentId":{"type":"string","description":"The Facebook attachment ID."},"whatsappAttachmentId":{"type":"string","description":"The WhatsApp attachment ID."},"instagramAttachmentId":{"type":"string","description":"The Instagram attachment ID."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageContentButtonsDto":{"type":"object","properties":{"buttons":{"description":"The list of buttons.","type":"array","items":{"$ref":"#/components/schemas/MessageContentButtonDto"}}},"required":["buttons"]},"MessageContentButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, postback)."},"value":{"type":"string","description":"The value associated with the button."},"payload":{"type":"string","description":"An optional payload for the button."}},"required":["label","type","value"]},"MessageContentButtonReplyDto":{"type":"object","properties":{"label":{"type":"string","description":"The label of the selected button."},"value":{"type":"string","description":"The value of the selected button."},"payload":{"type":"string","description":"An optional payload from the button."},"type":{"type":"string","description":"The type of the button."},"reference":{"type":"string","description":"The reference to the original button message."}},"required":["label","value","reference"]},"MessageTemplateDto":{"type":"object","properties":{"body":{"type":"string","description":"The body text of the template."},"header":{"type":"string","description":"The header text of the template."},"footer":{"type":"string","description":"The footer text of the template."}},"required":["body"]},"MessageLocationDto":{"type":"object","properties":{"latitude":{"type":"number","description":"The latitude coordinate."},"longitude":{"type":"number","description":"The longitude coordinate."}},"required":["latitude","longitude"]},"MessageVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for hanging up the call."},"headers":{"type":"object","description":"Custom SIP headers for the hangup.","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"MessageVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string","description":"The target phone number or SIP address for the transfer."},"reason":{"type":"string","description":"The reason for the transfer."},"headers":{"type":"object","description":"Custom SIP headers for the transfer.","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"MessageAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for the handover to an agent."},"timeoutSeconds":{"type":"number","description":"Timeout in seconds before the handover expires."},"agentId":{"type":"string","description":"The ID of the specific agent to hand over to."},"groupId":{"type":"string","description":"The ID of the agent group to hand over to."},"assignmentMethod":{"type":"string","description":"The method for assigning the agent (e.g., round_robin, least_busy)."}},"required":["reason"]},"MessageContentEmailDto":{"type":"object","properties":{"subject":{"type":"string","description":"The subject of the email."},"body":{"type":"string","description":"The body content of the email."},"from":{"type":"string","description":"The sender email address."},"to":{"description":"The list of recipient email addresses.","type":"array","items":{"type":"string"}},"cc":{"description":"The list of CC recipient email addresses.","type":"array","items":{"type":"string"}},"bcc":{"description":"The list of BCC recipient email addresses.","type":"array","items":{"type":"string"}},"attachmentIds":{"description":"The list of attachment IDs.","type":"array","items":{"type":"string"}},"references":{"description":"The list of email references for threading.","type":"array","items":{"type":"string"}}},"required":["subject","body","from","to","cc","bcc","attachmentIds","references"]},"MessageContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"string","description":"The text to be converted to speech."},"speech":{"type":"string","description":"Pre-generated speech audio reference."}},"required":["text"]},"MessageMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the template on Meta."},"language":{"type":"string","description":"The language code of the template."},"bodyText":{"type":"string","description":"The body text of the message. Placeholders are in the form `{{1}}`."},"headerText":{"type":"string","description":"The text in the header (if present)."},"footerText":{"type":"string","description":"The text in the footer (if present)."},"header":{"description":"The header component, which can contain a file or text parameters.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_HeaderDto"}]},"bodyParameters":{"description":"A list of values that replace the placeholders in the `bodyText`.","type":"array","items":{"type":"string"}},"buttons":{"description":"A list of buttons attached to the message.","type":"array","items":{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_ButtonDto"}}},"required":["templateName","language","bodyText","bodyParameters","buttons"]},"MessageMetaWhatsAppTemplate_HeaderDto":{"type":"object","properties":{"file":{"description":"The file attached to the header.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_Header_FileDto"}]},"parameters":{"description":"The list of parameter values for the header placeholders.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"MessageMetaWhatsAppTemplate_Header_FileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, video)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageMetaWhatsAppTemplate_ButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, quick_reply)."},"url":{"type":"string","description":"The URL for URL-type buttons."},"value":{"type":"string","description":"The value for quick_reply-type buttons."}},"required":["label","type"]},"OperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The unique identifier of the operator."}},"required":["operatorId"]}}}}
```

## The SendMessageResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"SendMessageResponseDto":{"type":"object","properties":{"message":{"description":"The newly created message.","nullable":true,"allOf":[{"$ref":"#/components/schemas/MessageDto"}]},"error":{"type":"string","description":"Optional error message."}},"required":["message"]},"MessageDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the message."},"sender":{"type":"string","description":"The sender of the message (e.g., user, bot, agent)."},"type":{"type":"string","description":"The type of message (e.g., text, file, template)."},"persona":{"description":"The persona representing the sender.","allOf":[{"$ref":"#/components/schemas/MessagePersonaDto"}]},"providerMessageId":{"type":"string","description":"The message ID from the external provider."},"status":{"type":"string","description":"The delivery status of the message."},"created":{"type":"string","description":"Timestamp when the message was created."},"processed":{"type":"string","description":"Timestamp when the message was processed."},"sent":{"type":"string","description":"Timestamp when the message was sent."},"received":{"type":"string","description":"Timestamp when the message was received by the recipient."},"read":{"type":"string","description":"Timestamp when the message was read by the recipient."},"outgoing":{"type":"boolean","description":"Whether the message is outgoing (true) or incoming (false)."},"messengerId":{"type":"string","description":"The messenger ID associated with the message."},"contextId":{"type":"string","description":"The context ID for message threading."},"content":{"description":"The content of the message.","allOf":[{"$ref":"#/components/schemas/ContentDto"}]},"tags":{"description":"The list of tags associated with the message.","type":"array","items":{"type":"string"}},"error":{"type":"string","description":"Optional error message."},"isSensitive":{"type":"boolean","description":"Whether the message contains sensitive content."},"streamGroupId":{"type":"string","description":"The stream group ID for grouped streaming messages."},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."}},"required":["id","sender","type","status","created","outgoing","content","tags"]},"MessagePersonaDto":{"type":"object","properties":{"image":{"type":"string","description":"The URL of the persona's avatar image."},"name":{"type":"string","description":"The display name of the persona."}},"required":["image","name"]},"ContentDto":{"type":"object","properties":{"text":{"type":"string","description":"The text content of the message."},"file":{"description":"A file attachment.","allOf":[{"$ref":"#/components/schemas/MessageContentFileDto"}]},"buttons":{"description":"Interactive buttons for the message.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonsDto"}]},"selectedButton":{"description":"The button selected by the user.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonReplyDto"}]},"template":{"description":"A message template.","allOf":[{"$ref":"#/components/schemas/MessageTemplateDto"}]},"location":{"description":"A location shared in the message.","allOf":[{"$ref":"#/components/schemas/MessageLocationDto"}]},"voiceHangup":{"description":"Voice hangup data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceHangupDto"}]},"voiceTransfer":{"description":"Voice transfer data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceTransferDto"}]},"agentHandover":{"description":"Agent handover data.","allOf":[{"$ref":"#/components/schemas/MessageAgentHandoverDto"}]},"email":{"description":"Email content data.","allOf":[{"$ref":"#/components/schemas/MessageContentEmailDto"}]},"textToSpeech":{"description":"Text-to-speech content data.","allOf":[{"$ref":"#/components/schemas/MessageContentTextToSpeechDto"}]},"metaWhatsappTemplate":{"description":"A Meta WhatsApp template message.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplateDto"}]},"operator":{"description":"Operator data for the message.","allOf":[{"$ref":"#/components/schemas/OperatorDto"}]},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."},"leadAiId":{"type":"string","description":"The ID of the Lead AI associated with this message."}}},"MessageContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, audio)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."},"caption":{"type":"string","description":"An optional caption for the file."},"transcript":{"type":"string","description":"The transcript of audio/video content."},"facebookAttachmentId":{"type":"string","description":"The Facebook attachment ID."},"whatsappAttachmentId":{"type":"string","description":"The WhatsApp attachment ID."},"instagramAttachmentId":{"type":"string","description":"The Instagram attachment ID."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageContentButtonsDto":{"type":"object","properties":{"buttons":{"description":"The list of buttons.","type":"array","items":{"$ref":"#/components/schemas/MessageContentButtonDto"}}},"required":["buttons"]},"MessageContentButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, postback)."},"value":{"type":"string","description":"The value associated with the button."},"payload":{"type":"string","description":"An optional payload for the button."}},"required":["label","type","value"]},"MessageContentButtonReplyDto":{"type":"object","properties":{"label":{"type":"string","description":"The label of the selected button."},"value":{"type":"string","description":"The value of the selected button."},"payload":{"type":"string","description":"An optional payload from the button."},"type":{"type":"string","description":"The type of the button."},"reference":{"type":"string","description":"The reference to the original button message."}},"required":["label","value","reference"]},"MessageTemplateDto":{"type":"object","properties":{"body":{"type":"string","description":"The body text of the template."},"header":{"type":"string","description":"The header text of the template."},"footer":{"type":"string","description":"The footer text of the template."}},"required":["body"]},"MessageLocationDto":{"type":"object","properties":{"latitude":{"type":"number","description":"The latitude coordinate."},"longitude":{"type":"number","description":"The longitude coordinate."}},"required":["latitude","longitude"]},"MessageVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for hanging up the call."},"headers":{"type":"object","description":"Custom SIP headers for the hangup.","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"MessageVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string","description":"The target phone number or SIP address for the transfer."},"reason":{"type":"string","description":"The reason for the transfer."},"headers":{"type":"object","description":"Custom SIP headers for the transfer.","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"MessageAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for the handover to an agent."},"timeoutSeconds":{"type":"number","description":"Timeout in seconds before the handover expires."},"agentId":{"type":"string","description":"The ID of the specific agent to hand over to."},"groupId":{"type":"string","description":"The ID of the agent group to hand over to."},"assignmentMethod":{"type":"string","description":"The method for assigning the agent (e.g., round_robin, least_busy)."}},"required":["reason"]},"MessageContentEmailDto":{"type":"object","properties":{"subject":{"type":"string","description":"The subject of the email."},"body":{"type":"string","description":"The body content of the email."},"from":{"type":"string","description":"The sender email address."},"to":{"description":"The list of recipient email addresses.","type":"array","items":{"type":"string"}},"cc":{"description":"The list of CC recipient email addresses.","type":"array","items":{"type":"string"}},"bcc":{"description":"The list of BCC recipient email addresses.","type":"array","items":{"type":"string"}},"attachmentIds":{"description":"The list of attachment IDs.","type":"array","items":{"type":"string"}},"references":{"description":"The list of email references for threading.","type":"array","items":{"type":"string"}}},"required":["subject","body","from","to","cc","bcc","attachmentIds","references"]},"MessageContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"string","description":"The text to be converted to speech."},"speech":{"type":"string","description":"Pre-generated speech audio reference."}},"required":["text"]},"MessageMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the template on Meta."},"language":{"type":"string","description":"The language code of the template."},"bodyText":{"type":"string","description":"The body text of the message. Placeholders are in the form `{{1}}`."},"headerText":{"type":"string","description":"The text in the header (if present)."},"footerText":{"type":"string","description":"The text in the footer (if present)."},"header":{"description":"The header component, which can contain a file or text parameters.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_HeaderDto"}]},"bodyParameters":{"description":"A list of values that replace the placeholders in the `bodyText`.","type":"array","items":{"type":"string"}},"buttons":{"description":"A list of buttons attached to the message.","type":"array","items":{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_ButtonDto"}}},"required":["templateName","language","bodyText","bodyParameters","buttons"]},"MessageMetaWhatsAppTemplate_HeaderDto":{"type":"object","properties":{"file":{"description":"The file attached to the header.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_Header_FileDto"}]},"parameters":{"description":"The list of parameter values for the header placeholders.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"MessageMetaWhatsAppTemplate_Header_FileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, video)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageMetaWhatsAppTemplate_ButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, quick_reply)."},"url":{"type":"string","description":"The URL for URL-type buttons."},"value":{"type":"string","description":"The value for quick_reply-type buttons."}},"required":["label","type"]},"OperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The unique identifier of the operator."}},"required":["operatorId"]}}}}
```

## The CreateInboxConversationRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateInboxConversationRequestDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the contact for the new conversation."},"email":{"type":"string","format":"email","description":"The email address of the contact."},"phone":{"type":"string","description":"The phone number of the contact."},"channelId":{"type":"string","description":"The ID of the channel in which the conversation is created."}},"required":["name","channelId"]}}}}
```

## The CreateInboxConversationResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateInboxConversationResponseDto":{"type":"object","properties":{"conversationId":{"type":"string","description":"The ID of the newly created conversation."},"error":{"type":"string","description":"Optional error message."}}}}}}
```

## The SendNoteRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"SendNoteRequestDto":{"type":"object","properties":{"conversationId":{"type":"string","description":"The ID of the conversation to which the note is added."},"text":{"type":"string","description":"The text content of the note."},"mentions":{"description":"A list of agent IDs mentioned in the note.","type":"array","items":{"type":"string"}}},"required":["conversationId","text"]}}}}
```

## The SendNoteResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"SendNoteResponseDto":{"type":"object","properties":{"message":{"description":"The message created as a note.","nullable":true,"allOf":[{"$ref":"#/components/schemas/MessageDto"}]},"error":{"type":"string","description":"An optional error message."}},"required":["message"]},"MessageDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the message."},"sender":{"type":"string","description":"The sender of the message (e.g., user, bot, agent)."},"type":{"type":"string","description":"The type of message (e.g., text, file, template)."},"persona":{"description":"The persona representing the sender.","allOf":[{"$ref":"#/components/schemas/MessagePersonaDto"}]},"providerMessageId":{"type":"string","description":"The message ID from the external provider."},"status":{"type":"string","description":"The delivery status of the message."},"created":{"type":"string","description":"Timestamp when the message was created."},"processed":{"type":"string","description":"Timestamp when the message was processed."},"sent":{"type":"string","description":"Timestamp when the message was sent."},"received":{"type":"string","description":"Timestamp when the message was received by the recipient."},"read":{"type":"string","description":"Timestamp when the message was read by the recipient."},"outgoing":{"type":"boolean","description":"Whether the message is outgoing (true) or incoming (false)."},"messengerId":{"type":"string","description":"The messenger ID associated with the message."},"contextId":{"type":"string","description":"The context ID for message threading."},"content":{"description":"The content of the message.","allOf":[{"$ref":"#/components/schemas/ContentDto"}]},"tags":{"description":"The list of tags associated with the message.","type":"array","items":{"type":"string"}},"error":{"type":"string","description":"Optional error message."},"isSensitive":{"type":"boolean","description":"Whether the message contains sensitive content."},"streamGroupId":{"type":"string","description":"The stream group ID for grouped streaming messages."},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."}},"required":["id","sender","type","status","created","outgoing","content","tags"]},"MessagePersonaDto":{"type":"object","properties":{"image":{"type":"string","description":"The URL of the persona's avatar image."},"name":{"type":"string","description":"The display name of the persona."}},"required":["image","name"]},"ContentDto":{"type":"object","properties":{"text":{"type":"string","description":"The text content of the message."},"file":{"description":"A file attachment.","allOf":[{"$ref":"#/components/schemas/MessageContentFileDto"}]},"buttons":{"description":"Interactive buttons for the message.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonsDto"}]},"selectedButton":{"description":"The button selected by the user.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonReplyDto"}]},"template":{"description":"A message template.","allOf":[{"$ref":"#/components/schemas/MessageTemplateDto"}]},"location":{"description":"A location shared in the message.","allOf":[{"$ref":"#/components/schemas/MessageLocationDto"}]},"voiceHangup":{"description":"Voice hangup data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceHangupDto"}]},"voiceTransfer":{"description":"Voice transfer data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceTransferDto"}]},"agentHandover":{"description":"Agent handover data.","allOf":[{"$ref":"#/components/schemas/MessageAgentHandoverDto"}]},"email":{"description":"Email content data.","allOf":[{"$ref":"#/components/schemas/MessageContentEmailDto"}]},"textToSpeech":{"description":"Text-to-speech content data.","allOf":[{"$ref":"#/components/schemas/MessageContentTextToSpeechDto"}]},"metaWhatsappTemplate":{"description":"A Meta WhatsApp template message.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplateDto"}]},"operator":{"description":"Operator data for the message.","allOf":[{"$ref":"#/components/schemas/OperatorDto"}]},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."},"leadAiId":{"type":"string","description":"The ID of the Lead AI associated with this message."}}},"MessageContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, audio)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."},"caption":{"type":"string","description":"An optional caption for the file."},"transcript":{"type":"string","description":"The transcript of audio/video content."},"facebookAttachmentId":{"type":"string","description":"The Facebook attachment ID."},"whatsappAttachmentId":{"type":"string","description":"The WhatsApp attachment ID."},"instagramAttachmentId":{"type":"string","description":"The Instagram attachment ID."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageContentButtonsDto":{"type":"object","properties":{"buttons":{"description":"The list of buttons.","type":"array","items":{"$ref":"#/components/schemas/MessageContentButtonDto"}}},"required":["buttons"]},"MessageContentButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, postback)."},"value":{"type":"string","description":"The value associated with the button."},"payload":{"type":"string","description":"An optional payload for the button."}},"required":["label","type","value"]},"MessageContentButtonReplyDto":{"type":"object","properties":{"label":{"type":"string","description":"The label of the selected button."},"value":{"type":"string","description":"The value of the selected button."},"payload":{"type":"string","description":"An optional payload from the button."},"type":{"type":"string","description":"The type of the button."},"reference":{"type":"string","description":"The reference to the original button message."}},"required":["label","value","reference"]},"MessageTemplateDto":{"type":"object","properties":{"body":{"type":"string","description":"The body text of the template."},"header":{"type":"string","description":"The header text of the template."},"footer":{"type":"string","description":"The footer text of the template."}},"required":["body"]},"MessageLocationDto":{"type":"object","properties":{"latitude":{"type":"number","description":"The latitude coordinate."},"longitude":{"type":"number","description":"The longitude coordinate."}},"required":["latitude","longitude"]},"MessageVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for hanging up the call."},"headers":{"type":"object","description":"Custom SIP headers for the hangup.","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"MessageVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string","description":"The target phone number or SIP address for the transfer."},"reason":{"type":"string","description":"The reason for the transfer."},"headers":{"type":"object","description":"Custom SIP headers for the transfer.","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"MessageAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for the handover to an agent."},"timeoutSeconds":{"type":"number","description":"Timeout in seconds before the handover expires."},"agentId":{"type":"string","description":"The ID of the specific agent to hand over to."},"groupId":{"type":"string","description":"The ID of the agent group to hand over to."},"assignmentMethod":{"type":"string","description":"The method for assigning the agent (e.g., round_robin, least_busy)."}},"required":["reason"]},"MessageContentEmailDto":{"type":"object","properties":{"subject":{"type":"string","description":"The subject of the email."},"body":{"type":"string","description":"The body content of the email."},"from":{"type":"string","description":"The sender email address."},"to":{"description":"The list of recipient email addresses.","type":"array","items":{"type":"string"}},"cc":{"description":"The list of CC recipient email addresses.","type":"array","items":{"type":"string"}},"bcc":{"description":"The list of BCC recipient email addresses.","type":"array","items":{"type":"string"}},"attachmentIds":{"description":"The list of attachment IDs.","type":"array","items":{"type":"string"}},"references":{"description":"The list of email references for threading.","type":"array","items":{"type":"string"}}},"required":["subject","body","from","to","cc","bcc","attachmentIds","references"]},"MessageContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"string","description":"The text to be converted to speech."},"speech":{"type":"string","description":"Pre-generated speech audio reference."}},"required":["text"]},"MessageMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the template on Meta."},"language":{"type":"string","description":"The language code of the template."},"bodyText":{"type":"string","description":"The body text of the message. Placeholders are in the form `{{1}}`."},"headerText":{"type":"string","description":"The text in the header (if present)."},"footerText":{"type":"string","description":"The text in the footer (if present)."},"header":{"description":"The header component, which can contain a file or text parameters.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_HeaderDto"}]},"bodyParameters":{"description":"A list of values that replace the placeholders in the `bodyText`.","type":"array","items":{"type":"string"}},"buttons":{"description":"A list of buttons attached to the message.","type":"array","items":{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_ButtonDto"}}},"required":["templateName","language","bodyText","bodyParameters","buttons"]},"MessageMetaWhatsAppTemplate_HeaderDto":{"type":"object","properties":{"file":{"description":"The file attached to the header.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_Header_FileDto"}]},"parameters":{"description":"The list of parameter values for the header placeholders.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"MessageMetaWhatsAppTemplate_Header_FileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, video)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageMetaWhatsAppTemplate_ButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, quick_reply)."},"url":{"type":"string","description":"The URL for URL-type buttons."},"value":{"type":"string","description":"The value for quick_reply-type buttons."}},"required":["label","type"]},"OperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The unique identifier of the operator."}},"required":["operatorId"]}}}}
```

## The AnswerDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"AnswerDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the answer."},"created":{"type":"string","description":"Timestamp when the answer was created."},"updated":{"type":"string","description":"Timestamp when the answer was last updated."},"name":{"type":"string","description":"The name/title of the text snippet."},"message":{"type":"string","description":"The content of the text snippet."}},"required":["id","created","updated","name","message"]}}}}
```

## The ListAnswersResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListAnswersResponseDto":{"type":"object","properties":{"answers":{"description":"The list of answers.","type":"array","items":{"$ref":"#/components/schemas/AnswerDto"}},"error":{"type":"string","description":"Optional error message."}},"required":["answers"]},"AnswerDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the answer."},"created":{"type":"string","description":"Timestamp when the answer was created."},"updated":{"type":"string","description":"Timestamp when the answer was last updated."},"name":{"type":"string","description":"The name/title of the text snippet."},"message":{"type":"string","description":"The content of the text snippet."}},"required":["id","created","updated","name","message"]}}}}
```

## The CreateAnswerRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateAnswerRequestDto":{"type":"object","properties":{"name":{"type":"string","description":"The name/title of the text snippet."},"message":{"type":"string","description":"The content of the text snippet."}},"required":["name","message"]}}}}
```

## The AnswerResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"AnswerResponseDto":{"type":"object","properties":{"answer":{"description":"The answer.","nullable":true,"allOf":[{"$ref":"#/components/schemas/AnswerDto"}]},"error":{"type":"string","description":"Optional error message."}},"required":["answer"]},"AnswerDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the answer."},"created":{"type":"string","description":"Timestamp when the answer was created."},"updated":{"type":"string","description":"Timestamp when the answer was last updated."},"name":{"type":"string","description":"The name/title of the text snippet."},"message":{"type":"string","description":"The content of the text snippet."}},"required":["id","created","updated","name","message"]}}}}
```

## The UpdateAnswerRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateAnswerRequestDto":{"type":"object","properties":{"name":{"type":"string","description":"The new name of the text snippet."},"message":{"type":"string","description":"The new content of the text snippet."}},"required":["name","message"]}}}}
```

## The DeleteAnswerResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"DeleteAnswerResponseDto":{"type":"object","properties":{"error":{"type":"string","description":"Optional error message."}}}}}}
```

## The CreateChatSummaryResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateChatSummaryResponseDto":{"type":"object","properties":{"summary":{"type":"string","description":"The generated summary of the conversation."},"error":{"type":"string","description":"Optional error message."}},"required":["summary"]}}}}
```

## The CreateChatCompletionResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateChatCompletionResponseDto":{"type":"object","properties":{"completion":{"type":"string","description":"The completed text suggestion."},"error":{"type":"string","description":"Optional error message."}},"required":["completion"]}}}}
```

## The CreateChatFormulationRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateChatFormulationRequestDto":{"type":"object","properties":{"message":{"type":"string","description":"The message to be reformulated."}},"required":["message"]}}}}
```

## The CreateChatFormulationResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateChatFormulationResponseDto":{"type":"object","properties":{"formulation":{"type":"string","description":"The reformulated text suggestion."}}}}}}
```

## The AgentOnlineStateDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"AgentOnlineStateDto":{"type":"object","properties":{"agentId":{"type":"string","description":"The unique identifier of the agent."},"online":{"type":"boolean","description":"Whether the agent is currently online."},"lastSeen":{"type":"string","description":"Timestamp of the last activity."}},"required":["agentId","online","lastSeen"]}}}}
```

## The ListAgentOnlineStateResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListAgentOnlineStateResponseDto":{"type":"object","properties":{"agents":{"description":"The list of agent online states.","type":"array","items":{"$ref":"#/components/schemas/AgentOnlineStateDto"}},"error":{"type":"string","description":"Optional error message."}},"required":["agents"]},"AgentOnlineStateDto":{"type":"object","properties":{"agentId":{"type":"string","description":"The unique identifier of the agent."},"online":{"type":"boolean","description":"Whether the agent is currently online."},"lastSeen":{"type":"string","description":"Timestamp of the last activity."}},"required":["agentId","online","lastSeen"]}}}}
```

## The SetAgentOnlineStateRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"SetAgentOnlineStateRequestDto":{"type":"object","properties":{"online":{"type":"boolean","description":"Sets the online status of the agent."},"clientTimestamp":{"type":"string","description":"The client timestamp when the request is made. This is used to resolve conflicts when multiple requests are made in a short period of time."}},"required":["online","clientTimestamp"]}}}}
```

## The SetAgentOnlineStateResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"SetAgentOnlineStateResponseDto":{"type":"object","properties":{"agent":{"description":"The updated agent online state.","nullable":true,"allOf":[{"$ref":"#/components/schemas/AgentOnlineStateDto"}]},"error":{"type":"string","description":"Optional error message."}},"required":["agent"]},"AgentOnlineStateDto":{"type":"object","properties":{"agentId":{"type":"string","description":"The unique identifier of the agent."},"online":{"type":"boolean","description":"Whether the agent is currently online."},"lastSeen":{"type":"string","description":"Timestamp of the last activity."}},"required":["agentId","online","lastSeen"]}}}}
```

## The AgentNotificationSettings\_SettingDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"AgentNotificationSettings_SettingDto":{"type":"object","properties":{"email":{"type":"boolean","description":"Enable/disable email notifications."},"browser":{"type":"boolean","description":"Enable/disable in-browser (push) notifications."}},"required":["email","browser"]}}}}
```

## The UpdateAgentNotificationSettingsRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateAgentNotificationSettingsRequestDto":{"type":"object","properties":{"botHandoverToUnassigned":{"description":"Notification settings for bot handover to unassigned.","allOf":[{"$ref":"#/components/schemas/AgentNotificationSettings_SettingDto"}]},"botAssignsYou":{"description":"Notification settings for when bot assigns you.","allOf":[{"$ref":"#/components/schemas/AgentNotificationSettings_SettingDto"}]},"conversationsAssignedToYou":{"description":"Notification settings for conversations assigned to you.","allOf":[{"$ref":"#/components/schemas/AgentNotificationSettings_SettingDto"}]},"pushToken":{"type":"string","description":"The push token for browser notifications."}},"required":["botHandoverToUnassigned","botAssignsYou","conversationsAssignedToYou"]},"AgentNotificationSettings_SettingDto":{"type":"object","properties":{"email":{"type":"boolean","description":"Enable/disable email notifications."},"browser":{"type":"boolean","description":"Enable/disable in-browser (push) notifications."}},"required":["email","browser"]}}}}
```

## The AgentNotificationSettingsDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"AgentNotificationSettingsDto":{"type":"object","properties":{"agentId":{"type":"string","description":"The unique identifier of the agent."},"botHandoverToUnassigned":{"description":"Notification settings for bot handover to unassigned.","allOf":[{"$ref":"#/components/schemas/AgentNotificationSettings_SettingDto"}]},"botAssignsYou":{"description":"Notification settings for when bot assigns you.","allOf":[{"$ref":"#/components/schemas/AgentNotificationSettings_SettingDto"}]},"conversationsAssignedToYou":{"description":"Notification settings for conversations assigned to you.","allOf":[{"$ref":"#/components/schemas/AgentNotificationSettings_SettingDto"}]},"pushToken":{"type":"string","description":"The push token for browser notifications."}},"required":["agentId","botHandoverToUnassigned","botAssignsYou","conversationsAssignedToYou"]},"AgentNotificationSettings_SettingDto":{"type":"object","properties":{"email":{"type":"boolean","description":"Enable/disable email notifications."},"browser":{"type":"boolean","description":"Enable/disable in-browser (push) notifications."}},"required":["email","browser"]}}}}
```

## The AgentNotificationSettingsResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"AgentNotificationSettingsResponseDto":{"type":"object","properties":{"settings":{"description":"The agent notification settings.","nullable":true,"allOf":[{"$ref":"#/components/schemas/AgentNotificationSettingsDto"}]},"error":{"type":"string","description":"Optional error message."}},"required":["settings"]},"AgentNotificationSettingsDto":{"type":"object","properties":{"agentId":{"type":"string","description":"The unique identifier of the agent."},"botHandoverToUnassigned":{"description":"Notification settings for bot handover to unassigned.","allOf":[{"$ref":"#/components/schemas/AgentNotificationSettings_SettingDto"}]},"botAssignsYou":{"description":"Notification settings for when bot assigns you.","allOf":[{"$ref":"#/components/schemas/AgentNotificationSettings_SettingDto"}]},"conversationsAssignedToYou":{"description":"Notification settings for conversations assigned to you.","allOf":[{"$ref":"#/components/schemas/AgentNotificationSettings_SettingDto"}]},"pushToken":{"type":"string","description":"The push token for browser notifications."}},"required":["agentId","botHandoverToUnassigned","botAssignsYou","conversationsAssignedToYou"]},"AgentNotificationSettings_SettingDto":{"type":"object","properties":{"email":{"type":"boolean","description":"Enable/disable email notifications."},"browser":{"type":"boolean","description":"Enable/disable in-browser (push) notifications."}},"required":["email","browser"]}}}}
```

## The TeamDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"TeamDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the team."},"name":{"type":"string","description":"The name of the team."},"created":{"type":"string","description":"Timestamp when the team was created."},"updated":{"type":"string","description":"Timestamp when the team was last updated."},"icon":{"type":"string","description":"The icon identifier for the team."},"userIds":{"description":"The list of user IDs that are members of the team.","type":"array","items":{"type":"string"}}},"required":["id","name","created","updated","icon","userIds"]}}}}
```

## The ListTeamsResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListTeamsResponseDto":{"type":"object","properties":{"teams":{"description":"The list of teams.","type":"array","items":{"$ref":"#/components/schemas/TeamDto"}},"error":{"type":"string","description":"Optional error message."}},"required":["teams"]},"TeamDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the team."},"name":{"type":"string","description":"The name of the team."},"created":{"type":"string","description":"Timestamp when the team was created."},"updated":{"type":"string","description":"Timestamp when the team was last updated."},"icon":{"type":"string","description":"The icon identifier for the team."},"userIds":{"description":"The list of user IDs that are members of the team.","type":"array","items":{"type":"string"}}},"required":["id","name","created","updated","icon","userIds"]}}}}
```

## The TeamResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"TeamResponseDto":{"type":"object","properties":{"team":{"description":"The team.","nullable":true,"allOf":[{"$ref":"#/components/schemas/TeamDto"}]},"error":{"type":"string","description":"Optional error message."}},"required":["team"]},"TeamDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the team."},"name":{"type":"string","description":"The name of the team."},"created":{"type":"string","description":"Timestamp when the team was created."},"updated":{"type":"string","description":"Timestamp when the team was last updated."},"icon":{"type":"string","description":"The icon identifier for the team."},"userIds":{"description":"The list of user IDs that are members of the team.","type":"array","items":{"type":"string"}}},"required":["id","name","created","updated","icon","userIds"]}}}}
```

## The CreateTeamRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateTeamRequestDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the new team."}},"required":["name"]}}}}
```

## The UpdateTeamDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateTeamDto":{"type":"object","properties":{"userIds":{"description":"A list of user IDs that should be members of the team.","type":"array","items":{"type":"string"}},"name":{"type":"string","description":"The new name of the team."}},"required":["userIds"]}}}}
```

## The UpdateTeamRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateTeamRequestDto":{"type":"object","properties":{"updated":{"description":"The object containing the fields to be updated.","allOf":[{"$ref":"#/components/schemas/UpdateTeamDto"}]}},"required":["updated"]},"UpdateTeamDto":{"type":"object","properties":{"userIds":{"description":"A list of user IDs that should be members of the team.","type":"array","items":{"type":"string"}},"name":{"type":"string","description":"The new name of the team."}},"required":["userIds"]}}}}
```

## The InboxWidgetFieldType object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"InboxWidgetFieldType":{"type":"number","enum":[0,1,2,3,4,-1],"description":"The type of the field.\n\n- `0`: TEXT\n- `1`: NUMBER\n- `2`: CHECKBOX\n- `3`: DROPDOWN\n- `4`: DATE"}}}}
```

## The InboxWidgetFieldDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"InboxWidgetFieldDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the field."},"variable":{"type":"string","description":"The variable id used to bind field data."},"type":{"description":"The type of the field.\n\n- `0`: TEXT\n- `1`: NUMBER\n- `2`: CHECKBOX\n- `3`: DROPDOWN\n- `4`: DATE","allOf":[{"$ref":"#/components/schemas/InboxWidgetFieldType"}]},"readonly":{"type":"boolean","description":"Whether the field is read-only."},"options":{"description":"The selectable options for DROPDOWN type fields.","type":"array","items":{"type":"string"}},"position":{"type":"number","description":"The display position of the field in which they will be ordered by in the widget."}},"required":["label","variable","type","options","position"]},"InboxWidgetFieldType":{"type":"number","enum":[0,1,2,3,4,-1],"description":"The type of the field.\n\n- `0`: TEXT\n- `1`: NUMBER\n- `2`: CHECKBOX\n- `3`: DROPDOWN\n- `4`: DATE"}}}}
```

## The CreateInboxWidgetRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateInboxWidgetRequestDto":{"type":"object","properties":{"title":{"type":"string","description":"The title of the widget."},"fields":{"description":"The fields for the widget.","type":"array","items":{"$ref":"#/components/schemas/InboxWidgetFieldDto"}}},"required":["title","fields"]},"InboxWidgetFieldDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the field."},"variable":{"type":"string","description":"The variable id used to bind field data."},"type":{"description":"The type of the field.\n\n- `0`: TEXT\n- `1`: NUMBER\n- `2`: CHECKBOX\n- `3`: DROPDOWN\n- `4`: DATE","allOf":[{"$ref":"#/components/schemas/InboxWidgetFieldType"}]},"readonly":{"type":"boolean","description":"Whether the field is read-only."},"options":{"description":"The selectable options for DROPDOWN type fields.","type":"array","items":{"type":"string"}},"position":{"type":"number","description":"The display position of the field in which they will be ordered by in the widget."}},"required":["label","variable","type","options","position"]},"InboxWidgetFieldType":{"type":"number","enum":[0,1,2,3,4,-1],"description":"The type of the field.\n\n- `0`: TEXT\n- `1`: NUMBER\n- `2`: CHECKBOX\n- `3`: DROPDOWN\n- `4`: DATE"}}}}
```

## The InboxWidgetDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"InboxWidgetDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the widget."},"title":{"type":"string","description":"The title of the widget."},"fields":{"description":"The fields contained in the widget.","type":"array","items":{"$ref":"#/components/schemas/InboxWidgetFieldDto"}},"created":{"type":"string","description":"Timestamp when the widget was created."},"updated":{"type":"string","description":"Timestamp when the widget was last updated."}},"required":["id","title","fields","created","updated"]},"InboxWidgetFieldDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the field."},"variable":{"type":"string","description":"The variable id used to bind field data."},"type":{"description":"The type of the field.\n\n- `0`: TEXT\n- `1`: NUMBER\n- `2`: CHECKBOX\n- `3`: DROPDOWN\n- `4`: DATE","allOf":[{"$ref":"#/components/schemas/InboxWidgetFieldType"}]},"readonly":{"type":"boolean","description":"Whether the field is read-only."},"options":{"description":"The selectable options for DROPDOWN type fields.","type":"array","items":{"type":"string"}},"position":{"type":"number","description":"The display position of the field in which they will be ordered by in the widget."}},"required":["label","variable","type","options","position"]},"InboxWidgetFieldType":{"type":"number","enum":[0,1,2,3,4,-1],"description":"The type of the field.\n\n- `0`: TEXT\n- `1`: NUMBER\n- `2`: CHECKBOX\n- `3`: DROPDOWN\n- `4`: DATE"}}}}
```

## The InboxWidgetResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"InboxWidgetResponseDto":{"type":"object","properties":{"inboxWidget":{"description":"The widget.","nullable":true,"allOf":[{"$ref":"#/components/schemas/InboxWidgetDto"}]}}},"InboxWidgetDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the widget."},"title":{"type":"string","description":"The title of the widget."},"fields":{"description":"The fields contained in the widget.","type":"array","items":{"$ref":"#/components/schemas/InboxWidgetFieldDto"}},"created":{"type":"string","description":"Timestamp when the widget was created."},"updated":{"type":"string","description":"Timestamp when the widget was last updated."}},"required":["id","title","fields","created","updated"]},"InboxWidgetFieldDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the field."},"variable":{"type":"string","description":"The variable id used to bind field data."},"type":{"description":"The type of the field.\n\n- `0`: TEXT\n- `1`: NUMBER\n- `2`: CHECKBOX\n- `3`: DROPDOWN\n- `4`: DATE","allOf":[{"$ref":"#/components/schemas/InboxWidgetFieldType"}]},"readonly":{"type":"boolean","description":"Whether the field is read-only."},"options":{"description":"The selectable options for DROPDOWN type fields.","type":"array","items":{"type":"string"}},"position":{"type":"number","description":"The display position of the field in which they will be ordered by in the widget."}},"required":["label","variable","type","options","position"]},"InboxWidgetFieldType":{"type":"number","enum":[0,1,2,3,4,-1],"description":"The type of the field.\n\n- `0`: TEXT\n- `1`: NUMBER\n- `2`: CHECKBOX\n- `3`: DROPDOWN\n- `4`: DATE"}}}}
```

## The ListInboxWidgetsResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListInboxWidgetsResponseDto":{"type":"object","properties":{"inboxWidgets":{"description":"The list of widgets.","type":"array","items":{"$ref":"#/components/schemas/InboxWidgetDto"}}},"required":["inboxWidgets"]},"InboxWidgetDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the widget."},"title":{"type":"string","description":"The title of the widget."},"fields":{"description":"The fields contained in the widget.","type":"array","items":{"$ref":"#/components/schemas/InboxWidgetFieldDto"}},"created":{"type":"string","description":"Timestamp when the widget was created."},"updated":{"type":"string","description":"Timestamp when the widget was last updated."}},"required":["id","title","fields","created","updated"]},"InboxWidgetFieldDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the field."},"variable":{"type":"string","description":"The variable id used to bind field data."},"type":{"description":"The type of the field.\n\n- `0`: TEXT\n- `1`: NUMBER\n- `2`: CHECKBOX\n- `3`: DROPDOWN\n- `4`: DATE","allOf":[{"$ref":"#/components/schemas/InboxWidgetFieldType"}]},"readonly":{"type":"boolean","description":"Whether the field is read-only."},"options":{"description":"The selectable options for DROPDOWN type fields.","type":"array","items":{"type":"string"}},"position":{"type":"number","description":"The display position of the field in which they will be ordered by in the widget."}},"required":["label","variable","type","options","position"]},"InboxWidgetFieldType":{"type":"number","enum":[0,1,2,3,4,-1],"description":"The type of the field.\n\n- `0`: TEXT\n- `1`: NUMBER\n- `2`: CHECKBOX\n- `3`: DROPDOWN\n- `4`: DATE"}}}}
```

## The InboxWidgetValuesResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"InboxWidgetValuesResponseDto":{"type":"object","properties":{"fieldValues":{"description":"The widget values.","type":"array","items":{"type":"object"}}},"required":["fieldValues"]}}}}
```

## The UpdateInboxWidgetRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateInboxWidgetRequestDto":{"type":"object","properties":{"title":{"type":"string","description":"The updated title of the widget."},"fields":{"description":"The updated fields for the widget.","type":"array","items":{"$ref":"#/components/schemas/InboxWidgetFieldDto"}}},"required":["fields"]},"InboxWidgetFieldDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the field."},"variable":{"type":"string","description":"The variable id used to bind field data."},"type":{"description":"The type of the field.\n\n- `0`: TEXT\n- `1`: NUMBER\n- `2`: CHECKBOX\n- `3`: DROPDOWN\n- `4`: DATE","allOf":[{"$ref":"#/components/schemas/InboxWidgetFieldType"}]},"readonly":{"type":"boolean","description":"Whether the field is read-only."},"options":{"description":"The selectable options for DROPDOWN type fields.","type":"array","items":{"type":"string"}},"position":{"type":"number","description":"The display position of the field in which they will be ordered by in the widget."}},"required":["label","variable","type","options","position"]},"InboxWidgetFieldType":{"type":"number","enum":[0,1,2,3,4,-1],"description":"The type of the field.\n\n- `0`: TEXT\n- `1`: NUMBER\n- `2`: CHECKBOX\n- `3`: DROPDOWN\n- `4`: DATE"}}}}
```

## The DeleteInboxWidgetResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"DeleteInboxWidgetResponseDto":{"type":"object","properties":{"deleted":{"type":"boolean","description":"Whether the widget was successfully deleted."}}}}}}
```

## The ChannelDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ChannelDto":{"type":"object","properties":{"id":{"type":"string","description":"The Id of the channel."},"name":{"type":"string","description":"The name of the channel."},"number":{"type":"string","description":"The phone number of the channel (In case of voice channel)."},"status":{"type":"string","description":"The status of the channel."},"token":{"type":"string","description":"The token of the channel."},"type":{"type":"string","description":"The type of the channel.","enum":["facebook","voice","audiocodes","web","meta-whatsapp","telegram","brevo","email","debug"]},"created":{"type":"string","description":"Creation timestamp (ISO format)."},"updated":{"type":"string","description":"Last updated timestamp (ISO format)."},"tokenValidUntil":{"type":"string","description":"The date until the token is valid (ISO format)."},"chatbotId":{"type":"string","description":"The Id of the chatbot the channel exists in."},"environment":{"type":"string","description":"The environment the channel is in.","enum":["dev","test","prod"]},"mpId":{"type":"string","description":"The Id for the MP channel."},"whatsappId":{"type":"string","description":"The Id for the WhatsApp provider."},"facebookId":{"type":"string","description":"The Id for the Facebook Messenger provider."},"telegramId":{"type":"string","description":"The Id for the Telegram provider."},"instagramId":{"type":"string","description":"The Id for the Instagram provider."},"audiocodesId":{"type":"string","description":"The Id for the AudioCodes voice gateway."},"language":{"type":"string","description":"The language code for the channel."},"domains":{"description":"A list of domains on which the channel is used (In case of web-widget channel).","type":"array","items":{"type":"string"}},"providerId":{"type":"string","description":"The Id of the provider."},"pin":{"type":"string","description":"The pin for the channel."},"metadata":{"type":"object","description":"Additional custom metadata as key-value pairs.","additionalProperties":{"type":"string"}},"async":{"type":"boolean","description":"Indicates whether the channel is async or not."},"description":{"type":"string","description":"The description for the channel."},"email":{"type":"string","description":"The email of the channel (In case of email channel)."}},"required":["id","name","status","token","type","created","updated","tokenValidUntil","chatbotId","environment","domains","providerId"]}}}}
```

## The ListChannelsResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListChannelsResponseDto":{"type":"object","properties":{"error":{"type":"string","description":"Optional error message."},"channels":{"description":"A list of retrieved channels.","type":"array","items":{"$ref":"#/components/schemas/ChannelDto"}}},"required":["channels"]},"ChannelDto":{"type":"object","properties":{"id":{"type":"string","description":"The Id of the channel."},"name":{"type":"string","description":"The name of the channel."},"number":{"type":"string","description":"The phone number of the channel (In case of voice channel)."},"status":{"type":"string","description":"The status of the channel."},"token":{"type":"string","description":"The token of the channel."},"type":{"type":"string","description":"The type of the channel.","enum":["facebook","voice","audiocodes","web","meta-whatsapp","telegram","brevo","email","debug"]},"created":{"type":"string","description":"Creation timestamp (ISO format)."},"updated":{"type":"string","description":"Last updated timestamp (ISO format)."},"tokenValidUntil":{"type":"string","description":"The date until the token is valid (ISO format)."},"chatbotId":{"type":"string","description":"The Id of the chatbot the channel exists in."},"environment":{"type":"string","description":"The environment the channel is in.","enum":["dev","test","prod"]},"mpId":{"type":"string","description":"The Id for the MP channel."},"whatsappId":{"type":"string","description":"The Id for the WhatsApp provider."},"facebookId":{"type":"string","description":"The Id for the Facebook Messenger provider."},"telegramId":{"type":"string","description":"The Id for the Telegram provider."},"instagramId":{"type":"string","description":"The Id for the Instagram provider."},"audiocodesId":{"type":"string","description":"The Id for the AudioCodes voice gateway."},"language":{"type":"string","description":"The language code for the channel."},"domains":{"description":"A list of domains on which the channel is used (In case of web-widget channel).","type":"array","items":{"type":"string"}},"providerId":{"type":"string","description":"The Id of the provider."},"pin":{"type":"string","description":"The pin for the channel."},"metadata":{"type":"object","description":"Additional custom metadata as key-value pairs.","additionalProperties":{"type":"string"}},"async":{"type":"boolean","description":"Indicates whether the channel is async or not."},"description":{"type":"string","description":"The description for the channel."},"email":{"type":"string","description":"The email of the channel (In case of email channel)."}},"required":["id","name","status","token","type","created","updated","tokenValidUntil","chatbotId","environment","domains","providerId"]}}}}
```

## The ChannelType object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ChannelType":{"type":"number","enum":[0,6]}}}}
```

## The GenerateChannelTokenResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"GenerateChannelTokenResponseDto":{"type":"object","properties":{"error":{"type":"string","description":"Optional error message."},"token":{"type":"string","description":"The generated token."}}}}}}
```

## The WebWidgetColorsDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"WebWidgetColorsDto":{"type":"object","properties":{"gradientFirst":{"type":"string","description":"First color for the header gradient (Hex)."},"gradientSecond":{"type":"string","description":"Second color for the header gradient (Hex)."},"gradientThird":{"type":"string","description":"Third color for the header gradient (Hex)."},"gradientText":{"type":"string","description":"Color for text placed over the header gradient."},"primary":{"type":"string","description":"Main branding color for the widget."},"onPrimary":{"type":"string","description":"Contrast color for text/icons on top of the primary color."},"secondary":{"type":"string","description":"Accent color used for highlights or secondary UI elements."},"onSecondary":{"type":"string","description":"Contrast color for text/icons on top of the secondary color."},"button":{"type":"string","description":"Background color for primary action buttons."},"onButton":{"type":"string","description":"Color for text/icons inside buttons."},"dark":{"type":"boolean","description":"Activates dark mode."}},"required":["gradientFirst","gradientSecond","gradientThird","gradientText","primary","onPrimary","secondary","onSecondary","button","onButton","dark"]}}}}
```

## The WebWidgetContentsDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"WebWidgetContentsDto":{"type":"object","properties":{"headline":{"type":"object","description":"Headline, multilingual.","additionalProperties":{"type":"string"}},"subHeadline":{"type":"object","description":"Sub-headline, multilingual.","additionalProperties":{"type":"string"}},"callToAction":{"type":"object","description":"Call-to-action text, multilingual.","additionalProperties":{"type":"string"}},"callToActionSubtitle":{"type":"object","description":"Call-to-action subtitle, multilingual.","additionalProperties":{"type":"string"}},"botName":{"type":"string","description":"The name of the chatbot displayed in the header."},"hideBotAvatar":{"type":"boolean","description":"Hides the bot's avatar in the chat header."},"hideFileUpload":{"type":"boolean","description":"Hides the option to upload files."}},"required":["headline","subHeadline","callToAction","callToActionSubtitle","botName","hideBotAvatar","hideFileUpload"]}}}}
```

## The WebWidgetSettingsDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"WebWidgetSettingsDto":{"type":"object","properties":{"colors":{"description":"The widget's color settings.","nullable":true,"allOf":[{"$ref":"#/components/schemas/WebWidgetColorsDto"}]},"contents":{"description":"The widget's content settings.","nullable":true,"allOf":[{"$ref":"#/components/schemas/WebWidgetContentsDto"}]},"privacyConsent":{"type":"boolean","description":"Indicates whether the privacy policy must be accepted."},"updated":{"type":"string","description":"Last updated timestamp (ISO format)."},"created":{"type":"string","description":"Creation timestamp (ISO format)."}},"required":["colors","contents","privacyConsent","updated","created"]},"WebWidgetColorsDto":{"type":"object","properties":{"gradientFirst":{"type":"string","description":"First color for the header gradient (Hex)."},"gradientSecond":{"type":"string","description":"Second color for the header gradient (Hex)."},"gradientThird":{"type":"string","description":"Third color for the header gradient (Hex)."},"gradientText":{"type":"string","description":"Color for text placed over the header gradient."},"primary":{"type":"string","description":"Main branding color for the widget."},"onPrimary":{"type":"string","description":"Contrast color for text/icons on top of the primary color."},"secondary":{"type":"string","description":"Accent color used for highlights or secondary UI elements."},"onSecondary":{"type":"string","description":"Contrast color for text/icons on top of the secondary color."},"button":{"type":"string","description":"Background color for primary action buttons."},"onButton":{"type":"string","description":"Color for text/icons inside buttons."},"dark":{"type":"boolean","description":"Activates dark mode."}},"required":["gradientFirst","gradientSecond","gradientThird","gradientText","primary","onPrimary","secondary","onSecondary","button","onButton","dark"]},"WebWidgetContentsDto":{"type":"object","properties":{"headline":{"type":"object","description":"Headline, multilingual.","additionalProperties":{"type":"string"}},"subHeadline":{"type":"object","description":"Sub-headline, multilingual.","additionalProperties":{"type":"string"}},"callToAction":{"type":"object","description":"Call-to-action text, multilingual.","additionalProperties":{"type":"string"}},"callToActionSubtitle":{"type":"object","description":"Call-to-action subtitle, multilingual.","additionalProperties":{"type":"string"}},"botName":{"type":"string","description":"The name of the chatbot displayed in the header."},"hideBotAvatar":{"type":"boolean","description":"Hides the bot's avatar in the chat header."},"hideFileUpload":{"type":"boolean","description":"Hides the option to upload files."}},"required":["headline","subHeadline","callToAction","callToActionSubtitle","botName","hideBotAvatar","hideFileUpload"]}}}}
```

## The WebWidgetSettingsResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"WebWidgetSettingsResponseDto":{"type":"object","properties":{"error":{"type":"string","description":"Optional error message"},"webWidgetSettings":{"description":"The widgets settings.","nullable":true,"allOf":[{"$ref":"#/components/schemas/WebWidgetSettingsDto"}]}}},"WebWidgetSettingsDto":{"type":"object","properties":{"colors":{"description":"The widget's color settings.","nullable":true,"allOf":[{"$ref":"#/components/schemas/WebWidgetColorsDto"}]},"contents":{"description":"The widget's content settings.","nullable":true,"allOf":[{"$ref":"#/components/schemas/WebWidgetContentsDto"}]},"privacyConsent":{"type":"boolean","description":"Indicates whether the privacy policy must be accepted."},"updated":{"type":"string","description":"Last updated timestamp (ISO format)."},"created":{"type":"string","description":"Creation timestamp (ISO format)."}},"required":["colors","contents","privacyConsent","updated","created"]},"WebWidgetColorsDto":{"type":"object","properties":{"gradientFirst":{"type":"string","description":"First color for the header gradient (Hex)."},"gradientSecond":{"type":"string","description":"Second color for the header gradient (Hex)."},"gradientThird":{"type":"string","description":"Third color for the header gradient (Hex)."},"gradientText":{"type":"string","description":"Color for text placed over the header gradient."},"primary":{"type":"string","description":"Main branding color for the widget."},"onPrimary":{"type":"string","description":"Contrast color for text/icons on top of the primary color."},"secondary":{"type":"string","description":"Accent color used for highlights or secondary UI elements."},"onSecondary":{"type":"string","description":"Contrast color for text/icons on top of the secondary color."},"button":{"type":"string","description":"Background color for primary action buttons."},"onButton":{"type":"string","description":"Color for text/icons inside buttons."},"dark":{"type":"boolean","description":"Activates dark mode."}},"required":["gradientFirst","gradientSecond","gradientThird","gradientText","primary","onPrimary","secondary","onSecondary","button","onButton","dark"]},"WebWidgetContentsDto":{"type":"object","properties":{"headline":{"type":"object","description":"Headline, multilingual.","additionalProperties":{"type":"string"}},"subHeadline":{"type":"object","description":"Sub-headline, multilingual.","additionalProperties":{"type":"string"}},"callToAction":{"type":"object","description":"Call-to-action text, multilingual.","additionalProperties":{"type":"string"}},"callToActionSubtitle":{"type":"object","description":"Call-to-action subtitle, multilingual.","additionalProperties":{"type":"string"}},"botName":{"type":"string","description":"The name of the chatbot displayed in the header."},"hideBotAvatar":{"type":"boolean","description":"Hides the bot's avatar in the chat header."},"hideFileUpload":{"type":"boolean","description":"Hides the option to upload files."}},"required":["headline","subHeadline","callToAction","callToActionSubtitle","botName","hideBotAvatar","hideFileUpload"]}}}}
```

## The UpdateWebWidgetDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateWebWidgetDto":{"type":"object","properties":{"colors":{"description":"The widget's color settings.","nullable":true,"allOf":[{"$ref":"#/components/schemas/WebWidgetColorsDto"}]},"contents":{"description":"The widget's content settings.","nullable":true,"allOf":[{"$ref":"#/components/schemas/WebWidgetContentsDto"}]},"privacyConsent":{"type":"boolean","description":"Indicates whether the privacy policy must be accepted."}},"required":["colors","contents","privacyConsent"]},"WebWidgetColorsDto":{"type":"object","properties":{"gradientFirst":{"type":"string","description":"First color for the header gradient (Hex)."},"gradientSecond":{"type":"string","description":"Second color for the header gradient (Hex)."},"gradientThird":{"type":"string","description":"Third color for the header gradient (Hex)."},"gradientText":{"type":"string","description":"Color for text placed over the header gradient."},"primary":{"type":"string","description":"Main branding color for the widget."},"onPrimary":{"type":"string","description":"Contrast color for text/icons on top of the primary color."},"secondary":{"type":"string","description":"Accent color used for highlights or secondary UI elements."},"onSecondary":{"type":"string","description":"Contrast color for text/icons on top of the secondary color."},"button":{"type":"string","description":"Background color for primary action buttons."},"onButton":{"type":"string","description":"Color for text/icons inside buttons."},"dark":{"type":"boolean","description":"Activates dark mode."}},"required":["gradientFirst","gradientSecond","gradientThird","gradientText","primary","onPrimary","secondary","onSecondary","button","onButton","dark"]},"WebWidgetContentsDto":{"type":"object","properties":{"headline":{"type":"object","description":"Headline, multilingual.","additionalProperties":{"type":"string"}},"subHeadline":{"type":"object","description":"Sub-headline, multilingual.","additionalProperties":{"type":"string"}},"callToAction":{"type":"object","description":"Call-to-action text, multilingual.","additionalProperties":{"type":"string"}},"callToActionSubtitle":{"type":"object","description":"Call-to-action subtitle, multilingual.","additionalProperties":{"type":"string"}},"botName":{"type":"string","description":"The name of the chatbot displayed in the header."},"hideBotAvatar":{"type":"boolean","description":"Hides the bot's avatar in the chat header."},"hideFileUpload":{"type":"boolean","description":"Hides the option to upload files."}},"required":["headline","subHeadline","callToAction","callToActionSubtitle","botName","hideBotAvatar","hideFileUpload"]}}}}
```

## The UpdateWebWidgetSettingsRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateWebWidgetSettingsRequestDto":{"type":"object","properties":{"updateWebWidget":{"description":"The object containing the widget settings to be updated.","nullable":true,"allOf":[{"$ref":"#/components/schemas/UpdateWebWidgetDto"}]}},"required":["updateWebWidget"]},"UpdateWebWidgetDto":{"type":"object","properties":{"colors":{"description":"The widget's color settings.","nullable":true,"allOf":[{"$ref":"#/components/schemas/WebWidgetColorsDto"}]},"contents":{"description":"The widget's content settings.","nullable":true,"allOf":[{"$ref":"#/components/schemas/WebWidgetContentsDto"}]},"privacyConsent":{"type":"boolean","description":"Indicates whether the privacy policy must be accepted."}},"required":["colors","contents","privacyConsent"]},"WebWidgetColorsDto":{"type":"object","properties":{"gradientFirst":{"type":"string","description":"First color for the header gradient (Hex)."},"gradientSecond":{"type":"string","description":"Second color for the header gradient (Hex)."},"gradientThird":{"type":"string","description":"Third color for the header gradient (Hex)."},"gradientText":{"type":"string","description":"Color for text placed over the header gradient."},"primary":{"type":"string","description":"Main branding color for the widget."},"onPrimary":{"type":"string","description":"Contrast color for text/icons on top of the primary color."},"secondary":{"type":"string","description":"Accent color used for highlights or secondary UI elements."},"onSecondary":{"type":"string","description":"Contrast color for text/icons on top of the secondary color."},"button":{"type":"string","description":"Background color for primary action buttons."},"onButton":{"type":"string","description":"Color for text/icons inside buttons."},"dark":{"type":"boolean","description":"Activates dark mode."}},"required":["gradientFirst","gradientSecond","gradientThird","gradientText","primary","onPrimary","secondary","onSecondary","button","onButton","dark"]},"WebWidgetContentsDto":{"type":"object","properties":{"headline":{"type":"object","description":"Headline, multilingual.","additionalProperties":{"type":"string"}},"subHeadline":{"type":"object","description":"Sub-headline, multilingual.","additionalProperties":{"type":"string"}},"callToAction":{"type":"object","description":"Call-to-action text, multilingual.","additionalProperties":{"type":"string"}},"callToActionSubtitle":{"type":"object","description":"Call-to-action subtitle, multilingual.","additionalProperties":{"type":"string"}},"botName":{"type":"string","description":"The name of the chatbot displayed in the header."},"hideBotAvatar":{"type":"boolean","description":"Hides the bot's avatar in the chat header."},"hideFileUpload":{"type":"boolean","description":"Hides the option to upload files."}},"required":["headline","subHeadline","callToAction","callToActionSubtitle","botName","hideBotAvatar","hideFileUpload"]}}}}
```

## The SearchResultFacet\_CountDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"SearchResultFacet_CountDto":{"type":"object","properties":{"count":{"type":"number","description":"The number of results for this facet value."},"highlighted":{"type":"string","description":"The highlighted facet value."},"value":{"type":"string","description":"The facet value."}},"required":["count","highlighted","value"]}}}}
```

## The SearchResultFacet\_StatsDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"SearchResultFacet_StatsDto":{"type":"object","properties":{"max":{"type":"number","description":"The maximum value."},"avg":{"type":"number","description":"The average value."},"min":{"type":"number","description":"The minimum value."},"sum":{"type":"number","description":"The sum of all values."}}}}}}
```

## The SearchResultFacetDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"SearchResultFacetDto":{"type":"object","properties":{"counts":{"description":"The facet value counts.","type":"array","items":{"$ref":"#/components/schemas/SearchResultFacet_CountDto"}},"fieldName":{"type":"string","description":"The name of the faceted field."},"stats":{"description":"Statistics for numeric facets.","allOf":[{"$ref":"#/components/schemas/SearchResultFacet_StatsDto"}]}},"required":["counts","fieldName"]},"SearchResultFacet_CountDto":{"type":"object","properties":{"count":{"type":"number","description":"The number of results for this facet value."},"highlighted":{"type":"string","description":"The highlighted facet value."},"value":{"type":"string","description":"The facet value."}},"required":["count","highlighted","value"]},"SearchResultFacet_StatsDto":{"type":"object","properties":{"max":{"type":"number","description":"The maximum value."},"avg":{"type":"number","description":"The average value."},"min":{"type":"number","description":"The minimum value."},"sum":{"type":"number","description":"The sum of all values."}}}}}}
```

## The ConversationBlockDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ConversationBlockDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the block."},"name":{"type":"string","description":"The display name of the block."}},"required":["id","name"]}}}}
```

## The ConversationNotesDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ConversationNotesDto":{"type":"object","properties":{"notes":{"description":"List of notes attached to the conversation.","type":"array","items":{"type":"string"}}},"required":["notes"]}}}}
```

## The ConversationUserInputDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ConversationUserInputDto":{"type":"object","properties":{"redirect":{"type":"string","description":"The redirect destination for user input."},"isSensitive":{"type":"boolean","description":"Whether the user input contains sensitive data."}},"required":["redirect"]}}}}
```

## The ConversationLeadAiConversationDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ConversationLeadAiConversationDto":{"type":"object","properties":{"flowId":{"type":"string","description":"The ID of the flow being executed."},"stepId":{"type":"string","description":"The ID of the current step in the flow."},"interactions":{"type":"number","description":"The number of interactions in this conversation."},"executionId":{"type":"string","description":"The unique execution ID for this conversation flow."}},"required":["flowId","stepId","interactions","executionId"]}}}}
```

## The ConversationTeamDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ConversationTeamDto":{"type":"object","properties":{"teamId":{"type":"string","description":"The ID of the team assigned to this conversation."}},"required":["teamId"]}}}}
```

## The ConversationStatus object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ConversationStatus":{"type":"number","enum":[0,1,2,3,-1],"description":"The current state of the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED"}}}}
```

## The ConversationDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ConversationDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the conversation."},"contactId":{"type":"string","description":"The ID of the contact associated with this conversation."},"archived":{"type":"boolean","description":"Whether the conversation is archived."},"channelId":{"type":"string","description":"The ID of the channel for this conversation."},"channelType":{"type":"string","description":"The type of channel (e.g., web, whatsapp, telegram)."},"chatbotId":{"type":"string","description":"The ID of the chatbot handling this conversation."},"idToken":{"type":"string","description":"The ID token for this conversation."},"language":{"type":"string","description":"The language code of the conversation."},"operatorId":{"type":"string","description":"The ID of the assigned operator."},"photoUrl":{"type":"string","description":"The URL of the contact's photo."},"sessionCount":{"type":"number","description":"The number of sessions in this conversation."},"tags":{"description":"Tags associated with this conversation.","type":"array","items":{"type":"string"}},"unread":{"type":"boolean","description":"Whether the conversation has unread messages."},"variables":{"type":"object","description":"Custom variables for this conversation.","additionalProperties":{"type":"string"}},"lastBlock":{"description":"The last block visited in the flow.","allOf":[{"$ref":"#/components/schemas/ConversationBlockDto"}]},"lastButton":{"description":"The last button clicked by the user.","allOf":[{"$ref":"#/components/schemas/ConversationBlockDto"}]},"created":{"type":"string","description":"Timestamp when the conversation was created."},"updated":{"type":"string","description":"Timestamp when the conversation was last updated."},"providerId":{"type":"string","description":"The external provider ID for this conversation."},"name":{"type":"string","description":"The display name of the contact."},"lastMessage":{"description":"The content of the last message in the conversation.","allOf":[{"$ref":"#/components/schemas/ContentDto"}]},"snoozed":{"type":"string","description":"Timestamp until which the conversation is snoozed."},"lastUserAction":{"type":"string","description":"Timestamp of the last user action."},"mentions":{"description":"List of user IDs mentioned in this conversation.","type":"array","items":{"type":"string"}},"mentionsRead":{"type":"object","description":"Map of mentions to their read status.","additionalProperties":{"type":"boolean"}},"notes":{"description":"Notes attached to this conversation.","allOf":[{"$ref":"#/components/schemas/ConversationNotesDto"}]},"lastSender":{"type":"string","description":"The type of the last sender (user, bot, operator)."},"userInput":{"description":"Current user input state.","allOf":[{"$ref":"#/components/schemas/ConversationUserInputDto"}]},"environment":{"type":"string","description":"The environment.","enum":["dev","test","prod"]},"metadata":{"type":"object","description":"Custom metadata for this conversation.","additionalProperties":{"type":"string"}},"lastUserInput":{"type":"string","description":"The last user input text."},"leadAiConversation":{"description":"Lead AI conversation state.","allOf":[{"$ref":"#/components/schemas/ConversationLeadAiConversationDto"}]},"team":{"description":"The team assigned to this conversation.","allOf":[{"$ref":"#/components/schemas/ConversationTeamDto"}]},"state":{"description":"The current state of the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED","allOf":[{"$ref":"#/components/schemas/ConversationStatus"}]},"lastAssignedOperatorId":{"type":"string","description":"The ID of the last assigned operator."},"lastSeen":{"type":"string","description":"Timestamp when the conversation was last seen."}},"required":["id","contactId","archived","channelId","channelType","chatbotId","idToken","language","operatorId","photoUrl","sessionCount","tags","unread","variables","created","updated","name","snoozed","lastUserAction","mentions","mentionsRead","environment","metadata","state"]},"ConversationBlockDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the block."},"name":{"type":"string","description":"The display name of the block."}},"required":["id","name"]},"ContentDto":{"type":"object","properties":{"text":{"type":"string","description":"The text content of the message."},"file":{"description":"A file attachment.","allOf":[{"$ref":"#/components/schemas/MessageContentFileDto"}]},"buttons":{"description":"Interactive buttons for the message.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonsDto"}]},"selectedButton":{"description":"The button selected by the user.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonReplyDto"}]},"template":{"description":"A message template.","allOf":[{"$ref":"#/components/schemas/MessageTemplateDto"}]},"location":{"description":"A location shared in the message.","allOf":[{"$ref":"#/components/schemas/MessageLocationDto"}]},"voiceHangup":{"description":"Voice hangup data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceHangupDto"}]},"voiceTransfer":{"description":"Voice transfer data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceTransferDto"}]},"agentHandover":{"description":"Agent handover data.","allOf":[{"$ref":"#/components/schemas/MessageAgentHandoverDto"}]},"email":{"description":"Email content data.","allOf":[{"$ref":"#/components/schemas/MessageContentEmailDto"}]},"textToSpeech":{"description":"Text-to-speech content data.","allOf":[{"$ref":"#/components/schemas/MessageContentTextToSpeechDto"}]},"metaWhatsappTemplate":{"description":"A Meta WhatsApp template message.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplateDto"}]},"operator":{"description":"Operator data for the message.","allOf":[{"$ref":"#/components/schemas/OperatorDto"}]},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."},"leadAiId":{"type":"string","description":"The ID of the Lead AI associated with this message."}}},"MessageContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, audio)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."},"caption":{"type":"string","description":"An optional caption for the file."},"transcript":{"type":"string","description":"The transcript of audio/video content."},"facebookAttachmentId":{"type":"string","description":"The Facebook attachment ID."},"whatsappAttachmentId":{"type":"string","description":"The WhatsApp attachment ID."},"instagramAttachmentId":{"type":"string","description":"The Instagram attachment ID."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageContentButtonsDto":{"type":"object","properties":{"buttons":{"description":"The list of buttons.","type":"array","items":{"$ref":"#/components/schemas/MessageContentButtonDto"}}},"required":["buttons"]},"MessageContentButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, postback)."},"value":{"type":"string","description":"The value associated with the button."},"payload":{"type":"string","description":"An optional payload for the button."}},"required":["label","type","value"]},"MessageContentButtonReplyDto":{"type":"object","properties":{"label":{"type":"string","description":"The label of the selected button."},"value":{"type":"string","description":"The value of the selected button."},"payload":{"type":"string","description":"An optional payload from the button."},"type":{"type":"string","description":"The type of the button."},"reference":{"type":"string","description":"The reference to the original button message."}},"required":["label","value","reference"]},"MessageTemplateDto":{"type":"object","properties":{"body":{"type":"string","description":"The body text of the template."},"header":{"type":"string","description":"The header text of the template."},"footer":{"type":"string","description":"The footer text of the template."}},"required":["body"]},"MessageLocationDto":{"type":"object","properties":{"latitude":{"type":"number","description":"The latitude coordinate."},"longitude":{"type":"number","description":"The longitude coordinate."}},"required":["latitude","longitude"]},"MessageVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for hanging up the call."},"headers":{"type":"object","description":"Custom SIP headers for the hangup.","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"MessageVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string","description":"The target phone number or SIP address for the transfer."},"reason":{"type":"string","description":"The reason for the transfer."},"headers":{"type":"object","description":"Custom SIP headers for the transfer.","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"MessageAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for the handover to an agent."},"timeoutSeconds":{"type":"number","description":"Timeout in seconds before the handover expires."},"agentId":{"type":"string","description":"The ID of the specific agent to hand over to."},"groupId":{"type":"string","description":"The ID of the agent group to hand over to."},"assignmentMethod":{"type":"string","description":"The method for assigning the agent (e.g., round_robin, least_busy)."}},"required":["reason"]},"MessageContentEmailDto":{"type":"object","properties":{"subject":{"type":"string","description":"The subject of the email."},"body":{"type":"string","description":"The body content of the email."},"from":{"type":"string","description":"The sender email address."},"to":{"description":"The list of recipient email addresses.","type":"array","items":{"type":"string"}},"cc":{"description":"The list of CC recipient email addresses.","type":"array","items":{"type":"string"}},"bcc":{"description":"The list of BCC recipient email addresses.","type":"array","items":{"type":"string"}},"attachmentIds":{"description":"The list of attachment IDs.","type":"array","items":{"type":"string"}},"references":{"description":"The list of email references for threading.","type":"array","items":{"type":"string"}}},"required":["subject","body","from","to","cc","bcc","attachmentIds","references"]},"MessageContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"string","description":"The text to be converted to speech."},"speech":{"type":"string","description":"Pre-generated speech audio reference."}},"required":["text"]},"MessageMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the template on Meta."},"language":{"type":"string","description":"The language code of the template."},"bodyText":{"type":"string","description":"The body text of the message. Placeholders are in the form `{{1}}`."},"headerText":{"type":"string","description":"The text in the header (if present)."},"footerText":{"type":"string","description":"The text in the footer (if present)."},"header":{"description":"The header component, which can contain a file or text parameters.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_HeaderDto"}]},"bodyParameters":{"description":"A list of values that replace the placeholders in the `bodyText`.","type":"array","items":{"type":"string"}},"buttons":{"description":"A list of buttons attached to the message.","type":"array","items":{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_ButtonDto"}}},"required":["templateName","language","bodyText","bodyParameters","buttons"]},"MessageMetaWhatsAppTemplate_HeaderDto":{"type":"object","properties":{"file":{"description":"The file attached to the header.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_Header_FileDto"}]},"parameters":{"description":"The list of parameter values for the header placeholders.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"MessageMetaWhatsAppTemplate_Header_FileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, video)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageMetaWhatsAppTemplate_ButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, quick_reply)."},"url":{"type":"string","description":"The URL for URL-type buttons."},"value":{"type":"string","description":"The value for quick_reply-type buttons."}},"required":["label","type"]},"OperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The unique identifier of the operator."}},"required":["operatorId"]},"ConversationNotesDto":{"type":"object","properties":{"notes":{"description":"List of notes attached to the conversation.","type":"array","items":{"type":"string"}}},"required":["notes"]},"ConversationUserInputDto":{"type":"object","properties":{"redirect":{"type":"string","description":"The redirect destination for user input."},"isSensitive":{"type":"boolean","description":"Whether the user input contains sensitive data."}},"required":["redirect"]},"ConversationLeadAiConversationDto":{"type":"object","properties":{"flowId":{"type":"string","description":"The ID of the flow being executed."},"stepId":{"type":"string","description":"The ID of the current step in the flow."},"interactions":{"type":"number","description":"The number of interactions in this conversation."},"executionId":{"type":"string","description":"The unique execution ID for this conversation flow."}},"required":["flowId","stepId","interactions","executionId"]},"ConversationTeamDto":{"type":"object","properties":{"teamId":{"type":"string","description":"The ID of the team assigned to this conversation."}},"required":["teamId"]},"ConversationStatus":{"type":"number","enum":[0,1,2,3,-1],"description":"The current state of the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED"}}}}
```

## The HighlightResultDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"HighlightResultDto":{"type":"object","properties":{"field":{"type":"string","description":"The field where the hit was found."},"matchedTokens":{"description":"The exact words that matched.","type":"array","items":{"type":"string"}},"snippet":{"type":"string","description":"A short excerpt of the text with highlights."}},"required":["field","matchedTokens","snippet"]}}}}
```

## The SearchResultHitDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"SearchResultHitDto":{"type":"object","properties":{"conversation":{"description":"The matching conversation.","allOf":[{"$ref":"#/components/schemas/ConversationDto"}]},"highlights":{"description":"List of highlighted match results.","type":"array","items":{"$ref":"#/components/schemas/HighlightResultDto"}},"textMatch":{"type":"string","description":"A combined string of all text matches."}},"required":["conversation","highlights","textMatch"]},"ConversationDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the conversation."},"contactId":{"type":"string","description":"The ID of the contact associated with this conversation."},"archived":{"type":"boolean","description":"Whether the conversation is archived."},"channelId":{"type":"string","description":"The ID of the channel for this conversation."},"channelType":{"type":"string","description":"The type of channel (e.g., web, whatsapp, telegram)."},"chatbotId":{"type":"string","description":"The ID of the chatbot handling this conversation."},"idToken":{"type":"string","description":"The ID token for this conversation."},"language":{"type":"string","description":"The language code of the conversation."},"operatorId":{"type":"string","description":"The ID of the assigned operator."},"photoUrl":{"type":"string","description":"The URL of the contact's photo."},"sessionCount":{"type":"number","description":"The number of sessions in this conversation."},"tags":{"description":"Tags associated with this conversation.","type":"array","items":{"type":"string"}},"unread":{"type":"boolean","description":"Whether the conversation has unread messages."},"variables":{"type":"object","description":"Custom variables for this conversation.","additionalProperties":{"type":"string"}},"lastBlock":{"description":"The last block visited in the flow.","allOf":[{"$ref":"#/components/schemas/ConversationBlockDto"}]},"lastButton":{"description":"The last button clicked by the user.","allOf":[{"$ref":"#/components/schemas/ConversationBlockDto"}]},"created":{"type":"string","description":"Timestamp when the conversation was created."},"updated":{"type":"string","description":"Timestamp when the conversation was last updated."},"providerId":{"type":"string","description":"The external provider ID for this conversation."},"name":{"type":"string","description":"The display name of the contact."},"lastMessage":{"description":"The content of the last message in the conversation.","allOf":[{"$ref":"#/components/schemas/ContentDto"}]},"snoozed":{"type":"string","description":"Timestamp until which the conversation is snoozed."},"lastUserAction":{"type":"string","description":"Timestamp of the last user action."},"mentions":{"description":"List of user IDs mentioned in this conversation.","type":"array","items":{"type":"string"}},"mentionsRead":{"type":"object","description":"Map of mentions to their read status.","additionalProperties":{"type":"boolean"}},"notes":{"description":"Notes attached to this conversation.","allOf":[{"$ref":"#/components/schemas/ConversationNotesDto"}]},"lastSender":{"type":"string","description":"The type of the last sender (user, bot, operator)."},"userInput":{"description":"Current user input state.","allOf":[{"$ref":"#/components/schemas/ConversationUserInputDto"}]},"environment":{"type":"string","description":"The environment.","enum":["dev","test","prod"]},"metadata":{"type":"object","description":"Custom metadata for this conversation.","additionalProperties":{"type":"string"}},"lastUserInput":{"type":"string","description":"The last user input text."},"leadAiConversation":{"description":"Lead AI conversation state.","allOf":[{"$ref":"#/components/schemas/ConversationLeadAiConversationDto"}]},"team":{"description":"The team assigned to this conversation.","allOf":[{"$ref":"#/components/schemas/ConversationTeamDto"}]},"state":{"description":"The current state of the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED","allOf":[{"$ref":"#/components/schemas/ConversationStatus"}]},"lastAssignedOperatorId":{"type":"string","description":"The ID of the last assigned operator."},"lastSeen":{"type":"string","description":"Timestamp when the conversation was last seen."}},"required":["id","contactId","archived","channelId","channelType","chatbotId","idToken","language","operatorId","photoUrl","sessionCount","tags","unread","variables","created","updated","name","snoozed","lastUserAction","mentions","mentionsRead","environment","metadata","state"]},"ConversationBlockDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the block."},"name":{"type":"string","description":"The display name of the block."}},"required":["id","name"]},"ContentDto":{"type":"object","properties":{"text":{"type":"string","description":"The text content of the message."},"file":{"description":"A file attachment.","allOf":[{"$ref":"#/components/schemas/MessageContentFileDto"}]},"buttons":{"description":"Interactive buttons for the message.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonsDto"}]},"selectedButton":{"description":"The button selected by the user.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonReplyDto"}]},"template":{"description":"A message template.","allOf":[{"$ref":"#/components/schemas/MessageTemplateDto"}]},"location":{"description":"A location shared in the message.","allOf":[{"$ref":"#/components/schemas/MessageLocationDto"}]},"voiceHangup":{"description":"Voice hangup data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceHangupDto"}]},"voiceTransfer":{"description":"Voice transfer data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceTransferDto"}]},"agentHandover":{"description":"Agent handover data.","allOf":[{"$ref":"#/components/schemas/MessageAgentHandoverDto"}]},"email":{"description":"Email content data.","allOf":[{"$ref":"#/components/schemas/MessageContentEmailDto"}]},"textToSpeech":{"description":"Text-to-speech content data.","allOf":[{"$ref":"#/components/schemas/MessageContentTextToSpeechDto"}]},"metaWhatsappTemplate":{"description":"A Meta WhatsApp template message.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplateDto"}]},"operator":{"description":"Operator data for the message.","allOf":[{"$ref":"#/components/schemas/OperatorDto"}]},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."},"leadAiId":{"type":"string","description":"The ID of the Lead AI associated with this message."}}},"MessageContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, audio)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."},"caption":{"type":"string","description":"An optional caption for the file."},"transcript":{"type":"string","description":"The transcript of audio/video content."},"facebookAttachmentId":{"type":"string","description":"The Facebook attachment ID."},"whatsappAttachmentId":{"type":"string","description":"The WhatsApp attachment ID."},"instagramAttachmentId":{"type":"string","description":"The Instagram attachment ID."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageContentButtonsDto":{"type":"object","properties":{"buttons":{"description":"The list of buttons.","type":"array","items":{"$ref":"#/components/schemas/MessageContentButtonDto"}}},"required":["buttons"]},"MessageContentButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, postback)."},"value":{"type":"string","description":"The value associated with the button."},"payload":{"type":"string","description":"An optional payload for the button."}},"required":["label","type","value"]},"MessageContentButtonReplyDto":{"type":"object","properties":{"label":{"type":"string","description":"The label of the selected button."},"value":{"type":"string","description":"The value of the selected button."},"payload":{"type":"string","description":"An optional payload from the button."},"type":{"type":"string","description":"The type of the button."},"reference":{"type":"string","description":"The reference to the original button message."}},"required":["label","value","reference"]},"MessageTemplateDto":{"type":"object","properties":{"body":{"type":"string","description":"The body text of the template."},"header":{"type":"string","description":"The header text of the template."},"footer":{"type":"string","description":"The footer text of the template."}},"required":["body"]},"MessageLocationDto":{"type":"object","properties":{"latitude":{"type":"number","description":"The latitude coordinate."},"longitude":{"type":"number","description":"The longitude coordinate."}},"required":["latitude","longitude"]},"MessageVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for hanging up the call."},"headers":{"type":"object","description":"Custom SIP headers for the hangup.","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"MessageVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string","description":"The target phone number or SIP address for the transfer."},"reason":{"type":"string","description":"The reason for the transfer."},"headers":{"type":"object","description":"Custom SIP headers for the transfer.","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"MessageAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for the handover to an agent."},"timeoutSeconds":{"type":"number","description":"Timeout in seconds before the handover expires."},"agentId":{"type":"string","description":"The ID of the specific agent to hand over to."},"groupId":{"type":"string","description":"The ID of the agent group to hand over to."},"assignmentMethod":{"type":"string","description":"The method for assigning the agent (e.g., round_robin, least_busy)."}},"required":["reason"]},"MessageContentEmailDto":{"type":"object","properties":{"subject":{"type":"string","description":"The subject of the email."},"body":{"type":"string","description":"The body content of the email."},"from":{"type":"string","description":"The sender email address."},"to":{"description":"The list of recipient email addresses.","type":"array","items":{"type":"string"}},"cc":{"description":"The list of CC recipient email addresses.","type":"array","items":{"type":"string"}},"bcc":{"description":"The list of BCC recipient email addresses.","type":"array","items":{"type":"string"}},"attachmentIds":{"description":"The list of attachment IDs.","type":"array","items":{"type":"string"}},"references":{"description":"The list of email references for threading.","type":"array","items":{"type":"string"}}},"required":["subject","body","from","to","cc","bcc","attachmentIds","references"]},"MessageContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"string","description":"The text to be converted to speech."},"speech":{"type":"string","description":"Pre-generated speech audio reference."}},"required":["text"]},"MessageMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the template on Meta."},"language":{"type":"string","description":"The language code of the template."},"bodyText":{"type":"string","description":"The body text of the message. Placeholders are in the form `{{1}}`."},"headerText":{"type":"string","description":"The text in the header (if present)."},"footerText":{"type":"string","description":"The text in the footer (if present)."},"header":{"description":"The header component, which can contain a file or text parameters.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_HeaderDto"}]},"bodyParameters":{"description":"A list of values that replace the placeholders in the `bodyText`.","type":"array","items":{"type":"string"}},"buttons":{"description":"A list of buttons attached to the message.","type":"array","items":{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_ButtonDto"}}},"required":["templateName","language","bodyText","bodyParameters","buttons"]},"MessageMetaWhatsAppTemplate_HeaderDto":{"type":"object","properties":{"file":{"description":"The file attached to the header.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_Header_FileDto"}]},"parameters":{"description":"The list of parameter values for the header placeholders.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"MessageMetaWhatsAppTemplate_Header_FileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, video)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageMetaWhatsAppTemplate_ButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, quick_reply)."},"url":{"type":"string","description":"The URL for URL-type buttons."},"value":{"type":"string","description":"The value for quick_reply-type buttons."}},"required":["label","type"]},"OperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The unique identifier of the operator."}},"required":["operatorId"]},"ConversationNotesDto":{"type":"object","properties":{"notes":{"description":"List of notes attached to the conversation.","type":"array","items":{"type":"string"}}},"required":["notes"]},"ConversationUserInputDto":{"type":"object","properties":{"redirect":{"type":"string","description":"The redirect destination for user input."},"isSensitive":{"type":"boolean","description":"Whether the user input contains sensitive data."}},"required":["redirect"]},"ConversationLeadAiConversationDto":{"type":"object","properties":{"flowId":{"type":"string","description":"The ID of the flow being executed."},"stepId":{"type":"string","description":"The ID of the current step in the flow."},"interactions":{"type":"number","description":"The number of interactions in this conversation."},"executionId":{"type":"string","description":"The unique execution ID for this conversation flow."}},"required":["flowId","stepId","interactions","executionId"]},"ConversationTeamDto":{"type":"object","properties":{"teamId":{"type":"string","description":"The ID of the team assigned to this conversation."}},"required":["teamId"]},"ConversationStatus":{"type":"number","enum":[0,1,2,3,-1],"description":"The current state of the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED"},"HighlightResultDto":{"type":"object","properties":{"field":{"type":"string","description":"The field where the hit was found."},"matchedTokens":{"description":"The exact words that matched.","type":"array","items":{"type":"string"}},"snippet":{"type":"string","description":"A short excerpt of the text with highlights."}},"required":["field","matchedTokens","snippet"]}}}}
```

## The SearchConversationResultDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"SearchConversationResultDto":{"type":"object","properties":{"facetCounts":{"description":"The facet counts for the search.","type":"array","items":{"$ref":"#/components/schemas/SearchResultFacetDto"}},"found":{"type":"number","description":"Total number of results found."},"hits":{"description":"The search result hits.","type":"array","items":{"$ref":"#/components/schemas/SearchResultHitDto"}},"outOf":{"type":"number","description":"Total number of documents searched."},"page":{"type":"number","description":"The current page of search results."},"searchTimeMs":{"type":"number","description":"The duration of the search in milliseconds."}},"required":["facetCounts","found","hits","outOf","page","searchTimeMs"]},"SearchResultFacetDto":{"type":"object","properties":{"counts":{"description":"The facet value counts.","type":"array","items":{"$ref":"#/components/schemas/SearchResultFacet_CountDto"}},"fieldName":{"type":"string","description":"The name of the faceted field."},"stats":{"description":"Statistics for numeric facets.","allOf":[{"$ref":"#/components/schemas/SearchResultFacet_StatsDto"}]}},"required":["counts","fieldName"]},"SearchResultFacet_CountDto":{"type":"object","properties":{"count":{"type":"number","description":"The number of results for this facet value."},"highlighted":{"type":"string","description":"The highlighted facet value."},"value":{"type":"string","description":"The facet value."}},"required":["count","highlighted","value"]},"SearchResultFacet_StatsDto":{"type":"object","properties":{"max":{"type":"number","description":"The maximum value."},"avg":{"type":"number","description":"The average value."},"min":{"type":"number","description":"The minimum value."},"sum":{"type":"number","description":"The sum of all values."}}},"SearchResultHitDto":{"type":"object","properties":{"conversation":{"description":"The matching conversation.","allOf":[{"$ref":"#/components/schemas/ConversationDto"}]},"highlights":{"description":"List of highlighted match results.","type":"array","items":{"$ref":"#/components/schemas/HighlightResultDto"}},"textMatch":{"type":"string","description":"A combined string of all text matches."}},"required":["conversation","highlights","textMatch"]},"ConversationDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the conversation."},"contactId":{"type":"string","description":"The ID of the contact associated with this conversation."},"archived":{"type":"boolean","description":"Whether the conversation is archived."},"channelId":{"type":"string","description":"The ID of the channel for this conversation."},"channelType":{"type":"string","description":"The type of channel (e.g., web, whatsapp, telegram)."},"chatbotId":{"type":"string","description":"The ID of the chatbot handling this conversation."},"idToken":{"type":"string","description":"The ID token for this conversation."},"language":{"type":"string","description":"The language code of the conversation."},"operatorId":{"type":"string","description":"The ID of the assigned operator."},"photoUrl":{"type":"string","description":"The URL of the contact's photo."},"sessionCount":{"type":"number","description":"The number of sessions in this conversation."},"tags":{"description":"Tags associated with this conversation.","type":"array","items":{"type":"string"}},"unread":{"type":"boolean","description":"Whether the conversation has unread messages."},"variables":{"type":"object","description":"Custom variables for this conversation.","additionalProperties":{"type":"string"}},"lastBlock":{"description":"The last block visited in the flow.","allOf":[{"$ref":"#/components/schemas/ConversationBlockDto"}]},"lastButton":{"description":"The last button clicked by the user.","allOf":[{"$ref":"#/components/schemas/ConversationBlockDto"}]},"created":{"type":"string","description":"Timestamp when the conversation was created."},"updated":{"type":"string","description":"Timestamp when the conversation was last updated."},"providerId":{"type":"string","description":"The external provider ID for this conversation."},"name":{"type":"string","description":"The display name of the contact."},"lastMessage":{"description":"The content of the last message in the conversation.","allOf":[{"$ref":"#/components/schemas/ContentDto"}]},"snoozed":{"type":"string","description":"Timestamp until which the conversation is snoozed."},"lastUserAction":{"type":"string","description":"Timestamp of the last user action."},"mentions":{"description":"List of user IDs mentioned in this conversation.","type":"array","items":{"type":"string"}},"mentionsRead":{"type":"object","description":"Map of mentions to their read status.","additionalProperties":{"type":"boolean"}},"notes":{"description":"Notes attached to this conversation.","allOf":[{"$ref":"#/components/schemas/ConversationNotesDto"}]},"lastSender":{"type":"string","description":"The type of the last sender (user, bot, operator)."},"userInput":{"description":"Current user input state.","allOf":[{"$ref":"#/components/schemas/ConversationUserInputDto"}]},"environment":{"type":"string","description":"The environment.","enum":["dev","test","prod"]},"metadata":{"type":"object","description":"Custom metadata for this conversation.","additionalProperties":{"type":"string"}},"lastUserInput":{"type":"string","description":"The last user input text."},"leadAiConversation":{"description":"Lead AI conversation state.","allOf":[{"$ref":"#/components/schemas/ConversationLeadAiConversationDto"}]},"team":{"description":"The team assigned to this conversation.","allOf":[{"$ref":"#/components/schemas/ConversationTeamDto"}]},"state":{"description":"The current state of the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED","allOf":[{"$ref":"#/components/schemas/ConversationStatus"}]},"lastAssignedOperatorId":{"type":"string","description":"The ID of the last assigned operator."},"lastSeen":{"type":"string","description":"Timestamp when the conversation was last seen."}},"required":["id","contactId","archived","channelId","channelType","chatbotId","idToken","language","operatorId","photoUrl","sessionCount","tags","unread","variables","created","updated","name","snoozed","lastUserAction","mentions","mentionsRead","environment","metadata","state"]},"ConversationBlockDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the block."},"name":{"type":"string","description":"The display name of the block."}},"required":["id","name"]},"ContentDto":{"type":"object","properties":{"text":{"type":"string","description":"The text content of the message."},"file":{"description":"A file attachment.","allOf":[{"$ref":"#/components/schemas/MessageContentFileDto"}]},"buttons":{"description":"Interactive buttons for the message.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonsDto"}]},"selectedButton":{"description":"The button selected by the user.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonReplyDto"}]},"template":{"description":"A message template.","allOf":[{"$ref":"#/components/schemas/MessageTemplateDto"}]},"location":{"description":"A location shared in the message.","allOf":[{"$ref":"#/components/schemas/MessageLocationDto"}]},"voiceHangup":{"description":"Voice hangup data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceHangupDto"}]},"voiceTransfer":{"description":"Voice transfer data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceTransferDto"}]},"agentHandover":{"description":"Agent handover data.","allOf":[{"$ref":"#/components/schemas/MessageAgentHandoverDto"}]},"email":{"description":"Email content data.","allOf":[{"$ref":"#/components/schemas/MessageContentEmailDto"}]},"textToSpeech":{"description":"Text-to-speech content data.","allOf":[{"$ref":"#/components/schemas/MessageContentTextToSpeechDto"}]},"metaWhatsappTemplate":{"description":"A Meta WhatsApp template message.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplateDto"}]},"operator":{"description":"Operator data for the message.","allOf":[{"$ref":"#/components/schemas/OperatorDto"}]},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."},"leadAiId":{"type":"string","description":"The ID of the Lead AI associated with this message."}}},"MessageContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, audio)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."},"caption":{"type":"string","description":"An optional caption for the file."},"transcript":{"type":"string","description":"The transcript of audio/video content."},"facebookAttachmentId":{"type":"string","description":"The Facebook attachment ID."},"whatsappAttachmentId":{"type":"string","description":"The WhatsApp attachment ID."},"instagramAttachmentId":{"type":"string","description":"The Instagram attachment ID."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageContentButtonsDto":{"type":"object","properties":{"buttons":{"description":"The list of buttons.","type":"array","items":{"$ref":"#/components/schemas/MessageContentButtonDto"}}},"required":["buttons"]},"MessageContentButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, postback)."},"value":{"type":"string","description":"The value associated with the button."},"payload":{"type":"string","description":"An optional payload for the button."}},"required":["label","type","value"]},"MessageContentButtonReplyDto":{"type":"object","properties":{"label":{"type":"string","description":"The label of the selected button."},"value":{"type":"string","description":"The value of the selected button."},"payload":{"type":"string","description":"An optional payload from the button."},"type":{"type":"string","description":"The type of the button."},"reference":{"type":"string","description":"The reference to the original button message."}},"required":["label","value","reference"]},"MessageTemplateDto":{"type":"object","properties":{"body":{"type":"string","description":"The body text of the template."},"header":{"type":"string","description":"The header text of the template."},"footer":{"type":"string","description":"The footer text of the template."}},"required":["body"]},"MessageLocationDto":{"type":"object","properties":{"latitude":{"type":"number","description":"The latitude coordinate."},"longitude":{"type":"number","description":"The longitude coordinate."}},"required":["latitude","longitude"]},"MessageVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for hanging up the call."},"headers":{"type":"object","description":"Custom SIP headers for the hangup.","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"MessageVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string","description":"The target phone number or SIP address for the transfer."},"reason":{"type":"string","description":"The reason for the transfer."},"headers":{"type":"object","description":"Custom SIP headers for the transfer.","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"MessageAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for the handover to an agent."},"timeoutSeconds":{"type":"number","description":"Timeout in seconds before the handover expires."},"agentId":{"type":"string","description":"The ID of the specific agent to hand over to."},"groupId":{"type":"string","description":"The ID of the agent group to hand over to."},"assignmentMethod":{"type":"string","description":"The method for assigning the agent (e.g., round_robin, least_busy)."}},"required":["reason"]},"MessageContentEmailDto":{"type":"object","properties":{"subject":{"type":"string","description":"The subject of the email."},"body":{"type":"string","description":"The body content of the email."},"from":{"type":"string","description":"The sender email address."},"to":{"description":"The list of recipient email addresses.","type":"array","items":{"type":"string"}},"cc":{"description":"The list of CC recipient email addresses.","type":"array","items":{"type":"string"}},"bcc":{"description":"The list of BCC recipient email addresses.","type":"array","items":{"type":"string"}},"attachmentIds":{"description":"The list of attachment IDs.","type":"array","items":{"type":"string"}},"references":{"description":"The list of email references for threading.","type":"array","items":{"type":"string"}}},"required":["subject","body","from","to","cc","bcc","attachmentIds","references"]},"MessageContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"string","description":"The text to be converted to speech."},"speech":{"type":"string","description":"Pre-generated speech audio reference."}},"required":["text"]},"MessageMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the template on Meta."},"language":{"type":"string","description":"The language code of the template."},"bodyText":{"type":"string","description":"The body text of the message. Placeholders are in the form `{{1}}`."},"headerText":{"type":"string","description":"The text in the header (if present)."},"footerText":{"type":"string","description":"The text in the footer (if present)."},"header":{"description":"The header component, which can contain a file or text parameters.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_HeaderDto"}]},"bodyParameters":{"description":"A list of values that replace the placeholders in the `bodyText`.","type":"array","items":{"type":"string"}},"buttons":{"description":"A list of buttons attached to the message.","type":"array","items":{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_ButtonDto"}}},"required":["templateName","language","bodyText","bodyParameters","buttons"]},"MessageMetaWhatsAppTemplate_HeaderDto":{"type":"object","properties":{"file":{"description":"The file attached to the header.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_Header_FileDto"}]},"parameters":{"description":"The list of parameter values for the header placeholders.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"MessageMetaWhatsAppTemplate_Header_FileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, video)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageMetaWhatsAppTemplate_ButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, quick_reply)."},"url":{"type":"string","description":"The URL for URL-type buttons."},"value":{"type":"string","description":"The value for quick_reply-type buttons."}},"required":["label","type"]},"OperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The unique identifier of the operator."}},"required":["operatorId"]},"ConversationNotesDto":{"type":"object","properties":{"notes":{"description":"List of notes attached to the conversation.","type":"array","items":{"type":"string"}}},"required":["notes"]},"ConversationUserInputDto":{"type":"object","properties":{"redirect":{"type":"string","description":"The redirect destination for user input."},"isSensitive":{"type":"boolean","description":"Whether the user input contains sensitive data."}},"required":["redirect"]},"ConversationLeadAiConversationDto":{"type":"object","properties":{"flowId":{"type":"string","description":"The ID of the flow being executed."},"stepId":{"type":"string","description":"The ID of the current step in the flow."},"interactions":{"type":"number","description":"The number of interactions in this conversation."},"executionId":{"type":"string","description":"The unique execution ID for this conversation flow."}},"required":["flowId","stepId","interactions","executionId"]},"ConversationTeamDto":{"type":"object","properties":{"teamId":{"type":"string","description":"The ID of the team assigned to this conversation."}},"required":["teamId"]},"ConversationStatus":{"type":"number","enum":[0,1,2,3,-1],"description":"The current state of the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED"},"HighlightResultDto":{"type":"object","properties":{"field":{"type":"string","description":"The field where the hit was found."},"matchedTokens":{"description":"The exact words that matched.","type":"array","items":{"type":"string"}},"snippet":{"type":"string","description":"A short excerpt of the text with highlights."}},"required":["field","matchedTokens","snippet"]}}}}
```

## The SearchConversationsResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"SearchConversationsResponseDto":{"type":"object","properties":{"results":{"description":"The search results.","nullable":true,"allOf":[{"$ref":"#/components/schemas/SearchConversationResultDto"}]},"error":{"type":"string","description":"Optional error message."}},"required":["results"]},"SearchConversationResultDto":{"type":"object","properties":{"facetCounts":{"description":"The facet counts for the search.","type":"array","items":{"$ref":"#/components/schemas/SearchResultFacetDto"}},"found":{"type":"number","description":"Total number of results found."},"hits":{"description":"The search result hits.","type":"array","items":{"$ref":"#/components/schemas/SearchResultHitDto"}},"outOf":{"type":"number","description":"Total number of documents searched."},"page":{"type":"number","description":"The current page of search results."},"searchTimeMs":{"type":"number","description":"The duration of the search in milliseconds."}},"required":["facetCounts","found","hits","outOf","page","searchTimeMs"]},"SearchResultFacetDto":{"type":"object","properties":{"counts":{"description":"The facet value counts.","type":"array","items":{"$ref":"#/components/schemas/SearchResultFacet_CountDto"}},"fieldName":{"type":"string","description":"The name of the faceted field."},"stats":{"description":"Statistics for numeric facets.","allOf":[{"$ref":"#/components/schemas/SearchResultFacet_StatsDto"}]}},"required":["counts","fieldName"]},"SearchResultFacet_CountDto":{"type":"object","properties":{"count":{"type":"number","description":"The number of results for this facet value."},"highlighted":{"type":"string","description":"The highlighted facet value."},"value":{"type":"string","description":"The facet value."}},"required":["count","highlighted","value"]},"SearchResultFacet_StatsDto":{"type":"object","properties":{"max":{"type":"number","description":"The maximum value."},"avg":{"type":"number","description":"The average value."},"min":{"type":"number","description":"The minimum value."},"sum":{"type":"number","description":"The sum of all values."}}},"SearchResultHitDto":{"type":"object","properties":{"conversation":{"description":"The matching conversation.","allOf":[{"$ref":"#/components/schemas/ConversationDto"}]},"highlights":{"description":"List of highlighted match results.","type":"array","items":{"$ref":"#/components/schemas/HighlightResultDto"}},"textMatch":{"type":"string","description":"A combined string of all text matches."}},"required":["conversation","highlights","textMatch"]},"ConversationDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the conversation."},"contactId":{"type":"string","description":"The ID of the contact associated with this conversation."},"archived":{"type":"boolean","description":"Whether the conversation is archived."},"channelId":{"type":"string","description":"The ID of the channel for this conversation."},"channelType":{"type":"string","description":"The type of channel (e.g., web, whatsapp, telegram)."},"chatbotId":{"type":"string","description":"The ID of the chatbot handling this conversation."},"idToken":{"type":"string","description":"The ID token for this conversation."},"language":{"type":"string","description":"The language code of the conversation."},"operatorId":{"type":"string","description":"The ID of the assigned operator."},"photoUrl":{"type":"string","description":"The URL of the contact's photo."},"sessionCount":{"type":"number","description":"The number of sessions in this conversation."},"tags":{"description":"Tags associated with this conversation.","type":"array","items":{"type":"string"}},"unread":{"type":"boolean","description":"Whether the conversation has unread messages."},"variables":{"type":"object","description":"Custom variables for this conversation.","additionalProperties":{"type":"string"}},"lastBlock":{"description":"The last block visited in the flow.","allOf":[{"$ref":"#/components/schemas/ConversationBlockDto"}]},"lastButton":{"description":"The last button clicked by the user.","allOf":[{"$ref":"#/components/schemas/ConversationBlockDto"}]},"created":{"type":"string","description":"Timestamp when the conversation was created."},"updated":{"type":"string","description":"Timestamp when the conversation was last updated."},"providerId":{"type":"string","description":"The external provider ID for this conversation."},"name":{"type":"string","description":"The display name of the contact."},"lastMessage":{"description":"The content of the last message in the conversation.","allOf":[{"$ref":"#/components/schemas/ContentDto"}]},"snoozed":{"type":"string","description":"Timestamp until which the conversation is snoozed."},"lastUserAction":{"type":"string","description":"Timestamp of the last user action."},"mentions":{"description":"List of user IDs mentioned in this conversation.","type":"array","items":{"type":"string"}},"mentionsRead":{"type":"object","description":"Map of mentions to their read status.","additionalProperties":{"type":"boolean"}},"notes":{"description":"Notes attached to this conversation.","allOf":[{"$ref":"#/components/schemas/ConversationNotesDto"}]},"lastSender":{"type":"string","description":"The type of the last sender (user, bot, operator)."},"userInput":{"description":"Current user input state.","allOf":[{"$ref":"#/components/schemas/ConversationUserInputDto"}]},"environment":{"type":"string","description":"The environment.","enum":["dev","test","prod"]},"metadata":{"type":"object","description":"Custom metadata for this conversation.","additionalProperties":{"type":"string"}},"lastUserInput":{"type":"string","description":"The last user input text."},"leadAiConversation":{"description":"Lead AI conversation state.","allOf":[{"$ref":"#/components/schemas/ConversationLeadAiConversationDto"}]},"team":{"description":"The team assigned to this conversation.","allOf":[{"$ref":"#/components/schemas/ConversationTeamDto"}]},"state":{"description":"The current state of the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED","allOf":[{"$ref":"#/components/schemas/ConversationStatus"}]},"lastAssignedOperatorId":{"type":"string","description":"The ID of the last assigned operator."},"lastSeen":{"type":"string","description":"Timestamp when the conversation was last seen."}},"required":["id","contactId","archived","channelId","channelType","chatbotId","idToken","language","operatorId","photoUrl","sessionCount","tags","unread","variables","created","updated","name","snoozed","lastUserAction","mentions","mentionsRead","environment","metadata","state"]},"ConversationBlockDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the block."},"name":{"type":"string","description":"The display name of the block."}},"required":["id","name"]},"ContentDto":{"type":"object","properties":{"text":{"type":"string","description":"The text content of the message."},"file":{"description":"A file attachment.","allOf":[{"$ref":"#/components/schemas/MessageContentFileDto"}]},"buttons":{"description":"Interactive buttons for the message.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonsDto"}]},"selectedButton":{"description":"The button selected by the user.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonReplyDto"}]},"template":{"description":"A message template.","allOf":[{"$ref":"#/components/schemas/MessageTemplateDto"}]},"location":{"description":"A location shared in the message.","allOf":[{"$ref":"#/components/schemas/MessageLocationDto"}]},"voiceHangup":{"description":"Voice hangup data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceHangupDto"}]},"voiceTransfer":{"description":"Voice transfer data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceTransferDto"}]},"agentHandover":{"description":"Agent handover data.","allOf":[{"$ref":"#/components/schemas/MessageAgentHandoverDto"}]},"email":{"description":"Email content data.","allOf":[{"$ref":"#/components/schemas/MessageContentEmailDto"}]},"textToSpeech":{"description":"Text-to-speech content data.","allOf":[{"$ref":"#/components/schemas/MessageContentTextToSpeechDto"}]},"metaWhatsappTemplate":{"description":"A Meta WhatsApp template message.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplateDto"}]},"operator":{"description":"Operator data for the message.","allOf":[{"$ref":"#/components/schemas/OperatorDto"}]},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."},"leadAiId":{"type":"string","description":"The ID of the Lead AI associated with this message."}}},"MessageContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, audio)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."},"caption":{"type":"string","description":"An optional caption for the file."},"transcript":{"type":"string","description":"The transcript of audio/video content."},"facebookAttachmentId":{"type":"string","description":"The Facebook attachment ID."},"whatsappAttachmentId":{"type":"string","description":"The WhatsApp attachment ID."},"instagramAttachmentId":{"type":"string","description":"The Instagram attachment ID."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageContentButtonsDto":{"type":"object","properties":{"buttons":{"description":"The list of buttons.","type":"array","items":{"$ref":"#/components/schemas/MessageContentButtonDto"}}},"required":["buttons"]},"MessageContentButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, postback)."},"value":{"type":"string","description":"The value associated with the button."},"payload":{"type":"string","description":"An optional payload for the button."}},"required":["label","type","value"]},"MessageContentButtonReplyDto":{"type":"object","properties":{"label":{"type":"string","description":"The label of the selected button."},"value":{"type":"string","description":"The value of the selected button."},"payload":{"type":"string","description":"An optional payload from the button."},"type":{"type":"string","description":"The type of the button."},"reference":{"type":"string","description":"The reference to the original button message."}},"required":["label","value","reference"]},"MessageTemplateDto":{"type":"object","properties":{"body":{"type":"string","description":"The body text of the template."},"header":{"type":"string","description":"The header text of the template."},"footer":{"type":"string","description":"The footer text of the template."}},"required":["body"]},"MessageLocationDto":{"type":"object","properties":{"latitude":{"type":"number","description":"The latitude coordinate."},"longitude":{"type":"number","description":"The longitude coordinate."}},"required":["latitude","longitude"]},"MessageVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for hanging up the call."},"headers":{"type":"object","description":"Custom SIP headers for the hangup.","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"MessageVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string","description":"The target phone number or SIP address for the transfer."},"reason":{"type":"string","description":"The reason for the transfer."},"headers":{"type":"object","description":"Custom SIP headers for the transfer.","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"MessageAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for the handover to an agent."},"timeoutSeconds":{"type":"number","description":"Timeout in seconds before the handover expires."},"agentId":{"type":"string","description":"The ID of the specific agent to hand over to."},"groupId":{"type":"string","description":"The ID of the agent group to hand over to."},"assignmentMethod":{"type":"string","description":"The method for assigning the agent (e.g., round_robin, least_busy)."}},"required":["reason"]},"MessageContentEmailDto":{"type":"object","properties":{"subject":{"type":"string","description":"The subject of the email."},"body":{"type":"string","description":"The body content of the email."},"from":{"type":"string","description":"The sender email address."},"to":{"description":"The list of recipient email addresses.","type":"array","items":{"type":"string"}},"cc":{"description":"The list of CC recipient email addresses.","type":"array","items":{"type":"string"}},"bcc":{"description":"The list of BCC recipient email addresses.","type":"array","items":{"type":"string"}},"attachmentIds":{"description":"The list of attachment IDs.","type":"array","items":{"type":"string"}},"references":{"description":"The list of email references for threading.","type":"array","items":{"type":"string"}}},"required":["subject","body","from","to","cc","bcc","attachmentIds","references"]},"MessageContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"string","description":"The text to be converted to speech."},"speech":{"type":"string","description":"Pre-generated speech audio reference."}},"required":["text"]},"MessageMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the template on Meta."},"language":{"type":"string","description":"The language code of the template."},"bodyText":{"type":"string","description":"The body text of the message. Placeholders are in the form `{{1}}`."},"headerText":{"type":"string","description":"The text in the header (if present)."},"footerText":{"type":"string","description":"The text in the footer (if present)."},"header":{"description":"The header component, which can contain a file or text parameters.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_HeaderDto"}]},"bodyParameters":{"description":"A list of values that replace the placeholders in the `bodyText`.","type":"array","items":{"type":"string"}},"buttons":{"description":"A list of buttons attached to the message.","type":"array","items":{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_ButtonDto"}}},"required":["templateName","language","bodyText","bodyParameters","buttons"]},"MessageMetaWhatsAppTemplate_HeaderDto":{"type":"object","properties":{"file":{"description":"The file attached to the header.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_Header_FileDto"}]},"parameters":{"description":"The list of parameter values for the header placeholders.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"MessageMetaWhatsAppTemplate_Header_FileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, video)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageMetaWhatsAppTemplate_ButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, quick_reply)."},"url":{"type":"string","description":"The URL for URL-type buttons."},"value":{"type":"string","description":"The value for quick_reply-type buttons."}},"required":["label","type"]},"OperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The unique identifier of the operator."}},"required":["operatorId"]},"ConversationNotesDto":{"type":"object","properties":{"notes":{"description":"List of notes attached to the conversation.","type":"array","items":{"type":"string"}}},"required":["notes"]},"ConversationUserInputDto":{"type":"object","properties":{"redirect":{"type":"string","description":"The redirect destination for user input."},"isSensitive":{"type":"boolean","description":"Whether the user input contains sensitive data."}},"required":["redirect"]},"ConversationLeadAiConversationDto":{"type":"object","properties":{"flowId":{"type":"string","description":"The ID of the flow being executed."},"stepId":{"type":"string","description":"The ID of the current step in the flow."},"interactions":{"type":"number","description":"The number of interactions in this conversation."},"executionId":{"type":"string","description":"The unique execution ID for this conversation flow."}},"required":["flowId","stepId","interactions","executionId"]},"ConversationTeamDto":{"type":"object","properties":{"teamId":{"type":"string","description":"The ID of the team assigned to this conversation."}},"required":["teamId"]},"ConversationStatus":{"type":"number","enum":[0,1,2,3,-1],"description":"The current state of the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED"},"HighlightResultDto":{"type":"object","properties":{"field":{"type":"string","description":"The field where the hit was found."},"matchedTokens":{"description":"The exact words that matched.","type":"array","items":{"type":"string"}},"snippet":{"type":"string","description":"A short excerpt of the text with highlights."}},"required":["field","matchedTokens","snippet"]}}}}
```

## The ListConversationsResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListConversationsResponseDto":{"type":"object","properties":{"conversations":{"description":"The list of conversations.","type":"array","items":{"$ref":"#/components/schemas/ConversationDto"}},"error":{"type":"string","description":"Optional error message."}},"required":["conversations"]},"ConversationDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the conversation."},"contactId":{"type":"string","description":"The ID of the contact associated with this conversation."},"archived":{"type":"boolean","description":"Whether the conversation is archived."},"channelId":{"type":"string","description":"The ID of the channel for this conversation."},"channelType":{"type":"string","description":"The type of channel (e.g., web, whatsapp, telegram)."},"chatbotId":{"type":"string","description":"The ID of the chatbot handling this conversation."},"idToken":{"type":"string","description":"The ID token for this conversation."},"language":{"type":"string","description":"The language code of the conversation."},"operatorId":{"type":"string","description":"The ID of the assigned operator."},"photoUrl":{"type":"string","description":"The URL of the contact's photo."},"sessionCount":{"type":"number","description":"The number of sessions in this conversation."},"tags":{"description":"Tags associated with this conversation.","type":"array","items":{"type":"string"}},"unread":{"type":"boolean","description":"Whether the conversation has unread messages."},"variables":{"type":"object","description":"Custom variables for this conversation.","additionalProperties":{"type":"string"}},"lastBlock":{"description":"The last block visited in the flow.","allOf":[{"$ref":"#/components/schemas/ConversationBlockDto"}]},"lastButton":{"description":"The last button clicked by the user.","allOf":[{"$ref":"#/components/schemas/ConversationBlockDto"}]},"created":{"type":"string","description":"Timestamp when the conversation was created."},"updated":{"type":"string","description":"Timestamp when the conversation was last updated."},"providerId":{"type":"string","description":"The external provider ID for this conversation."},"name":{"type":"string","description":"The display name of the contact."},"lastMessage":{"description":"The content of the last message in the conversation.","allOf":[{"$ref":"#/components/schemas/ContentDto"}]},"snoozed":{"type":"string","description":"Timestamp until which the conversation is snoozed."},"lastUserAction":{"type":"string","description":"Timestamp of the last user action."},"mentions":{"description":"List of user IDs mentioned in this conversation.","type":"array","items":{"type":"string"}},"mentionsRead":{"type":"object","description":"Map of mentions to their read status.","additionalProperties":{"type":"boolean"}},"notes":{"description":"Notes attached to this conversation.","allOf":[{"$ref":"#/components/schemas/ConversationNotesDto"}]},"lastSender":{"type":"string","description":"The type of the last sender (user, bot, operator)."},"userInput":{"description":"Current user input state.","allOf":[{"$ref":"#/components/schemas/ConversationUserInputDto"}]},"environment":{"type":"string","description":"The environment.","enum":["dev","test","prod"]},"metadata":{"type":"object","description":"Custom metadata for this conversation.","additionalProperties":{"type":"string"}},"lastUserInput":{"type":"string","description":"The last user input text."},"leadAiConversation":{"description":"Lead AI conversation state.","allOf":[{"$ref":"#/components/schemas/ConversationLeadAiConversationDto"}]},"team":{"description":"The team assigned to this conversation.","allOf":[{"$ref":"#/components/schemas/ConversationTeamDto"}]},"state":{"description":"The current state of the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED","allOf":[{"$ref":"#/components/schemas/ConversationStatus"}]},"lastAssignedOperatorId":{"type":"string","description":"The ID of the last assigned operator."},"lastSeen":{"type":"string","description":"Timestamp when the conversation was last seen."}},"required":["id","contactId","archived","channelId","channelType","chatbotId","idToken","language","operatorId","photoUrl","sessionCount","tags","unread","variables","created","updated","name","snoozed","lastUserAction","mentions","mentionsRead","environment","metadata","state"]},"ConversationBlockDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the block."},"name":{"type":"string","description":"The display name of the block."}},"required":["id","name"]},"ContentDto":{"type":"object","properties":{"text":{"type":"string","description":"The text content of the message."},"file":{"description":"A file attachment.","allOf":[{"$ref":"#/components/schemas/MessageContentFileDto"}]},"buttons":{"description":"Interactive buttons for the message.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonsDto"}]},"selectedButton":{"description":"The button selected by the user.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonReplyDto"}]},"template":{"description":"A message template.","allOf":[{"$ref":"#/components/schemas/MessageTemplateDto"}]},"location":{"description":"A location shared in the message.","allOf":[{"$ref":"#/components/schemas/MessageLocationDto"}]},"voiceHangup":{"description":"Voice hangup data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceHangupDto"}]},"voiceTransfer":{"description":"Voice transfer data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceTransferDto"}]},"agentHandover":{"description":"Agent handover data.","allOf":[{"$ref":"#/components/schemas/MessageAgentHandoverDto"}]},"email":{"description":"Email content data.","allOf":[{"$ref":"#/components/schemas/MessageContentEmailDto"}]},"textToSpeech":{"description":"Text-to-speech content data.","allOf":[{"$ref":"#/components/schemas/MessageContentTextToSpeechDto"}]},"metaWhatsappTemplate":{"description":"A Meta WhatsApp template message.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplateDto"}]},"operator":{"description":"Operator data for the message.","allOf":[{"$ref":"#/components/schemas/OperatorDto"}]},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."},"leadAiId":{"type":"string","description":"The ID of the Lead AI associated with this message."}}},"MessageContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, audio)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."},"caption":{"type":"string","description":"An optional caption for the file."},"transcript":{"type":"string","description":"The transcript of audio/video content."},"facebookAttachmentId":{"type":"string","description":"The Facebook attachment ID."},"whatsappAttachmentId":{"type":"string","description":"The WhatsApp attachment ID."},"instagramAttachmentId":{"type":"string","description":"The Instagram attachment ID."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageContentButtonsDto":{"type":"object","properties":{"buttons":{"description":"The list of buttons.","type":"array","items":{"$ref":"#/components/schemas/MessageContentButtonDto"}}},"required":["buttons"]},"MessageContentButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, postback)."},"value":{"type":"string","description":"The value associated with the button."},"payload":{"type":"string","description":"An optional payload for the button."}},"required":["label","type","value"]},"MessageContentButtonReplyDto":{"type":"object","properties":{"label":{"type":"string","description":"The label of the selected button."},"value":{"type":"string","description":"The value of the selected button."},"payload":{"type":"string","description":"An optional payload from the button."},"type":{"type":"string","description":"The type of the button."},"reference":{"type":"string","description":"The reference to the original button message."}},"required":["label","value","reference"]},"MessageTemplateDto":{"type":"object","properties":{"body":{"type":"string","description":"The body text of the template."},"header":{"type":"string","description":"The header text of the template."},"footer":{"type":"string","description":"The footer text of the template."}},"required":["body"]},"MessageLocationDto":{"type":"object","properties":{"latitude":{"type":"number","description":"The latitude coordinate."},"longitude":{"type":"number","description":"The longitude coordinate."}},"required":["latitude","longitude"]},"MessageVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for hanging up the call."},"headers":{"type":"object","description":"Custom SIP headers for the hangup.","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"MessageVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string","description":"The target phone number or SIP address for the transfer."},"reason":{"type":"string","description":"The reason for the transfer."},"headers":{"type":"object","description":"Custom SIP headers for the transfer.","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"MessageAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for the handover to an agent."},"timeoutSeconds":{"type":"number","description":"Timeout in seconds before the handover expires."},"agentId":{"type":"string","description":"The ID of the specific agent to hand over to."},"groupId":{"type":"string","description":"The ID of the agent group to hand over to."},"assignmentMethod":{"type":"string","description":"The method for assigning the agent (e.g., round_robin, least_busy)."}},"required":["reason"]},"MessageContentEmailDto":{"type":"object","properties":{"subject":{"type":"string","description":"The subject of the email."},"body":{"type":"string","description":"The body content of the email."},"from":{"type":"string","description":"The sender email address."},"to":{"description":"The list of recipient email addresses.","type":"array","items":{"type":"string"}},"cc":{"description":"The list of CC recipient email addresses.","type":"array","items":{"type":"string"}},"bcc":{"description":"The list of BCC recipient email addresses.","type":"array","items":{"type":"string"}},"attachmentIds":{"description":"The list of attachment IDs.","type":"array","items":{"type":"string"}},"references":{"description":"The list of email references for threading.","type":"array","items":{"type":"string"}}},"required":["subject","body","from","to","cc","bcc","attachmentIds","references"]},"MessageContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"string","description":"The text to be converted to speech."},"speech":{"type":"string","description":"Pre-generated speech audio reference."}},"required":["text"]},"MessageMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the template on Meta."},"language":{"type":"string","description":"The language code of the template."},"bodyText":{"type":"string","description":"The body text of the message. Placeholders are in the form `{{1}}`."},"headerText":{"type":"string","description":"The text in the header (if present)."},"footerText":{"type":"string","description":"The text in the footer (if present)."},"header":{"description":"The header component, which can contain a file or text parameters.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_HeaderDto"}]},"bodyParameters":{"description":"A list of values that replace the placeholders in the `bodyText`.","type":"array","items":{"type":"string"}},"buttons":{"description":"A list of buttons attached to the message.","type":"array","items":{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_ButtonDto"}}},"required":["templateName","language","bodyText","bodyParameters","buttons"]},"MessageMetaWhatsAppTemplate_HeaderDto":{"type":"object","properties":{"file":{"description":"The file attached to the header.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_Header_FileDto"}]},"parameters":{"description":"The list of parameter values for the header placeholders.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"MessageMetaWhatsAppTemplate_Header_FileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, video)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageMetaWhatsAppTemplate_ButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, quick_reply)."},"url":{"type":"string","description":"The URL for URL-type buttons."},"value":{"type":"string","description":"The value for quick_reply-type buttons."}},"required":["label","type"]},"OperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The unique identifier of the operator."}},"required":["operatorId"]},"ConversationNotesDto":{"type":"object","properties":{"notes":{"description":"List of notes attached to the conversation.","type":"array","items":{"type":"string"}}},"required":["notes"]},"ConversationUserInputDto":{"type":"object","properties":{"redirect":{"type":"string","description":"The redirect destination for user input."},"isSensitive":{"type":"boolean","description":"Whether the user input contains sensitive data."}},"required":["redirect"]},"ConversationLeadAiConversationDto":{"type":"object","properties":{"flowId":{"type":"string","description":"The ID of the flow being executed."},"stepId":{"type":"string","description":"The ID of the current step in the flow."},"interactions":{"type":"number","description":"The number of interactions in this conversation."},"executionId":{"type":"string","description":"The unique execution ID for this conversation flow."}},"required":["flowId","stepId","interactions","executionId"]},"ConversationTeamDto":{"type":"object","properties":{"teamId":{"type":"string","description":"The ID of the team assigned to this conversation."}},"required":["teamId"]},"ConversationStatus":{"type":"number","enum":[0,1,2,3,-1],"description":"The current state of the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED"}}}}
```

## The FindConversationResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"FindConversationResponseDto":{"type":"object","properties":{"conversation":{"description":"The found conversation.","allOf":[{"$ref":"#/components/schemas/ConversationDto"}]},"error":{"type":"string","description":"Optional error message."}}},"ConversationDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the conversation."},"contactId":{"type":"string","description":"The ID of the contact associated with this conversation."},"archived":{"type":"boolean","description":"Whether the conversation is archived."},"channelId":{"type":"string","description":"The ID of the channel for this conversation."},"channelType":{"type":"string","description":"The type of channel (e.g., web, whatsapp, telegram)."},"chatbotId":{"type":"string","description":"The ID of the chatbot handling this conversation."},"idToken":{"type":"string","description":"The ID token for this conversation."},"language":{"type":"string","description":"The language code of the conversation."},"operatorId":{"type":"string","description":"The ID of the assigned operator."},"photoUrl":{"type":"string","description":"The URL of the contact's photo."},"sessionCount":{"type":"number","description":"The number of sessions in this conversation."},"tags":{"description":"Tags associated with this conversation.","type":"array","items":{"type":"string"}},"unread":{"type":"boolean","description":"Whether the conversation has unread messages."},"variables":{"type":"object","description":"Custom variables for this conversation.","additionalProperties":{"type":"string"}},"lastBlock":{"description":"The last block visited in the flow.","allOf":[{"$ref":"#/components/schemas/ConversationBlockDto"}]},"lastButton":{"description":"The last button clicked by the user.","allOf":[{"$ref":"#/components/schemas/ConversationBlockDto"}]},"created":{"type":"string","description":"Timestamp when the conversation was created."},"updated":{"type":"string","description":"Timestamp when the conversation was last updated."},"providerId":{"type":"string","description":"The external provider ID for this conversation."},"name":{"type":"string","description":"The display name of the contact."},"lastMessage":{"description":"The content of the last message in the conversation.","allOf":[{"$ref":"#/components/schemas/ContentDto"}]},"snoozed":{"type":"string","description":"Timestamp until which the conversation is snoozed."},"lastUserAction":{"type":"string","description":"Timestamp of the last user action."},"mentions":{"description":"List of user IDs mentioned in this conversation.","type":"array","items":{"type":"string"}},"mentionsRead":{"type":"object","description":"Map of mentions to their read status.","additionalProperties":{"type":"boolean"}},"notes":{"description":"Notes attached to this conversation.","allOf":[{"$ref":"#/components/schemas/ConversationNotesDto"}]},"lastSender":{"type":"string","description":"The type of the last sender (user, bot, operator)."},"userInput":{"description":"Current user input state.","allOf":[{"$ref":"#/components/schemas/ConversationUserInputDto"}]},"environment":{"type":"string","description":"The environment.","enum":["dev","test","prod"]},"metadata":{"type":"object","description":"Custom metadata for this conversation.","additionalProperties":{"type":"string"}},"lastUserInput":{"type":"string","description":"The last user input text."},"leadAiConversation":{"description":"Lead AI conversation state.","allOf":[{"$ref":"#/components/schemas/ConversationLeadAiConversationDto"}]},"team":{"description":"The team assigned to this conversation.","allOf":[{"$ref":"#/components/schemas/ConversationTeamDto"}]},"state":{"description":"The current state of the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED","allOf":[{"$ref":"#/components/schemas/ConversationStatus"}]},"lastAssignedOperatorId":{"type":"string","description":"The ID of the last assigned operator."},"lastSeen":{"type":"string","description":"Timestamp when the conversation was last seen."}},"required":["id","contactId","archived","channelId","channelType","chatbotId","idToken","language","operatorId","photoUrl","sessionCount","tags","unread","variables","created","updated","name","snoozed","lastUserAction","mentions","mentionsRead","environment","metadata","state"]},"ConversationBlockDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the block."},"name":{"type":"string","description":"The display name of the block."}},"required":["id","name"]},"ContentDto":{"type":"object","properties":{"text":{"type":"string","description":"The text content of the message."},"file":{"description":"A file attachment.","allOf":[{"$ref":"#/components/schemas/MessageContentFileDto"}]},"buttons":{"description":"Interactive buttons for the message.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonsDto"}]},"selectedButton":{"description":"The button selected by the user.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonReplyDto"}]},"template":{"description":"A message template.","allOf":[{"$ref":"#/components/schemas/MessageTemplateDto"}]},"location":{"description":"A location shared in the message.","allOf":[{"$ref":"#/components/schemas/MessageLocationDto"}]},"voiceHangup":{"description":"Voice hangup data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceHangupDto"}]},"voiceTransfer":{"description":"Voice transfer data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceTransferDto"}]},"agentHandover":{"description":"Agent handover data.","allOf":[{"$ref":"#/components/schemas/MessageAgentHandoverDto"}]},"email":{"description":"Email content data.","allOf":[{"$ref":"#/components/schemas/MessageContentEmailDto"}]},"textToSpeech":{"description":"Text-to-speech content data.","allOf":[{"$ref":"#/components/schemas/MessageContentTextToSpeechDto"}]},"metaWhatsappTemplate":{"description":"A Meta WhatsApp template message.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplateDto"}]},"operator":{"description":"Operator data for the message.","allOf":[{"$ref":"#/components/schemas/OperatorDto"}]},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."},"leadAiId":{"type":"string","description":"The ID of the Lead AI associated with this message."}}},"MessageContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, audio)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."},"caption":{"type":"string","description":"An optional caption for the file."},"transcript":{"type":"string","description":"The transcript of audio/video content."},"facebookAttachmentId":{"type":"string","description":"The Facebook attachment ID."},"whatsappAttachmentId":{"type":"string","description":"The WhatsApp attachment ID."},"instagramAttachmentId":{"type":"string","description":"The Instagram attachment ID."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageContentButtonsDto":{"type":"object","properties":{"buttons":{"description":"The list of buttons.","type":"array","items":{"$ref":"#/components/schemas/MessageContentButtonDto"}}},"required":["buttons"]},"MessageContentButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, postback)."},"value":{"type":"string","description":"The value associated with the button."},"payload":{"type":"string","description":"An optional payload for the button."}},"required":["label","type","value"]},"MessageContentButtonReplyDto":{"type":"object","properties":{"label":{"type":"string","description":"The label of the selected button."},"value":{"type":"string","description":"The value of the selected button."},"payload":{"type":"string","description":"An optional payload from the button."},"type":{"type":"string","description":"The type of the button."},"reference":{"type":"string","description":"The reference to the original button message."}},"required":["label","value","reference"]},"MessageTemplateDto":{"type":"object","properties":{"body":{"type":"string","description":"The body text of the template."},"header":{"type":"string","description":"The header text of the template."},"footer":{"type":"string","description":"The footer text of the template."}},"required":["body"]},"MessageLocationDto":{"type":"object","properties":{"latitude":{"type":"number","description":"The latitude coordinate."},"longitude":{"type":"number","description":"The longitude coordinate."}},"required":["latitude","longitude"]},"MessageVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for hanging up the call."},"headers":{"type":"object","description":"Custom SIP headers for the hangup.","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"MessageVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string","description":"The target phone number or SIP address for the transfer."},"reason":{"type":"string","description":"The reason for the transfer."},"headers":{"type":"object","description":"Custom SIP headers for the transfer.","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"MessageAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for the handover to an agent."},"timeoutSeconds":{"type":"number","description":"Timeout in seconds before the handover expires."},"agentId":{"type":"string","description":"The ID of the specific agent to hand over to."},"groupId":{"type":"string","description":"The ID of the agent group to hand over to."},"assignmentMethod":{"type":"string","description":"The method for assigning the agent (e.g., round_robin, least_busy)."}},"required":["reason"]},"MessageContentEmailDto":{"type":"object","properties":{"subject":{"type":"string","description":"The subject of the email."},"body":{"type":"string","description":"The body content of the email."},"from":{"type":"string","description":"The sender email address."},"to":{"description":"The list of recipient email addresses.","type":"array","items":{"type":"string"}},"cc":{"description":"The list of CC recipient email addresses.","type":"array","items":{"type":"string"}},"bcc":{"description":"The list of BCC recipient email addresses.","type":"array","items":{"type":"string"}},"attachmentIds":{"description":"The list of attachment IDs.","type":"array","items":{"type":"string"}},"references":{"description":"The list of email references for threading.","type":"array","items":{"type":"string"}}},"required":["subject","body","from","to","cc","bcc","attachmentIds","references"]},"MessageContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"string","description":"The text to be converted to speech."},"speech":{"type":"string","description":"Pre-generated speech audio reference."}},"required":["text"]},"MessageMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the template on Meta."},"language":{"type":"string","description":"The language code of the template."},"bodyText":{"type":"string","description":"The body text of the message. Placeholders are in the form `{{1}}`."},"headerText":{"type":"string","description":"The text in the header (if present)."},"footerText":{"type":"string","description":"The text in the footer (if present)."},"header":{"description":"The header component, which can contain a file or text parameters.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_HeaderDto"}]},"bodyParameters":{"description":"A list of values that replace the placeholders in the `bodyText`.","type":"array","items":{"type":"string"}},"buttons":{"description":"A list of buttons attached to the message.","type":"array","items":{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_ButtonDto"}}},"required":["templateName","language","bodyText","bodyParameters","buttons"]},"MessageMetaWhatsAppTemplate_HeaderDto":{"type":"object","properties":{"file":{"description":"The file attached to the header.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_Header_FileDto"}]},"parameters":{"description":"The list of parameter values for the header placeholders.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"MessageMetaWhatsAppTemplate_Header_FileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, video)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageMetaWhatsAppTemplate_ButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, quick_reply)."},"url":{"type":"string","description":"The URL for URL-type buttons."},"value":{"type":"string","description":"The value for quick_reply-type buttons."}},"required":["label","type"]},"OperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The unique identifier of the operator."}},"required":["operatorId"]},"ConversationNotesDto":{"type":"object","properties":{"notes":{"description":"List of notes attached to the conversation.","type":"array","items":{"type":"string"}}},"required":["notes"]},"ConversationUserInputDto":{"type":"object","properties":{"redirect":{"type":"string","description":"The redirect destination for user input."},"isSensitive":{"type":"boolean","description":"Whether the user input contains sensitive data."}},"required":["redirect"]},"ConversationLeadAiConversationDto":{"type":"object","properties":{"flowId":{"type":"string","description":"The ID of the flow being executed."},"stepId":{"type":"string","description":"The ID of the current step in the flow."},"interactions":{"type":"number","description":"The number of interactions in this conversation."},"executionId":{"type":"string","description":"The unique execution ID for this conversation flow."}},"required":["flowId","stepId","interactions","executionId"]},"ConversationTeamDto":{"type":"object","properties":{"teamId":{"type":"string","description":"The ID of the team assigned to this conversation."}},"required":["teamId"]},"ConversationStatus":{"type":"number","enum":[0,1,2,3,-1],"description":"The current state of the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED"}}}}
```

## The ConversationResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ConversationResponseDto":{"type":"object","properties":{"conversation":{"description":"The conversation.","allOf":[{"$ref":"#/components/schemas/ConversationDto"}]},"error":{"type":"string","description":"Optional error message."}}},"ConversationDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the conversation."},"contactId":{"type":"string","description":"The ID of the contact associated with this conversation."},"archived":{"type":"boolean","description":"Whether the conversation is archived."},"channelId":{"type":"string","description":"The ID of the channel for this conversation."},"channelType":{"type":"string","description":"The type of channel (e.g., web, whatsapp, telegram)."},"chatbotId":{"type":"string","description":"The ID of the chatbot handling this conversation."},"idToken":{"type":"string","description":"The ID token for this conversation."},"language":{"type":"string","description":"The language code of the conversation."},"operatorId":{"type":"string","description":"The ID of the assigned operator."},"photoUrl":{"type":"string","description":"The URL of the contact's photo."},"sessionCount":{"type":"number","description":"The number of sessions in this conversation."},"tags":{"description":"Tags associated with this conversation.","type":"array","items":{"type":"string"}},"unread":{"type":"boolean","description":"Whether the conversation has unread messages."},"variables":{"type":"object","description":"Custom variables for this conversation.","additionalProperties":{"type":"string"}},"lastBlock":{"description":"The last block visited in the flow.","allOf":[{"$ref":"#/components/schemas/ConversationBlockDto"}]},"lastButton":{"description":"The last button clicked by the user.","allOf":[{"$ref":"#/components/schemas/ConversationBlockDto"}]},"created":{"type":"string","description":"Timestamp when the conversation was created."},"updated":{"type":"string","description":"Timestamp when the conversation was last updated."},"providerId":{"type":"string","description":"The external provider ID for this conversation."},"name":{"type":"string","description":"The display name of the contact."},"lastMessage":{"description":"The content of the last message in the conversation.","allOf":[{"$ref":"#/components/schemas/ContentDto"}]},"snoozed":{"type":"string","description":"Timestamp until which the conversation is snoozed."},"lastUserAction":{"type":"string","description":"Timestamp of the last user action."},"mentions":{"description":"List of user IDs mentioned in this conversation.","type":"array","items":{"type":"string"}},"mentionsRead":{"type":"object","description":"Map of mentions to their read status.","additionalProperties":{"type":"boolean"}},"notes":{"description":"Notes attached to this conversation.","allOf":[{"$ref":"#/components/schemas/ConversationNotesDto"}]},"lastSender":{"type":"string","description":"The type of the last sender (user, bot, operator)."},"userInput":{"description":"Current user input state.","allOf":[{"$ref":"#/components/schemas/ConversationUserInputDto"}]},"environment":{"type":"string","description":"The environment.","enum":["dev","test","prod"]},"metadata":{"type":"object","description":"Custom metadata for this conversation.","additionalProperties":{"type":"string"}},"lastUserInput":{"type":"string","description":"The last user input text."},"leadAiConversation":{"description":"Lead AI conversation state.","allOf":[{"$ref":"#/components/schemas/ConversationLeadAiConversationDto"}]},"team":{"description":"The team assigned to this conversation.","allOf":[{"$ref":"#/components/schemas/ConversationTeamDto"}]},"state":{"description":"The current state of the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED","allOf":[{"$ref":"#/components/schemas/ConversationStatus"}]},"lastAssignedOperatorId":{"type":"string","description":"The ID of the last assigned operator."},"lastSeen":{"type":"string","description":"Timestamp when the conversation was last seen."}},"required":["id","contactId","archived","channelId","channelType","chatbotId","idToken","language","operatorId","photoUrl","sessionCount","tags","unread","variables","created","updated","name","snoozed","lastUserAction","mentions","mentionsRead","environment","metadata","state"]},"ConversationBlockDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the block."},"name":{"type":"string","description":"The display name of the block."}},"required":["id","name"]},"ContentDto":{"type":"object","properties":{"text":{"type":"string","description":"The text content of the message."},"file":{"description":"A file attachment.","allOf":[{"$ref":"#/components/schemas/MessageContentFileDto"}]},"buttons":{"description":"Interactive buttons for the message.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonsDto"}]},"selectedButton":{"description":"The button selected by the user.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonReplyDto"}]},"template":{"description":"A message template.","allOf":[{"$ref":"#/components/schemas/MessageTemplateDto"}]},"location":{"description":"A location shared in the message.","allOf":[{"$ref":"#/components/schemas/MessageLocationDto"}]},"voiceHangup":{"description":"Voice hangup data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceHangupDto"}]},"voiceTransfer":{"description":"Voice transfer data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceTransferDto"}]},"agentHandover":{"description":"Agent handover data.","allOf":[{"$ref":"#/components/schemas/MessageAgentHandoverDto"}]},"email":{"description":"Email content data.","allOf":[{"$ref":"#/components/schemas/MessageContentEmailDto"}]},"textToSpeech":{"description":"Text-to-speech content data.","allOf":[{"$ref":"#/components/schemas/MessageContentTextToSpeechDto"}]},"metaWhatsappTemplate":{"description":"A Meta WhatsApp template message.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplateDto"}]},"operator":{"description":"Operator data for the message.","allOf":[{"$ref":"#/components/schemas/OperatorDto"}]},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."},"leadAiId":{"type":"string","description":"The ID of the Lead AI associated with this message."}}},"MessageContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, audio)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."},"caption":{"type":"string","description":"An optional caption for the file."},"transcript":{"type":"string","description":"The transcript of audio/video content."},"facebookAttachmentId":{"type":"string","description":"The Facebook attachment ID."},"whatsappAttachmentId":{"type":"string","description":"The WhatsApp attachment ID."},"instagramAttachmentId":{"type":"string","description":"The Instagram attachment ID."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageContentButtonsDto":{"type":"object","properties":{"buttons":{"description":"The list of buttons.","type":"array","items":{"$ref":"#/components/schemas/MessageContentButtonDto"}}},"required":["buttons"]},"MessageContentButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, postback)."},"value":{"type":"string","description":"The value associated with the button."},"payload":{"type":"string","description":"An optional payload for the button."}},"required":["label","type","value"]},"MessageContentButtonReplyDto":{"type":"object","properties":{"label":{"type":"string","description":"The label of the selected button."},"value":{"type":"string","description":"The value of the selected button."},"payload":{"type":"string","description":"An optional payload from the button."},"type":{"type":"string","description":"The type of the button."},"reference":{"type":"string","description":"The reference to the original button message."}},"required":["label","value","reference"]},"MessageTemplateDto":{"type":"object","properties":{"body":{"type":"string","description":"The body text of the template."},"header":{"type":"string","description":"The header text of the template."},"footer":{"type":"string","description":"The footer text of the template."}},"required":["body"]},"MessageLocationDto":{"type":"object","properties":{"latitude":{"type":"number","description":"The latitude coordinate."},"longitude":{"type":"number","description":"The longitude coordinate."}},"required":["latitude","longitude"]},"MessageVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for hanging up the call."},"headers":{"type":"object","description":"Custom SIP headers for the hangup.","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"MessageVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string","description":"The target phone number or SIP address for the transfer."},"reason":{"type":"string","description":"The reason for the transfer."},"headers":{"type":"object","description":"Custom SIP headers for the transfer.","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"MessageAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for the handover to an agent."},"timeoutSeconds":{"type":"number","description":"Timeout in seconds before the handover expires."},"agentId":{"type":"string","description":"The ID of the specific agent to hand over to."},"groupId":{"type":"string","description":"The ID of the agent group to hand over to."},"assignmentMethod":{"type":"string","description":"The method for assigning the agent (e.g., round_robin, least_busy)."}},"required":["reason"]},"MessageContentEmailDto":{"type":"object","properties":{"subject":{"type":"string","description":"The subject of the email."},"body":{"type":"string","description":"The body content of the email."},"from":{"type":"string","description":"The sender email address."},"to":{"description":"The list of recipient email addresses.","type":"array","items":{"type":"string"}},"cc":{"description":"The list of CC recipient email addresses.","type":"array","items":{"type":"string"}},"bcc":{"description":"The list of BCC recipient email addresses.","type":"array","items":{"type":"string"}},"attachmentIds":{"description":"The list of attachment IDs.","type":"array","items":{"type":"string"}},"references":{"description":"The list of email references for threading.","type":"array","items":{"type":"string"}}},"required":["subject","body","from","to","cc","bcc","attachmentIds","references"]},"MessageContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"string","description":"The text to be converted to speech."},"speech":{"type":"string","description":"Pre-generated speech audio reference."}},"required":["text"]},"MessageMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the template on Meta."},"language":{"type":"string","description":"The language code of the template."},"bodyText":{"type":"string","description":"The body text of the message. Placeholders are in the form `{{1}}`."},"headerText":{"type":"string","description":"The text in the header (if present)."},"footerText":{"type":"string","description":"The text in the footer (if present)."},"header":{"description":"The header component, which can contain a file or text parameters.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_HeaderDto"}]},"bodyParameters":{"description":"A list of values that replace the placeholders in the `bodyText`.","type":"array","items":{"type":"string"}},"buttons":{"description":"A list of buttons attached to the message.","type":"array","items":{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_ButtonDto"}}},"required":["templateName","language","bodyText","bodyParameters","buttons"]},"MessageMetaWhatsAppTemplate_HeaderDto":{"type":"object","properties":{"file":{"description":"The file attached to the header.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_Header_FileDto"}]},"parameters":{"description":"The list of parameter values for the header placeholders.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"MessageMetaWhatsAppTemplate_Header_FileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, video)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageMetaWhatsAppTemplate_ButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, quick_reply)."},"url":{"type":"string","description":"The URL for URL-type buttons."},"value":{"type":"string","description":"The value for quick_reply-type buttons."}},"required":["label","type"]},"OperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The unique identifier of the operator."}},"required":["operatorId"]},"ConversationNotesDto":{"type":"object","properties":{"notes":{"description":"List of notes attached to the conversation.","type":"array","items":{"type":"string"}}},"required":["notes"]},"ConversationUserInputDto":{"type":"object","properties":{"redirect":{"type":"string","description":"The redirect destination for user input."},"isSensitive":{"type":"boolean","description":"Whether the user input contains sensitive data."}},"required":["redirect"]},"ConversationLeadAiConversationDto":{"type":"object","properties":{"flowId":{"type":"string","description":"The ID of the flow being executed."},"stepId":{"type":"string","description":"The ID of the current step in the flow."},"interactions":{"type":"number","description":"The number of interactions in this conversation."},"executionId":{"type":"string","description":"The unique execution ID for this conversation flow."}},"required":["flowId","stepId","interactions","executionId"]},"ConversationTeamDto":{"type":"object","properties":{"teamId":{"type":"string","description":"The ID of the team assigned to this conversation."}},"required":["teamId"]},"ConversationStatus":{"type":"number","enum":[0,1,2,3,-1],"description":"The current state of the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED"}}}}
```

## The CreateConversationTagsDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateConversationTagsDto":{"type":"object","properties":{"tags":{"description":"List of tags to attach to the conversation.","type":"array","items":{"type":"string"}}},"required":["tags"]}}}}
```

## The CreateConversationNotesDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateConversationNotesDto":{"type":"object","properties":{"notes":{"description":"List of notes to attach to the conversation.","type":"array","items":{"type":"string"}}},"required":["notes"]}}}}
```

## The CreateConversationMentionsDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateConversationMentionsDto":{"type":"object","properties":{"mentions":{"description":"List of user IDs to mention in the conversation.","type":"array","items":{"type":"string"}}},"required":["mentions"]}}}}
```

## The CreateConversationDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateConversationDto":{"type":"object","properties":{"contactId":{"type":"string","description":"The ID of the contact for this conversation."},"channelId":{"type":"string","description":"The ID of the channel for this conversation."},"channelType":{"type":"string","description":"The type of channel.","enum":["facebook","voice","audiocodes","web","meta-whatsapp","telegram","brevo","email","debug"]},"name":{"type":"string","description":"The display name of the contact."},"environment":{"type":"string","description":"The environment.","enum":["dev","test","prod"]},"providerId":{"type":"string","description":"The external provider ID for this conversation."},"unread":{"type":"boolean","description":"Whether the conversation has unread messages."},"archived":{"type":"boolean","description":"Whether the conversation is archived."},"tags":{"description":"Tags to attach to the conversation.","allOf":[{"$ref":"#/components/schemas/CreateConversationTagsDto"}]},"notes":{"description":"Notes to attach to the conversation.","allOf":[{"$ref":"#/components/schemas/CreateConversationNotesDto"}]},"lastMessage":{"description":"The content of the last message.","allOf":[{"$ref":"#/components/schemas/ContentDto"}]},"operatorId":{"type":"string","description":"The ID of the assigned operator."},"snoozed":{"type":"string","description":"Timestamp until which the conversation is snoozed."},"lastUserAction":{"type":"string","description":"Timestamp of the last user action."},"lastSender":{"type":"string","description":"The type of the last sender (user, bot, operator)."},"mentions":{"description":"User mentions for this conversation.","allOf":[{"$ref":"#/components/schemas/CreateConversationMentionsDto"}]},"metadata":{"type":"object","description":"Custom metadata for this conversation.","additionalProperties":{"type":"string"}},"language":{"type":"string","description":"The language code of the conversation."},"lastAssignedOperatorId":{"type":"string","description":"The ID of the last assigned operator."},"lastSeen":{"type":"string","description":"Timestamp when the conversation was last seen."}},"required":["contactId","channelId","channelType","name","environment"]},"CreateConversationTagsDto":{"type":"object","properties":{"tags":{"description":"List of tags to attach to the conversation.","type":"array","items":{"type":"string"}}},"required":["tags"]},"CreateConversationNotesDto":{"type":"object","properties":{"notes":{"description":"List of notes to attach to the conversation.","type":"array","items":{"type":"string"}}},"required":["notes"]},"ContentDto":{"type":"object","properties":{"text":{"type":"string","description":"The text content of the message."},"file":{"description":"A file attachment.","allOf":[{"$ref":"#/components/schemas/MessageContentFileDto"}]},"buttons":{"description":"Interactive buttons for the message.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonsDto"}]},"selectedButton":{"description":"The button selected by the user.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonReplyDto"}]},"template":{"description":"A message template.","allOf":[{"$ref":"#/components/schemas/MessageTemplateDto"}]},"location":{"description":"A location shared in the message.","allOf":[{"$ref":"#/components/schemas/MessageLocationDto"}]},"voiceHangup":{"description":"Voice hangup data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceHangupDto"}]},"voiceTransfer":{"description":"Voice transfer data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceTransferDto"}]},"agentHandover":{"description":"Agent handover data.","allOf":[{"$ref":"#/components/schemas/MessageAgentHandoverDto"}]},"email":{"description":"Email content data.","allOf":[{"$ref":"#/components/schemas/MessageContentEmailDto"}]},"textToSpeech":{"description":"Text-to-speech content data.","allOf":[{"$ref":"#/components/schemas/MessageContentTextToSpeechDto"}]},"metaWhatsappTemplate":{"description":"A Meta WhatsApp template message.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplateDto"}]},"operator":{"description":"Operator data for the message.","allOf":[{"$ref":"#/components/schemas/OperatorDto"}]},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."},"leadAiId":{"type":"string","description":"The ID of the Lead AI associated with this message."}}},"MessageContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, audio)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."},"caption":{"type":"string","description":"An optional caption for the file."},"transcript":{"type":"string","description":"The transcript of audio/video content."},"facebookAttachmentId":{"type":"string","description":"The Facebook attachment ID."},"whatsappAttachmentId":{"type":"string","description":"The WhatsApp attachment ID."},"instagramAttachmentId":{"type":"string","description":"The Instagram attachment ID."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageContentButtonsDto":{"type":"object","properties":{"buttons":{"description":"The list of buttons.","type":"array","items":{"$ref":"#/components/schemas/MessageContentButtonDto"}}},"required":["buttons"]},"MessageContentButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, postback)."},"value":{"type":"string","description":"The value associated with the button."},"payload":{"type":"string","description":"An optional payload for the button."}},"required":["label","type","value"]},"MessageContentButtonReplyDto":{"type":"object","properties":{"label":{"type":"string","description":"The label of the selected button."},"value":{"type":"string","description":"The value of the selected button."},"payload":{"type":"string","description":"An optional payload from the button."},"type":{"type":"string","description":"The type of the button."},"reference":{"type":"string","description":"The reference to the original button message."}},"required":["label","value","reference"]},"MessageTemplateDto":{"type":"object","properties":{"body":{"type":"string","description":"The body text of the template."},"header":{"type":"string","description":"The header text of the template."},"footer":{"type":"string","description":"The footer text of the template."}},"required":["body"]},"MessageLocationDto":{"type":"object","properties":{"latitude":{"type":"number","description":"The latitude coordinate."},"longitude":{"type":"number","description":"The longitude coordinate."}},"required":["latitude","longitude"]},"MessageVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for hanging up the call."},"headers":{"type":"object","description":"Custom SIP headers for the hangup.","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"MessageVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string","description":"The target phone number or SIP address for the transfer."},"reason":{"type":"string","description":"The reason for the transfer."},"headers":{"type":"object","description":"Custom SIP headers for the transfer.","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"MessageAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for the handover to an agent."},"timeoutSeconds":{"type":"number","description":"Timeout in seconds before the handover expires."},"agentId":{"type":"string","description":"The ID of the specific agent to hand over to."},"groupId":{"type":"string","description":"The ID of the agent group to hand over to."},"assignmentMethod":{"type":"string","description":"The method for assigning the agent (e.g., round_robin, least_busy)."}},"required":["reason"]},"MessageContentEmailDto":{"type":"object","properties":{"subject":{"type":"string","description":"The subject of the email."},"body":{"type":"string","description":"The body content of the email."},"from":{"type":"string","description":"The sender email address."},"to":{"description":"The list of recipient email addresses.","type":"array","items":{"type":"string"}},"cc":{"description":"The list of CC recipient email addresses.","type":"array","items":{"type":"string"}},"bcc":{"description":"The list of BCC recipient email addresses.","type":"array","items":{"type":"string"}},"attachmentIds":{"description":"The list of attachment IDs.","type":"array","items":{"type":"string"}},"references":{"description":"The list of email references for threading.","type":"array","items":{"type":"string"}}},"required":["subject","body","from","to","cc","bcc","attachmentIds","references"]},"MessageContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"string","description":"The text to be converted to speech."},"speech":{"type":"string","description":"Pre-generated speech audio reference."}},"required":["text"]},"MessageMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the template on Meta."},"language":{"type":"string","description":"The language code of the template."},"bodyText":{"type":"string","description":"The body text of the message. Placeholders are in the form `{{1}}`."},"headerText":{"type":"string","description":"The text in the header (if present)."},"footerText":{"type":"string","description":"The text in the footer (if present)."},"header":{"description":"The header component, which can contain a file or text parameters.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_HeaderDto"}]},"bodyParameters":{"description":"A list of values that replace the placeholders in the `bodyText`.","type":"array","items":{"type":"string"}},"buttons":{"description":"A list of buttons attached to the message.","type":"array","items":{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_ButtonDto"}}},"required":["templateName","language","bodyText","bodyParameters","buttons"]},"MessageMetaWhatsAppTemplate_HeaderDto":{"type":"object","properties":{"file":{"description":"The file attached to the header.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_Header_FileDto"}]},"parameters":{"description":"The list of parameter values for the header placeholders.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"MessageMetaWhatsAppTemplate_Header_FileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, video)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageMetaWhatsAppTemplate_ButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, quick_reply)."},"url":{"type":"string","description":"The URL for URL-type buttons."},"value":{"type":"string","description":"The value for quick_reply-type buttons."}},"required":["label","type"]},"OperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The unique identifier of the operator."}},"required":["operatorId"]},"CreateConversationMentionsDto":{"type":"object","properties":{"mentions":{"description":"List of user IDs to mention in the conversation.","type":"array","items":{"type":"string"}}},"required":["mentions"]}}}}
```

## The CreateConversationRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateConversationRequestDto":{"type":"object","properties":{"conversation":{"description":"The conversation data to create.","allOf":[{"$ref":"#/components/schemas/CreateConversationDto"}]}},"required":["conversation"]},"CreateConversationDto":{"type":"object","properties":{"contactId":{"type":"string","description":"The ID of the contact for this conversation."},"channelId":{"type":"string","description":"The ID of the channel for this conversation."},"channelType":{"type":"string","description":"The type of channel.","enum":["facebook","voice","audiocodes","web","meta-whatsapp","telegram","brevo","email","debug"]},"name":{"type":"string","description":"The display name of the contact."},"environment":{"type":"string","description":"The environment.","enum":["dev","test","prod"]},"providerId":{"type":"string","description":"The external provider ID for this conversation."},"unread":{"type":"boolean","description":"Whether the conversation has unread messages."},"archived":{"type":"boolean","description":"Whether the conversation is archived."},"tags":{"description":"Tags to attach to the conversation.","allOf":[{"$ref":"#/components/schemas/CreateConversationTagsDto"}]},"notes":{"description":"Notes to attach to the conversation.","allOf":[{"$ref":"#/components/schemas/CreateConversationNotesDto"}]},"lastMessage":{"description":"The content of the last message.","allOf":[{"$ref":"#/components/schemas/ContentDto"}]},"operatorId":{"type":"string","description":"The ID of the assigned operator."},"snoozed":{"type":"string","description":"Timestamp until which the conversation is snoozed."},"lastUserAction":{"type":"string","description":"Timestamp of the last user action."},"lastSender":{"type":"string","description":"The type of the last sender (user, bot, operator)."},"mentions":{"description":"User mentions for this conversation.","allOf":[{"$ref":"#/components/schemas/CreateConversationMentionsDto"}]},"metadata":{"type":"object","description":"Custom metadata for this conversation.","additionalProperties":{"type":"string"}},"language":{"type":"string","description":"The language code of the conversation."},"lastAssignedOperatorId":{"type":"string","description":"The ID of the last assigned operator."},"lastSeen":{"type":"string","description":"Timestamp when the conversation was last seen."}},"required":["contactId","channelId","channelType","name","environment"]},"CreateConversationTagsDto":{"type":"object","properties":{"tags":{"description":"List of tags to attach to the conversation.","type":"array","items":{"type":"string"}}},"required":["tags"]},"CreateConversationNotesDto":{"type":"object","properties":{"notes":{"description":"List of notes to attach to the conversation.","type":"array","items":{"type":"string"}}},"required":["notes"]},"ContentDto":{"type":"object","properties":{"text":{"type":"string","description":"The text content of the message."},"file":{"description":"A file attachment.","allOf":[{"$ref":"#/components/schemas/MessageContentFileDto"}]},"buttons":{"description":"Interactive buttons for the message.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonsDto"}]},"selectedButton":{"description":"The button selected by the user.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonReplyDto"}]},"template":{"description":"A message template.","allOf":[{"$ref":"#/components/schemas/MessageTemplateDto"}]},"location":{"description":"A location shared in the message.","allOf":[{"$ref":"#/components/schemas/MessageLocationDto"}]},"voiceHangup":{"description":"Voice hangup data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceHangupDto"}]},"voiceTransfer":{"description":"Voice transfer data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceTransferDto"}]},"agentHandover":{"description":"Agent handover data.","allOf":[{"$ref":"#/components/schemas/MessageAgentHandoverDto"}]},"email":{"description":"Email content data.","allOf":[{"$ref":"#/components/schemas/MessageContentEmailDto"}]},"textToSpeech":{"description":"Text-to-speech content data.","allOf":[{"$ref":"#/components/schemas/MessageContentTextToSpeechDto"}]},"metaWhatsappTemplate":{"description":"A Meta WhatsApp template message.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplateDto"}]},"operator":{"description":"Operator data for the message.","allOf":[{"$ref":"#/components/schemas/OperatorDto"}]},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."},"leadAiId":{"type":"string","description":"The ID of the Lead AI associated with this message."}}},"MessageContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, audio)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."},"caption":{"type":"string","description":"An optional caption for the file."},"transcript":{"type":"string","description":"The transcript of audio/video content."},"facebookAttachmentId":{"type":"string","description":"The Facebook attachment ID."},"whatsappAttachmentId":{"type":"string","description":"The WhatsApp attachment ID."},"instagramAttachmentId":{"type":"string","description":"The Instagram attachment ID."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageContentButtonsDto":{"type":"object","properties":{"buttons":{"description":"The list of buttons.","type":"array","items":{"$ref":"#/components/schemas/MessageContentButtonDto"}}},"required":["buttons"]},"MessageContentButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, postback)."},"value":{"type":"string","description":"The value associated with the button."},"payload":{"type":"string","description":"An optional payload for the button."}},"required":["label","type","value"]},"MessageContentButtonReplyDto":{"type":"object","properties":{"label":{"type":"string","description":"The label of the selected button."},"value":{"type":"string","description":"The value of the selected button."},"payload":{"type":"string","description":"An optional payload from the button."},"type":{"type":"string","description":"The type of the button."},"reference":{"type":"string","description":"The reference to the original button message."}},"required":["label","value","reference"]},"MessageTemplateDto":{"type":"object","properties":{"body":{"type":"string","description":"The body text of the template."},"header":{"type":"string","description":"The header text of the template."},"footer":{"type":"string","description":"The footer text of the template."}},"required":["body"]},"MessageLocationDto":{"type":"object","properties":{"latitude":{"type":"number","description":"The latitude coordinate."},"longitude":{"type":"number","description":"The longitude coordinate."}},"required":["latitude","longitude"]},"MessageVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for hanging up the call."},"headers":{"type":"object","description":"Custom SIP headers for the hangup.","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"MessageVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string","description":"The target phone number or SIP address for the transfer."},"reason":{"type":"string","description":"The reason for the transfer."},"headers":{"type":"object","description":"Custom SIP headers for the transfer.","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"MessageAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for the handover to an agent."},"timeoutSeconds":{"type":"number","description":"Timeout in seconds before the handover expires."},"agentId":{"type":"string","description":"The ID of the specific agent to hand over to."},"groupId":{"type":"string","description":"The ID of the agent group to hand over to."},"assignmentMethod":{"type":"string","description":"The method for assigning the agent (e.g., round_robin, least_busy)."}},"required":["reason"]},"MessageContentEmailDto":{"type":"object","properties":{"subject":{"type":"string","description":"The subject of the email."},"body":{"type":"string","description":"The body content of the email."},"from":{"type":"string","description":"The sender email address."},"to":{"description":"The list of recipient email addresses.","type":"array","items":{"type":"string"}},"cc":{"description":"The list of CC recipient email addresses.","type":"array","items":{"type":"string"}},"bcc":{"description":"The list of BCC recipient email addresses.","type":"array","items":{"type":"string"}},"attachmentIds":{"description":"The list of attachment IDs.","type":"array","items":{"type":"string"}},"references":{"description":"The list of email references for threading.","type":"array","items":{"type":"string"}}},"required":["subject","body","from","to","cc","bcc","attachmentIds","references"]},"MessageContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"string","description":"The text to be converted to speech."},"speech":{"type":"string","description":"Pre-generated speech audio reference."}},"required":["text"]},"MessageMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the template on Meta."},"language":{"type":"string","description":"The language code of the template."},"bodyText":{"type":"string","description":"The body text of the message. Placeholders are in the form `{{1}}`."},"headerText":{"type":"string","description":"The text in the header (if present)."},"footerText":{"type":"string","description":"The text in the footer (if present)."},"header":{"description":"The header component, which can contain a file or text parameters.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_HeaderDto"}]},"bodyParameters":{"description":"A list of values that replace the placeholders in the `bodyText`.","type":"array","items":{"type":"string"}},"buttons":{"description":"A list of buttons attached to the message.","type":"array","items":{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_ButtonDto"}}},"required":["templateName","language","bodyText","bodyParameters","buttons"]},"MessageMetaWhatsAppTemplate_HeaderDto":{"type":"object","properties":{"file":{"description":"The file attached to the header.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_Header_FileDto"}]},"parameters":{"description":"The list of parameter values for the header placeholders.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"MessageMetaWhatsAppTemplate_Header_FileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, video)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageMetaWhatsAppTemplate_ButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, quick_reply)."},"url":{"type":"string","description":"The URL for URL-type buttons."},"value":{"type":"string","description":"The value for quick_reply-type buttons."}},"required":["label","type"]},"OperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The unique identifier of the operator."}},"required":["operatorId"]},"CreateConversationMentionsDto":{"type":"object","properties":{"mentions":{"description":"List of user IDs to mention in the conversation.","type":"array","items":{"type":"string"}}},"required":["mentions"]}}}}
```

## The UpdateConversation\_TagsDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateConversation_TagsDto":{"type":"object","properties":{"tags":{"description":"The tags to set on the conversation.","type":"array","items":{"type":"string"}}},"required":["tags"]}}}}
```

## The ConversationButtonDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ConversationButtonDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the button."},"text":{"type":"string","description":"The display text of the button."},"value":{"type":"string","description":"The value sent when the button is clicked."}},"required":["id"]}}}}
```

## The UpdateConversation\_NotesDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateConversation_NotesDto":{"type":"object","properties":{"notes":{"description":"The notes to set on the conversation.","type":"array","items":{"type":"string"}}},"required":["notes"]}}}}
```

## The UpdateConversation\_MentionsDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateConversation_MentionsDto":{"type":"object","properties":{"mentions":{"description":"The user IDs to mention in the conversation.","type":"array","items":{"type":"string"}}},"required":["mentions"]}}}}
```

## The UpdateConversation\_UserInputDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateConversation_UserInputDto":{"type":"object","properties":{"redirect":{"type":"string","description":"The redirect destination for user input."},"isSensitive":{"type":"boolean","description":"Whether the user input contains sensitive data."}},"required":["redirect"]}}}}
```

## The UpdateConversation\_MetadataDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateConversation_MetadataDto":{"type":"object","properties":{"metadata":{"type":"object","description":"The metadata to set on the conversation.","additionalProperties":{"type":"string"}}},"required":["metadata"]}}}}
```

## The UpdateConversation\_LeadAiConversationDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateConversation_LeadAiConversationDto":{"type":"object","properties":{"flowId":{"type":"string","description":"The ID of the flow being executed."},"stepId":{"type":"string","description":"The ID of the current step in the flow."},"interactions":{"type":"number","description":"The number of interactions in this conversation."},"executionId":{"type":"string","description":"The unique execution ID for this conversation flow."}},"required":["flowId","stepId","interactions","executionId"]}}}}
```

## The UpdateConversation\_ConversationTeamDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateConversation_ConversationTeamDto":{"type":"object","properties":{"teamId":{"type":"string","description":"The ID of the team to assign to this conversation."}},"required":["teamId"]}}}}
```

## The UpdateConversationDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateConversationDto":{"type":"object","properties":{"contactId":{"type":"string","description":"The new contact ID."},"archived":{"type":"boolean","description":"Whether to archive the conversation."},"idToken":{"type":"string","description":"The new ID token."},"language":{"type":"string","description":"The new language code."},"operatorId":{"type":"string","description":"The new assigned operator ID."},"photoUrl":{"type":"string","description":"The new photo URL for the contact."},"sessionCount":{"type":"number","description":"The new session count."},"tags":{"description":"Tags to set on the conversation.","allOf":[{"$ref":"#/components/schemas/UpdateConversation_TagsDto"}]},"unread":{"type":"boolean","description":"Whether the conversation has unread messages."},"lastBlock":{"description":"The last visited block in the flow.","allOf":[{"$ref":"#/components/schemas/ConversationBlockDto"}]},"lastButton":{"description":"The last clicked button.","allOf":[{"$ref":"#/components/schemas/ConversationButtonDto"}]},"providerId":{"type":"string","description":"The new external provider ID."},"lastMessage":{"description":"The content of the last message.","allOf":[{"$ref":"#/components/schemas/ContentDto"}]},"notes":{"description":"Notes to set on the conversation.","allOf":[{"$ref":"#/components/schemas/UpdateConversation_NotesDto"}]},"snoozed":{"type":"string","description":"Timestamp until which the conversation is snoozed."},"lastUserAction":{"type":"string","description":"Timestamp of the last user action."},"mentions":{"description":"User mentions to set on the conversation.","allOf":[{"$ref":"#/components/schemas/UpdateConversation_MentionsDto"}]},"lastSender":{"type":"string","description":"The type of the last sender (user, bot, operator)."},"name":{"type":"string","description":"The new display name of the contact."},"userInput":{"description":"The user input state.","allOf":[{"$ref":"#/components/schemas/UpdateConversation_UserInputDto"}]},"metadata":{"description":"Metadata to set on the conversation.","allOf":[{"$ref":"#/components/schemas/UpdateConversation_MetadataDto"}]},"leadAiConversation":{"description":"Lead AI conversation state.","allOf":[{"$ref":"#/components/schemas/UpdateConversation_LeadAiConversationDto"}]},"team":{"description":"The team to assign to this conversation.","allOf":[{"$ref":"#/components/schemas/UpdateConversation_ConversationTeamDto"}]},"lastUserInput":{"type":"string","description":"The last user input text."},"state":{"description":"The new conversation state.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED","allOf":[{"$ref":"#/components/schemas/ConversationStatus"}]},"lastAssignedOperatorId":{"type":"string","description":"The ID of the last assigned operator."},"lastSeen":{"type":"string","description":"Timestamp when the conversation was last seen."}}},"UpdateConversation_TagsDto":{"type":"object","properties":{"tags":{"description":"The tags to set on the conversation.","type":"array","items":{"type":"string"}}},"required":["tags"]},"ConversationBlockDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the block."},"name":{"type":"string","description":"The display name of the block."}},"required":["id","name"]},"ConversationButtonDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the button."},"text":{"type":"string","description":"The display text of the button."},"value":{"type":"string","description":"The value sent when the button is clicked."}},"required":["id"]},"ContentDto":{"type":"object","properties":{"text":{"type":"string","description":"The text content of the message."},"file":{"description":"A file attachment.","allOf":[{"$ref":"#/components/schemas/MessageContentFileDto"}]},"buttons":{"description":"Interactive buttons for the message.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonsDto"}]},"selectedButton":{"description":"The button selected by the user.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonReplyDto"}]},"template":{"description":"A message template.","allOf":[{"$ref":"#/components/schemas/MessageTemplateDto"}]},"location":{"description":"A location shared in the message.","allOf":[{"$ref":"#/components/schemas/MessageLocationDto"}]},"voiceHangup":{"description":"Voice hangup data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceHangupDto"}]},"voiceTransfer":{"description":"Voice transfer data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceTransferDto"}]},"agentHandover":{"description":"Agent handover data.","allOf":[{"$ref":"#/components/schemas/MessageAgentHandoverDto"}]},"email":{"description":"Email content data.","allOf":[{"$ref":"#/components/schemas/MessageContentEmailDto"}]},"textToSpeech":{"description":"Text-to-speech content data.","allOf":[{"$ref":"#/components/schemas/MessageContentTextToSpeechDto"}]},"metaWhatsappTemplate":{"description":"A Meta WhatsApp template message.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplateDto"}]},"operator":{"description":"Operator data for the message.","allOf":[{"$ref":"#/components/schemas/OperatorDto"}]},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."},"leadAiId":{"type":"string","description":"The ID of the Lead AI associated with this message."}}},"MessageContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, audio)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."},"caption":{"type":"string","description":"An optional caption for the file."},"transcript":{"type":"string","description":"The transcript of audio/video content."},"facebookAttachmentId":{"type":"string","description":"The Facebook attachment ID."},"whatsappAttachmentId":{"type":"string","description":"The WhatsApp attachment ID."},"instagramAttachmentId":{"type":"string","description":"The Instagram attachment ID."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageContentButtonsDto":{"type":"object","properties":{"buttons":{"description":"The list of buttons.","type":"array","items":{"$ref":"#/components/schemas/MessageContentButtonDto"}}},"required":["buttons"]},"MessageContentButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, postback)."},"value":{"type":"string","description":"The value associated with the button."},"payload":{"type":"string","description":"An optional payload for the button."}},"required":["label","type","value"]},"MessageContentButtonReplyDto":{"type":"object","properties":{"label":{"type":"string","description":"The label of the selected button."},"value":{"type":"string","description":"The value of the selected button."},"payload":{"type":"string","description":"An optional payload from the button."},"type":{"type":"string","description":"The type of the button."},"reference":{"type":"string","description":"The reference to the original button message."}},"required":["label","value","reference"]},"MessageTemplateDto":{"type":"object","properties":{"body":{"type":"string","description":"The body text of the template."},"header":{"type":"string","description":"The header text of the template."},"footer":{"type":"string","description":"The footer text of the template."}},"required":["body"]},"MessageLocationDto":{"type":"object","properties":{"latitude":{"type":"number","description":"The latitude coordinate."},"longitude":{"type":"number","description":"The longitude coordinate."}},"required":["latitude","longitude"]},"MessageVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for hanging up the call."},"headers":{"type":"object","description":"Custom SIP headers for the hangup.","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"MessageVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string","description":"The target phone number or SIP address for the transfer."},"reason":{"type":"string","description":"The reason for the transfer."},"headers":{"type":"object","description":"Custom SIP headers for the transfer.","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"MessageAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for the handover to an agent."},"timeoutSeconds":{"type":"number","description":"Timeout in seconds before the handover expires."},"agentId":{"type":"string","description":"The ID of the specific agent to hand over to."},"groupId":{"type":"string","description":"The ID of the agent group to hand over to."},"assignmentMethod":{"type":"string","description":"The method for assigning the agent (e.g., round_robin, least_busy)."}},"required":["reason"]},"MessageContentEmailDto":{"type":"object","properties":{"subject":{"type":"string","description":"The subject of the email."},"body":{"type":"string","description":"The body content of the email."},"from":{"type":"string","description":"The sender email address."},"to":{"description":"The list of recipient email addresses.","type":"array","items":{"type":"string"}},"cc":{"description":"The list of CC recipient email addresses.","type":"array","items":{"type":"string"}},"bcc":{"description":"The list of BCC recipient email addresses.","type":"array","items":{"type":"string"}},"attachmentIds":{"description":"The list of attachment IDs.","type":"array","items":{"type":"string"}},"references":{"description":"The list of email references for threading.","type":"array","items":{"type":"string"}}},"required":["subject","body","from","to","cc","bcc","attachmentIds","references"]},"MessageContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"string","description":"The text to be converted to speech."},"speech":{"type":"string","description":"Pre-generated speech audio reference."}},"required":["text"]},"MessageMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the template on Meta."},"language":{"type":"string","description":"The language code of the template."},"bodyText":{"type":"string","description":"The body text of the message. Placeholders are in the form `{{1}}`."},"headerText":{"type":"string","description":"The text in the header (if present)."},"footerText":{"type":"string","description":"The text in the footer (if present)."},"header":{"description":"The header component, which can contain a file or text parameters.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_HeaderDto"}]},"bodyParameters":{"description":"A list of values that replace the placeholders in the `bodyText`.","type":"array","items":{"type":"string"}},"buttons":{"description":"A list of buttons attached to the message.","type":"array","items":{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_ButtonDto"}}},"required":["templateName","language","bodyText","bodyParameters","buttons"]},"MessageMetaWhatsAppTemplate_HeaderDto":{"type":"object","properties":{"file":{"description":"The file attached to the header.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_Header_FileDto"}]},"parameters":{"description":"The list of parameter values for the header placeholders.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"MessageMetaWhatsAppTemplate_Header_FileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, video)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageMetaWhatsAppTemplate_ButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, quick_reply)."},"url":{"type":"string","description":"The URL for URL-type buttons."},"value":{"type":"string","description":"The value for quick_reply-type buttons."}},"required":["label","type"]},"OperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The unique identifier of the operator."}},"required":["operatorId"]},"UpdateConversation_NotesDto":{"type":"object","properties":{"notes":{"description":"The notes to set on the conversation.","type":"array","items":{"type":"string"}}},"required":["notes"]},"UpdateConversation_MentionsDto":{"type":"object","properties":{"mentions":{"description":"The user IDs to mention in the conversation.","type":"array","items":{"type":"string"}}},"required":["mentions"]},"UpdateConversation_UserInputDto":{"type":"object","properties":{"redirect":{"type":"string","description":"The redirect destination for user input."},"isSensitive":{"type":"boolean","description":"Whether the user input contains sensitive data."}},"required":["redirect"]},"UpdateConversation_MetadataDto":{"type":"object","properties":{"metadata":{"type":"object","description":"The metadata to set on the conversation.","additionalProperties":{"type":"string"}}},"required":["metadata"]},"UpdateConversation_LeadAiConversationDto":{"type":"object","properties":{"flowId":{"type":"string","description":"The ID of the flow being executed."},"stepId":{"type":"string","description":"The ID of the current step in the flow."},"interactions":{"type":"number","description":"The number of interactions in this conversation."},"executionId":{"type":"string","description":"The unique execution ID for this conversation flow."}},"required":["flowId","stepId","interactions","executionId"]},"UpdateConversation_ConversationTeamDto":{"type":"object","properties":{"teamId":{"type":"string","description":"The ID of the team to assign to this conversation."}},"required":["teamId"]},"ConversationStatus":{"type":"number","enum":[0,1,2,3,-1],"description":"The current state of the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED"}}}}
```

## The UpdateConversationRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateConversationRequestDto":{"type":"object","properties":{"conversation":{"description":"The conversation data to update.","allOf":[{"$ref":"#/components/schemas/UpdateConversationDto"}]}},"required":["conversation"]},"UpdateConversationDto":{"type":"object","properties":{"contactId":{"type":"string","description":"The new contact ID."},"archived":{"type":"boolean","description":"Whether to archive the conversation."},"idToken":{"type":"string","description":"The new ID token."},"language":{"type":"string","description":"The new language code."},"operatorId":{"type":"string","description":"The new assigned operator ID."},"photoUrl":{"type":"string","description":"The new photo URL for the contact."},"sessionCount":{"type":"number","description":"The new session count."},"tags":{"description":"Tags to set on the conversation.","allOf":[{"$ref":"#/components/schemas/UpdateConversation_TagsDto"}]},"unread":{"type":"boolean","description":"Whether the conversation has unread messages."},"lastBlock":{"description":"The last visited block in the flow.","allOf":[{"$ref":"#/components/schemas/ConversationBlockDto"}]},"lastButton":{"description":"The last clicked button.","allOf":[{"$ref":"#/components/schemas/ConversationButtonDto"}]},"providerId":{"type":"string","description":"The new external provider ID."},"lastMessage":{"description":"The content of the last message.","allOf":[{"$ref":"#/components/schemas/ContentDto"}]},"notes":{"description":"Notes to set on the conversation.","allOf":[{"$ref":"#/components/schemas/UpdateConversation_NotesDto"}]},"snoozed":{"type":"string","description":"Timestamp until which the conversation is snoozed."},"lastUserAction":{"type":"string","description":"Timestamp of the last user action."},"mentions":{"description":"User mentions to set on the conversation.","allOf":[{"$ref":"#/components/schemas/UpdateConversation_MentionsDto"}]},"lastSender":{"type":"string","description":"The type of the last sender (user, bot, operator)."},"name":{"type":"string","description":"The new display name of the contact."},"userInput":{"description":"The user input state.","allOf":[{"$ref":"#/components/schemas/UpdateConversation_UserInputDto"}]},"metadata":{"description":"Metadata to set on the conversation.","allOf":[{"$ref":"#/components/schemas/UpdateConversation_MetadataDto"}]},"leadAiConversation":{"description":"Lead AI conversation state.","allOf":[{"$ref":"#/components/schemas/UpdateConversation_LeadAiConversationDto"}]},"team":{"description":"The team to assign to this conversation.","allOf":[{"$ref":"#/components/schemas/UpdateConversation_ConversationTeamDto"}]},"lastUserInput":{"type":"string","description":"The last user input text."},"state":{"description":"The new conversation state.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED","allOf":[{"$ref":"#/components/schemas/ConversationStatus"}]},"lastAssignedOperatorId":{"type":"string","description":"The ID of the last assigned operator."},"lastSeen":{"type":"string","description":"Timestamp when the conversation was last seen."}}},"UpdateConversation_TagsDto":{"type":"object","properties":{"tags":{"description":"The tags to set on the conversation.","type":"array","items":{"type":"string"}}},"required":["tags"]},"ConversationBlockDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the block."},"name":{"type":"string","description":"The display name of the block."}},"required":["id","name"]},"ConversationButtonDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the button."},"text":{"type":"string","description":"The display text of the button."},"value":{"type":"string","description":"The value sent when the button is clicked."}},"required":["id"]},"ContentDto":{"type":"object","properties":{"text":{"type":"string","description":"The text content of the message."},"file":{"description":"A file attachment.","allOf":[{"$ref":"#/components/schemas/MessageContentFileDto"}]},"buttons":{"description":"Interactive buttons for the message.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonsDto"}]},"selectedButton":{"description":"The button selected by the user.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonReplyDto"}]},"template":{"description":"A message template.","allOf":[{"$ref":"#/components/schemas/MessageTemplateDto"}]},"location":{"description":"A location shared in the message.","allOf":[{"$ref":"#/components/schemas/MessageLocationDto"}]},"voiceHangup":{"description":"Voice hangup data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceHangupDto"}]},"voiceTransfer":{"description":"Voice transfer data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceTransferDto"}]},"agentHandover":{"description":"Agent handover data.","allOf":[{"$ref":"#/components/schemas/MessageAgentHandoverDto"}]},"email":{"description":"Email content data.","allOf":[{"$ref":"#/components/schemas/MessageContentEmailDto"}]},"textToSpeech":{"description":"Text-to-speech content data.","allOf":[{"$ref":"#/components/schemas/MessageContentTextToSpeechDto"}]},"metaWhatsappTemplate":{"description":"A Meta WhatsApp template message.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplateDto"}]},"operator":{"description":"Operator data for the message.","allOf":[{"$ref":"#/components/schemas/OperatorDto"}]},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."},"leadAiId":{"type":"string","description":"The ID of the Lead AI associated with this message."}}},"MessageContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, audio)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."},"caption":{"type":"string","description":"An optional caption for the file."},"transcript":{"type":"string","description":"The transcript of audio/video content."},"facebookAttachmentId":{"type":"string","description":"The Facebook attachment ID."},"whatsappAttachmentId":{"type":"string","description":"The WhatsApp attachment ID."},"instagramAttachmentId":{"type":"string","description":"The Instagram attachment ID."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageContentButtonsDto":{"type":"object","properties":{"buttons":{"description":"The list of buttons.","type":"array","items":{"$ref":"#/components/schemas/MessageContentButtonDto"}}},"required":["buttons"]},"MessageContentButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, postback)."},"value":{"type":"string","description":"The value associated with the button."},"payload":{"type":"string","description":"An optional payload for the button."}},"required":["label","type","value"]},"MessageContentButtonReplyDto":{"type":"object","properties":{"label":{"type":"string","description":"The label of the selected button."},"value":{"type":"string","description":"The value of the selected button."},"payload":{"type":"string","description":"An optional payload from the button."},"type":{"type":"string","description":"The type of the button."},"reference":{"type":"string","description":"The reference to the original button message."}},"required":["label","value","reference"]},"MessageTemplateDto":{"type":"object","properties":{"body":{"type":"string","description":"The body text of the template."},"header":{"type":"string","description":"The header text of the template."},"footer":{"type":"string","description":"The footer text of the template."}},"required":["body"]},"MessageLocationDto":{"type":"object","properties":{"latitude":{"type":"number","description":"The latitude coordinate."},"longitude":{"type":"number","description":"The longitude coordinate."}},"required":["latitude","longitude"]},"MessageVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for hanging up the call."},"headers":{"type":"object","description":"Custom SIP headers for the hangup.","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"MessageVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string","description":"The target phone number or SIP address for the transfer."},"reason":{"type":"string","description":"The reason for the transfer."},"headers":{"type":"object","description":"Custom SIP headers for the transfer.","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"MessageAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for the handover to an agent."},"timeoutSeconds":{"type":"number","description":"Timeout in seconds before the handover expires."},"agentId":{"type":"string","description":"The ID of the specific agent to hand over to."},"groupId":{"type":"string","description":"The ID of the agent group to hand over to."},"assignmentMethod":{"type":"string","description":"The method for assigning the agent (e.g., round_robin, least_busy)."}},"required":["reason"]},"MessageContentEmailDto":{"type":"object","properties":{"subject":{"type":"string","description":"The subject of the email."},"body":{"type":"string","description":"The body content of the email."},"from":{"type":"string","description":"The sender email address."},"to":{"description":"The list of recipient email addresses.","type":"array","items":{"type":"string"}},"cc":{"description":"The list of CC recipient email addresses.","type":"array","items":{"type":"string"}},"bcc":{"description":"The list of BCC recipient email addresses.","type":"array","items":{"type":"string"}},"attachmentIds":{"description":"The list of attachment IDs.","type":"array","items":{"type":"string"}},"references":{"description":"The list of email references for threading.","type":"array","items":{"type":"string"}}},"required":["subject","body","from","to","cc","bcc","attachmentIds","references"]},"MessageContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"string","description":"The text to be converted to speech."},"speech":{"type":"string","description":"Pre-generated speech audio reference."}},"required":["text"]},"MessageMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the template on Meta."},"language":{"type":"string","description":"The language code of the template."},"bodyText":{"type":"string","description":"The body text of the message. Placeholders are in the form `{{1}}`."},"headerText":{"type":"string","description":"The text in the header (if present)."},"footerText":{"type":"string","description":"The text in the footer (if present)."},"header":{"description":"The header component, which can contain a file or text parameters.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_HeaderDto"}]},"bodyParameters":{"description":"A list of values that replace the placeholders in the `bodyText`.","type":"array","items":{"type":"string"}},"buttons":{"description":"A list of buttons attached to the message.","type":"array","items":{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_ButtonDto"}}},"required":["templateName","language","bodyText","bodyParameters","buttons"]},"MessageMetaWhatsAppTemplate_HeaderDto":{"type":"object","properties":{"file":{"description":"The file attached to the header.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_Header_FileDto"}]},"parameters":{"description":"The list of parameter values for the header placeholders.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"MessageMetaWhatsAppTemplate_Header_FileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, video)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageMetaWhatsAppTemplate_ButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, quick_reply)."},"url":{"type":"string","description":"The URL for URL-type buttons."},"value":{"type":"string","description":"The value for quick_reply-type buttons."}},"required":["label","type"]},"OperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The unique identifier of the operator."}},"required":["operatorId"]},"UpdateConversation_NotesDto":{"type":"object","properties":{"notes":{"description":"The notes to set on the conversation.","type":"array","items":{"type":"string"}}},"required":["notes"]},"UpdateConversation_MentionsDto":{"type":"object","properties":{"mentions":{"description":"The user IDs to mention in the conversation.","type":"array","items":{"type":"string"}}},"required":["mentions"]},"UpdateConversation_UserInputDto":{"type":"object","properties":{"redirect":{"type":"string","description":"The redirect destination for user input."},"isSensitive":{"type":"boolean","description":"Whether the user input contains sensitive data."}},"required":["redirect"]},"UpdateConversation_MetadataDto":{"type":"object","properties":{"metadata":{"type":"object","description":"The metadata to set on the conversation.","additionalProperties":{"type":"string"}}},"required":["metadata"]},"UpdateConversation_LeadAiConversationDto":{"type":"object","properties":{"flowId":{"type":"string","description":"The ID of the flow being executed."},"stepId":{"type":"string","description":"The ID of the current step in the flow."},"interactions":{"type":"number","description":"The number of interactions in this conversation."},"executionId":{"type":"string","description":"The unique execution ID for this conversation flow."}},"required":["flowId","stepId","interactions","executionId"]},"UpdateConversation_ConversationTeamDto":{"type":"object","properties":{"teamId":{"type":"string","description":"The ID of the team to assign to this conversation."}},"required":["teamId"]},"ConversationStatus":{"type":"number","enum":[0,1,2,3,-1],"description":"The current state of the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED"}}}}
```

## The DeleteConversationResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"DeleteConversationResponseDto":{"type":"object","properties":{"deleted":{"type":"boolean","description":"Indicates whether the deletion was successful."},"error":{"type":"string","description":"Optional error message."}}}}}}
```

## The HandleNewIncomingMessageRequest\_MessageDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"HandleNewIncomingMessageRequest_MessageDto":{"type":"object","properties":{"providerMessageId":{"type":"string","description":"The message ID from the external provider."},"content":{"description":"The content of the message.","allOf":[{"$ref":"#/components/schemas/ContentDto"}]},"sender":{"type":"string","description":"The sender type (user, bot, operator)."},"type":{"type":"string","description":"The type of message content."},"status":{"type":"string","description":"The delivery status of the message."},"created":{"type":"string","description":"Timestamp when the message was created (ISO format)."},"outgoing":{"type":"boolean","description":"Whether this is an outgoing message."},"processed":{"type":"string","description":"Timestamp when the message was processed."},"sent":{"type":"string","description":"Timestamp when the message was sent."},"received":{"type":"string","description":"Timestamp when the message was received."},"read":{"type":"string","description":"Timestamp when the message was read."},"contextId":{"type":"string","description":"The context ID for message threading."},"messengerId":{"type":"string","description":"The messenger-specific ID."},"detectedLanguage":{"type":"string","description":"The detected language code of the message."}},"required":["providerMessageId","content","sender","type","status","created","outgoing"]},"ContentDto":{"type":"object","properties":{"text":{"type":"string","description":"The text content of the message."},"file":{"description":"A file attachment.","allOf":[{"$ref":"#/components/schemas/MessageContentFileDto"}]},"buttons":{"description":"Interactive buttons for the message.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonsDto"}]},"selectedButton":{"description":"The button selected by the user.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonReplyDto"}]},"template":{"description":"A message template.","allOf":[{"$ref":"#/components/schemas/MessageTemplateDto"}]},"location":{"description":"A location shared in the message.","allOf":[{"$ref":"#/components/schemas/MessageLocationDto"}]},"voiceHangup":{"description":"Voice hangup data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceHangupDto"}]},"voiceTransfer":{"description":"Voice transfer data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceTransferDto"}]},"agentHandover":{"description":"Agent handover data.","allOf":[{"$ref":"#/components/schemas/MessageAgentHandoverDto"}]},"email":{"description":"Email content data.","allOf":[{"$ref":"#/components/schemas/MessageContentEmailDto"}]},"textToSpeech":{"description":"Text-to-speech content data.","allOf":[{"$ref":"#/components/schemas/MessageContentTextToSpeechDto"}]},"metaWhatsappTemplate":{"description":"A Meta WhatsApp template message.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplateDto"}]},"operator":{"description":"Operator data for the message.","allOf":[{"$ref":"#/components/schemas/OperatorDto"}]},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."},"leadAiId":{"type":"string","description":"The ID of the Lead AI associated with this message."}}},"MessageContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, audio)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."},"caption":{"type":"string","description":"An optional caption for the file."},"transcript":{"type":"string","description":"The transcript of audio/video content."},"facebookAttachmentId":{"type":"string","description":"The Facebook attachment ID."},"whatsappAttachmentId":{"type":"string","description":"The WhatsApp attachment ID."},"instagramAttachmentId":{"type":"string","description":"The Instagram attachment ID."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageContentButtonsDto":{"type":"object","properties":{"buttons":{"description":"The list of buttons.","type":"array","items":{"$ref":"#/components/schemas/MessageContentButtonDto"}}},"required":["buttons"]},"MessageContentButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, postback)."},"value":{"type":"string","description":"The value associated with the button."},"payload":{"type":"string","description":"An optional payload for the button."}},"required":["label","type","value"]},"MessageContentButtonReplyDto":{"type":"object","properties":{"label":{"type":"string","description":"The label of the selected button."},"value":{"type":"string","description":"The value of the selected button."},"payload":{"type":"string","description":"An optional payload from the button."},"type":{"type":"string","description":"The type of the button."},"reference":{"type":"string","description":"The reference to the original button message."}},"required":["label","value","reference"]},"MessageTemplateDto":{"type":"object","properties":{"body":{"type":"string","description":"The body text of the template."},"header":{"type":"string","description":"The header text of the template."},"footer":{"type":"string","description":"The footer text of the template."}},"required":["body"]},"MessageLocationDto":{"type":"object","properties":{"latitude":{"type":"number","description":"The latitude coordinate."},"longitude":{"type":"number","description":"The longitude coordinate."}},"required":["latitude","longitude"]},"MessageVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for hanging up the call."},"headers":{"type":"object","description":"Custom SIP headers for the hangup.","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"MessageVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string","description":"The target phone number or SIP address for the transfer."},"reason":{"type":"string","description":"The reason for the transfer."},"headers":{"type":"object","description":"Custom SIP headers for the transfer.","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"MessageAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for the handover to an agent."},"timeoutSeconds":{"type":"number","description":"Timeout in seconds before the handover expires."},"agentId":{"type":"string","description":"The ID of the specific agent to hand over to."},"groupId":{"type":"string","description":"The ID of the agent group to hand over to."},"assignmentMethod":{"type":"string","description":"The method for assigning the agent (e.g., round_robin, least_busy)."}},"required":["reason"]},"MessageContentEmailDto":{"type":"object","properties":{"subject":{"type":"string","description":"The subject of the email."},"body":{"type":"string","description":"The body content of the email."},"from":{"type":"string","description":"The sender email address."},"to":{"description":"The list of recipient email addresses.","type":"array","items":{"type":"string"}},"cc":{"description":"The list of CC recipient email addresses.","type":"array","items":{"type":"string"}},"bcc":{"description":"The list of BCC recipient email addresses.","type":"array","items":{"type":"string"}},"attachmentIds":{"description":"The list of attachment IDs.","type":"array","items":{"type":"string"}},"references":{"description":"The list of email references for threading.","type":"array","items":{"type":"string"}}},"required":["subject","body","from","to","cc","bcc","attachmentIds","references"]},"MessageContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"string","description":"The text to be converted to speech."},"speech":{"type":"string","description":"Pre-generated speech audio reference."}},"required":["text"]},"MessageMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the template on Meta."},"language":{"type":"string","description":"The language code of the template."},"bodyText":{"type":"string","description":"The body text of the message. Placeholders are in the form `{{1}}`."},"headerText":{"type":"string","description":"The text in the header (if present)."},"footerText":{"type":"string","description":"The text in the footer (if present)."},"header":{"description":"The header component, which can contain a file or text parameters.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_HeaderDto"}]},"bodyParameters":{"description":"A list of values that replace the placeholders in the `bodyText`.","type":"array","items":{"type":"string"}},"buttons":{"description":"A list of buttons attached to the message.","type":"array","items":{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_ButtonDto"}}},"required":["templateName","language","bodyText","bodyParameters","buttons"]},"MessageMetaWhatsAppTemplate_HeaderDto":{"type":"object","properties":{"file":{"description":"The file attached to the header.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_Header_FileDto"}]},"parameters":{"description":"The list of parameter values for the header placeholders.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"MessageMetaWhatsAppTemplate_Header_FileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, video)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageMetaWhatsAppTemplate_ButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, quick_reply)."},"url":{"type":"string","description":"The URL for URL-type buttons."},"value":{"type":"string","description":"The value for quick_reply-type buttons."}},"required":["label","type"]},"OperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The unique identifier of the operator."}},"required":["operatorId"]}}}}
```

## The HandleNewIncomingMessageRequest\_ProfileDataDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"HandleNewIncomingMessageRequest_ProfileDataDto":{"type":"object","properties":{"providerProfileId":{"type":"string","description":"The profile ID from the external provider."},"name":{"type":"string","description":"The display name of the user."},"profilePhotoUrl":{"type":"string","description":"The URL of the user's profile photo."},"language":{"type":"string","description":"The user's preferred language code."},"timezone":{"type":"string","description":"The user's timezone."},"email":{"type":"string","description":"The user's email address."},"phoneNumber":{"type":"string","description":"The user's phone number."},"subject":{"type":"string","description":"The subject of the message (for email channels)."}}}}}}
```

## The HandleNewIncomingMessageRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"HandleNewIncomingMessageRequestDto":{"type":"object","properties":{"chatbotId":{"type":"string","description":"The ID of the chatbot."},"channelId":{"type":"string","description":"The ID of the channel."},"channelName":{"type":"string","description":"The name of the channel."},"providerId":{"type":"string","description":"The external provider ID for the conversation."},"message":{"description":"The incoming message data.","allOf":[{"$ref":"#/components/schemas/HandleNewIncomingMessageRequest_MessageDto"}]},"profileData":{"description":"The user's profile data.","allOf":[{"$ref":"#/components/schemas/HandleNewIncomingMessageRequest_ProfileDataDto"}]},"callee":{"type":"string","description":"The callee phone number (for voice channels)."},"async":{"type":"boolean","description":"Whether to process the message asynchronously."}},"required":["chatbotId","channelId","channelName","providerId","message","profileData"]},"HandleNewIncomingMessageRequest_MessageDto":{"type":"object","properties":{"providerMessageId":{"type":"string","description":"The message ID from the external provider."},"content":{"description":"The content of the message.","allOf":[{"$ref":"#/components/schemas/ContentDto"}]},"sender":{"type":"string","description":"The sender type (user, bot, operator)."},"type":{"type":"string","description":"The type of message content."},"status":{"type":"string","description":"The delivery status of the message."},"created":{"type":"string","description":"Timestamp when the message was created (ISO format)."},"outgoing":{"type":"boolean","description":"Whether this is an outgoing message."},"processed":{"type":"string","description":"Timestamp when the message was processed."},"sent":{"type":"string","description":"Timestamp when the message was sent."},"received":{"type":"string","description":"Timestamp when the message was received."},"read":{"type":"string","description":"Timestamp when the message was read."},"contextId":{"type":"string","description":"The context ID for message threading."},"messengerId":{"type":"string","description":"The messenger-specific ID."},"detectedLanguage":{"type":"string","description":"The detected language code of the message."}},"required":["providerMessageId","content","sender","type","status","created","outgoing"]},"ContentDto":{"type":"object","properties":{"text":{"type":"string","description":"The text content of the message."},"file":{"description":"A file attachment.","allOf":[{"$ref":"#/components/schemas/MessageContentFileDto"}]},"buttons":{"description":"Interactive buttons for the message.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonsDto"}]},"selectedButton":{"description":"The button selected by the user.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonReplyDto"}]},"template":{"description":"A message template.","allOf":[{"$ref":"#/components/schemas/MessageTemplateDto"}]},"location":{"description":"A location shared in the message.","allOf":[{"$ref":"#/components/schemas/MessageLocationDto"}]},"voiceHangup":{"description":"Voice hangup data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceHangupDto"}]},"voiceTransfer":{"description":"Voice transfer data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceTransferDto"}]},"agentHandover":{"description":"Agent handover data.","allOf":[{"$ref":"#/components/schemas/MessageAgentHandoverDto"}]},"email":{"description":"Email content data.","allOf":[{"$ref":"#/components/schemas/MessageContentEmailDto"}]},"textToSpeech":{"description":"Text-to-speech content data.","allOf":[{"$ref":"#/components/schemas/MessageContentTextToSpeechDto"}]},"metaWhatsappTemplate":{"description":"A Meta WhatsApp template message.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplateDto"}]},"operator":{"description":"Operator data for the message.","allOf":[{"$ref":"#/components/schemas/OperatorDto"}]},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."},"leadAiId":{"type":"string","description":"The ID of the Lead AI associated with this message."}}},"MessageContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, audio)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."},"caption":{"type":"string","description":"An optional caption for the file."},"transcript":{"type":"string","description":"The transcript of audio/video content."},"facebookAttachmentId":{"type":"string","description":"The Facebook attachment ID."},"whatsappAttachmentId":{"type":"string","description":"The WhatsApp attachment ID."},"instagramAttachmentId":{"type":"string","description":"The Instagram attachment ID."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageContentButtonsDto":{"type":"object","properties":{"buttons":{"description":"The list of buttons.","type":"array","items":{"$ref":"#/components/schemas/MessageContentButtonDto"}}},"required":["buttons"]},"MessageContentButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, postback)."},"value":{"type":"string","description":"The value associated with the button."},"payload":{"type":"string","description":"An optional payload for the button."}},"required":["label","type","value"]},"MessageContentButtonReplyDto":{"type":"object","properties":{"label":{"type":"string","description":"The label of the selected button."},"value":{"type":"string","description":"The value of the selected button."},"payload":{"type":"string","description":"An optional payload from the button."},"type":{"type":"string","description":"The type of the button."},"reference":{"type":"string","description":"The reference to the original button message."}},"required":["label","value","reference"]},"MessageTemplateDto":{"type":"object","properties":{"body":{"type":"string","description":"The body text of the template."},"header":{"type":"string","description":"The header text of the template."},"footer":{"type":"string","description":"The footer text of the template."}},"required":["body"]},"MessageLocationDto":{"type":"object","properties":{"latitude":{"type":"number","description":"The latitude coordinate."},"longitude":{"type":"number","description":"The longitude coordinate."}},"required":["latitude","longitude"]},"MessageVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for hanging up the call."},"headers":{"type":"object","description":"Custom SIP headers for the hangup.","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"MessageVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string","description":"The target phone number or SIP address for the transfer."},"reason":{"type":"string","description":"The reason for the transfer."},"headers":{"type":"object","description":"Custom SIP headers for the transfer.","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"MessageAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for the handover to an agent."},"timeoutSeconds":{"type":"number","description":"Timeout in seconds before the handover expires."},"agentId":{"type":"string","description":"The ID of the specific agent to hand over to."},"groupId":{"type":"string","description":"The ID of the agent group to hand over to."},"assignmentMethod":{"type":"string","description":"The method for assigning the agent (e.g., round_robin, least_busy)."}},"required":["reason"]},"MessageContentEmailDto":{"type":"object","properties":{"subject":{"type":"string","description":"The subject of the email."},"body":{"type":"string","description":"The body content of the email."},"from":{"type":"string","description":"The sender email address."},"to":{"description":"The list of recipient email addresses.","type":"array","items":{"type":"string"}},"cc":{"description":"The list of CC recipient email addresses.","type":"array","items":{"type":"string"}},"bcc":{"description":"The list of BCC recipient email addresses.","type":"array","items":{"type":"string"}},"attachmentIds":{"description":"The list of attachment IDs.","type":"array","items":{"type":"string"}},"references":{"description":"The list of email references for threading.","type":"array","items":{"type":"string"}}},"required":["subject","body","from","to","cc","bcc","attachmentIds","references"]},"MessageContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"string","description":"The text to be converted to speech."},"speech":{"type":"string","description":"Pre-generated speech audio reference."}},"required":["text"]},"MessageMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the template on Meta."},"language":{"type":"string","description":"The language code of the template."},"bodyText":{"type":"string","description":"The body text of the message. Placeholders are in the form `{{1}}`."},"headerText":{"type":"string","description":"The text in the header (if present)."},"footerText":{"type":"string","description":"The text in the footer (if present)."},"header":{"description":"The header component, which can contain a file or text parameters.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_HeaderDto"}]},"bodyParameters":{"description":"A list of values that replace the placeholders in the `bodyText`.","type":"array","items":{"type":"string"}},"buttons":{"description":"A list of buttons attached to the message.","type":"array","items":{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_ButtonDto"}}},"required":["templateName","language","bodyText","bodyParameters","buttons"]},"MessageMetaWhatsAppTemplate_HeaderDto":{"type":"object","properties":{"file":{"description":"The file attached to the header.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_Header_FileDto"}]},"parameters":{"description":"The list of parameter values for the header placeholders.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"MessageMetaWhatsAppTemplate_Header_FileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, video)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageMetaWhatsAppTemplate_ButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, quick_reply)."},"url":{"type":"string","description":"The URL for URL-type buttons."},"value":{"type":"string","description":"The value for quick_reply-type buttons."}},"required":["label","type"]},"OperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The unique identifier of the operator."}},"required":["operatorId"]},"HandleNewIncomingMessageRequest_ProfileDataDto":{"type":"object","properties":{"providerProfileId":{"type":"string","description":"The profile ID from the external provider."},"name":{"type":"string","description":"The display name of the user."},"profilePhotoUrl":{"type":"string","description":"The URL of the user's profile photo."},"language":{"type":"string","description":"The user's preferred language code."},"timezone":{"type":"string","description":"The user's timezone."},"email":{"type":"string","description":"The user's email address."},"phoneNumber":{"type":"string","description":"The user's phone number."},"subject":{"type":"string","description":"The subject of the message (for email channels)."}}}}}}
```

## The HandleIncomingResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"HandleIncomingResponseDto":{"type":"object","properties":{"conversationId":{"type":"string","description":"The ID of the affected conversation."},"messageId":{"type":"string","description":"The ID of the newly created message."},"messages":{"description":"A list of messages generated as a response.","type":"array","items":{"$ref":"#/components/schemas/MessageDto"}},"error":{"type":"string","description":"Optional error message."}},"required":["conversationId","messageId","messages"]},"MessageDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the message."},"sender":{"type":"string","description":"The sender of the message (e.g., user, bot, agent)."},"type":{"type":"string","description":"The type of message (e.g., text, file, template)."},"persona":{"description":"The persona representing the sender.","allOf":[{"$ref":"#/components/schemas/MessagePersonaDto"}]},"providerMessageId":{"type":"string","description":"The message ID from the external provider."},"status":{"type":"string","description":"The delivery status of the message."},"created":{"type":"string","description":"Timestamp when the message was created."},"processed":{"type":"string","description":"Timestamp when the message was processed."},"sent":{"type":"string","description":"Timestamp when the message was sent."},"received":{"type":"string","description":"Timestamp when the message was received by the recipient."},"read":{"type":"string","description":"Timestamp when the message was read by the recipient."},"outgoing":{"type":"boolean","description":"Whether the message is outgoing (true) or incoming (false)."},"messengerId":{"type":"string","description":"The messenger ID associated with the message."},"contextId":{"type":"string","description":"The context ID for message threading."},"content":{"description":"The content of the message.","allOf":[{"$ref":"#/components/schemas/ContentDto"}]},"tags":{"description":"The list of tags associated with the message.","type":"array","items":{"type":"string"}},"error":{"type":"string","description":"Optional error message."},"isSensitive":{"type":"boolean","description":"Whether the message contains sensitive content."},"streamGroupId":{"type":"string","description":"The stream group ID for grouped streaming messages."},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."}},"required":["id","sender","type","status","created","outgoing","content","tags"]},"MessagePersonaDto":{"type":"object","properties":{"image":{"type":"string","description":"The URL of the persona's avatar image."},"name":{"type":"string","description":"The display name of the persona."}},"required":["image","name"]},"ContentDto":{"type":"object","properties":{"text":{"type":"string","description":"The text content of the message."},"file":{"description":"A file attachment.","allOf":[{"$ref":"#/components/schemas/MessageContentFileDto"}]},"buttons":{"description":"Interactive buttons for the message.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonsDto"}]},"selectedButton":{"description":"The button selected by the user.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonReplyDto"}]},"template":{"description":"A message template.","allOf":[{"$ref":"#/components/schemas/MessageTemplateDto"}]},"location":{"description":"A location shared in the message.","allOf":[{"$ref":"#/components/schemas/MessageLocationDto"}]},"voiceHangup":{"description":"Voice hangup data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceHangupDto"}]},"voiceTransfer":{"description":"Voice transfer data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceTransferDto"}]},"agentHandover":{"description":"Agent handover data.","allOf":[{"$ref":"#/components/schemas/MessageAgentHandoverDto"}]},"email":{"description":"Email content data.","allOf":[{"$ref":"#/components/schemas/MessageContentEmailDto"}]},"textToSpeech":{"description":"Text-to-speech content data.","allOf":[{"$ref":"#/components/schemas/MessageContentTextToSpeechDto"}]},"metaWhatsappTemplate":{"description":"A Meta WhatsApp template message.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplateDto"}]},"operator":{"description":"Operator data for the message.","allOf":[{"$ref":"#/components/schemas/OperatorDto"}]},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."},"leadAiId":{"type":"string","description":"The ID of the Lead AI associated with this message."}}},"MessageContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, audio)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."},"caption":{"type":"string","description":"An optional caption for the file."},"transcript":{"type":"string","description":"The transcript of audio/video content."},"facebookAttachmentId":{"type":"string","description":"The Facebook attachment ID."},"whatsappAttachmentId":{"type":"string","description":"The WhatsApp attachment ID."},"instagramAttachmentId":{"type":"string","description":"The Instagram attachment ID."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageContentButtonsDto":{"type":"object","properties":{"buttons":{"description":"The list of buttons.","type":"array","items":{"$ref":"#/components/schemas/MessageContentButtonDto"}}},"required":["buttons"]},"MessageContentButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, postback)."},"value":{"type":"string","description":"The value associated with the button."},"payload":{"type":"string","description":"An optional payload for the button."}},"required":["label","type","value"]},"MessageContentButtonReplyDto":{"type":"object","properties":{"label":{"type":"string","description":"The label of the selected button."},"value":{"type":"string","description":"The value of the selected button."},"payload":{"type":"string","description":"An optional payload from the button."},"type":{"type":"string","description":"The type of the button."},"reference":{"type":"string","description":"The reference to the original button message."}},"required":["label","value","reference"]},"MessageTemplateDto":{"type":"object","properties":{"body":{"type":"string","description":"The body text of the template."},"header":{"type":"string","description":"The header text of the template."},"footer":{"type":"string","description":"The footer text of the template."}},"required":["body"]},"MessageLocationDto":{"type":"object","properties":{"latitude":{"type":"number","description":"The latitude coordinate."},"longitude":{"type":"number","description":"The longitude coordinate."}},"required":["latitude","longitude"]},"MessageVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for hanging up the call."},"headers":{"type":"object","description":"Custom SIP headers for the hangup.","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"MessageVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string","description":"The target phone number or SIP address for the transfer."},"reason":{"type":"string","description":"The reason for the transfer."},"headers":{"type":"object","description":"Custom SIP headers for the transfer.","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"MessageAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for the handover to an agent."},"timeoutSeconds":{"type":"number","description":"Timeout in seconds before the handover expires."},"agentId":{"type":"string","description":"The ID of the specific agent to hand over to."},"groupId":{"type":"string","description":"The ID of the agent group to hand over to."},"assignmentMethod":{"type":"string","description":"The method for assigning the agent (e.g., round_robin, least_busy)."}},"required":["reason"]},"MessageContentEmailDto":{"type":"object","properties":{"subject":{"type":"string","description":"The subject of the email."},"body":{"type":"string","description":"The body content of the email."},"from":{"type":"string","description":"The sender email address."},"to":{"description":"The list of recipient email addresses.","type":"array","items":{"type":"string"}},"cc":{"description":"The list of CC recipient email addresses.","type":"array","items":{"type":"string"}},"bcc":{"description":"The list of BCC recipient email addresses.","type":"array","items":{"type":"string"}},"attachmentIds":{"description":"The list of attachment IDs.","type":"array","items":{"type":"string"}},"references":{"description":"The list of email references for threading.","type":"array","items":{"type":"string"}}},"required":["subject","body","from","to","cc","bcc","attachmentIds","references"]},"MessageContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"string","description":"The text to be converted to speech."},"speech":{"type":"string","description":"Pre-generated speech audio reference."}},"required":["text"]},"MessageMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the template on Meta."},"language":{"type":"string","description":"The language code of the template."},"bodyText":{"type":"string","description":"The body text of the message. Placeholders are in the form `{{1}}`."},"headerText":{"type":"string","description":"The text in the header (if present)."},"footerText":{"type":"string","description":"The text in the footer (if present)."},"header":{"description":"The header component, which can contain a file or text parameters.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_HeaderDto"}]},"bodyParameters":{"description":"A list of values that replace the placeholders in the `bodyText`.","type":"array","items":{"type":"string"}},"buttons":{"description":"A list of buttons attached to the message.","type":"array","items":{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_ButtonDto"}}},"required":["templateName","language","bodyText","bodyParameters","buttons"]},"MessageMetaWhatsAppTemplate_HeaderDto":{"type":"object","properties":{"file":{"description":"The file attached to the header.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_Header_FileDto"}]},"parameters":{"description":"The list of parameter values for the header placeholders.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"MessageMetaWhatsAppTemplate_Header_FileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, video)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageMetaWhatsAppTemplate_ButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, quick_reply)."},"url":{"type":"string","description":"The URL for URL-type buttons."},"value":{"type":"string","description":"The value for quick_reply-type buttons."}},"required":["label","type"]},"OperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The unique identifier of the operator."}},"required":["operatorId"]}}}}
```

## The HandleNewIncomingEventRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"HandleNewIncomingEventRequestDto":{"type":"object","properties":{"chatbotId":{"type":"string","description":"The ID of the chatbot."},"channelId":{"type":"string","description":"The ID of the channel."},"channelName":{"type":"string","description":"The name of the channel."},"providerId":{"type":"string","description":"The external provider ID for the conversation."},"profileData":{"description":"The user's profile data.","allOf":[{"$ref":"#/components/schemas/HandleNewIncomingMessageRequest_ProfileDataDto"}]},"event":{"type":"string","description":"The triggering event."},"callee":{"type":"string","description":"The callee phone number (for voice channels)."},"async":{"type":"boolean","description":"Whether to process the event asynchronously."}},"required":["chatbotId","channelId","channelName","providerId","profileData","event"]},"HandleNewIncomingMessageRequest_ProfileDataDto":{"type":"object","properties":{"providerProfileId":{"type":"string","description":"The profile ID from the external provider."},"name":{"type":"string","description":"The display name of the user."},"profilePhotoUrl":{"type":"string","description":"The URL of the user's profile photo."},"language":{"type":"string","description":"The user's preferred language code."},"timezone":{"type":"string","description":"The user's timezone."},"email":{"type":"string","description":"The user's email address."},"phoneNumber":{"type":"string","description":"The user's phone number."},"subject":{"type":"string","description":"The subject of the message (for email channels)."}}}}}}
```

## The HandleNewIncomingStepPayloadRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"HandleNewIncomingStepPayloadRequestDto":{"type":"object","properties":{"chatbotId":{"type":"string","description":"The ID of the chatbot."},"conversationId":{"type":"string","description":"The ID of the conversation."},"flowId":{"type":"string","description":"The ID of the flow to execute."},"stepId":{"type":"string","description":"The ID of the step to execute."},"event":{"type":"string","description":"The event name to trigger."},"eventPayload":{"type":"string","description":"JSON payload for the event."},"async":{"type":"boolean","description":"Whether to process asynchronously."},"isDebug":{"type":"boolean","description":"Whether this is a debug request."}},"required":["chatbotId","conversationId"]}}}}
```

## The TriggerCustomConversationEventRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"TriggerCustomConversationEventRequestDto":{"type":"object","properties":{"chatbotId":{"type":"string","description":"The ID of the chatbot."},"conversationId":{"type":"string","description":"The ID of the conversation."},"event":{"type":"string","description":"The custom event name to trigger."}},"required":["chatbotId","conversationId","event"]}}}}
```

## The TriggerCustomConversationEventResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"TriggerCustomConversationEventResponseDto":{"type":"object","properties":{"error":{"type":"string","description":"Optional error message."}}}}}}
```

## The ListMessagesResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListMessagesResponseDto":{"type":"object","properties":{"messages":{"description":"The list of messages.","type":"array","items":{"$ref":"#/components/schemas/MessageDto"}},"error":{"type":"string","description":"Optional error message."}},"required":["messages"]},"MessageDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the message."},"sender":{"type":"string","description":"The sender of the message (e.g., user, bot, agent)."},"type":{"type":"string","description":"The type of message (e.g., text, file, template)."},"persona":{"description":"The persona representing the sender.","allOf":[{"$ref":"#/components/schemas/MessagePersonaDto"}]},"providerMessageId":{"type":"string","description":"The message ID from the external provider."},"status":{"type":"string","description":"The delivery status of the message."},"created":{"type":"string","description":"Timestamp when the message was created."},"processed":{"type":"string","description":"Timestamp when the message was processed."},"sent":{"type":"string","description":"Timestamp when the message was sent."},"received":{"type":"string","description":"Timestamp when the message was received by the recipient."},"read":{"type":"string","description":"Timestamp when the message was read by the recipient."},"outgoing":{"type":"boolean","description":"Whether the message is outgoing (true) or incoming (false)."},"messengerId":{"type":"string","description":"The messenger ID associated with the message."},"contextId":{"type":"string","description":"The context ID for message threading."},"content":{"description":"The content of the message.","allOf":[{"$ref":"#/components/schemas/ContentDto"}]},"tags":{"description":"The list of tags associated with the message.","type":"array","items":{"type":"string"}},"error":{"type":"string","description":"Optional error message."},"isSensitive":{"type":"boolean","description":"Whether the message contains sensitive content."},"streamGroupId":{"type":"string","description":"The stream group ID for grouped streaming messages."},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."}},"required":["id","sender","type","status","created","outgoing","content","tags"]},"MessagePersonaDto":{"type":"object","properties":{"image":{"type":"string","description":"The URL of the persona's avatar image."},"name":{"type":"string","description":"The display name of the persona."}},"required":["image","name"]},"ContentDto":{"type":"object","properties":{"text":{"type":"string","description":"The text content of the message."},"file":{"description":"A file attachment.","allOf":[{"$ref":"#/components/schemas/MessageContentFileDto"}]},"buttons":{"description":"Interactive buttons for the message.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonsDto"}]},"selectedButton":{"description":"The button selected by the user.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonReplyDto"}]},"template":{"description":"A message template.","allOf":[{"$ref":"#/components/schemas/MessageTemplateDto"}]},"location":{"description":"A location shared in the message.","allOf":[{"$ref":"#/components/schemas/MessageLocationDto"}]},"voiceHangup":{"description":"Voice hangup data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceHangupDto"}]},"voiceTransfer":{"description":"Voice transfer data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceTransferDto"}]},"agentHandover":{"description":"Agent handover data.","allOf":[{"$ref":"#/components/schemas/MessageAgentHandoverDto"}]},"email":{"description":"Email content data.","allOf":[{"$ref":"#/components/schemas/MessageContentEmailDto"}]},"textToSpeech":{"description":"Text-to-speech content data.","allOf":[{"$ref":"#/components/schemas/MessageContentTextToSpeechDto"}]},"metaWhatsappTemplate":{"description":"A Meta WhatsApp template message.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplateDto"}]},"operator":{"description":"Operator data for the message.","allOf":[{"$ref":"#/components/schemas/OperatorDto"}]},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."},"leadAiId":{"type":"string","description":"The ID of the Lead AI associated with this message."}}},"MessageContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, audio)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."},"caption":{"type":"string","description":"An optional caption for the file."},"transcript":{"type":"string","description":"The transcript of audio/video content."},"facebookAttachmentId":{"type":"string","description":"The Facebook attachment ID."},"whatsappAttachmentId":{"type":"string","description":"The WhatsApp attachment ID."},"instagramAttachmentId":{"type":"string","description":"The Instagram attachment ID."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageContentButtonsDto":{"type":"object","properties":{"buttons":{"description":"The list of buttons.","type":"array","items":{"$ref":"#/components/schemas/MessageContentButtonDto"}}},"required":["buttons"]},"MessageContentButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, postback)."},"value":{"type":"string","description":"The value associated with the button."},"payload":{"type":"string","description":"An optional payload for the button."}},"required":["label","type","value"]},"MessageContentButtonReplyDto":{"type":"object","properties":{"label":{"type":"string","description":"The label of the selected button."},"value":{"type":"string","description":"The value of the selected button."},"payload":{"type":"string","description":"An optional payload from the button."},"type":{"type":"string","description":"The type of the button."},"reference":{"type":"string","description":"The reference to the original button message."}},"required":["label","value","reference"]},"MessageTemplateDto":{"type":"object","properties":{"body":{"type":"string","description":"The body text of the template."},"header":{"type":"string","description":"The header text of the template."},"footer":{"type":"string","description":"The footer text of the template."}},"required":["body"]},"MessageLocationDto":{"type":"object","properties":{"latitude":{"type":"number","description":"The latitude coordinate."},"longitude":{"type":"number","description":"The longitude coordinate."}},"required":["latitude","longitude"]},"MessageVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for hanging up the call."},"headers":{"type":"object","description":"Custom SIP headers for the hangup.","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"MessageVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string","description":"The target phone number or SIP address for the transfer."},"reason":{"type":"string","description":"The reason for the transfer."},"headers":{"type":"object","description":"Custom SIP headers for the transfer.","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"MessageAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for the handover to an agent."},"timeoutSeconds":{"type":"number","description":"Timeout in seconds before the handover expires."},"agentId":{"type":"string","description":"The ID of the specific agent to hand over to."},"groupId":{"type":"string","description":"The ID of the agent group to hand over to."},"assignmentMethod":{"type":"string","description":"The method for assigning the agent (e.g., round_robin, least_busy)."}},"required":["reason"]},"MessageContentEmailDto":{"type":"object","properties":{"subject":{"type":"string","description":"The subject of the email."},"body":{"type":"string","description":"The body content of the email."},"from":{"type":"string","description":"The sender email address."},"to":{"description":"The list of recipient email addresses.","type":"array","items":{"type":"string"}},"cc":{"description":"The list of CC recipient email addresses.","type":"array","items":{"type":"string"}},"bcc":{"description":"The list of BCC recipient email addresses.","type":"array","items":{"type":"string"}},"attachmentIds":{"description":"The list of attachment IDs.","type":"array","items":{"type":"string"}},"references":{"description":"The list of email references for threading.","type":"array","items":{"type":"string"}}},"required":["subject","body","from","to","cc","bcc","attachmentIds","references"]},"MessageContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"string","description":"The text to be converted to speech."},"speech":{"type":"string","description":"Pre-generated speech audio reference."}},"required":["text"]},"MessageMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the template on Meta."},"language":{"type":"string","description":"The language code of the template."},"bodyText":{"type":"string","description":"The body text of the message. Placeholders are in the form `{{1}}`."},"headerText":{"type":"string","description":"The text in the header (if present)."},"footerText":{"type":"string","description":"The text in the footer (if present)."},"header":{"description":"The header component, which can contain a file or text parameters.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_HeaderDto"}]},"bodyParameters":{"description":"A list of values that replace the placeholders in the `bodyText`.","type":"array","items":{"type":"string"}},"buttons":{"description":"A list of buttons attached to the message.","type":"array","items":{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_ButtonDto"}}},"required":["templateName","language","bodyText","bodyParameters","buttons"]},"MessageMetaWhatsAppTemplate_HeaderDto":{"type":"object","properties":{"file":{"description":"The file attached to the header.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_Header_FileDto"}]},"parameters":{"description":"The list of parameter values for the header placeholders.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"MessageMetaWhatsAppTemplate_Header_FileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, video)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageMetaWhatsAppTemplate_ButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, quick_reply)."},"url":{"type":"string","description":"The URL for URL-type buttons."},"value":{"type":"string","description":"The value for quick_reply-type buttons."}},"required":["label","type"]},"OperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The unique identifier of the operator."}},"required":["operatorId"]}}}}
```

## The MessageResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"MessageResponseDto":{"type":"object","properties":{"message":{"description":"The message.","allOf":[{"$ref":"#/components/schemas/MessageDto"}]},"error":{"type":"string","description":"Optional error message."}}},"MessageDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the message."},"sender":{"type":"string","description":"The sender of the message (e.g., user, bot, agent)."},"type":{"type":"string","description":"The type of message (e.g., text, file, template)."},"persona":{"description":"The persona representing the sender.","allOf":[{"$ref":"#/components/schemas/MessagePersonaDto"}]},"providerMessageId":{"type":"string","description":"The message ID from the external provider."},"status":{"type":"string","description":"The delivery status of the message."},"created":{"type":"string","description":"Timestamp when the message was created."},"processed":{"type":"string","description":"Timestamp when the message was processed."},"sent":{"type":"string","description":"Timestamp when the message was sent."},"received":{"type":"string","description":"Timestamp when the message was received by the recipient."},"read":{"type":"string","description":"Timestamp when the message was read by the recipient."},"outgoing":{"type":"boolean","description":"Whether the message is outgoing (true) or incoming (false)."},"messengerId":{"type":"string","description":"The messenger ID associated with the message."},"contextId":{"type":"string","description":"The context ID for message threading."},"content":{"description":"The content of the message.","allOf":[{"$ref":"#/components/schemas/ContentDto"}]},"tags":{"description":"The list of tags associated with the message.","type":"array","items":{"type":"string"}},"error":{"type":"string","description":"Optional error message."},"isSensitive":{"type":"boolean","description":"Whether the message contains sensitive content."},"streamGroupId":{"type":"string","description":"The stream group ID for grouped streaming messages."},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."}},"required":["id","sender","type","status","created","outgoing","content","tags"]},"MessagePersonaDto":{"type":"object","properties":{"image":{"type":"string","description":"The URL of the persona's avatar image."},"name":{"type":"string","description":"The display name of the persona."}},"required":["image","name"]},"ContentDto":{"type":"object","properties":{"text":{"type":"string","description":"The text content of the message."},"file":{"description":"A file attachment.","allOf":[{"$ref":"#/components/schemas/MessageContentFileDto"}]},"buttons":{"description":"Interactive buttons for the message.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonsDto"}]},"selectedButton":{"description":"The button selected by the user.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonReplyDto"}]},"template":{"description":"A message template.","allOf":[{"$ref":"#/components/schemas/MessageTemplateDto"}]},"location":{"description":"A location shared in the message.","allOf":[{"$ref":"#/components/schemas/MessageLocationDto"}]},"voiceHangup":{"description":"Voice hangup data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceHangupDto"}]},"voiceTransfer":{"description":"Voice transfer data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceTransferDto"}]},"agentHandover":{"description":"Agent handover data.","allOf":[{"$ref":"#/components/schemas/MessageAgentHandoverDto"}]},"email":{"description":"Email content data.","allOf":[{"$ref":"#/components/schemas/MessageContentEmailDto"}]},"textToSpeech":{"description":"Text-to-speech content data.","allOf":[{"$ref":"#/components/schemas/MessageContentTextToSpeechDto"}]},"metaWhatsappTemplate":{"description":"A Meta WhatsApp template message.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplateDto"}]},"operator":{"description":"Operator data for the message.","allOf":[{"$ref":"#/components/schemas/OperatorDto"}]},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."},"leadAiId":{"type":"string","description":"The ID of the Lead AI associated with this message."}}},"MessageContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, audio)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."},"caption":{"type":"string","description":"An optional caption for the file."},"transcript":{"type":"string","description":"The transcript of audio/video content."},"facebookAttachmentId":{"type":"string","description":"The Facebook attachment ID."},"whatsappAttachmentId":{"type":"string","description":"The WhatsApp attachment ID."},"instagramAttachmentId":{"type":"string","description":"The Instagram attachment ID."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageContentButtonsDto":{"type":"object","properties":{"buttons":{"description":"The list of buttons.","type":"array","items":{"$ref":"#/components/schemas/MessageContentButtonDto"}}},"required":["buttons"]},"MessageContentButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, postback)."},"value":{"type":"string","description":"The value associated with the button."},"payload":{"type":"string","description":"An optional payload for the button."}},"required":["label","type","value"]},"MessageContentButtonReplyDto":{"type":"object","properties":{"label":{"type":"string","description":"The label of the selected button."},"value":{"type":"string","description":"The value of the selected button."},"payload":{"type":"string","description":"An optional payload from the button."},"type":{"type":"string","description":"The type of the button."},"reference":{"type":"string","description":"The reference to the original button message."}},"required":["label","value","reference"]},"MessageTemplateDto":{"type":"object","properties":{"body":{"type":"string","description":"The body text of the template."},"header":{"type":"string","description":"The header text of the template."},"footer":{"type":"string","description":"The footer text of the template."}},"required":["body"]},"MessageLocationDto":{"type":"object","properties":{"latitude":{"type":"number","description":"The latitude coordinate."},"longitude":{"type":"number","description":"The longitude coordinate."}},"required":["latitude","longitude"]},"MessageVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for hanging up the call."},"headers":{"type":"object","description":"Custom SIP headers for the hangup.","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"MessageVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string","description":"The target phone number or SIP address for the transfer."},"reason":{"type":"string","description":"The reason for the transfer."},"headers":{"type":"object","description":"Custom SIP headers for the transfer.","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"MessageAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for the handover to an agent."},"timeoutSeconds":{"type":"number","description":"Timeout in seconds before the handover expires."},"agentId":{"type":"string","description":"The ID of the specific agent to hand over to."},"groupId":{"type":"string","description":"The ID of the agent group to hand over to."},"assignmentMethod":{"type":"string","description":"The method for assigning the agent (e.g., round_robin, least_busy)."}},"required":["reason"]},"MessageContentEmailDto":{"type":"object","properties":{"subject":{"type":"string","description":"The subject of the email."},"body":{"type":"string","description":"The body content of the email."},"from":{"type":"string","description":"The sender email address."},"to":{"description":"The list of recipient email addresses.","type":"array","items":{"type":"string"}},"cc":{"description":"The list of CC recipient email addresses.","type":"array","items":{"type":"string"}},"bcc":{"description":"The list of BCC recipient email addresses.","type":"array","items":{"type":"string"}},"attachmentIds":{"description":"The list of attachment IDs.","type":"array","items":{"type":"string"}},"references":{"description":"The list of email references for threading.","type":"array","items":{"type":"string"}}},"required":["subject","body","from","to","cc","bcc","attachmentIds","references"]},"MessageContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"string","description":"The text to be converted to speech."},"speech":{"type":"string","description":"Pre-generated speech audio reference."}},"required":["text"]},"MessageMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the template on Meta."},"language":{"type":"string","description":"The language code of the template."},"bodyText":{"type":"string","description":"The body text of the message. Placeholders are in the form `{{1}}`."},"headerText":{"type":"string","description":"The text in the header (if present)."},"footerText":{"type":"string","description":"The text in the footer (if present)."},"header":{"description":"The header component, which can contain a file or text parameters.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_HeaderDto"}]},"bodyParameters":{"description":"A list of values that replace the placeholders in the `bodyText`.","type":"array","items":{"type":"string"}},"buttons":{"description":"A list of buttons attached to the message.","type":"array","items":{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_ButtonDto"}}},"required":["templateName","language","bodyText","bodyParameters","buttons"]},"MessageMetaWhatsAppTemplate_HeaderDto":{"type":"object","properties":{"file":{"description":"The file attached to the header.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_Header_FileDto"}]},"parameters":{"description":"The list of parameter values for the header placeholders.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"MessageMetaWhatsAppTemplate_Header_FileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, video)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageMetaWhatsAppTemplate_ButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, quick_reply)."},"url":{"type":"string","description":"The URL for URL-type buttons."},"value":{"type":"string","description":"The value for quick_reply-type buttons."}},"required":["label","type"]},"OperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The unique identifier of the operator."}},"required":["operatorId"]}}}}
```

## The CreateMessageDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateMessageDto":{"type":"object","properties":{"content":{"description":"The content of the message.","allOf":[{"$ref":"#/components/schemas/ContentDto"}]},"sender":{"type":"string","description":"The sender type.","enum":["agent","bot","user"]},"type":{"type":"string","description":"The type of message content."},"persona":{"description":"The persona used for this message.","allOf":[{"$ref":"#/components/schemas/MessagePersonaDto"}]},"providerMessageId":{"type":"string","description":"The message ID from the external provider."},"status":{"type":"string","description":"The delivery status of the message."},"created":{"type":"string","description":"Timestamp when the message was created (ISO format)."},"processed":{"type":"string","description":"Timestamp when the message was processed."},"sent":{"type":"string","description":"Timestamp when the message was sent."},"received":{"type":"string","description":"Timestamp when the message was received."},"read":{"type":"string","description":"Timestamp when the message was read."},"outgoing":{"type":"boolean","description":"Whether this is an outgoing message from the bot/operator."},"contextId":{"type":"string","description":"The context ID for message threading."},"messengerId":{"type":"string","description":"The messenger-specific ID."},"author":{"type":"string","description":"The author of the message (operator ID)."},"error":{"type":"string","description":"Optional error message."},"isSensitive":{"type":"boolean","description":"Whether the message contains sensitive data."},"leadAiId":{"type":"string","description":"The Lead AI ID associated with this message."},"streamGroupId":{"type":"string","description":"The stream group ID for grouped messages."},"delay":{"type":"number","description":"Delay in milliseconds before sending."}},"required":["content","sender","type","status","created","outgoing"]},"ContentDto":{"type":"object","properties":{"text":{"type":"string","description":"The text content of the message."},"file":{"description":"A file attachment.","allOf":[{"$ref":"#/components/schemas/MessageContentFileDto"}]},"buttons":{"description":"Interactive buttons for the message.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonsDto"}]},"selectedButton":{"description":"The button selected by the user.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonReplyDto"}]},"template":{"description":"A message template.","allOf":[{"$ref":"#/components/schemas/MessageTemplateDto"}]},"location":{"description":"A location shared in the message.","allOf":[{"$ref":"#/components/schemas/MessageLocationDto"}]},"voiceHangup":{"description":"Voice hangup data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceHangupDto"}]},"voiceTransfer":{"description":"Voice transfer data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceTransferDto"}]},"agentHandover":{"description":"Agent handover data.","allOf":[{"$ref":"#/components/schemas/MessageAgentHandoverDto"}]},"email":{"description":"Email content data.","allOf":[{"$ref":"#/components/schemas/MessageContentEmailDto"}]},"textToSpeech":{"description":"Text-to-speech content data.","allOf":[{"$ref":"#/components/schemas/MessageContentTextToSpeechDto"}]},"metaWhatsappTemplate":{"description":"A Meta WhatsApp template message.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplateDto"}]},"operator":{"description":"Operator data for the message.","allOf":[{"$ref":"#/components/schemas/OperatorDto"}]},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."},"leadAiId":{"type":"string","description":"The ID of the Lead AI associated with this message."}}},"MessageContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, audio)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."},"caption":{"type":"string","description":"An optional caption for the file."},"transcript":{"type":"string","description":"The transcript of audio/video content."},"facebookAttachmentId":{"type":"string","description":"The Facebook attachment ID."},"whatsappAttachmentId":{"type":"string","description":"The WhatsApp attachment ID."},"instagramAttachmentId":{"type":"string","description":"The Instagram attachment ID."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageContentButtonsDto":{"type":"object","properties":{"buttons":{"description":"The list of buttons.","type":"array","items":{"$ref":"#/components/schemas/MessageContentButtonDto"}}},"required":["buttons"]},"MessageContentButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, postback)."},"value":{"type":"string","description":"The value associated with the button."},"payload":{"type":"string","description":"An optional payload for the button."}},"required":["label","type","value"]},"MessageContentButtonReplyDto":{"type":"object","properties":{"label":{"type":"string","description":"The label of the selected button."},"value":{"type":"string","description":"The value of the selected button."},"payload":{"type":"string","description":"An optional payload from the button."},"type":{"type":"string","description":"The type of the button."},"reference":{"type":"string","description":"The reference to the original button message."}},"required":["label","value","reference"]},"MessageTemplateDto":{"type":"object","properties":{"body":{"type":"string","description":"The body text of the template."},"header":{"type":"string","description":"The header text of the template."},"footer":{"type":"string","description":"The footer text of the template."}},"required":["body"]},"MessageLocationDto":{"type":"object","properties":{"latitude":{"type":"number","description":"The latitude coordinate."},"longitude":{"type":"number","description":"The longitude coordinate."}},"required":["latitude","longitude"]},"MessageVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for hanging up the call."},"headers":{"type":"object","description":"Custom SIP headers for the hangup.","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"MessageVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string","description":"The target phone number or SIP address for the transfer."},"reason":{"type":"string","description":"The reason for the transfer."},"headers":{"type":"object","description":"Custom SIP headers for the transfer.","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"MessageAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for the handover to an agent."},"timeoutSeconds":{"type":"number","description":"Timeout in seconds before the handover expires."},"agentId":{"type":"string","description":"The ID of the specific agent to hand over to."},"groupId":{"type":"string","description":"The ID of the agent group to hand over to."},"assignmentMethod":{"type":"string","description":"The method for assigning the agent (e.g., round_robin, least_busy)."}},"required":["reason"]},"MessageContentEmailDto":{"type":"object","properties":{"subject":{"type":"string","description":"The subject of the email."},"body":{"type":"string","description":"The body content of the email."},"from":{"type":"string","description":"The sender email address."},"to":{"description":"The list of recipient email addresses.","type":"array","items":{"type":"string"}},"cc":{"description":"The list of CC recipient email addresses.","type":"array","items":{"type":"string"}},"bcc":{"description":"The list of BCC recipient email addresses.","type":"array","items":{"type":"string"}},"attachmentIds":{"description":"The list of attachment IDs.","type":"array","items":{"type":"string"}},"references":{"description":"The list of email references for threading.","type":"array","items":{"type":"string"}}},"required":["subject","body","from","to","cc","bcc","attachmentIds","references"]},"MessageContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"string","description":"The text to be converted to speech."},"speech":{"type":"string","description":"Pre-generated speech audio reference."}},"required":["text"]},"MessageMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the template on Meta."},"language":{"type":"string","description":"The language code of the template."},"bodyText":{"type":"string","description":"The body text of the message. Placeholders are in the form `{{1}}`."},"headerText":{"type":"string","description":"The text in the header (if present)."},"footerText":{"type":"string","description":"The text in the footer (if present)."},"header":{"description":"The header component, which can contain a file or text parameters.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_HeaderDto"}]},"bodyParameters":{"description":"A list of values that replace the placeholders in the `bodyText`.","type":"array","items":{"type":"string"}},"buttons":{"description":"A list of buttons attached to the message.","type":"array","items":{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_ButtonDto"}}},"required":["templateName","language","bodyText","bodyParameters","buttons"]},"MessageMetaWhatsAppTemplate_HeaderDto":{"type":"object","properties":{"file":{"description":"The file attached to the header.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_Header_FileDto"}]},"parameters":{"description":"The list of parameter values for the header placeholders.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"MessageMetaWhatsAppTemplate_Header_FileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, video)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageMetaWhatsAppTemplate_ButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, quick_reply)."},"url":{"type":"string","description":"The URL for URL-type buttons."},"value":{"type":"string","description":"The value for quick_reply-type buttons."}},"required":["label","type"]},"OperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The unique identifier of the operator."}},"required":["operatorId"]},"MessagePersonaDto":{"type":"object","properties":{"image":{"type":"string","description":"The URL of the persona's avatar image."},"name":{"type":"string","description":"The display name of the persona."}},"required":["image","name"]}}}}
```

## The CreateMessageRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateMessageRequestDto":{"type":"object","properties":{"disableSending":{"type":"boolean","description":"Whether to skip sending the message to the channel."},"message":{"description":"The message data to create.","allOf":[{"$ref":"#/components/schemas/CreateMessageDto"}]}},"required":["disableSending","message"]},"CreateMessageDto":{"type":"object","properties":{"content":{"description":"The content of the message.","allOf":[{"$ref":"#/components/schemas/ContentDto"}]},"sender":{"type":"string","description":"The sender type.","enum":["agent","bot","user"]},"type":{"type":"string","description":"The type of message content."},"persona":{"description":"The persona used for this message.","allOf":[{"$ref":"#/components/schemas/MessagePersonaDto"}]},"providerMessageId":{"type":"string","description":"The message ID from the external provider."},"status":{"type":"string","description":"The delivery status of the message."},"created":{"type":"string","description":"Timestamp when the message was created (ISO format)."},"processed":{"type":"string","description":"Timestamp when the message was processed."},"sent":{"type":"string","description":"Timestamp when the message was sent."},"received":{"type":"string","description":"Timestamp when the message was received."},"read":{"type":"string","description":"Timestamp when the message was read."},"outgoing":{"type":"boolean","description":"Whether this is an outgoing message from the bot/operator."},"contextId":{"type":"string","description":"The context ID for message threading."},"messengerId":{"type":"string","description":"The messenger-specific ID."},"author":{"type":"string","description":"The author of the message (operator ID)."},"error":{"type":"string","description":"Optional error message."},"isSensitive":{"type":"boolean","description":"Whether the message contains sensitive data."},"leadAiId":{"type":"string","description":"The Lead AI ID associated with this message."},"streamGroupId":{"type":"string","description":"The stream group ID for grouped messages."},"delay":{"type":"number","description":"Delay in milliseconds before sending."}},"required":["content","sender","type","status","created","outgoing"]},"ContentDto":{"type":"object","properties":{"text":{"type":"string","description":"The text content of the message."},"file":{"description":"A file attachment.","allOf":[{"$ref":"#/components/schemas/MessageContentFileDto"}]},"buttons":{"description":"Interactive buttons for the message.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonsDto"}]},"selectedButton":{"description":"The button selected by the user.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonReplyDto"}]},"template":{"description":"A message template.","allOf":[{"$ref":"#/components/schemas/MessageTemplateDto"}]},"location":{"description":"A location shared in the message.","allOf":[{"$ref":"#/components/schemas/MessageLocationDto"}]},"voiceHangup":{"description":"Voice hangup data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceHangupDto"}]},"voiceTransfer":{"description":"Voice transfer data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceTransferDto"}]},"agentHandover":{"description":"Agent handover data.","allOf":[{"$ref":"#/components/schemas/MessageAgentHandoverDto"}]},"email":{"description":"Email content data.","allOf":[{"$ref":"#/components/schemas/MessageContentEmailDto"}]},"textToSpeech":{"description":"Text-to-speech content data.","allOf":[{"$ref":"#/components/schemas/MessageContentTextToSpeechDto"}]},"metaWhatsappTemplate":{"description":"A Meta WhatsApp template message.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplateDto"}]},"operator":{"description":"Operator data for the message.","allOf":[{"$ref":"#/components/schemas/OperatorDto"}]},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."},"leadAiId":{"type":"string","description":"The ID of the Lead AI associated with this message."}}},"MessageContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, audio)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."},"caption":{"type":"string","description":"An optional caption for the file."},"transcript":{"type":"string","description":"The transcript of audio/video content."},"facebookAttachmentId":{"type":"string","description":"The Facebook attachment ID."},"whatsappAttachmentId":{"type":"string","description":"The WhatsApp attachment ID."},"instagramAttachmentId":{"type":"string","description":"The Instagram attachment ID."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageContentButtonsDto":{"type":"object","properties":{"buttons":{"description":"The list of buttons.","type":"array","items":{"$ref":"#/components/schemas/MessageContentButtonDto"}}},"required":["buttons"]},"MessageContentButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, postback)."},"value":{"type":"string","description":"The value associated with the button."},"payload":{"type":"string","description":"An optional payload for the button."}},"required":["label","type","value"]},"MessageContentButtonReplyDto":{"type":"object","properties":{"label":{"type":"string","description":"The label of the selected button."},"value":{"type":"string","description":"The value of the selected button."},"payload":{"type":"string","description":"An optional payload from the button."},"type":{"type":"string","description":"The type of the button."},"reference":{"type":"string","description":"The reference to the original button message."}},"required":["label","value","reference"]},"MessageTemplateDto":{"type":"object","properties":{"body":{"type":"string","description":"The body text of the template."},"header":{"type":"string","description":"The header text of the template."},"footer":{"type":"string","description":"The footer text of the template."}},"required":["body"]},"MessageLocationDto":{"type":"object","properties":{"latitude":{"type":"number","description":"The latitude coordinate."},"longitude":{"type":"number","description":"The longitude coordinate."}},"required":["latitude","longitude"]},"MessageVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for hanging up the call."},"headers":{"type":"object","description":"Custom SIP headers for the hangup.","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"MessageVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string","description":"The target phone number or SIP address for the transfer."},"reason":{"type":"string","description":"The reason for the transfer."},"headers":{"type":"object","description":"Custom SIP headers for the transfer.","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"MessageAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for the handover to an agent."},"timeoutSeconds":{"type":"number","description":"Timeout in seconds before the handover expires."},"agentId":{"type":"string","description":"The ID of the specific agent to hand over to."},"groupId":{"type":"string","description":"The ID of the agent group to hand over to."},"assignmentMethod":{"type":"string","description":"The method for assigning the agent (e.g., round_robin, least_busy)."}},"required":["reason"]},"MessageContentEmailDto":{"type":"object","properties":{"subject":{"type":"string","description":"The subject of the email."},"body":{"type":"string","description":"The body content of the email."},"from":{"type":"string","description":"The sender email address."},"to":{"description":"The list of recipient email addresses.","type":"array","items":{"type":"string"}},"cc":{"description":"The list of CC recipient email addresses.","type":"array","items":{"type":"string"}},"bcc":{"description":"The list of BCC recipient email addresses.","type":"array","items":{"type":"string"}},"attachmentIds":{"description":"The list of attachment IDs.","type":"array","items":{"type":"string"}},"references":{"description":"The list of email references for threading.","type":"array","items":{"type":"string"}}},"required":["subject","body","from","to","cc","bcc","attachmentIds","references"]},"MessageContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"string","description":"The text to be converted to speech."},"speech":{"type":"string","description":"Pre-generated speech audio reference."}},"required":["text"]},"MessageMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the template on Meta."},"language":{"type":"string","description":"The language code of the template."},"bodyText":{"type":"string","description":"The body text of the message. Placeholders are in the form `{{1}}`."},"headerText":{"type":"string","description":"The text in the header (if present)."},"footerText":{"type":"string","description":"The text in the footer (if present)."},"header":{"description":"The header component, which can contain a file or text parameters.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_HeaderDto"}]},"bodyParameters":{"description":"A list of values that replace the placeholders in the `bodyText`.","type":"array","items":{"type":"string"}},"buttons":{"description":"A list of buttons attached to the message.","type":"array","items":{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_ButtonDto"}}},"required":["templateName","language","bodyText","bodyParameters","buttons"]},"MessageMetaWhatsAppTemplate_HeaderDto":{"type":"object","properties":{"file":{"description":"The file attached to the header.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_Header_FileDto"}]},"parameters":{"description":"The list of parameter values for the header placeholders.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"MessageMetaWhatsAppTemplate_Header_FileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, video)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageMetaWhatsAppTemplate_ButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, quick_reply)."},"url":{"type":"string","description":"The URL for URL-type buttons."},"value":{"type":"string","description":"The value for quick_reply-type buttons."}},"required":["label","type"]},"OperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The unique identifier of the operator."}},"required":["operatorId"]},"MessagePersonaDto":{"type":"object","properties":{"image":{"type":"string","description":"The URL of the persona's avatar image."},"name":{"type":"string","description":"The display name of the persona."}},"required":["image","name"]}}}}
```

## The UpdateMessage\_TagsDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateMessage_TagsDto":{"type":"object","properties":{"tags":{"description":"The tags to set on the message.","type":"array","items":{"type":"string"}}},"required":["tags"]}}}}
```

## The UpdateMessageDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateMessageDto":{"type":"object","properties":{"providerMessageId":{"type":"string","description":"The new provider message ID."},"status":{"type":"string","description":"The new delivery status."},"processed":{"type":"string","description":"Timestamp when the message was processed."},"sent":{"type":"string","description":"Timestamp when the message was sent."},"received":{"type":"string","description":"Timestamp when the message was received."},"read":{"type":"string","description":"Timestamp when the message was read."},"tags":{"description":"Tags to set on the message.","allOf":[{"$ref":"#/components/schemas/UpdateMessage_TagsDto"}]},"messengerId":{"type":"string","description":"The new messenger-specific ID."},"transcript":{"type":"string","description":"The transcript of audio/video content."},"deleted":{"type":"boolean","description":"Whether to mark the message as deleted."},"error":{"type":"string","description":"Optional error message."},"isSensitive":{"type":"boolean","description":"Whether the message contains sensitive data."},"streamGroupId":{"type":"string","description":"The stream group ID for grouped messages."},"delay":{"type":"number","description":"Delay in milliseconds before sending."}}},"UpdateMessage_TagsDto":{"type":"object","properties":{"tags":{"description":"The tags to set on the message.","type":"array","items":{"type":"string"}}},"required":["tags"]}}}}
```

## The UpdateMessageRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateMessageRequestDto":{"type":"object","properties":{"message":{"description":"The message data to update.","allOf":[{"$ref":"#/components/schemas/UpdateMessageDto"}]}},"required":["message"]},"UpdateMessageDto":{"type":"object","properties":{"providerMessageId":{"type":"string","description":"The new provider message ID."},"status":{"type":"string","description":"The new delivery status."},"processed":{"type":"string","description":"Timestamp when the message was processed."},"sent":{"type":"string","description":"Timestamp when the message was sent."},"received":{"type":"string","description":"Timestamp when the message was received."},"read":{"type":"string","description":"Timestamp when the message was read."},"tags":{"description":"Tags to set on the message.","allOf":[{"$ref":"#/components/schemas/UpdateMessage_TagsDto"}]},"messengerId":{"type":"string","description":"The new messenger-specific ID."},"transcript":{"type":"string","description":"The transcript of audio/video content."},"deleted":{"type":"boolean","description":"Whether to mark the message as deleted."},"error":{"type":"string","description":"Optional error message."},"isSensitive":{"type":"boolean","description":"Whether the message contains sensitive data."},"streamGroupId":{"type":"string","description":"The stream group ID for grouped messages."},"delay":{"type":"number","description":"Delay in milliseconds before sending."}}},"UpdateMessage_TagsDto":{"type":"object","properties":{"tags":{"description":"The tags to set on the message.","type":"array","items":{"type":"string"}}},"required":["tags"]}}}}
```

## The AddressDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"AddressDto":{"type":"object","properties":{"street":{"type":"string","description":"The street name."},"country":{"type":"string","description":"The country name."},"zipcode":{"type":"string","description":"The postal/zip code."},"houseNumber":{"type":"string","description":"The house number."},"location":{"type":"string","description":"The city or location name."}}}}}}
```

## The OrganizationDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"OrganizationDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the organization."},"name":{"type":"string","description":"The name of the organization."},"created":{"type":"string","description":"Timestamp when the organization was created."},"updated":{"type":"string","description":"Timestamp when the organization was last updated."},"email":{"type":"string","format":"email","description":"The email address of the organization."},"website":{"type":"string","format":"uri","description":"The website URL of the organization."},"size":{"type":"number","description":"The number of employees in the organization."},"industry":{"type":"string","description":"The industry of the organization."},"address":{"description":"The address of the organization.","allOf":[{"$ref":"#/components/schemas/AddressDto"}]},"variables":{"type":"object","description":"Custom variables as key-value pairs.","additionalProperties":{"type":"string"}}},"required":["id","name","created","updated","variables"]},"AddressDto":{"type":"object","properties":{"street":{"type":"string","description":"The street name."},"country":{"type":"string","description":"The country name."},"zipcode":{"type":"string","description":"The postal/zip code."},"houseNumber":{"type":"string","description":"The house number."},"location":{"type":"string","description":"The city or location name."}}}}}}
```

## The ListOrganizationsResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListOrganizationsResponseDto":{"type":"object","properties":{"organizations":{"description":"The list of organizations.","type":"array","items":{"$ref":"#/components/schemas/OrganizationDto"}},"error":{"type":"string","description":"Optional error message."}},"required":["organizations"]},"OrganizationDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the organization."},"name":{"type":"string","description":"The name of the organization."},"created":{"type":"string","description":"Timestamp when the organization was created."},"updated":{"type":"string","description":"Timestamp when the organization was last updated."},"email":{"type":"string","format":"email","description":"The email address of the organization."},"website":{"type":"string","format":"uri","description":"The website URL of the organization."},"size":{"type":"number","description":"The number of employees in the organization."},"industry":{"type":"string","description":"The industry of the organization."},"address":{"description":"The address of the organization.","allOf":[{"$ref":"#/components/schemas/AddressDto"}]},"variables":{"type":"object","description":"Custom variables as key-value pairs.","additionalProperties":{"type":"string"}}},"required":["id","name","created","updated","variables"]},"AddressDto":{"type":"object","properties":{"street":{"type":"string","description":"The street name."},"country":{"type":"string","description":"The country name."},"zipcode":{"type":"string","description":"The postal/zip code."},"houseNumber":{"type":"string","description":"The house number."},"location":{"type":"string","description":"The city or location name."}}}}}}
```

## The SearchResultHitOrganizationDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"SearchResultHitOrganizationDto":{"type":"object","properties":{"organization":{"description":"The matching organization.","allOf":[{"$ref":"#/components/schemas/OrganizationDto"}]},"highlights":{"description":"List of highlighted match results.","type":"array","items":{"$ref":"#/components/schemas/HighlightResultDto"}},"textMatch":{"type":"string","description":"A combined string of all text matches."}},"required":["organization","highlights","textMatch"]},"OrganizationDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the organization."},"name":{"type":"string","description":"The name of the organization."},"created":{"type":"string","description":"Timestamp when the organization was created."},"updated":{"type":"string","description":"Timestamp when the organization was last updated."},"email":{"type":"string","format":"email","description":"The email address of the organization."},"website":{"type":"string","format":"uri","description":"The website URL of the organization."},"size":{"type":"number","description":"The number of employees in the organization."},"industry":{"type":"string","description":"The industry of the organization."},"address":{"description":"The address of the organization.","allOf":[{"$ref":"#/components/schemas/AddressDto"}]},"variables":{"type":"object","description":"Custom variables as key-value pairs.","additionalProperties":{"type":"string"}}},"required":["id","name","created","updated","variables"]},"AddressDto":{"type":"object","properties":{"street":{"type":"string","description":"The street name."},"country":{"type":"string","description":"The country name."},"zipcode":{"type":"string","description":"The postal/zip code."},"houseNumber":{"type":"string","description":"The house number."},"location":{"type":"string","description":"The city or location name."}}},"HighlightResultDto":{"type":"object","properties":{"field":{"type":"string","description":"The field where the hit was found."},"matchedTokens":{"description":"The exact words that matched.","type":"array","items":{"type":"string"}},"snippet":{"type":"string","description":"A short excerpt of the text with highlights."}},"required":["field","matchedTokens","snippet"]}}}}
```

## The SearchOrganizationResultDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"SearchOrganizationResultDto":{"type":"object","properties":{"facetCounts":{"description":"The facet counts for the search.","type":"array","items":{"$ref":"#/components/schemas/SearchResultFacetDto"}},"found":{"type":"number","description":"Total number of results found."},"hits":{"description":"The search result hits.","type":"array","items":{"$ref":"#/components/schemas/SearchResultHitOrganizationDto"}},"outOf":{"type":"number","description":"Total number of documents searched."},"page":{"type":"number","description":"The current page of search results."},"searchTimeMs":{"type":"number","description":"The search duration in milliseconds."}},"required":["facetCounts","found","hits","outOf","page","searchTimeMs"]},"SearchResultFacetDto":{"type":"object","properties":{"counts":{"description":"The facet value counts.","type":"array","items":{"$ref":"#/components/schemas/SearchResultFacet_CountDto"}},"fieldName":{"type":"string","description":"The name of the faceted field."},"stats":{"description":"Statistics for numeric facets.","allOf":[{"$ref":"#/components/schemas/SearchResultFacet_StatsDto"}]}},"required":["counts","fieldName"]},"SearchResultFacet_CountDto":{"type":"object","properties":{"count":{"type":"number","description":"The number of results for this facet value."},"highlighted":{"type":"string","description":"The highlighted facet value."},"value":{"type":"string","description":"The facet value."}},"required":["count","highlighted","value"]},"SearchResultFacet_StatsDto":{"type":"object","properties":{"max":{"type":"number","description":"The maximum value."},"avg":{"type":"number","description":"The average value."},"min":{"type":"number","description":"The minimum value."},"sum":{"type":"number","description":"The sum of all values."}}},"SearchResultHitOrganizationDto":{"type":"object","properties":{"organization":{"description":"The matching organization.","allOf":[{"$ref":"#/components/schemas/OrganizationDto"}]},"highlights":{"description":"List of highlighted match results.","type":"array","items":{"$ref":"#/components/schemas/HighlightResultDto"}},"textMatch":{"type":"string","description":"A combined string of all text matches."}},"required":["organization","highlights","textMatch"]},"OrganizationDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the organization."},"name":{"type":"string","description":"The name of the organization."},"created":{"type":"string","description":"Timestamp when the organization was created."},"updated":{"type":"string","description":"Timestamp when the organization was last updated."},"email":{"type":"string","format":"email","description":"The email address of the organization."},"website":{"type":"string","format":"uri","description":"The website URL of the organization."},"size":{"type":"number","description":"The number of employees in the organization."},"industry":{"type":"string","description":"The industry of the organization."},"address":{"description":"The address of the organization.","allOf":[{"$ref":"#/components/schemas/AddressDto"}]},"variables":{"type":"object","description":"Custom variables as key-value pairs.","additionalProperties":{"type":"string"}}},"required":["id","name","created","updated","variables"]},"AddressDto":{"type":"object","properties":{"street":{"type":"string","description":"The street name."},"country":{"type":"string","description":"The country name."},"zipcode":{"type":"string","description":"The postal/zip code."},"houseNumber":{"type":"string","description":"The house number."},"location":{"type":"string","description":"The city or location name."}}},"HighlightResultDto":{"type":"object","properties":{"field":{"type":"string","description":"The field where the hit was found."},"matchedTokens":{"description":"The exact words that matched.","type":"array","items":{"type":"string"}},"snippet":{"type":"string","description":"A short excerpt of the text with highlights."}},"required":["field","matchedTokens","snippet"]}}}}
```

## The SearchOrganizationResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"SearchOrganizationResponseDto":{"type":"object","properties":{"results":{"description":"The search results.","nullable":true,"allOf":[{"$ref":"#/components/schemas/SearchOrganizationResultDto"}]},"error":{"type":"string","description":"Optional error message."}},"required":["results"]},"SearchOrganizationResultDto":{"type":"object","properties":{"facetCounts":{"description":"The facet counts for the search.","type":"array","items":{"$ref":"#/components/schemas/SearchResultFacetDto"}},"found":{"type":"number","description":"Total number of results found."},"hits":{"description":"The search result hits.","type":"array","items":{"$ref":"#/components/schemas/SearchResultHitOrganizationDto"}},"outOf":{"type":"number","description":"Total number of documents searched."},"page":{"type":"number","description":"The current page of search results."},"searchTimeMs":{"type":"number","description":"The search duration in milliseconds."}},"required":["facetCounts","found","hits","outOf","page","searchTimeMs"]},"SearchResultFacetDto":{"type":"object","properties":{"counts":{"description":"The facet value counts.","type":"array","items":{"$ref":"#/components/schemas/SearchResultFacet_CountDto"}},"fieldName":{"type":"string","description":"The name of the faceted field."},"stats":{"description":"Statistics for numeric facets.","allOf":[{"$ref":"#/components/schemas/SearchResultFacet_StatsDto"}]}},"required":["counts","fieldName"]},"SearchResultFacet_CountDto":{"type":"object","properties":{"count":{"type":"number","description":"The number of results for this facet value."},"highlighted":{"type":"string","description":"The highlighted facet value."},"value":{"type":"string","description":"The facet value."}},"required":["count","highlighted","value"]},"SearchResultFacet_StatsDto":{"type":"object","properties":{"max":{"type":"number","description":"The maximum value."},"avg":{"type":"number","description":"The average value."},"min":{"type":"number","description":"The minimum value."},"sum":{"type":"number","description":"The sum of all values."}}},"SearchResultHitOrganizationDto":{"type":"object","properties":{"organization":{"description":"The matching organization.","allOf":[{"$ref":"#/components/schemas/OrganizationDto"}]},"highlights":{"description":"List of highlighted match results.","type":"array","items":{"$ref":"#/components/schemas/HighlightResultDto"}},"textMatch":{"type":"string","description":"A combined string of all text matches."}},"required":["organization","highlights","textMatch"]},"OrganizationDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the organization."},"name":{"type":"string","description":"The name of the organization."},"created":{"type":"string","description":"Timestamp when the organization was created."},"updated":{"type":"string","description":"Timestamp when the organization was last updated."},"email":{"type":"string","format":"email","description":"The email address of the organization."},"website":{"type":"string","format":"uri","description":"The website URL of the organization."},"size":{"type":"number","description":"The number of employees in the organization."},"industry":{"type":"string","description":"The industry of the organization."},"address":{"description":"The address of the organization.","allOf":[{"$ref":"#/components/schemas/AddressDto"}]},"variables":{"type":"object","description":"Custom variables as key-value pairs.","additionalProperties":{"type":"string"}}},"required":["id","name","created","updated","variables"]},"AddressDto":{"type":"object","properties":{"street":{"type":"string","description":"The street name."},"country":{"type":"string","description":"The country name."},"zipcode":{"type":"string","description":"The postal/zip code."},"houseNumber":{"type":"string","description":"The house number."},"location":{"type":"string","description":"The city or location name."}}},"HighlightResultDto":{"type":"object","properties":{"field":{"type":"string","description":"The field where the hit was found."},"matchedTokens":{"description":"The exact words that matched.","type":"array","items":{"type":"string"}},"snippet":{"type":"string","description":"A short excerpt of the text with highlights."}},"required":["field","matchedTokens","snippet"]}}}}
```

## The ContactDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ContactDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the contact."},"name":{"type":"string","description":"The display name of the contact."},"created":{"type":"string","description":"Timestamp when the contact was created."},"updated":{"type":"string","description":"Timestamp when the contact was last updated."},"email":{"type":"string","description":"The email address of the contact."},"address":{"description":"The address of the contact.","allOf":[{"$ref":"#/components/schemas/AddressDto"}]},"phoneNumber":{"type":"string","description":"The phone number of the contact."},"variables":{"type":"object","description":"Custom variables as key-value pairs.","additionalProperties":{"type":"string"}},"organizationIds":{"description":"List of organization IDs this contact belongs to.","type":"array","items":{"type":"string"}},"whatsappId":{"type":"string","description":"The WhatsApp ID of the contact."},"telegramId":{"type":"string","description":"The Telegram ID of the contact."},"facebookId":{"type":"string","description":"The Facebook ID of the contact."},"instagramId":{"type":"string","description":"The Instagram ID of the contact."},"avatar":{"type":"string","description":"The URL to the contact's avatar image."}},"required":["id","name","created","updated","variables","organizationIds"]},"AddressDto":{"type":"object","properties":{"street":{"type":"string","description":"The street name."},"country":{"type":"string","description":"The country name."},"zipcode":{"type":"string","description":"The postal/zip code."},"houseNumber":{"type":"string","description":"The house number."},"location":{"type":"string","description":"The city or location name."}}}}}}
```

## The ListOrganizationContactsResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListOrganizationContactsResponseDto":{"type":"object","properties":{"contacts":{"description":"The list of contacts in the organization.","type":"array","items":{"$ref":"#/components/schemas/ContactDto"}},"error":{"type":"string","description":"Optional error message."}},"required":["contacts"]},"ContactDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the contact."},"name":{"type":"string","description":"The display name of the contact."},"created":{"type":"string","description":"Timestamp when the contact was created."},"updated":{"type":"string","description":"Timestamp when the contact was last updated."},"email":{"type":"string","description":"The email address of the contact."},"address":{"description":"The address of the contact.","allOf":[{"$ref":"#/components/schemas/AddressDto"}]},"phoneNumber":{"type":"string","description":"The phone number of the contact."},"variables":{"type":"object","description":"Custom variables as key-value pairs.","additionalProperties":{"type":"string"}},"organizationIds":{"description":"List of organization IDs this contact belongs to.","type":"array","items":{"type":"string"}},"whatsappId":{"type":"string","description":"The WhatsApp ID of the contact."},"telegramId":{"type":"string","description":"The Telegram ID of the contact."},"facebookId":{"type":"string","description":"The Facebook ID of the contact."},"instagramId":{"type":"string","description":"The Instagram ID of the contact."},"avatar":{"type":"string","description":"The URL to the contact's avatar image."}},"required":["id","name","created","updated","variables","organizationIds"]},"AddressDto":{"type":"object","properties":{"street":{"type":"string","description":"The street name."},"country":{"type":"string","description":"The country name."},"zipcode":{"type":"string","description":"The postal/zip code."},"houseNumber":{"type":"string","description":"The house number."},"location":{"type":"string","description":"The city or location name."}}}}}}
```

## The CreateOrganizationRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateOrganizationRequestDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the organization."},"email":{"type":"string","description":"The email address of the organization."},"website":{"type":"string","description":"The website URL of the organization."},"size":{"type":"number","description":"The number of employees in the organization."},"industry":{"type":"string","description":"The industry of the organization."},"address":{"description":"The address of the organization.","allOf":[{"$ref":"#/components/schemas/AddressDto"}]},"phoneNumber":{"type":"string","description":"The phone number of the organization."}},"required":["name"]},"AddressDto":{"type":"object","properties":{"street":{"type":"string","description":"The street name."},"country":{"type":"string","description":"The country name."},"zipcode":{"type":"string","description":"The postal/zip code."},"houseNumber":{"type":"string","description":"The house number."},"location":{"type":"string","description":"The city or location name."}}}}}}
```

## The OrganizationResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"OrganizationResponseDto":{"type":"object","properties":{"organization":{"description":"The organization.","allOf":[{"$ref":"#/components/schemas/OrganizationDto"}]},"error":{"type":"string","description":"Optional error message."}}},"OrganizationDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the organization."},"name":{"type":"string","description":"The name of the organization."},"created":{"type":"string","description":"Timestamp when the organization was created."},"updated":{"type":"string","description":"Timestamp when the organization was last updated."},"email":{"type":"string","format":"email","description":"The email address of the organization."},"website":{"type":"string","format":"uri","description":"The website URL of the organization."},"size":{"type":"number","description":"The number of employees in the organization."},"industry":{"type":"string","description":"The industry of the organization."},"address":{"description":"The address of the organization.","allOf":[{"$ref":"#/components/schemas/AddressDto"}]},"variables":{"type":"object","description":"Custom variables as key-value pairs.","additionalProperties":{"type":"string"}}},"required":["id","name","created","updated","variables"]},"AddressDto":{"type":"object","properties":{"street":{"type":"string","description":"The street name."},"country":{"type":"string","description":"The country name."},"zipcode":{"type":"string","description":"The postal/zip code."},"houseNumber":{"type":"string","description":"The house number."},"location":{"type":"string","description":"The city or location name."}}}}}}
```

## The UpdateOrganizationDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateOrganizationDto":{"type":"object","properties":{"name":{"type":"string","description":"The new name of the organization."},"email":{"type":"string","description":"The new email address of the organization."},"website":{"type":"string","description":"The new website URL of the organization."},"size":{"type":"number","description":"The new number of employees."},"industry":{"type":"string","description":"The new industry of the organization."},"address":{"description":"The new address of the organization.","allOf":[{"$ref":"#/components/schemas/AddressDto"}]},"variables":{"type":"object","description":"Custom variables to set on the organization.","additionalProperties":{"type":"string"}}},"required":["variables"]},"AddressDto":{"type":"object","properties":{"street":{"type":"string","description":"The street name."},"country":{"type":"string","description":"The country name."},"zipcode":{"type":"string","description":"The postal/zip code."},"houseNumber":{"type":"string","description":"The house number."},"location":{"type":"string","description":"The city or location name."}}}}}}
```

## The UpdateOrganizationRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateOrganizationRequestDto":{"type":"object","properties":{"organization":{"description":"The organization data to update.","allOf":[{"$ref":"#/components/schemas/UpdateOrganizationDto"}]}},"required":["organization"]},"UpdateOrganizationDto":{"type":"object","properties":{"name":{"type":"string","description":"The new name of the organization."},"email":{"type":"string","description":"The new email address of the organization."},"website":{"type":"string","description":"The new website URL of the organization."},"size":{"type":"number","description":"The new number of employees."},"industry":{"type":"string","description":"The new industry of the organization."},"address":{"description":"The new address of the organization.","allOf":[{"$ref":"#/components/schemas/AddressDto"}]},"variables":{"type":"object","description":"Custom variables to set on the organization.","additionalProperties":{"type":"string"}}},"required":["variables"]},"AddressDto":{"type":"object","properties":{"street":{"type":"string","description":"The street name."},"country":{"type":"string","description":"The country name."},"zipcode":{"type":"string","description":"The postal/zip code."},"houseNumber":{"type":"string","description":"The house number."},"location":{"type":"string","description":"The city or location name."}}}}}}
```

## The DeleteOrganizationResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"DeleteOrganizationResponseDto":{"type":"object","properties":{"deleted":{"type":"boolean","description":"Indicates whether the organization was successfully deleted."},"error":{"type":"string","description":"Optional error message."}}}}}}
```

## The GetOrganizationContactsCountResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"GetOrganizationContactsCountResponseDto":{"type":"object","properties":{"count":{"type":"number","description":"The number of contacts in the organization."},"error":{"type":"string","description":"Optional error message."}}}}}}
```

## The VariableDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"VariableDto":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the variable (corresponds to the global variable ID)."},"name":{"type":"string","description":"The programmatic name of the variable."},"type":{"type":"string","description":"The data type of the variable."},"value":{"type":"string","description":"The value assigned in this conversation."},"updated":{"type":"string","description":"The timestamp of the last update."}},"required":["id","name","type","value","updated"]}}}}
```

## The ListVariablesResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListVariablesResponseDto":{"type":"object","properties":{"variables":{"description":"The list of conversation variables.","type":"array","items":{"$ref":"#/components/schemas/VariableDto"}},"error":{"type":"string","description":"Optional error message."}},"required":["variables"]},"VariableDto":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the variable (corresponds to the global variable ID)."},"name":{"type":"string","description":"The programmatic name of the variable."},"type":{"type":"string","description":"The data type of the variable."},"value":{"type":"string","description":"The value assigned in this conversation."},"updated":{"type":"string","description":"The timestamp of the last update."}},"required":["id","name","type","value","updated"]}}}}
```

## The VariableResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"VariableResponseDto":{"type":"object","properties":{"variable":{"description":"The variable.","allOf":[{"$ref":"#/components/schemas/VariableDto"}]},"error":{"type":"string","description":"Optional error message."}}},"VariableDto":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the variable (corresponds to the global variable ID)."},"name":{"type":"string","description":"The programmatic name of the variable."},"type":{"type":"string","description":"The data type of the variable."},"value":{"type":"string","description":"The value assigned in this conversation."},"updated":{"type":"string","description":"The timestamp of the last update."}},"required":["id","name","type","value","updated"]}}}}
```

## The AssignValueToConversationVariableRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"AssignValueToConversationVariableRequestDto":{"type":"object","properties":{"value":{"type":"string","description":"The new value to be assigned to the variable."}},"required":["value"]}}}}
```

## The DeleteVariablesResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"DeleteVariablesResponseDto":{"type":"object","properties":{"deleted":{"type":"boolean","description":"Indicates whether the deletion operation was successful."},"error":{"type":"string","description":"Optional error message."}}}}}}
```

## The AssignValueToVariableRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"AssignValueToVariableRequestDto":{"type":"object","properties":{"value":{"type":"string","description":"The new value to be assigned to the variable."},"contactId":{"type":"string","description":"The id of the contact to assign the variable to."}},"required":["value"]}}}}
```

## The SearchResultHitContactDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"SearchResultHitContactDto":{"type":"object","properties":{"contact":{"description":"The matching contact.","allOf":[{"$ref":"#/components/schemas/ContactDto"}]},"highlights":{"description":"List of highlighted match results.","type":"array","items":{"type":"object"}},"textMatch":{"type":"string","description":"A combined string of all text matches."}},"required":["contact","highlights","textMatch"]},"ContactDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the contact."},"name":{"type":"string","description":"The display name of the contact."},"created":{"type":"string","description":"Timestamp when the contact was created."},"updated":{"type":"string","description":"Timestamp when the contact was last updated."},"email":{"type":"string","description":"The email address of the contact."},"address":{"description":"The address of the contact.","allOf":[{"$ref":"#/components/schemas/AddressDto"}]},"phoneNumber":{"type":"string","description":"The phone number of the contact."},"variables":{"type":"object","description":"Custom variables as key-value pairs.","additionalProperties":{"type":"string"}},"organizationIds":{"description":"List of organization IDs this contact belongs to.","type":"array","items":{"type":"string"}},"whatsappId":{"type":"string","description":"The WhatsApp ID of the contact."},"telegramId":{"type":"string","description":"The Telegram ID of the contact."},"facebookId":{"type":"string","description":"The Facebook ID of the contact."},"instagramId":{"type":"string","description":"The Instagram ID of the contact."},"avatar":{"type":"string","description":"The URL to the contact's avatar image."}},"required":["id","name","created","updated","variables","organizationIds"]},"AddressDto":{"type":"object","properties":{"street":{"type":"string","description":"The street name."},"country":{"type":"string","description":"The country name."},"zipcode":{"type":"string","description":"The postal/zip code."},"houseNumber":{"type":"string","description":"The house number."},"location":{"type":"string","description":"The city or location name."}}}}}}
```

## The SearchContactResultDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"SearchContactResultDto":{"type":"object","properties":{"facetCounts":{"description":"The facet counts for the search.","type":"array","items":{"type":"object"}},"found":{"type":"number","description":"Total number of results found."},"hits":{"description":"The search result hits.","type":"array","items":{"$ref":"#/components/schemas/SearchResultHitContactDto"}},"outOf":{"type":"number","description":"Total number of documents searched."},"page":{"type":"number","description":"The current page of search results."},"searchTimeMs":{"type":"number","description":"The duration of the search in milliseconds."}},"required":["facetCounts","found","hits","outOf","page","searchTimeMs"]},"SearchResultHitContactDto":{"type":"object","properties":{"contact":{"description":"The matching contact.","allOf":[{"$ref":"#/components/schemas/ContactDto"}]},"highlights":{"description":"List of highlighted match results.","type":"array","items":{"type":"object"}},"textMatch":{"type":"string","description":"A combined string of all text matches."}},"required":["contact","highlights","textMatch"]},"ContactDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the contact."},"name":{"type":"string","description":"The display name of the contact."},"created":{"type":"string","description":"Timestamp when the contact was created."},"updated":{"type":"string","description":"Timestamp when the contact was last updated."},"email":{"type":"string","description":"The email address of the contact."},"address":{"description":"The address of the contact.","allOf":[{"$ref":"#/components/schemas/AddressDto"}]},"phoneNumber":{"type":"string","description":"The phone number of the contact."},"variables":{"type":"object","description":"Custom variables as key-value pairs.","additionalProperties":{"type":"string"}},"organizationIds":{"description":"List of organization IDs this contact belongs to.","type":"array","items":{"type":"string"}},"whatsappId":{"type":"string","description":"The WhatsApp ID of the contact."},"telegramId":{"type":"string","description":"The Telegram ID of the contact."},"facebookId":{"type":"string","description":"The Facebook ID of the contact."},"instagramId":{"type":"string","description":"The Instagram ID of the contact."},"avatar":{"type":"string","description":"The URL to the contact's avatar image."}},"required":["id","name","created","updated","variables","organizationIds"]},"AddressDto":{"type":"object","properties":{"street":{"type":"string","description":"The street name."},"country":{"type":"string","description":"The country name."},"zipcode":{"type":"string","description":"The postal/zip code."},"houseNumber":{"type":"string","description":"The house number."},"location":{"type":"string","description":"The city or location name."}}}}}}
```

## The SearchContactsResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"SearchContactsResponseDto":{"type":"object","properties":{"results":{"description":"The search results.","nullable":true,"allOf":[{"$ref":"#/components/schemas/SearchContactResultDto"}]},"error":{"type":"string","description":"Optional error message."}},"required":["results"]},"SearchContactResultDto":{"type":"object","properties":{"facetCounts":{"description":"The facet counts for the search.","type":"array","items":{"type":"object"}},"found":{"type":"number","description":"Total number of results found."},"hits":{"description":"The search result hits.","type":"array","items":{"$ref":"#/components/schemas/SearchResultHitContactDto"}},"outOf":{"type":"number","description":"Total number of documents searched."},"page":{"type":"number","description":"The current page of search results."},"searchTimeMs":{"type":"number","description":"The duration of the search in milliseconds."}},"required":["facetCounts","found","hits","outOf","page","searchTimeMs"]},"SearchResultHitContactDto":{"type":"object","properties":{"contact":{"description":"The matching contact.","allOf":[{"$ref":"#/components/schemas/ContactDto"}]},"highlights":{"description":"List of highlighted match results.","type":"array","items":{"type":"object"}},"textMatch":{"type":"string","description":"A combined string of all text matches."}},"required":["contact","highlights","textMatch"]},"ContactDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the contact."},"name":{"type":"string","description":"The display name of the contact."},"created":{"type":"string","description":"Timestamp when the contact was created."},"updated":{"type":"string","description":"Timestamp when the contact was last updated."},"email":{"type":"string","description":"The email address of the contact."},"address":{"description":"The address of the contact.","allOf":[{"$ref":"#/components/schemas/AddressDto"}]},"phoneNumber":{"type":"string","description":"The phone number of the contact."},"variables":{"type":"object","description":"Custom variables as key-value pairs.","additionalProperties":{"type":"string"}},"organizationIds":{"description":"List of organization IDs this contact belongs to.","type":"array","items":{"type":"string"}},"whatsappId":{"type":"string","description":"The WhatsApp ID of the contact."},"telegramId":{"type":"string","description":"The Telegram ID of the contact."},"facebookId":{"type":"string","description":"The Facebook ID of the contact."},"instagramId":{"type":"string","description":"The Instagram ID of the contact."},"avatar":{"type":"string","description":"The URL to the contact's avatar image."}},"required":["id","name","created","updated","variables","organizationIds"]},"AddressDto":{"type":"object","properties":{"street":{"type":"string","description":"The street name."},"country":{"type":"string","description":"The country name."},"zipcode":{"type":"string","description":"The postal/zip code."},"houseNumber":{"type":"string","description":"The house number."},"location":{"type":"string","description":"The city or location name."}}}}}}
```

## The ListContactsResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListContactsResponseDto":{"type":"object","properties":{"contacts":{"description":"The list of contacts.","type":"array","items":{"$ref":"#/components/schemas/ContactDto"}},"error":{"type":"string","description":"Optional error message."}},"required":["contacts"]},"ContactDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the contact."},"name":{"type":"string","description":"The display name of the contact."},"created":{"type":"string","description":"Timestamp when the contact was created."},"updated":{"type":"string","description":"Timestamp when the contact was last updated."},"email":{"type":"string","description":"The email address of the contact."},"address":{"description":"The address of the contact.","allOf":[{"$ref":"#/components/schemas/AddressDto"}]},"phoneNumber":{"type":"string","description":"The phone number of the contact."},"variables":{"type":"object","description":"Custom variables as key-value pairs.","additionalProperties":{"type":"string"}},"organizationIds":{"description":"List of organization IDs this contact belongs to.","type":"array","items":{"type":"string"}},"whatsappId":{"type":"string","description":"The WhatsApp ID of the contact."},"telegramId":{"type":"string","description":"The Telegram ID of the contact."},"facebookId":{"type":"string","description":"The Facebook ID of the contact."},"instagramId":{"type":"string","description":"The Instagram ID of the contact."},"avatar":{"type":"string","description":"The URL to the contact's avatar image."}},"required":["id","name","created","updated","variables","organizationIds"]},"AddressDto":{"type":"object","properties":{"street":{"type":"string","description":"The street name."},"country":{"type":"string","description":"The country name."},"zipcode":{"type":"string","description":"The postal/zip code."},"houseNumber":{"type":"string","description":"The house number."},"location":{"type":"string","description":"The city or location name."}}}}}}
```

## The ContactResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ContactResponseDto":{"type":"object","properties":{"contact":{"description":"The contact.","allOf":[{"$ref":"#/components/schemas/ContactDto"}]},"error":{"type":"string","description":"Optional error message."}}},"ContactDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the contact."},"name":{"type":"string","description":"The display name of the contact."},"created":{"type":"string","description":"Timestamp when the contact was created."},"updated":{"type":"string","description":"Timestamp when the contact was last updated."},"email":{"type":"string","description":"The email address of the contact."},"address":{"description":"The address of the contact.","allOf":[{"$ref":"#/components/schemas/AddressDto"}]},"phoneNumber":{"type":"string","description":"The phone number of the contact."},"variables":{"type":"object","description":"Custom variables as key-value pairs.","additionalProperties":{"type":"string"}},"organizationIds":{"description":"List of organization IDs this contact belongs to.","type":"array","items":{"type":"string"}},"whatsappId":{"type":"string","description":"The WhatsApp ID of the contact."},"telegramId":{"type":"string","description":"The Telegram ID of the contact."},"facebookId":{"type":"string","description":"The Facebook ID of the contact."},"instagramId":{"type":"string","description":"The Instagram ID of the contact."},"avatar":{"type":"string","description":"The URL to the contact's avatar image."}},"required":["id","name","created","updated","variables","organizationIds"]},"AddressDto":{"type":"object","properties":{"street":{"type":"string","description":"The street name."},"country":{"type":"string","description":"The country name."},"zipcode":{"type":"string","description":"The postal/zip code."},"houseNumber":{"type":"string","description":"The house number."},"location":{"type":"string","description":"The city or location name."}}}}}}
```

## The CreateContactRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateContactRequestDto":{"type":"object","properties":{"name":{"type":"string","description":"The name of the contact."},"language":{"type":"string","description":"The language of the contact."},"email":{"type":"string","description":"The email address of the contact."},"phoneNumber":{"type":"string","description":"The phone number of the contact."},"whatsappId":{"type":"string","description":"The WhatsApp ID of the contact."},"webId":{"type":"string","description":"The web channel ID of the contact."},"instagramId":{"type":"string","description":"The Instagram ID of the contact."},"facebookId":{"type":"string","description":"The Facebook ID of the contact."},"telegramId":{"type":"string","description":"The Telegram ID of the contact."},"providerId":{"type":"string","description":"The ID of the contact with the external provider."},"avatar":{"type":"string","format":"uri","description":"The URL to the avatar image of the contact."}},"required":["language"]}}}}
```

## The UpdateContactDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateContactDto":{"type":"object","properties":{"name":{"type":"string","description":"The new name of the contact."},"email":{"type":"string","description":"The new email address of the contact."},"address":{"description":"The new address of the contact.","allOf":[{"$ref":"#/components/schemas/AddressDto"}]},"phoneNumber":{"type":"string","description":"The new phone number of the contact."},"variables":{"type":"object","description":"Custom variables to set on the contact.","additionalProperties":{"type":"string"}},"organizationIds":{"description":"List of organization IDs to associate with the contact.","type":"array","items":{"type":"string"}},"avatar":{"type":"string","format":"uri","description":"The URL to the contact's avatar image."},"language":{"type":"string","description":"The language code of the contact."}},"required":["variables","organizationIds"]},"AddressDto":{"type":"object","properties":{"street":{"type":"string","description":"The street name."},"country":{"type":"string","description":"The country name."},"zipcode":{"type":"string","description":"The postal/zip code."},"houseNumber":{"type":"string","description":"The house number."},"location":{"type":"string","description":"The city or location name."}}}}}}
```

## The UpdateContactRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateContactRequestDto":{"type":"object","properties":{"contact":{"description":"The contact data to update.","allOf":[{"$ref":"#/components/schemas/UpdateContactDto"}]}},"required":["contact"]},"UpdateContactDto":{"type":"object","properties":{"name":{"type":"string","description":"The new name of the contact."},"email":{"type":"string","description":"The new email address of the contact."},"address":{"description":"The new address of the contact.","allOf":[{"$ref":"#/components/schemas/AddressDto"}]},"phoneNumber":{"type":"string","description":"The new phone number of the contact."},"variables":{"type":"object","description":"Custom variables to set on the contact.","additionalProperties":{"type":"string"}},"organizationIds":{"description":"List of organization IDs to associate with the contact.","type":"array","items":{"type":"string"}},"avatar":{"type":"string","format":"uri","description":"The URL to the contact's avatar image."},"language":{"type":"string","description":"The language code of the contact."}},"required":["variables","organizationIds"]},"AddressDto":{"type":"object","properties":{"street":{"type":"string","description":"The street name."},"country":{"type":"string","description":"The country name."},"zipcode":{"type":"string","description":"The postal/zip code."},"houseNumber":{"type":"string","description":"The house number."},"location":{"type":"string","description":"The city or location name."}}}}}}
```

## The DeleteContactResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"DeleteContactResponseDto":{"type":"object","properties":{"deleted":{"type":"boolean","description":"Indicates whether the contact was successfully deleted."},"error":{"type":"string","description":"Optional error message."}}}}}}
```

## The ListContactOrganizationsResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListContactOrganizationsResponseDto":{"type":"object","properties":{"organizations":{"description":"The list of organizations.","type":"array","items":{"$ref":"#/components/schemas/OrganizationDto"}},"error":{"type":"string","description":"Optional error message."}},"required":["organizations"]},"OrganizationDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the organization."},"name":{"type":"string","description":"The name of the organization."},"created":{"type":"string","description":"Timestamp when the organization was created."},"updated":{"type":"string","description":"Timestamp when the organization was last updated."},"email":{"type":"string","format":"email","description":"The email address of the organization."},"website":{"type":"string","format":"uri","description":"The website URL of the organization."},"size":{"type":"number","description":"The number of employees in the organization."},"industry":{"type":"string","description":"The industry of the organization."},"address":{"description":"The address of the organization.","allOf":[{"$ref":"#/components/schemas/AddressDto"}]},"variables":{"type":"object","description":"Custom variables as key-value pairs.","additionalProperties":{"type":"string"}}},"required":["id","name","created","updated","variables"]},"AddressDto":{"type":"object","properties":{"street":{"type":"string","description":"The street name."},"country":{"type":"string","description":"The country name."},"zipcode":{"type":"string","description":"The postal/zip code."},"houseNumber":{"type":"string","description":"The house number."},"location":{"type":"string","description":"The city or location name."}}}}}}
```

## The AddConversationNotesRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"AddConversationNotesRequestDto":{"type":"object","properties":{"notes":{"minItems":1,"description":"The notes to add to the conversation.","type":"array","items":{"type":"string"}}},"required":["notes"]}}}}
```

## The ConversationNotesResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ConversationNotesResponseDto":{"type":"object","properties":{}}}}}
```

## The RemoveConversationNotesRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"RemoveConversationNotesRequestDto":{"type":"object","properties":{"notes":{"minItems":1,"description":"The notes to remove from the conversation.","type":"array","items":{"type":"string"}}},"required":["notes"]}}}}
```

## The StatsExportResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StatsExportResponseDto":{"type":"object","properties":{"exportId":{"type":"string","description":"The ID of the started export job."},"error":{"type":"string","description":"Optional error message."}},"required":["exportId"]}}}}
```

## The GetStatsExportStatusResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"GetStatsExportStatusResponseDto":{"type":"object","properties":{"status":{"type":"string","description":"The status of the export."},"downloadUrl":{"type":"string","description":"URL to download the file when the export is completed."},"error":{"type":"string","description":"Optional error message."}},"required":["status"]}}}}
```

## The AgentPerformanceEntryDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"AgentPerformanceEntryDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The unique identifier of the operator."},"acceptedCount":{"type":"number","description":"The number of conversations accepted by the agent."},"avgJoinTimeSeconds":{"type":"number","description":"The average time in seconds for the agent to join a conversation."},"operatorName":{"type":"string","description":"The name of the operator."}},"required":["operatorId","acceptedCount","avgJoinTimeSeconds","operatorName"]}}}}
```

## The InboxReportDataDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"InboxReportDataDto":{"type":"object","properties":{"transferredToAgentCount":{"type":"number","description":"The number of conversations transferred to an agent."},"conversationAcceptedCount":{"type":"number","description":"The number of conversations accepted by agents."},"conversationNotAcceptedCount":{"type":"number","description":"The number of conversations not accepted by agents."},"averageJoinTimeSeconds":{"type":"number","description":"The average time in seconds for agents to join conversations."},"agentPerformance":{"description":"The list of agent performance entries.","type":"array","items":{"$ref":"#/components/schemas/AgentPerformanceEntryDto"}}},"required":["transferredToAgentCount","conversationAcceptedCount","conversationNotAcceptedCount","averageJoinTimeSeconds","agentPerformance"]},"AgentPerformanceEntryDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The unique identifier of the operator."},"acceptedCount":{"type":"number","description":"The number of conversations accepted by the agent."},"avgJoinTimeSeconds":{"type":"number","description":"The average time in seconds for the agent to join a conversation."},"operatorName":{"type":"string","description":"The name of the operator."}},"required":["operatorId","acceptedCount","avgJoinTimeSeconds","operatorName"]}}}}
```

## The GetInboxReportResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"GetInboxReportResponseDto":{"type":"object","properties":{"data":{"description":"The inbox report data.","nullable":true,"allOf":[{"$ref":"#/components/schemas/InboxReportDataDto"}]},"error":{"type":"string","description":"Optional error message."}},"required":["data"]},"InboxReportDataDto":{"type":"object","properties":{"transferredToAgentCount":{"type":"number","description":"The number of conversations transferred to an agent."},"conversationAcceptedCount":{"type":"number","description":"The number of conversations accepted by agents."},"conversationNotAcceptedCount":{"type":"number","description":"The number of conversations not accepted by agents."},"averageJoinTimeSeconds":{"type":"number","description":"The average time in seconds for agents to join conversations."},"agentPerformance":{"description":"The list of agent performance entries.","type":"array","items":{"$ref":"#/components/schemas/AgentPerformanceEntryDto"}}},"required":["transferredToAgentCount","conversationAcceptedCount","conversationNotAcceptedCount","averageJoinTimeSeconds","agentPerformance"]},"AgentPerformanceEntryDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The unique identifier of the operator."},"acceptedCount":{"type":"number","description":"The number of conversations accepted by the agent."},"avgJoinTimeSeconds":{"type":"number","description":"The average time in seconds for the agent to join a conversation."},"operatorName":{"type":"string","description":"The name of the operator."}},"required":["operatorId","acceptedCount","avgJoinTimeSeconds","operatorName"]}}}}
```

## The StatsChatbotChannelDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StatsChatbotChannelDto":{"type":"object","properties":{"channelId":{"type":"string","description":"The unique id of the channel."},"channelName":{"type":"string","description":"The display name of the channel."},"channelType":{"type":"string","description":"The type of the channel."}},"required":["channelId","channelName","channelType"]}}}}
```

## The StatsGetChannelsResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StatsGetChannelsResponseDto":{"type":"object","properties":{"channels":{"description":"The list of channels associated with the chatbot.","type":"array","items":{"$ref":"#/components/schemas/StatsChatbotChannelDto"}}},"required":["channels"]},"StatsChatbotChannelDto":{"type":"object","properties":{"channelId":{"type":"string","description":"The unique id of the channel."},"channelName":{"type":"string","description":"The display name of the channel."},"channelType":{"type":"string","description":"The type of the channel."}},"required":["channelId","channelName","channelType"]}}}}
```

## The ListWidgetConversationMessagesResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListWidgetConversationMessagesResponseDto":{"type":"object","properties":{"messages":{"description":"The list of messages.","type":"array","items":{"$ref":"#/components/schemas/MessageDto"}},"error":{"type":"string","description":"Optional error message."}},"required":["messages"]},"MessageDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the message."},"sender":{"type":"string","description":"The sender of the message (e.g., user, bot, agent)."},"type":{"type":"string","description":"The type of message (e.g., text, file, template)."},"persona":{"description":"The persona representing the sender.","allOf":[{"$ref":"#/components/schemas/MessagePersonaDto"}]},"providerMessageId":{"type":"string","description":"The message ID from the external provider."},"status":{"type":"string","description":"The delivery status of the message."},"created":{"type":"string","description":"Timestamp when the message was created."},"processed":{"type":"string","description":"Timestamp when the message was processed."},"sent":{"type":"string","description":"Timestamp when the message was sent."},"received":{"type":"string","description":"Timestamp when the message was received by the recipient."},"read":{"type":"string","description":"Timestamp when the message was read by the recipient."},"outgoing":{"type":"boolean","description":"Whether the message is outgoing (true) or incoming (false)."},"messengerId":{"type":"string","description":"The messenger ID associated with the message."},"contextId":{"type":"string","description":"The context ID for message threading."},"content":{"description":"The content of the message.","allOf":[{"$ref":"#/components/schemas/ContentDto"}]},"tags":{"description":"The list of tags associated with the message.","type":"array","items":{"type":"string"}},"error":{"type":"string","description":"Optional error message."},"isSensitive":{"type":"boolean","description":"Whether the message contains sensitive content."},"streamGroupId":{"type":"string","description":"The stream group ID for grouped streaming messages."},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."}},"required":["id","sender","type","status","created","outgoing","content","tags"]},"MessagePersonaDto":{"type":"object","properties":{"image":{"type":"string","description":"The URL of the persona's avatar image."},"name":{"type":"string","description":"The display name of the persona."}},"required":["image","name"]},"ContentDto":{"type":"object","properties":{"text":{"type":"string","description":"The text content of the message."},"file":{"description":"A file attachment.","allOf":[{"$ref":"#/components/schemas/MessageContentFileDto"}]},"buttons":{"description":"Interactive buttons for the message.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonsDto"}]},"selectedButton":{"description":"The button selected by the user.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonReplyDto"}]},"template":{"description":"A message template.","allOf":[{"$ref":"#/components/schemas/MessageTemplateDto"}]},"location":{"description":"A location shared in the message.","allOf":[{"$ref":"#/components/schemas/MessageLocationDto"}]},"voiceHangup":{"description":"Voice hangup data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceHangupDto"}]},"voiceTransfer":{"description":"Voice transfer data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceTransferDto"}]},"agentHandover":{"description":"Agent handover data.","allOf":[{"$ref":"#/components/schemas/MessageAgentHandoverDto"}]},"email":{"description":"Email content data.","allOf":[{"$ref":"#/components/schemas/MessageContentEmailDto"}]},"textToSpeech":{"description":"Text-to-speech content data.","allOf":[{"$ref":"#/components/schemas/MessageContentTextToSpeechDto"}]},"metaWhatsappTemplate":{"description":"A Meta WhatsApp template message.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplateDto"}]},"operator":{"description":"Operator data for the message.","allOf":[{"$ref":"#/components/schemas/OperatorDto"}]},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."},"leadAiId":{"type":"string","description":"The ID of the Lead AI associated with this message."}}},"MessageContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, audio)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."},"caption":{"type":"string","description":"An optional caption for the file."},"transcript":{"type":"string","description":"The transcript of audio/video content."},"facebookAttachmentId":{"type":"string","description":"The Facebook attachment ID."},"whatsappAttachmentId":{"type":"string","description":"The WhatsApp attachment ID."},"instagramAttachmentId":{"type":"string","description":"The Instagram attachment ID."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageContentButtonsDto":{"type":"object","properties":{"buttons":{"description":"The list of buttons.","type":"array","items":{"$ref":"#/components/schemas/MessageContentButtonDto"}}},"required":["buttons"]},"MessageContentButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, postback)."},"value":{"type":"string","description":"The value associated with the button."},"payload":{"type":"string","description":"An optional payload for the button."}},"required":["label","type","value"]},"MessageContentButtonReplyDto":{"type":"object","properties":{"label":{"type":"string","description":"The label of the selected button."},"value":{"type":"string","description":"The value of the selected button."},"payload":{"type":"string","description":"An optional payload from the button."},"type":{"type":"string","description":"The type of the button."},"reference":{"type":"string","description":"The reference to the original button message."}},"required":["label","value","reference"]},"MessageTemplateDto":{"type":"object","properties":{"body":{"type":"string","description":"The body text of the template."},"header":{"type":"string","description":"The header text of the template."},"footer":{"type":"string","description":"The footer text of the template."}},"required":["body"]},"MessageLocationDto":{"type":"object","properties":{"latitude":{"type":"number","description":"The latitude coordinate."},"longitude":{"type":"number","description":"The longitude coordinate."}},"required":["latitude","longitude"]},"MessageVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for hanging up the call."},"headers":{"type":"object","description":"Custom SIP headers for the hangup.","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"MessageVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string","description":"The target phone number or SIP address for the transfer."},"reason":{"type":"string","description":"The reason for the transfer."},"headers":{"type":"object","description":"Custom SIP headers for the transfer.","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"MessageAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for the handover to an agent."},"timeoutSeconds":{"type":"number","description":"Timeout in seconds before the handover expires."},"agentId":{"type":"string","description":"The ID of the specific agent to hand over to."},"groupId":{"type":"string","description":"The ID of the agent group to hand over to."},"assignmentMethod":{"type":"string","description":"The method for assigning the agent (e.g., round_robin, least_busy)."}},"required":["reason"]},"MessageContentEmailDto":{"type":"object","properties":{"subject":{"type":"string","description":"The subject of the email."},"body":{"type":"string","description":"The body content of the email."},"from":{"type":"string","description":"The sender email address."},"to":{"description":"The list of recipient email addresses.","type":"array","items":{"type":"string"}},"cc":{"description":"The list of CC recipient email addresses.","type":"array","items":{"type":"string"}},"bcc":{"description":"The list of BCC recipient email addresses.","type":"array","items":{"type":"string"}},"attachmentIds":{"description":"The list of attachment IDs.","type":"array","items":{"type":"string"}},"references":{"description":"The list of email references for threading.","type":"array","items":{"type":"string"}}},"required":["subject","body","from","to","cc","bcc","attachmentIds","references"]},"MessageContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"string","description":"The text to be converted to speech."},"speech":{"type":"string","description":"Pre-generated speech audio reference."}},"required":["text"]},"MessageMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the template on Meta."},"language":{"type":"string","description":"The language code of the template."},"bodyText":{"type":"string","description":"The body text of the message. Placeholders are in the form `{{1}}`."},"headerText":{"type":"string","description":"The text in the header (if present)."},"footerText":{"type":"string","description":"The text in the footer (if present)."},"header":{"description":"The header component, which can contain a file or text parameters.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_HeaderDto"}]},"bodyParameters":{"description":"A list of values that replace the placeholders in the `bodyText`.","type":"array","items":{"type":"string"}},"buttons":{"description":"A list of buttons attached to the message.","type":"array","items":{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_ButtonDto"}}},"required":["templateName","language","bodyText","bodyParameters","buttons"]},"MessageMetaWhatsAppTemplate_HeaderDto":{"type":"object","properties":{"file":{"description":"The file attached to the header.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_Header_FileDto"}]},"parameters":{"description":"The list of parameter values for the header placeholders.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"MessageMetaWhatsAppTemplate_Header_FileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, video)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageMetaWhatsAppTemplate_ButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, quick_reply)."},"url":{"type":"string","description":"The URL for URL-type buttons."},"value":{"type":"string","description":"The value for quick_reply-type buttons."}},"required":["label","type"]},"OperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The unique identifier of the operator."}},"required":["operatorId"]}}}}
```

## The CreateWidgetConversationRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateWidgetConversationRequestDto":{"type":"object","properties":{"widgetToken":{"type":"string","description":"The widget authentication token."},"channelId":{"type":"string","description":"The ID of the channel."},"language":{"type":"string","description":"The language code for the conversation."}},"required":["widgetToken","channelId","language"]}}}}
```

## The CreateWidgetConversationResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateWidgetConversationResponseDto":{"type":"object","properties":{"conversation":{"description":"The newly created conversation.","nullable":true,"allOf":[{"$ref":"#/components/schemas/ConversationDto"}]},"newWebToken":{"type":"string","description":"A new web token if the previous one expired."},"error":{"type":"string","description":"Optional error message."}},"required":["conversation"]},"ConversationDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the conversation."},"contactId":{"type":"string","description":"The ID of the contact associated with this conversation."},"archived":{"type":"boolean","description":"Whether the conversation is archived."},"channelId":{"type":"string","description":"The ID of the channel for this conversation."},"channelType":{"type":"string","description":"The type of channel (e.g., web, whatsapp, telegram)."},"chatbotId":{"type":"string","description":"The ID of the chatbot handling this conversation."},"idToken":{"type":"string","description":"The ID token for this conversation."},"language":{"type":"string","description":"The language code of the conversation."},"operatorId":{"type":"string","description":"The ID of the assigned operator."},"photoUrl":{"type":"string","description":"The URL of the contact's photo."},"sessionCount":{"type":"number","description":"The number of sessions in this conversation."},"tags":{"description":"Tags associated with this conversation.","type":"array","items":{"type":"string"}},"unread":{"type":"boolean","description":"Whether the conversation has unread messages."},"variables":{"type":"object","description":"Custom variables for this conversation.","additionalProperties":{"type":"string"}},"lastBlock":{"description":"The last block visited in the flow.","allOf":[{"$ref":"#/components/schemas/ConversationBlockDto"}]},"lastButton":{"description":"The last button clicked by the user.","allOf":[{"$ref":"#/components/schemas/ConversationBlockDto"}]},"created":{"type":"string","description":"Timestamp when the conversation was created."},"updated":{"type":"string","description":"Timestamp when the conversation was last updated."},"providerId":{"type":"string","description":"The external provider ID for this conversation."},"name":{"type":"string","description":"The display name of the contact."},"lastMessage":{"description":"The content of the last message in the conversation.","allOf":[{"$ref":"#/components/schemas/ContentDto"}]},"snoozed":{"type":"string","description":"Timestamp until which the conversation is snoozed."},"lastUserAction":{"type":"string","description":"Timestamp of the last user action."},"mentions":{"description":"List of user IDs mentioned in this conversation.","type":"array","items":{"type":"string"}},"mentionsRead":{"type":"object","description":"Map of mentions to their read status.","additionalProperties":{"type":"boolean"}},"notes":{"description":"Notes attached to this conversation.","allOf":[{"$ref":"#/components/schemas/ConversationNotesDto"}]},"lastSender":{"type":"string","description":"The type of the last sender (user, bot, operator)."},"userInput":{"description":"Current user input state.","allOf":[{"$ref":"#/components/schemas/ConversationUserInputDto"}]},"environment":{"type":"string","description":"The environment.","enum":["dev","test","prod"]},"metadata":{"type":"object","description":"Custom metadata for this conversation.","additionalProperties":{"type":"string"}},"lastUserInput":{"type":"string","description":"The last user input text."},"leadAiConversation":{"description":"Lead AI conversation state.","allOf":[{"$ref":"#/components/schemas/ConversationLeadAiConversationDto"}]},"team":{"description":"The team assigned to this conversation.","allOf":[{"$ref":"#/components/schemas/ConversationTeamDto"}]},"state":{"description":"The current state of the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED","allOf":[{"$ref":"#/components/schemas/ConversationStatus"}]},"lastAssignedOperatorId":{"type":"string","description":"The ID of the last assigned operator."},"lastSeen":{"type":"string","description":"Timestamp when the conversation was last seen."}},"required":["id","contactId","archived","channelId","channelType","chatbotId","idToken","language","operatorId","photoUrl","sessionCount","tags","unread","variables","created","updated","name","snoozed","lastUserAction","mentions","mentionsRead","environment","metadata","state"]},"ConversationBlockDto":{"type":"object","properties":{"id":{"type":"string","description":"The unique identifier of the block."},"name":{"type":"string","description":"The display name of the block."}},"required":["id","name"]},"ContentDto":{"type":"object","properties":{"text":{"type":"string","description":"The text content of the message."},"file":{"description":"A file attachment.","allOf":[{"$ref":"#/components/schemas/MessageContentFileDto"}]},"buttons":{"description":"Interactive buttons for the message.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonsDto"}]},"selectedButton":{"description":"The button selected by the user.","allOf":[{"$ref":"#/components/schemas/MessageContentButtonReplyDto"}]},"template":{"description":"A message template.","allOf":[{"$ref":"#/components/schemas/MessageTemplateDto"}]},"location":{"description":"A location shared in the message.","allOf":[{"$ref":"#/components/schemas/MessageLocationDto"}]},"voiceHangup":{"description":"Voice hangup data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceHangupDto"}]},"voiceTransfer":{"description":"Voice transfer data.","allOf":[{"$ref":"#/components/schemas/MessageVoiceTransferDto"}]},"agentHandover":{"description":"Agent handover data.","allOf":[{"$ref":"#/components/schemas/MessageAgentHandoverDto"}]},"email":{"description":"Email content data.","allOf":[{"$ref":"#/components/schemas/MessageContentEmailDto"}]},"textToSpeech":{"description":"Text-to-speech content data.","allOf":[{"$ref":"#/components/schemas/MessageContentTextToSpeechDto"}]},"metaWhatsappTemplate":{"description":"A Meta WhatsApp template message.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplateDto"}]},"operator":{"description":"Operator data for the message.","allOf":[{"$ref":"#/components/schemas/OperatorDto"}]},"delay":{"type":"number","description":"Delay in milliseconds before sending the message."},"leadAiId":{"type":"string","description":"The ID of the Lead AI associated with this message."}}},"MessageContentFileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, audio)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."},"caption":{"type":"string","description":"An optional caption for the file."},"transcript":{"type":"string","description":"The transcript of audio/video content."},"facebookAttachmentId":{"type":"string","description":"The Facebook attachment ID."},"whatsappAttachmentId":{"type":"string","description":"The WhatsApp attachment ID."},"instagramAttachmentId":{"type":"string","description":"The Instagram attachment ID."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageContentButtonsDto":{"type":"object","properties":{"buttons":{"description":"The list of buttons.","type":"array","items":{"$ref":"#/components/schemas/MessageContentButtonDto"}}},"required":["buttons"]},"MessageContentButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, postback)."},"value":{"type":"string","description":"The value associated with the button."},"payload":{"type":"string","description":"An optional payload for the button."}},"required":["label","type","value"]},"MessageContentButtonReplyDto":{"type":"object","properties":{"label":{"type":"string","description":"The label of the selected button."},"value":{"type":"string","description":"The value of the selected button."},"payload":{"type":"string","description":"An optional payload from the button."},"type":{"type":"string","description":"The type of the button."},"reference":{"type":"string","description":"The reference to the original button message."}},"required":["label","value","reference"]},"MessageTemplateDto":{"type":"object","properties":{"body":{"type":"string","description":"The body text of the template."},"header":{"type":"string","description":"The header text of the template."},"footer":{"type":"string","description":"The footer text of the template."}},"required":["body"]},"MessageLocationDto":{"type":"object","properties":{"latitude":{"type":"number","description":"The latitude coordinate."},"longitude":{"type":"number","description":"The longitude coordinate."}},"required":["latitude","longitude"]},"MessageVoiceHangupDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for hanging up the call."},"headers":{"type":"object","description":"Custom SIP headers for the hangup.","additionalProperties":{"type":"string"}}},"required":["reason","headers"]},"MessageVoiceTransferDto":{"type":"object","properties":{"target":{"type":"string","description":"The target phone number or SIP address for the transfer."},"reason":{"type":"string","description":"The reason for the transfer."},"headers":{"type":"object","description":"Custom SIP headers for the transfer.","additionalProperties":{"type":"string"}}},"required":["target","headers"]},"MessageAgentHandoverDto":{"type":"object","properties":{"reason":{"type":"string","description":"The reason for the handover to an agent."},"timeoutSeconds":{"type":"number","description":"Timeout in seconds before the handover expires."},"agentId":{"type":"string","description":"The ID of the specific agent to hand over to."},"groupId":{"type":"string","description":"The ID of the agent group to hand over to."},"assignmentMethod":{"type":"string","description":"The method for assigning the agent (e.g., round_robin, least_busy)."}},"required":["reason"]},"MessageContentEmailDto":{"type":"object","properties":{"subject":{"type":"string","description":"The subject of the email."},"body":{"type":"string","description":"The body content of the email."},"from":{"type":"string","description":"The sender email address."},"to":{"description":"The list of recipient email addresses.","type":"array","items":{"type":"string"}},"cc":{"description":"The list of CC recipient email addresses.","type":"array","items":{"type":"string"}},"bcc":{"description":"The list of BCC recipient email addresses.","type":"array","items":{"type":"string"}},"attachmentIds":{"description":"The list of attachment IDs.","type":"array","items":{"type":"string"}},"references":{"description":"The list of email references for threading.","type":"array","items":{"type":"string"}}},"required":["subject","body","from","to","cc","bcc","attachmentIds","references"]},"MessageContentTextToSpeechDto":{"type":"object","properties":{"text":{"type":"string","description":"The text to be converted to speech."},"speech":{"type":"string","description":"Pre-generated speech audio reference."}},"required":["text"]},"MessageMetaWhatsAppTemplateDto":{"type":"object","properties":{"templateName":{"type":"string","description":"The name of the template on Meta."},"language":{"type":"string","description":"The language code of the template."},"bodyText":{"type":"string","description":"The body text of the message. Placeholders are in the form `{{1}}`."},"headerText":{"type":"string","description":"The text in the header (if present)."},"footerText":{"type":"string","description":"The text in the footer (if present)."},"header":{"description":"The header component, which can contain a file or text parameters.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_HeaderDto"}]},"bodyParameters":{"description":"A list of values that replace the placeholders in the `bodyText`.","type":"array","items":{"type":"string"}},"buttons":{"description":"A list of buttons attached to the message.","type":"array","items":{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_ButtonDto"}}},"required":["templateName","language","bodyText","bodyParameters","buttons"]},"MessageMetaWhatsAppTemplate_HeaderDto":{"type":"object","properties":{"file":{"description":"The file attached to the header.","allOf":[{"$ref":"#/components/schemas/MessageMetaWhatsAppTemplate_Header_FileDto"}]},"parameters":{"description":"The list of parameter values for the header placeholders.","type":"array","items":{"type":"string"}}},"required":["parameters"]},"MessageMetaWhatsAppTemplate_Header_FileDto":{"type":"object","properties":{"name":{"type":"string","description":"The file name."},"url":{"type":"string","description":"The URL where the file is hosted."},"type":{"type":"string","description":"The type of file (e.g., image, document, video)."},"mimeType":{"type":"string","description":"The MIME type of the file."},"size":{"type":"number","description":"The file size in bytes."},"attachmentRef":{"type":"string","description":"The reference ID for the attachment."}},"required":["name","url","type","mimeType","size","attachmentRef"]},"MessageMetaWhatsAppTemplate_ButtonDto":{"type":"object","properties":{"label":{"type":"string","description":"The display label of the button."},"type":{"type":"string","description":"The type of button (e.g., url, quick_reply)."},"url":{"type":"string","description":"The URL for URL-type buttons."},"value":{"type":"string","description":"The value for quick_reply-type buttons."}},"required":["label","type"]},"OperatorDto":{"type":"object","properties":{"operatorId":{"type":"string","description":"The unique identifier of the operator."}},"required":["operatorId"]},"ConversationNotesDto":{"type":"object","properties":{"notes":{"description":"List of notes attached to the conversation.","type":"array","items":{"type":"string"}}},"required":["notes"]},"ConversationUserInputDto":{"type":"object","properties":{"redirect":{"type":"string","description":"The redirect destination for user input."},"isSensitive":{"type":"boolean","description":"Whether the user input contains sensitive data."}},"required":["redirect"]},"ConversationLeadAiConversationDto":{"type":"object","properties":{"flowId":{"type":"string","description":"The ID of the flow being executed."},"stepId":{"type":"string","description":"The ID of the current step in the flow."},"interactions":{"type":"number","description":"The number of interactions in this conversation."},"executionId":{"type":"string","description":"The unique execution ID for this conversation flow."}},"required":["flowId","stepId","interactions","executionId"]},"ConversationTeamDto":{"type":"object","properties":{"teamId":{"type":"string","description":"The ID of the team assigned to this conversation."}},"required":["teamId"]},"ConversationStatus":{"type":"number","enum":[0,1,2,3,-1],"description":"The current state of the conversation.\n\n- `0`: OPEN\n- `1`: BOT\n- `2`: IN_PROGRESS\n- `3`: CLOSED"}}}}
```

## The CreateWidgetContactRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateWidgetContactRequestDto":{"type":"object","properties":{"channelId":{"type":"string","description":"The ID of the channel."},"channelToken":{"type":"string","description":"The channel authentication token."},"originUrl":{"type":"string","description":"The origin URL where the widget is embedded."},"language":{"type":"string","description":"The language code for the widget."}},"required":["channelId","channelToken","originUrl","language"]}}}}
```

## The CreateWidgetContactResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateWidgetContactResponseDto":{"type":"object","properties":{"contactId":{"type":"string","description":"The ID of the newly created contact."},"widgetToken":{"type":"string","description":"The widget authentication token for the new contact."},"error":{"type":"string","description":"Optional error message."}}}}}}
```

## The KnowledgeSourceType object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"KnowledgeSourceType":{"type":"number","enum":[0,1,-1],"description":"Sets the type of the source.\n\n- `0`: WEBSITE\n- `1`: PDF\n"}}}}
```

## The KnowledgeSourceStatus object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"KnowledgeSourceStatus":{"type":"number","enum":[0,1,2,3,4,-1],"description":"Sets the status of the source.\n\n- `0`: PENDING\n- `1`: INDEXING\n- `2`: INDEXED\n- `3`: ERROR\n- `4`: DELETING"}}}}
```

## The KnowledgeSourceDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"KnowledgeSourceDto":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the knowledge source."},"source":{"type":"string","description":"The url or filepath of the source."},"groupIds":{"description":"A list of group ID's that the source is used in.","type":"array","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Indicates whether the knowledge source is enabled (true) or disabled (false)."},"isIndexing":{"type":"boolean","description":"Sets the indexing status of the source."},"created":{"type":"string","description":"Creation timestamp (ISO format)."},"type":{"description":"Sets the type of the source.\n\n- `0`: WEBSITE\n- `1`: PDF\n","allOf":[{"$ref":"#/components/schemas/KnowledgeSourceType"}]},"status":{"description":"Sets the status of the source.\n\n- `0`: PENDING\n- `1`: INDEXING\n- `2`: INDEXED\n- `3`: ERROR\n- `4`: DELETING","allOf":[{"$ref":"#/components/schemas/KnowledgeSourceStatus"}]},"name":{"type":"string","description":"Sets the name of the source."},"errorReason":{"type":"string","description":"The reason for the potential error."},"metadata":{"type":"object","description":"Additional custom metadata as key-value pairs.","additionalProperties":{"type":"string"}}},"required":["id","source","groupIds","enabled","isIndexing","created","type","status","name","metadata"]},"KnowledgeSourceType":{"type":"number","enum":[0,1,-1],"description":"Sets the type of the source.\n\n- `0`: WEBSITE\n- `1`: PDF\n"},"KnowledgeSourceStatus":{"type":"number","enum":[0,1,2,3,4,-1],"description":"Sets the status of the source.\n\n- `0`: PENDING\n- `1`: INDEXING\n- `2`: INDEXED\n- `3`: ERROR\n- `4`: DELETING"}}}}
```

## The ListKnowledgeSourcesResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListKnowledgeSourcesResponseDto":{"type":"object","properties":{"sources":{"description":"A list of retrieved knowledge sources.","type":"array","items":{"$ref":"#/components/schemas/KnowledgeSourceDto"}},"error":{"type":"string","description":"Optional error message"},"pageToken":{"type":"string","description":"The date of the latest fetched source."}},"required":["sources","pageToken"]},"KnowledgeSourceDto":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the knowledge source."},"source":{"type":"string","description":"The url or filepath of the source."},"groupIds":{"description":"A list of group ID's that the source is used in.","type":"array","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Indicates whether the knowledge source is enabled (true) or disabled (false)."},"isIndexing":{"type":"boolean","description":"Sets the indexing status of the source."},"created":{"type":"string","description":"Creation timestamp (ISO format)."},"type":{"description":"Sets the type of the source.\n\n- `0`: WEBSITE\n- `1`: PDF\n","allOf":[{"$ref":"#/components/schemas/KnowledgeSourceType"}]},"status":{"description":"Sets the status of the source.\n\n- `0`: PENDING\n- `1`: INDEXING\n- `2`: INDEXED\n- `3`: ERROR\n- `4`: DELETING","allOf":[{"$ref":"#/components/schemas/KnowledgeSourceStatus"}]},"name":{"type":"string","description":"Sets the name of the source."},"errorReason":{"type":"string","description":"The reason for the potential error."},"metadata":{"type":"object","description":"Additional custom metadata as key-value pairs.","additionalProperties":{"type":"string"}}},"required":["id","source","groupIds","enabled","isIndexing","created","type","status","name","metadata"]},"KnowledgeSourceType":{"type":"number","enum":[0,1,-1],"description":"Sets the type of the source.\n\n- `0`: WEBSITE\n- `1`: PDF\n"},"KnowledgeSourceStatus":{"type":"number","enum":[0,1,2,3,4,-1],"description":"Sets the status of the source.\n\n- `0`: PENDING\n- `1`: INDEXING\n- `2`: INDEXED\n- `3`: ERROR\n- `4`: DELETING"}}}}
```

## The GetKnowledgeSourceResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"GetKnowledgeSourceResponseDto":{"type":"object","properties":{"source":{"description":"The retrieved knowledge source.","nullable":true,"allOf":[{"$ref":"#/components/schemas/KnowledgeSourceDto"}]},"error":{"type":"string","description":"Optional error message"},"chunksContent":{"description":"Content of the source split into chunks.","type":"array","items":{"type":"string"}}},"required":["source","chunksContent"]},"KnowledgeSourceDto":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the knowledge source."},"source":{"type":"string","description":"The url or filepath of the source."},"groupIds":{"description":"A list of group ID's that the source is used in.","type":"array","items":{"type":"string"}},"enabled":{"type":"boolean","description":"Indicates whether the knowledge source is enabled (true) or disabled (false)."},"isIndexing":{"type":"boolean","description":"Sets the indexing status of the source."},"created":{"type":"string","description":"Creation timestamp (ISO format)."},"type":{"description":"Sets the type of the source.\n\n- `0`: WEBSITE\n- `1`: PDF\n","allOf":[{"$ref":"#/components/schemas/KnowledgeSourceType"}]},"status":{"description":"Sets the status of the source.\n\n- `0`: PENDING\n- `1`: INDEXING\n- `2`: INDEXED\n- `3`: ERROR\n- `4`: DELETING","allOf":[{"$ref":"#/components/schemas/KnowledgeSourceStatus"}]},"name":{"type":"string","description":"Sets the name of the source."},"errorReason":{"type":"string","description":"The reason for the potential error."},"metadata":{"type":"object","description":"Additional custom metadata as key-value pairs.","additionalProperties":{"type":"string"}}},"required":["id","source","groupIds","enabled","isIndexing","created","type","status","name","metadata"]},"KnowledgeSourceType":{"type":"number","enum":[0,1,-1],"description":"Sets the type of the source.\n\n- `0`: WEBSITE\n- `1`: PDF\n"},"KnowledgeSourceStatus":{"type":"number","enum":[0,1,2,3,4,-1],"description":"Sets the status of the source.\n\n- `0`: PENDING\n- `1`: INDEXING\n- `2`: INDEXED\n- `3`: ERROR\n- `4`: DELETING"}}}}
```

## The DeleteKnowledgeSourceBatchRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"DeleteKnowledgeSourceBatchRequestDto":{"type":"object","properties":{"sourceIds":{"description":"A list of deleted source Id's.","type":"array","items":{"type":"string"}}},"required":["sourceIds"]}}}}
```

## The DeleteKnowledgeSourceResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"DeleteKnowledgeSourceResponseDto":{"type":"object","properties":{"error":{"type":"string","description":"Optional error message."},"deleted":{"type":"boolean","description":"Indicates whether the deletion succeeded."}},"required":["deleted"]}}}}
```

## The UploadFilesDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UploadFilesDto":{"type":"object","properties":{"files":{"type":"array","description":"Files to be uploaded as knowledge sources.","items":{"type":"string","format":"binary"}}},"required":["files"]}}}}
```

## The UploadKnowledgeSourceFilesResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UploadKnowledgeSourceFilesResponseDto":{"type":"object","properties":{"success":{"type":"boolean","description":"Indicates whether the upload was successful."},"error":{"type":"string","description":"Optional error message."}}}}}}
```

## The KnowledgeGroupDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"KnowledgeGroupDto":{"type":"object","properties":{"id":{"type":"string","description":"Unique ID of the knowledge group."},"name":{"type":"string","description":"Name of the knowledge group."},"created":{"type":"string","description":"Creation timestamp (ISO format)."},"systemDefault":{"type":"boolean","description":"Indicates whether this is a system-created default group."},"sourceIds":{"description":"List of source IDs assigned to this group.","type":"array","items":{"type":"string"}}},"required":["id","name","created","systemDefault","sourceIds"]}}}}
```

## The ListKnowledgeGroupsResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ListKnowledgeGroupsResponseDto":{"type":"object","properties":{"groups":{"description":"A list of groups.","type":"array","items":{"$ref":"#/components/schemas/KnowledgeGroupDto"}},"error":{"type":"string","description":"Optional error message."},"pageToken":{"type":"string","description":"The date of the latest fetched group."}},"required":["groups","pageToken"]},"KnowledgeGroupDto":{"type":"object","properties":{"id":{"type":"string","description":"Unique ID of the knowledge group."},"name":{"type":"string","description":"Name of the knowledge group."},"created":{"type":"string","description":"Creation timestamp (ISO format)."},"systemDefault":{"type":"boolean","description":"Indicates whether this is a system-created default group."},"sourceIds":{"description":"List of source IDs assigned to this group.","type":"array","items":{"type":"string"}}},"required":["id","name","created","systemDefault","sourceIds"]}}}}
```

## The CreateKnowledgeGroupRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"CreateKnowledgeGroupRequestDto":{"type":"object","properties":{"name":{"type":"string","description":"Name of the new knowledge group."}},"required":["name"]}}}}
```

## The KnowledgeGroupResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"KnowledgeGroupResponseDto":{"type":"object","properties":{"group":{"description":"A knowledge group containing knowledge sources.","nullable":true,"allOf":[{"$ref":"#/components/schemas/KnowledgeGroupDto"}]},"error":{"type":"string","description":"Optional error message."}},"required":["group"]},"KnowledgeGroupDto":{"type":"object","properties":{"id":{"type":"string","description":"Unique ID of the knowledge group."},"name":{"type":"string","description":"Name of the knowledge group."},"created":{"type":"string","description":"Creation timestamp (ISO format)."},"systemDefault":{"type":"boolean","description":"Indicates whether this is a system-created default group."},"sourceIds":{"description":"List of source IDs assigned to this group.","type":"array","items":{"type":"string"}}},"required":["id","name","created","systemDefault","sourceIds"]}}}}
```

## The UpdateKnowledgeGroupDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateKnowledgeGroupDto":{"type":"object","properties":{"name":{"type":"string","description":"Optional new name of the knowledge group."},"sourceIds":{"description":"List of source IDs that should be linked to the knowledge group.","type":"array","items":{"type":"string"}}},"required":["sourceIds"]}}}}
```

## The UpdateKnowledgeGroupRequestDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"UpdateKnowledgeGroupRequestDto":{"type":"object","properties":{"updated":{"description":"Object containing the knowledge group fields to update.","nullable":true,"allOf":[{"$ref":"#/components/schemas/UpdateKnowledgeGroupDto"}]}},"required":["updated"]},"UpdateKnowledgeGroupDto":{"type":"object","properties":{"name":{"type":"string","description":"Optional new name of the knowledge group."},"sourceIds":{"description":"List of source IDs that should be linked to the knowledge group.","type":"array","items":{"type":"string"}}},"required":["sourceIds"]}}}}
```

## The DeleteKnowledgeGroupResponseDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"DeleteKnowledgeGroupResponseDto":{"type":"object","properties":{"error":{"type":"string","description":"Optional error message."}}}}}}
```

## The AudiocodesSettings\_TtsDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"AudiocodesSettings_TtsDto":{"type":"object","properties":{"provider":{"type":"string","description":"The TTS provider."},"voice":{"type":"string","description":"The ID of the voice to be used."},"languageDetectable":{"type":"boolean","description":"Whether this voice is available for language detection."}},"required":["provider","voice","languageDetectable"]}}}}
```

## The ConfusionMatrixEntryDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ConfusionMatrixEntryDto":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the confusion matrix entry."},"normalizedValue":{"type":"number","description":"The normalized value of the entry."},"rawValue":{"type":"number","description":"The raw value of the entry."}},"required":["id","normalizedValue","rawValue"]}}}}
```

## The ConfusionMatrixDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"ConfusionMatrixDto":{"type":"object","properties":{"confusionMatrixEntries":{"description":"The entries of the confusion matrix.","type":"array","items":{"$ref":"#/components/schemas/ConfusionMatrixEntryDto"}}},"required":["confusionMatrixEntries"]},"ConfusionMatrixEntryDto":{"type":"object","properties":{"id":{"type":"string","description":"The ID of the confusion matrix entry."},"normalizedValue":{"type":"number","description":"The normalized value of the entry."},"rawValue":{"type":"number","description":"The raw value of the entry."}},"required":["id","normalizedValue","rawValue"]}}}}
```

## The EvaluationMetricsDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"EvaluationMetricsDto":{"type":"object","properties":{"f1":{"type":"number","description":"The F1 score."},"precision":{"type":"number","description":"The precision score."},"recall":{"type":"number","description":"The recall score."},"truePositiveCount":{"type":"number","description":"The number of true positives."},"trueNegativeCount":{"type":"number","description":"The number of true negatives."},"falsePositiveCount":{"type":"number","description":"The number of false positives."},"falseNegativeCount":{"type":"number","description":"The number of false negatives."}},"required":["f1","precision","recall","truePositiveCount","trueNegativeCount","falsePositiveCount","falseNegativeCount"]}}}}
```

## The StepFlowOutletDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"StepFlowOutletDto":{"type":"object","properties":{"stepId":{"type":"string","description":"The ID of the step this outlet points to."},"name":{"type":"string","description":"The name of the flow outlet."}},"required":["stepId","name"]}}}}
```

## The WhatsAppTemplateTranslationsButtonDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"WhatsAppTemplateTranslationsButtonDto":{"type":"object","properties":{"type":{"type":"string","description":"The type of the button (e.g., QUICK_REPLY, URL, PHONE_NUMBER)."},"text":{"type":"string","description":"The display text of the button."},"url":{"type":"string","description":"The URL to open when the button is clicked (for URL type buttons)."},"phoneNumber":{"type":"string","description":"The phone number to call when the button is clicked (for PHONE_NUMBER type buttons)."}},"required":["type","text"]}}}}
```

## The WhatsAppTemplateTranslationsCreateDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"WhatsAppTemplateTranslationsCreateDto":{"type":"object","properties":{"bodyText":{"type":"string","description":"The body text of the template. Supports placeholders like {{1}}."},"buttons":{"description":"The buttons to attach to the template.","type":"array","items":{"$ref":"#/components/schemas/WhatsAppTemplateTranslationsButtonDto"}},"footerText":{"type":"string","description":"The text to display in the footer."},"headerText":{"type":"string","description":"The text to display in the header."},"headerType":{"type":"string","description":"The type of the header (e.g., TEXT, IMAGE, VIDEO, DOCUMENT)."},"language":{"type":"string","description":"The language code (ISO 639-1) for this translation."}},"required":["bodyText","buttons","footerText","headerText","headerType","language"]},"WhatsAppTemplateTranslationsButtonDto":{"type":"object","properties":{"type":{"type":"string","description":"The type of the button (e.g., QUICK_REPLY, URL, PHONE_NUMBER)."},"text":{"type":"string","description":"The display text of the button."},"url":{"type":"string","description":"The URL to open when the button is clicked (for URL type buttons)."},"phoneNumber":{"type":"string","description":"The phone number to call when the button is clicked (for PHONE_NUMBER type buttons)."}},"required":["type","text"]}}}}
```

## The WhatsAppTemplateTranslationsDto object

```json
{"openapi":"3.0.0","info":{"title":"ChatCaptain API","version":"1.0"},"components":{"schemas":{"WhatsAppTemplateTranslationsDto":{"type":"object","properties":{"bodyText":{"type":"string","description":"The body text of the translation."},"buttonType":{"type":"string","description":"The type of buttons."},"buttons":{"description":"The buttons attached to the template.","type":"array","items":{"$ref":"#/components/schemas/WhatsAppTemplateTranslationsButtonDto"}},"createdAt":{"type":"string","description":"Timestamp of creation."},"footerText":{"type":"string","description":"The text in the footer."},"headerMediaType":{"type":"string","description":"The media type of the header (e.g., \"TEXT\")."},"headerText":{"type":"string","description":"The text in the header."},"headerType":{"type":"string","description":"The type of the header."},"language":{"type":"string","description":"The language code (ISO 639-1)."},"rejectReason":{"type":"string","description":"The reason for rejection, if applicable."},"status":{"type":"string","description":"The status of the translation (e.g., \"APPROVED\")."},"templateId":{"type":"string","description":"The ID of the template at Meta."},"updatedAt":{"type":"string","description":"Timestamp of the last update."}},"required":["bodyText","buttons","createdAt","footerText","headerMediaType","headerText","headerType","language","rejectReason","status","templateId","updatedAt"]},"WhatsAppTemplateTranslationsButtonDto":{"type":"object","properties":{"type":{"type":"string","description":"The type of the button (e.g., QUICK_REPLY, URL, PHONE_NUMBER)."},"text":{"type":"string","description":"The display text of the button."},"url":{"type":"string","description":"The URL to open when the button is clicked (for URL type buttons)."},"phoneNumber":{"type":"string","description":"The phone number to call when the button is clicked (for PHONE_NUMBER type buttons)."}},"required":["type","text"]}}}}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.chatcaptain.com/api/api-dokumentation/models.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
