{
    "openapi": "3.0.1",
    "info": {
        "title": "Puretalk AI",
        "description": "Api Documentation for Puretalk AI",
        "license": {
            "name": "MIT"
        },
        "version": "1.0.0"
    },
    "servers": [
        {
            "url": "https://api.puretalk.ai/api"
        }
    ],
    "security": [
        {
            "ApiKeyAuth": []
        }
    ],
    "paths": {
        "/ai-assistants": {
            "post": {
                "description": "Create a new AI Assistant",
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "The name of the AI Assistant"
                                    },
                                    "voice": {
                                        "type": "integer",
                                        "description": "The voice id of the AI Assistant"
                                    },
                                    "prompt": {
                                        "type": "string",
                                        "description": "The prompt of the AI Assistant"
                                    },
                                    "model": {
                                        "type": "string",
                                        "enum": ["puretalk-plg"],
                                        "default": "puretalk-plg",
                                        "description": "The model of the AI Assistant"
                                    },
                                    "who_speaks_first": {
                                        "type": "string",
                                        "enum": ["user", "assistant"],
                                        "default": "assistant",
                                        "description": "Who speaks first value of the AI Assistant"
                                    },
                                    "begin_message": {
                                        "type": "string",
                                        "description": "The begin message of the AI Assistant"
                                    },
                                    "call_recording_enabled": {
                                        "type": "boolean",
                                        "default": true,
                                        "description": "If call recording is enabled for the AI Assistant"
                                    },
                                    "assistant_type": {
                                        "type": "string",
                                        "enum": ["single_prompt", "multi_prompt"],
                                        "default": "single_prompt",
                                        "description": "The assistant type of the AI Assistant"
                                    },
                                    "avatar": {
                                        "type": "string",
                                        "description": "The avatar url of the AI Assistant",
                                        "format": "uri",
                                        "nullable": true
                                    },
                                    "custom_knowledge_base": {
                                        "type": "string",
                                        "description": "The custom knowledge base of the AI Assistant"
                                    },
                                    "timezone": {
                                        "type": "string",
                                        "description": "The timezone of the AI Assistant"
                                    },
                                    "reminder_message_frequency": {
                                        "type": "integer",
                                        "description": "The reminder message frequency of the AI Assistant"
                                    },
                                    "max_reminder_messages": {
                                        "type": "integer",
                                        "description": "The maximum reminder messages of the AI Assistant"
                                    },
                                    "voice_stability": {
                                        "type": "string",
                                        "description": "The voice stability of the AI Assistant"
                                    },
                                    "voice_clarity_similarity": {
                                        "type": "string",
                                        "description": "The voice clarity similarity of the AI Assistant"
                                    },
                                    "voice_stream_latency_optimization": {
                                        "type": "integer",
                                        "description": "The voice stream latency optimization of the AI Assistant"
                                    },
                                    "voice_boost": {
                                        "type": "boolean",
                                        "description": "Indicates if voice boost is enabled for the AI Assistant",
                                        "default": false
                                    },
                                    "knowledge_base": {
                                        "type": "string",
                                        "description": "The knowledge base id of the AI Assistant",
                                        "format": "uuid"
                                    },
                                    "template": {
                                        "type": "string",
                                        "description": "The template id of the AI Assistant",
                                        "format": "uuid"
                                    },
                                    "behavior": {
                                        "type": "string",
                                        "description": "The behavior id of the AI Assistant",
                                        "format": "uuid"
                                    }
                                },
                                "required": ["name", "voice", "prompt"],
                                "oneOf": [
                                    {
                                        "properties": {
                                            "who_speaks_first": {
                                                "enum": ["assistant"]
                                            }
                                        },
                                        "required": ["begin_message"]
                                    },
                                    {
                                        "properties": {
                                            "who_speaks_first": {
                                                "enum": ["user"]
                                            }
                                        }
                                    }
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "AI Assistant created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AssistantResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "get": {
                "description": "Returns all AI Assistants from the system that the user has access to",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "description": "The page number to return",
                        "schema": {
                            "type": "integer",
                            "format": "int32"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "description": "The maximum number of results to return",
                        "schema": {
                            "type": "integer",
                            "format": "int32"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "AI Assistants response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "count": {
                                            "type": "integer",
                                            "description": "The total number of AI Assistants",
                                            "example": 100
                                        },
                                        "next": {
                                            "type": "string",
                                            "nullable": true,
                                            "description": "The next page of AI Assistants",
                                            "example": "https://api.puretalk.ai/api/ai-assistants/?page=2"
                                        },
                                        "previous": {
                                            "type": "string",
                                            "nullable": true,
                                            "description": "The previous page of AI Assistants",
                                            "example": "https://api.puretalk.ai/api/ai-assistants/?page=1"
                                        },
                                        "results": {
                                            "type": "array",
                                            "description": "The list of AI Assistants",
                                            "items": {
                                                "$ref": "#/components/schemas/AssistantPopulated"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/ai-assistants/{assistant_id}": {
            "get": {
                "description": "Returns a single AI Assistant based on the ID supplied",
                "parameters": [
                    {
                        "name": "assistant_id",
                        "in": "path",
                        "description": "ID of AI Assistant to return",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "AI Assistant response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "msg": {
                                            "type": "string",
                                            "description": "A success message",
                                            "example": "AI Assistant created successfully"
                                        },
                                        "err": {
                                            "type": "boolean",
                                            "description": "If the request is an error",
                                            "example": false
                                        },
                                        "results": {
                                            "$ref": "#/components/schemas/AssistantPopulated",
                                            "description": "The AI Assistant"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "patch": {
                "description": "Update an AI Assistant based on the ID supplied",
                "parameters": [
                    {
                        "name": "assistant_id",
                        "in": "path",
                        "description": "ID of AI Assistant to update",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string"
                                    },
                                    "voice": {
                                        "type": "integer"
                                    },
                                    "prompt": {
                                        "type": "string"
                                    },
                                    "model": {
                                        "type": "string",
                                        "enum": ["puretalk-plg"],
                                        "default": "puretalk-plg"
                                    },
                                    "who_speaks_first": {
                                        "type": "string",
                                        "enum": ["user", "assistant"],
                                        "default": "assistant"
                                    },
                                    "begin_message": {
                                        "type": "string"
                                    },
                                    "call_recording_enabled": {
                                        "type": "boolean",
                                        "default": true
                                    },
                                    "assistant_type": {
                                        "type": "string",
                                        "enum": ["single_prompt", "multi_prompt"],
                                        "default": "single_prompt"
                                    },
                                    "avatar": {
                                        "type": "string"
                                    },
                                    "custom_knowledge_base": {
                                        "type": "string"
                                    },
                                    "timezone": {
                                        "type": "string"
                                    },
                                    "reminder_message_frequency": {
                                        "type": "integer"
                                    },
                                    "max_reminder_messages": {
                                        "type": "integer"
                                    },
                                    "voice_stability": {
                                        "type": "string"
                                    },
                                    "voice_clarity_similarity": {
                                        "type": "string"
                                    },
                                    "voice_stream_latency_optimization": {
                                        "type": "integer"
                                    },
                                    "voice_boost": {
                                        "type": "boolean",
                                        "default": false
                                    },
                                    "chatbot_logo": {
                                        "type": "string"
                                    },
                                    "chatbot_accent_color": {
                                        "type": "string"
                                    },
                                    "chatbot_faq": {
                                        "type": "string"
                                    }
                                },
                                "required": ["name", "voice", "prompt"],
                                "oneOf": [
                                    {
                                        "properties": {
                                            "who_speaks_first": {
                                                "enum": ["assistant"]
                                            }
                                        },
                                        "required": ["begin_message"]
                                    },
                                    {
                                        "properties": {
                                            "who_speaks_first": {
                                                "enum": ["user"]
                                            }
                                        }
                                    }
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "AI Assistant updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/AssistantResponse"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            },
            "delete": {
                "description": "Delete an AI Assistant based on the ID supplied",
                "parameters": [
                    {
                        "name": "assistant_id",
                        "in": "path",
                        "description": "ID of AI Assistant to delete",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "AI Assistant deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/public/ai-assistants/chatbot-config/{assistant_id}": {
            "get": {
                "description": "Returns the chatbot config for the AI Assistant based on the ID supplied",
                "parameters": [
                    {
                        "name": "assistant_id",
                        "in": "path",
                        "description": "ID of AI Assistant to return chatbot config",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Chatbot config response",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "msg": {
                                            "type": "string",
                                            "description": "A success message",
                                            "example": "Chatbot config created successfully"
                                        },
                                        "err": {
                                            "type": "boolean",
                                            "description": "If the request is an error",
                                            "example": false
                                        },
                                        "results": {
                                            "type": "object",
                                            "properties": {
                                                "chatbot_logo": {
                                                    "type": "string",
                                                    "format": "uri",
                                                    "nullable": true,
                                                    "description": "The chatbot logo of the AI Assistant"
                                                },
                                                "chatbot_accent_color": {
                                                    "type": "string",
                                                    "nullable": true,
                                                    "description": "The chatbot accent color of the AI Assistant",
                                                    "example": "#000000"
                                                },
                                                "chatbot_faq": {
                                                    "type": "array",
                                                    "nullable": true,
                                                    "items": {
                                                        "type": "object",
                                                        "properties": {
                                                            "answer": {
                                                                "type": "string",
                                                                "description": "The answer of the chatbot FAQ",
                                                                "example": "The answer to the question"
                                                            },
                                                            "question": {
                                                                "type": "string",
                                                                "description": "The question of the chatbot FAQ",
                                                                "example": "The question"
                                                            }
                                                        }
                                                    }
                                                },
                                                "chatbot_whitelisted_domains": {
                                                    "type": "array",
                                                    "nullable": true,
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "voice": {
                                                    "type": "object",
                                                    "nullable": true,
                                                    "properties": {
                                                        "voice_id": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        },
                                                        "avatar": {
                                                            "type": "string",
                                                            "format": "uri"
                                                        },
                                                        "gender": {
                                                            "type": "string"
                                                        },
                                                        "demo_audio_url": {
                                                            "type": "string",
                                                            "format": "uri"
                                                        },
                                                        "is_cloned": {
                                                            "type": "boolean"
                                                        },
                                                        "language": {
                                                            "type": "string"
                                                        },
                                                        "description": {
                                                            "type": "string",
                                                            "nullable": true
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/ai-assistants/llm-states/{assistant_id}": {
            "post": {
                "summary": "Create or update LLM state",
                "description": "Creates a new LLM state for the specified assistant, or update an existing one.",
                "parameters": [
                    {
                        "name": "assistant_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "The ID of the assistant"
                    }
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "llm_states": {
                                        "type": "array",
                                        "items": {
                                            "$ref": "#/components/schemas/Node"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "LLM states response",
                        "content": {
                            "application/json": {
                                "schema": { "$ref": "#/components/schemas/Error" }
                            }
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/ai-assistants/delete-llm-states": {
            "delete": {
                "summary": "Delete LLM states",
                "description": "Deletes the specified LLM states.",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "llm_states": {
                                        "description": "Array of LLM state IDs to delete",
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "format": "uuid"
                                        }
                                    }
                                },
                                "required": ["llm_states"]
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successfully deleted LLM states",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "400": {
                        "description": "Bad request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "AssistantResponse": {
                "type": "object",
                "properties": {
                    "msg": {
                        "type": "string"
                    },
                    "err": {
                        "type": "boolean"
                    },
                    "results": {
                        "$ref": "#/components/schemas/Assistant"
                    }
                }
            },
            "Assistant": {
                "type": "object",
                "properties": {
                    "assistant_id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "The ID of the AI Assistant",
                        "example": "123e4567-e89b-12d3-a456-426614174000"
                    },
                    "name": {
                        "type": "string",
                        "description": "The name of the AI Assistant",
                        "example": "My AI Assistant"
                    },
                    "prompt": {
                        "type": "string",
                        "description": "The prompt of the AI Assistant",
                        "example": "Hello, how are you?"
                    },
                    "model": {
                        "type": "string",
                        "description": "The model of the AI Assistant",
                        "example": "gpt-3.5-turbo"
                    },
                    "who_speaks_first": {
                        "type": "string",
                        "enum": ["assistant", "user"],
                        "description": "Who speaks first value of the AI Assistant",
                        "example": "assistant"
                    },
                    "begin_message": {
                        "type": "string",
                        "nullable": true,
                        "description": "The begin message of the AI Assistant",
                        "example": "Hello, how are you?"
                    },
                    "assistant_type": {
                        "type": "string",
                        "description": "The assistant type of the AI Assistant",
                        "example": "single_prompt"
                    },
                    "avatar": {
                        "type": "string",
                        "format": "uri",
                        "nullable": true,
                        "description": "The avatar of the AI Assistant"
                    },
                    "custom_knowledge_base": {
                        "type": "string",
                        "nullable": true,
                        "description": "The custom knowledge base of the AI Assistant"
                    },
                    "timezone": {
                        "type": "string",
                        "description": "The timezone of the AI Assistant"
                    },
                    "voice_stability": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1,
                        "description": "The voice stability of the AI Assistant"
                    },
                    "voice_clarity_similarity": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1,
                        "description": "The voice clarity similarity of the AI Assistant"
                    },
                    "voice_stream_latency_optimization": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 5,
                        "description": "The voice stream latency optimization of the AI Assistant"
                    },
                    "voice_boost": {
                        "type": "boolean",
                        "default": false,
                        "description": "Indicates if voice boost is enabled for the AI Assistant"
                    },
                    "voice_speed": {
                        "type": "number",
                        "default": 0,
                        "description": "The voice speed of the AI Assistant"
                    },
                    "voice_emotion": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "default": [],
                        "description": "The voice emotion of the AI Assistant"
                    },
                    "call_recording_enabled": {
                        "type": "boolean",
                        "default": true,
                        "description": "Indicates if call recording is enabled for the AI Assistant"
                    },
                    "reminder_message_frequency": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "The reminder message frequency of the AI Assistant"
                    },
                    "max_reminder_messages": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "The maximum reminder messages of the AI Assistant"
                    },
                    "post_analysis": {
                        "type": "string",
                        "nullable": true,
                        "description": "The post analysis of the AI Assistant"
                    },
                    "chatbot_logo": {
                        "type": "string",
                        "format": "uri",
                        "nullable": true,
                        "description": "The chatbot logo of the AI Assistant"
                    },
                    "chatbot_accent_color": {
                        "type": "string",
                        "nullable": true,
                        "description": "The chatbot accent color of the AI Assistant"
                    },
                    "chatbot_faq": {
                        "type": "string",
                        "nullable": true,
                        "description": "The chatbot FAQ of the AI Assistant"
                    },
                    "chatbot_whitelisted_domains": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        },
                        "nullable": true,
                        "description": "The chatbot whitelisted domains of the AI Assistant"
                    },
                    "chatbot_begin_message": {
                        "type": "string",
                        "nullable": true,
                        "description": "The chatbot begin message of the AI Assistant"
                    },
                    "tools": {
                        "type": "string",
                        "nullable": true,
                        "description": "The tools of the AI Assistant"
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "The created at date of the AI Assistant"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "The updated at date of the AI Assistant"
                    },
                    "behavior": {
                        "type": "integer",
                        "minimum": 0,
                        "description": "The behavior of the AI Assistant"
                    },
                    "user": {
                        "type": "object",
                        "properties": {
                            "name": {
                                "type": "string",
                                "description": "The name of the user"
                            },
                            "dp": {
                                "type": "string",
                                "format": "uri",
                                "nullable": true,
                                "description": "The dp of the user"
                            },
                            "email": {
                                "type": "string",
                                "format": "email",
                                "description": "The email of the user"
                            }
                        }
                    },
                    "voice": {
                        "type": "object",
                        "properties": {
                            "voice_id": {
                                "type": "string",
                                "description": "The voice id of the user"
                            },
                            "name": {
                                "type": "string",
                                "description": "The name of the voice"
                            },
                            "avatar": {
                                "type": "string",
                                "format": "uri",
                                "description": "The avatar of the voice"
                            },
                            "gender": {
                                "type": "string",
                                "description": "The gender of the voice"
                            },
                            "demo_audio_url": {
                                "type": "string",
                                "format": "uri",
                                "description": "The demo audio url of the voice"
                            },
                            "is_cloned": {
                                "type": "boolean",
                                "description": "Indicates if the voice is cloned"
                            },
                            "language": {
                                "type": "string",
                                "description": "The language of the voice"
                            },
                            "description": {
                                "type": "string",
                                "nullable": true,
                                "description": "The description of the voice"
                            }
                        }
                    }
                }
            },
            "AssistantPopulated": {
                "type": "object",
                "properties": {
                    "user": {
                        "type": "object",
                        "properties": {
                            "name": {
                                "type": "string",
                                "description": "The name of the user"
                            },
                            "dp": {
                                "type": "string",
                                "format": "uri",
                                "nullable": true,
                                "description": "The dp of the user"
                            },
                            "email": {
                                "type": "string",
                                "format": "email",
                                "description": "The email of the user"
                            }
                        }
                    },
                    "voice": {
                        "type": "object",
                        "properties": {
                            "voice_id": {
                                "type": "string",
                                "description": "The voice id of the user"
                            },
                            "name": {
                                "type": "string",
                                "description": "The name of the voice"
                            },
                            "avatar": {
                                "type": "string",
                                "format": "uri",
                                "description": "The avatar of the voice"
                            },
                            "gender": {
                                "type": "string",
                                "description": "The gender of the voice"
                            },
                            "demo_audio_url": {
                                "type": "string",
                                "format": "uri",
                                "description": "The demo audio url of the voice"
                            },
                            "is_cloned": {
                                "type": "boolean",
                                "description": "Indicates if the voice is cloned"
                            },
                            "language": {
                                "type": "string",
                                "description": "The language of the voice"
                            },
                            "description": {
                                "type": "string",
                                "nullable": true,
                                "description": "The description of the voice"
                            }
                        }
                    },
                    "llm_states": {
                        "type": "array",
                        "items": {}
                    },
                    "phone_number": {
                        "type": "string",
                        "nullable": true,
                        "description": "The phone number of the AI Assistant"
                    },
                    "variables": {
                        "type": "array",
                        "items": {}
                    },
                    "knowledge_base": {
                        "type": "string",
                        "nullable": true,
                        "description": "The knowledge base of the AI Assistant"
                    },
                    "assistant_id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "The assistant id of the AI Assistant"
                    },
                    "name": {
                        "type": "string",
                        "description": "The name of the AI Assistant"
                    },
                    "prompt": {
                        "type": "string",
                        "description": "The prompt of the AI Assistant"
                    },
                    "model": {
                        "type": "string",
                        "description": "The model of the AI Assistant"
                    },
                    "who_speaks_first": {
                        "type": "string",
                        "enum": ["assistant", "user"],
                        "description": "Who speaks first value of the AI Assistant"
                    },
                    "begin_message": {
                        "type": "string",
                        "nullable": true,
                        "description": "The begin message of the AI Assistant"
                    },
                    "assistant_type": {
                        "type": "string",
                        "description": "The assistant type of the AI Assistant"
                    },
                    "avatar": {
                        "type": "string",
                        "format": "uri",
                        "description": "The avatar of the AI Assistant"
                    },
                    "custom_knowledge_base": {
                        "type": "string",
                        "description": "The custom knowledge base of the AI Assistant"
                    },
                    "timezone": {
                        "type": "string",
                        "description": "The timezone of the AI Assistant"
                    },
                    "voice_stability": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1,
                        "description": "The voice stability of the AI Assistant"
                    },
                    "voice_clarity_similarity": {
                        "type": "number",
                        "minimum": 0,
                        "maximum": 1,
                        "description": "The voice clarity similarity of the AI Assistant"
                    },
                    "voice_stream_latency_optimization": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 5,
                        "description": "The voice stream latency optimization of the AI Assistant"
                    },
                    "voice_boost": {
                        "type": "boolean",
                        "description": "Indicates if voice boost is enabled for the AI Assistant"
                    },
                    "voice_speed": {
                        "type": "number",
                        "description": "The voice speed of the AI Assistant"
                    },
                    "voice_emotion": {
                        "type": "array",
                        "items": {}
                    },
                    "call_recording_enabled": {
                        "type": "boolean",
                        "description": "Indicates if call recording is enabled for the AI Assistant"
                    },
                    "reminder_message_frequency": {
                        "type": "integer",
                        "description": "The reminder message frequency of the AI Assistant"
                    },
                    "max_reminder_messages": {
                        "type": "integer",
                        "description": "The maximum reminder messages of the AI Assistant"
                    },
                    "post_analysis": {
                        "type": "string",
                        "nullable": true,
                        "description": "The post analysis of the AI Assistant"
                    },
                    "chatbot_logo": {
                        "type": "string",
                        "format": "uri",
                        "nullable": true,
                        "description": "The chatbot logo of the AI Assistant"
                    },
                    "chatbot_accent_color": {
                        "type": "string",
                        "nullable": true,
                        "description": "The chatbot accent color of the AI Assistant"
                    },
                    "chatbot_faq": {
                        "type": "string",
                        "nullable": true,
                        "description": "The chatbot FAQ of the AI Assistant"
                    },
                    "chatbot_whitelisted_domains": {
                        "type": "array",
                        "nullable": true,
                        "items": {
                            "type": "string"
                        }
                    },
                    "chatbot_begin_message": {
                        "type": "string",
                        "nullable": true,
                        "description": "The chatbot begin message of the AI Assistant"
                    },
                    "tools": {
                        "type": "string",
                        "nullable": true,
                        "description": "The tools of the AI Assistant"
                    },
                    "created_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "The created at date of the AI Assistant"
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "The updated at date of the AI Assistant"
                    },
                    "behavior": {
                        "type": "integer",
                        "description": "The behavior of the AI Assistant"
                    }
                }
            },
            "Node": {
                "type": "object",
                "properties": {
                    "state_id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "The state id of the node"
                    },
                    "name": {
                        "type": "string",
                        "description": "The name of the node"
                    },
                    "description": {
                        "type": "string",
                        "description": "The description of the node"
                    },
                    "prompt": {
                        "type": "string",
                        "description": "The prompt of the node"
                    },
                    "children": {
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Node"
                        }
                    },
                    "parameters": {
                        "type": "object",
                        "nullable": true,
                        "description": "The parameters of the node"
                    },
                    "position": {
                        "type": "object",
                        "properties": {
                            "x": {
                                "type": "number",
                                "description": "The x position of the node"
                            },
                            "y": {
                                "type": "number",
                                "description": "The y position of the node"
                            }
                        }
                    },
                    "tools": {
                        "type": "array",
                        "nullable": true,
                        "items": {
                            "type": "object",
                            "properties": {
                                "type": {
                                    "type": "string",
                                    "description": "The type of the tool"
                                },
                                "functionId": {
                                    "type": "string",
                                    "description": "The function id of the tool"
                                },
                                "function": {
                                    "type": "object",
                                    "properties": {
                                        "name": {
                                            "type": "string",
                                            "description": "The name of the tool"
                                        },
                                        "description": {
                                            "type": "string",
                                            "description": "The description of the tool"
                                        },
                                        "parameters": {
                                            "oneOf": [
                                                {
                                                    "type": "object",
                                                    "properties": {
                                                        "start_time": {
                                                            "type": "string",
                                                            "description": "Availability check start date in YYYY-MM-DD format, e.g. 2024-06-18"
                                                        },
                                                        "end_time": {
                                                            "type": "string",
                                                            "description": "Availability check end date in YYYY-MM-DD format, e.g. 2024-06-23"
                                                        }
                                                    },
                                                    "required": ["start_time", "end_time"]
                                                },
                                                {
                                                    "type": "object",
                                                    "properties": {
                                                        "calendar_event_name": {
                                                            "type": "string",
                                                            "description": "Name of the calendar event, e.g. \"Meeting with John\""
                                                        },
                                                        "duration": {
                                                            "type": "number",
                                                            "description": "Duration of the calendar event in minutes, e.g. 60"
                                                        },
                                                        "start_date_time": {
                                                            "type": "string",
                                                            "description": "Start date and time of the calendar event in YYYY-MM-DDTHH:MM format, e.g. 2024-06-18T14:00"
                                                        },
                                                        "end_date_time": {
                                                            "type": "string",
                                                            "description": "End date and time of the calendar event in YYYY-MM-DDTHH:MM format, e.g. 2024-06-18T15:00"
                                                        }
                                                    },
                                                    "required": ["calendar_event_name", "duration", "start_date_time", "end_date_time"]
                                                }
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            },
            "Error": {
                "type": "object",
                "properties": {
                    "err": {
                        "type": "boolean"
                    },
                    "msg": {
                        "type": "string"
                    }
                }
            }
        },
        "securitySchemes": {
            "ApiKeyAuth": {
                "type": "apiKey",
                "in": "header",
                "name": "X-API-KEY",
                "description": "Authorization header containing API key. You can find your API key in the dashboard under 'API Keys'."
            }
        }
    }
}
