---
updatedAt: 2026-09-04T07:06:48.000Z
agentTools:
  projectIndex: https://documentation.indigitall.com/llms.txt
---

# Update complete agent with all components

Updates a complete agent configuration in a single atomic operation, including:
- Bot tools configuration and setup
- Document management and knowledge base setup
- Flow metadata and settings
- Front rail node configuration (input validation and filtering)
- Agent node configuration (main processing logic with LLM and tools)
- Back rail node configuration (output validation and filtering)

This endpoint provides a streamlined way to update a full workflow without requiring
separate API calls to update individual components. The entire agent is updated
atomically, ensuring consistency and reducing the complexity of agent updates.

Use this endpoint when you want to update a complete, production-ready agent in
a single operation. For more granular control or when working with existing
components, use the standard agent update endpoint instead.


# OpenAPI definition

````json
{
  "openapi": "3.0.0",
  "info": {
    "version": "2.0.0",
    "title": "INDIGITALL API",
    "x-logo": {
      "url": "https://console.indigitall.com/images/logo_verdeblanco@2x.png",
      "backgroundColor": "#0F3B7A"
    },
    "description": "\n### Introduction:\nThis documentation describes every endpoint of Indigitall's API v2\n\nAPI BASE URL: https://api.indigitall.com/v2\n\n### Authentication:\n\nMost of the endpoints of the API needs an Authorization header.\n\nThere are two Authorization ways:\n\n- If your intention is to manage API calls with a server-side script you have to create a Server key through Indigitall's console.\n\n  You can set the following Authorization Header : 'Authorization: ServerKey {ServerKey}'\n- If your intention is to integrate this API for front-end users POST /auth endpoint authorizes a user and returns an access token.\n\n  You can set the following Authorization Header : 'Authorization: Bearer {Token}'\n"
  },
  "security": [
    {
      "Authorization": []
    }
  ],
  "tags": [
    {
      "name": "pathbot-agents",
      "x-displayName": "Pathbot - Agents",
      "description": "Endpoints for manage pathbot agents"
    }
  ],
  "x-tagGroups": [
    {
      "name": "Chat Service",
      "tags": [
        "chat-configuration",
        "chat-channel",
        "chat-contact",
        "chat-integration",
        "chat-task",
        "chat-campaign",
        "chat-send",
        "chat-multimedia",
        "chat-slicing",
        "chat-tag",
        "chat-contact-list",
        "chat-cc-agent",
        "chat-cc-permissions-profile",
        "chat-cc-weekly-schedule",
        "chat-cc-special-days-schedule",
        "chat-cc-conversation",
        "chat-cc-agent-group",
        "chat-cc-contact-comment",
        "chat-cc-form",
        "chat-stats",
        "chat-internal"
      ]
    },
    {
      "name": "Customer Service",
      "tags": [
        "customer-service-adviser",
        "customer-service-customer",
        "customer-service-customer-csv",
        "customer-service-customer-field",
        "customer-service-customer-journey",
        "customer-service-customer-journey-template",
        "customer-service-customer-journey-control",
        "customer-service-customer-send",
        "customer-service-stats",
        "customer-service-webhook-template",
        "customer-service-segment",
        "customer-service-audience",
        "customer-service-application",
        "customer-service-journeywaitqueue",
        "customer-service-task",
        "customer-service-cdpeventtype",
        "customer-service-cdpeventtypetemplate",
        "customer-service-internal"
      ]
    },
    {
      "name": "Email Service",
      "tags": [
        "es-configuration",
        "es-configurationDomain",
        "es-configurationDomainEmail",
        "es-footer",
        "es-audience",
        "es-contact",
        "es-category",
        "es-campaign",
        "es-campaign-block",
        "es-campaign block-column",
        "es-campaign-multimedia",
        "es-shipment",
        "es-attachment",
        "es-statistics",
        "es-webhook",
        "es-tasks"
      ]
    },
    {
      "name": "InApp Service",
      "tags": [
        "inapp-configuration",
        "inapp-campaign",
        "inapp-schema",
        "inapp-topic",
        "inapp-multimedia",
        "inapp-form",
        "inapp-stats",
        "inapp-audience",
        "inapp-task"
      ]
    },
    {
      "name": "SMS Service",
      "tags": [
        "sms-campaign",
        "sms-configuration",
        "sms-contact",
        "sms-send",
        "sms-stats",
        "sms-topic",
        "sms-cost",
        "sms-webhook",
        "sms-private"
      ]
    },
    {
      "name": "Wallet Service",
      "tags": [
        "wallet-project",
        "wallet-images",
        "wallet-tasks",
        "wallet-notifications",
        "wallet-template",
        "wallet-loyalty-pass",
        "wallet-loyalty-template",
        "wallet-offer-pass",
        "wallet-offer-template",
        "wallet-generic-pass",
        "wallet-generic-template"
      ]
    },
    {
      "name": "Stats Service",
      "tags": [
        "stats-service-chat",
        "stats-service-cs",
        "stats-service-report",
        "stats-service-wallet",
        "stats-service-meta"
      ]
    },
    {
      "name": "ChatGen service",
      "tags": [
        "icc-chatgen-gateway-agent",
        "icc-chatgen-gateway-api-tool",
        "icc-chatgen-gateway-configured-custom-tool",
        "icc-chatgen-gateway-conversation",
        "icc-chatgen-gateway-custom-tool",
        "icc-chatgen-gateway-document",
        "icc-chatgen-gateway-file",
        "icc-chatgen-gateway-instance-config",
        "icc-chatgen-gateway-router-agent-tool",
        "icc-chatgen-gateway-router-agent"
      ]
    },
    {
      "name": "AI Assitant service",
      "tags": [
        "ai-generator-campaign"
      ]
    },
    {
      "name": "Meta Service",
      "tags": [
        "meta-cloudapi",
        "meta-configuration",
        "meta-webhook",
        "meta-business",
        "meta-templates",
        "meta-upload"
      ]
    },
    {
      "name": "Push Live Service",
      "tags": [
        "push-live-configuration",
        "push-live-ios-class",
        "push-live-activity",
        "push-live-send"
      ]
    },
    {
      "name": "Pathbot",
      "tags": [
        "pathbot-agents",
        "pathbot-applications",
        "pathbot-documents",
        "pathbot-flows",
        "pathbot-tools",
        "pathbot-nodes",
        "pathbot-ingestion-sources",
        "pathbot-evaluation",
        "pathbot-skills"
      ]
    },
    {
      "name": "Link Service",
      "tags": [
        "link-short-domain"
      ]
    }
  ],
  "servers": [
    {
      "url": "https://api.indigitall.com/v2"
    }
  ],
  "paths": {
    "/pathbot/{appId}/agents": {
      "parameters": [
        {
          "name": "appId",
          "in": "path",
          "required": true,
          "schema": {
            "type": "integer"
          }
        }
      ],
      "put": {
        "tags": [
          "pathbot-agents"
        ],
        "summary": "Update complete agent with all components",
        "description": "Updates a complete agent configuration in a single atomic operation, including:\n- Bot tools configuration and setup\n- Document management and knowledge base setup\n- Flow metadata and settings\n- Front rail node configuration (input validation and filtering)\n- Agent node configuration (main processing logic with LLM and tools)\n- Back rail node configuration (output validation and filtering)\n\nThis endpoint provides a streamlined way to update a full workflow without requiring\nseparate API calls to update individual components. The entire agent is updated\natomically, ensuring consistency and reducing the complexity of agent updates.\n\nUse this endpoint when you want to update a complete, production-ready agent in\na single operation. For more granular control or when working with existing\ncomponents, use the standard agent update endpoint instead.\n",
        "x-eov-operation-handler": "agentController",
        "x-gateway-endpoint": "pathbotService",
        "x-gateway-check-permission": {
          "account-features": [
            "PATHBOT_ENABLED"
          ]
        },
        "operationId": "updateAgent",
        "requestBody": {
          "$ref": "#/components/requestBodies/PG_PUT_Agent_Body"
        },
        "responses": {
          "201": {
            "$ref": "#/components/responses/PG_GET_Flow_OK"
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "500": {
            "$ref": "#/components/responses/Error"
          },
          "default": {
            "$ref": "#/components/responses/Default"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "Authorization": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "Authorization for accesing endpoints , must be in one of the following format:\n- **Bearer {token}**\n- **ServerKey {key}**\n"
      }
    },
    "schemas": {
      "PG_PII_Config": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean",
            "description": "Whether to enable pii.",
            "example": true
          },
          "onFailure": {
            "type": "string",
            "description": "Action when PII is detected: 'error' rejects the message, 'mask' anonymizes it.\n\nBehavior when null: No regex patterns applied (disabled).\n",
            "default": "error",
            "enum": [
              "error",
              "mask"
            ],
            "example": "mask"
          },
          "customPatterns": {
            "type": "object",
            "additionalProperties": true,
            "nullable": true,
            "description": "Custom regex patterns for PII anonymization.\n\nBehavior when null: No regex patterns applied (disabled).\n",
            "example": [
              {
                "creditCard": "\\b\\d{4}[\\s-]?\\d{4}[\\s-]?\\d{4}[\\s-]?\\d{4}\\b"
              }
            ]
          },
          "customLabels": {
            "type": "array",
            "items": {
              "type": "string",
              "description": "The custom label."
            },
            "nullable": true,
            "description": "Custom labels for PII anonymization. If none provided, defaults to a standard set list of labels.\n\nDefault labels applied: person, organization, location, address, phone number, email, username, iban, cvv,\npassword, passport number, social security number, national id number, driver's license number, tax\nidentification number, credit card number, bank account number.\n",
            "example": [
              "person",
              "email",
              "phone number",
              "iban"
            ]
          }
        }
      },
      "PG_Node": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The id of the node."
          },
          "applicationId": {
            "type": "integer",
            "description": "The id of the application.",
            "example": 1
          },
          "prompt": {
            "type": "string",
            "description": "The prompt of the node.",
            "example": "Prompt"
          },
          "llmModel": {
            "type": "string",
            "description": "The llm model of the node. For reasoning models (gpt-5-mini, gpt-5.6-luna...), an optional \":minimal\",\n\":low\", \":medium\" or \":high\" suffix can be appended (e.g. \"gpt-5.6-luna:low\") to set the reasoning\neffort. gpt-5-chat is the non-reasoning GPT-5 variant and does not support this suffix.\n",
            "example": "gpt-5.6-luna:low",
            "enum": [
              "gpt-4o-mini",
              "gpt-4o",
              "gpt-4.1",
              "gpt-4.1-mini",
              "gpt-5-mini",
              "gpt-5-mini:minimal",
              "gpt-5-mini:low",
              "gpt-5-mini:medium",
              "gpt-5-mini:high",
              "gpt-5-chat",
              "gpt-5.6-luna",
              "gpt-5.6-luna:minimal",
              "gpt-5.6-luna:low",
              "gpt-5.6-luna:medium",
              "gpt-5.6-luna:high",
              "gemini-2.5-pro",
              "gemini-2.5-flash"
            ]
          },
          "maxTokens": {
            "type": "integer",
            "description": "The max token of the node.",
            "example": 100
          },
          "temperature": {
            "type": "number",
            "description": "The temperature of the node.",
            "example": 0.5
          },
          "showSources": {
            "type": "boolean",
            "description": "Whether to show sources.",
            "example": true
          },
          "name": {
            "type": "string",
            "description": "The name of the node.",
            "example": "Node"
          },
          "description": {
            "type": "string",
            "description": "The description of the node.",
            "example": "Node"
          },
          "nodeTypeId": {
            "type": "integer",
            "description": "The id of the node type.",
            "example": 1
          },
          "nodeTypeCode": {
            "type": "string",
            "description": "The code of the node type.",
            "enum": [
              "AGENT",
              "FRONTRAILS",
              "BACKRAILS",
              "SUPERVISOR"
            ]
          },
          "createdAt": {
            "type": "string",
            "description": "The created time of the node.",
            "example": "2022-01-01T00:00:00.000Z."
          },
          "updatedAt": {
            "type": "string",
            "description": "The updated time of the node.",
            "example": "2022-01-01T00:00:00.000Z."
          },
          "linkedTools": {
            "type": "array",
            "description": "The linked tools of the node.",
            "items": {
              "$ref": "#/components/schemas/PG_Tool"
            }
          }
        }
      },
      "PG_PUT_Frontrails_Node_With_Id": {
        "type": "object",
        "properties": {
          "nodeTypeCode": {
            "type": "string",
            "description": "The code of the node type.",
            "default": "FRONTRAILS",
            "enum": [
              "FRONTRAILS"
            ]
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "bannedKeywords": {
            "type": "array",
            "description": "The banned keywords of the node.",
            "items": {
              "type": "string",
              "description": "The banned keyword."
            },
            "nullable": true
          },
          "llmRailsEnable": {
            "type": "boolean",
            "description": "Whether to use llm rails.",
            "example": true
          },
          "llmRailsPrompt": {
            "type": "string",
            "description": "The prompt of the llm rails.",
            "example": "Prompt",
            "nullable": true
          },
          "llmRailsModel": {
            "type": "string",
            "description": "The llm model of the llm rails. For reasoning models (gpt-5-mini, gpt-5.6-luna...), an optional \":minimal\",\n\":low\", \":medium\" or \":high\" suffix can be appended (e.g. \"gpt-5.6-luna:low\") to set the reasoning\neffort. gpt-5-chat is the non-reasoning GPT-5 variant and does not support this suffix.\n",
            "example": "gpt-5.6-luna:low",
            "enum": [
              "gpt-4o-mini",
              "gpt-4o",
              "gpt-4.1",
              "gpt-4.1-mini",
              "gpt-5-mini",
              "gpt-5-mini:minimal",
              "gpt-5-mini:low",
              "gpt-5-mini:medium",
              "gpt-5-mini:high",
              "gpt-5-chat",
              "gpt-5.6-luna",
              "gpt-5.6-luna:minimal",
              "gpt-5.6-luna:low",
              "gpt-5.6-luna:medium",
              "gpt-5.6-luna:high",
              "gemini-2.5-pro",
              "gemini-2.5-flash"
            ],
            "nullable": true
          },
          "llmRailsBannedKeywords": {
            "type": "array",
            "description": "The banned keywords of the llm rails.",
            "items": {
              "type": "string",
              "description": "The banned keyword."
            },
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "The name of the node.",
            "example": "Frontrails node"
          },
          "description": {
            "type": "string",
            "description": "The description of the node."
          },
          "piiConfig": {
            "$ref": "#/components/schemas/PG_PII_Config"
          }
        },
        "required": [
          "id",
          "nodeTypeCode"
        ]
      },
      "PG_PUT_Agent_Node_With_Id": {
        "type": "object",
        "properties": {
          "nodeTypeCode": {
            "type": "string",
            "description": "The code of the node type.",
            "default": "AGENT",
            "enum": [
              "AGENT"
            ]
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "prompt": {
            "type": "string",
            "description": "The prompt of the node.",
            "example": "Prompt"
          },
          "llmModel": {
            "type": "string",
            "description": "The llm model of the node. For reasoning models (gpt-5-mini, gpt-5.6-luna...), an optional \":minimal\",\n\":low\", \":medium\" or \":high\" suffix can be appended (e.g. \"gpt-5.6-luna:low\") to set the reasoning\neffort. gpt-5-chat is the non-reasoning GPT-5 variant and does not support this suffix.\n",
            "example": "gpt-5.6-luna:low",
            "enum": [
              "gpt-4o-mini",
              "gpt-4o",
              "gpt-4.1",
              "gpt-4.1-mini",
              "gpt-5-mini",
              "gpt-5-mini:minimal",
              "gpt-5-mini:low",
              "gpt-5-mini:medium",
              "gpt-5-mini:high",
              "gpt-5-chat",
              "gpt-5.6-luna",
              "gpt-5.6-luna:minimal",
              "gpt-5.6-luna:low",
              "gpt-5.6-luna:medium",
              "gpt-5.6-luna:high",
              "gemini-2.5-pro",
              "gemini-2.5-flash"
            ]
          },
          "maxTokens": {
            "type": "integer",
            "description": "The max token of the node.",
            "example": 100
          },
          "temperature": {
            "type": "number",
            "description": "The temperature of the node."
          },
          "showSources": {
            "type": "boolean",
            "description": "Whether to show sources.",
            "example": true
          },
          "name": {
            "type": "string",
            "description": "The name of the node.",
            "example": "Agent node"
          },
          "description": {
            "type": "string",
            "description": "The description of the node."
          },
          "tools": {
            "type": "array",
            "description": "The ids of the tools.",
            "items": {
              "type": "object",
              "discriminator": {
                "propertyName": "toolTypeCode",
                "mapping": {
                  "GENERAL": "#/components/schemas/PG_PUT_General_Tool_With_Id",
                  "API": "#/components/schemas/PG_PUT_Api_Tool_With_Id",
                  "RETRIEVAL": "#/components/schemas/PG_PUT_Retrieval_Tool_With_Id",
                  "MCP": "#/components/schemas/PG_PUT_Mcp_Tool_With_Id"
                }
              },
              "oneOf": [
                {
                  "$ref": "#/components/schemas/PG_PUT_General_Tool_With_Id"
                },
                {
                  "$ref": "#/components/schemas/PG_PUT_Api_Tool_With_Id"
                },
                {
                  "$ref": "#/components/schemas/PG_PUT_Retrieval_Tool_With_Id"
                },
                {
                  "$ref": "#/components/schemas/PG_PUT_Mcp_Tool_With_Id"
                }
              ]
            }
          }
        },
        "required": [
          "id",
          "nodeTypeCode"
        ]
      },
      "PG_PUT_Backrails_Node_With_Id": {
        "type": "object",
        "properties": {
          "nodeTypeCode": {
            "type": "string",
            "description": "The code of the node type.",
            "default": "BACKRAILS",
            "enum": [
              "BACKRAILS"
            ]
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "bannedKeywords": {
            "type": "array",
            "description": "The banned keywords of the node.",
            "items": {
              "type": "string",
              "description": "The banned keyword."
            },
            "nullable": true
          },
          "llmRailsEnable": {
            "type": "boolean",
            "description": "Whether to use llm rails.",
            "example": true
          },
          "llmRailsPrompt": {
            "type": "string",
            "description": "The prompt of the llm rails.",
            "example": "Prompt",
            "nullable": true
          },
          "llmRailsModel": {
            "type": "string",
            "description": "The llm model of the llm rails. For reasoning models (gpt-5-mini, gpt-5.6-luna...), an optional \":minimal\",\n\":low\", \":medium\" or \":high\" suffix can be appended (e.g. \"gpt-5.6-luna:low\") to set the reasoning\neffort. gpt-5-chat is the non-reasoning GPT-5 variant and does not support this suffix.\n",
            "example": "gpt-5.6-luna:low",
            "enum": [
              "gpt-4o-mini",
              "gpt-4o",
              "gpt-4.1",
              "gpt-4.1-mini",
              "gpt-5-mini",
              "gpt-5-mini:minimal",
              "gpt-5-mini:low",
              "gpt-5-mini:medium",
              "gpt-5-mini:high",
              "gpt-5-chat",
              "gpt-5.6-luna",
              "gpt-5.6-luna:minimal",
              "gpt-5.6-luna:low",
              "gpt-5.6-luna:medium",
              "gpt-5.6-luna:high",
              "gemini-2.5-pro",
              "gemini-2.5-flash"
            ],
            "nullable": true
          },
          "llmRailsBannedKeywords": {
            "type": "array",
            "description": "The banned keywords of the llm rails.",
            "items": {
              "type": "string",
              "description": "The banned keyword."
            },
            "nullable": true
          },
          "name": {
            "type": "string",
            "description": "The name of the node.",
            "example": "Frontrails node"
          },
          "description": {
            "type": "string",
            "description": "The description of the node."
          },
          "piiConfig": {
            "$ref": "#/components/schemas/PG_PII_Config"
          }
        },
        "required": [
          "id",
          "nodeTypeCode"
        ]
      },
      "PG_PUT_Supervisor_Node_With_Id": {
        "type": "object",
        "properties": {
          "nodeTypeCode": {
            "type": "string",
            "description": "The code of the node type.",
            "default": "SUPERVISOR",
            "enum": [
              "SUPERVISOR"
            ]
          },
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "prompt": {
            "type": "string",
            "description": "The prompt of the node.",
            "example": "Prompt"
          },
          "llmModel": {
            "type": "string",
            "description": "The llm model of the node. For reasoning models (gpt-5-mini, gpt-5.6-luna...), an optional \":minimal\",\n\":low\", \":medium\" or \":high\" suffix can be appended (e.g. \"gpt-5.6-luna:low\") to set the reasoning\neffort. gpt-5-chat is the non-reasoning GPT-5 variant and does not support this suffix.\n",
            "example": "gpt-5.6-luna:low",
            "enum": [
              "gpt-4o-mini",
              "gpt-4o",
              "gpt-4.1",
              "gpt-4.1-mini",
              "gpt-5-mini",
              "gpt-5-mini:minimal",
              "gpt-5-mini:low",
              "gpt-5-mini:medium",
              "gpt-5-mini:high",
              "gpt-5-chat",
              "gpt-5.6-luna",
              "gpt-5.6-luna:minimal",
              "gpt-5.6-luna:low",
              "gpt-5.6-luna:medium",
              "gpt-5.6-luna:high",
              "gemini-2.5-pro",
              "gemini-2.5-flash"
            ]
          },
          "maxTokens": {
            "type": "integer",
            "description": "The max token of the node.",
            "example": 100
          },
          "temperature": {
            "type": "number",
            "description": "The temperature of the node."
          },
          "showSources": {
            "type": "boolean",
            "description": "Whether to show sources.",
            "example": true
          },
          "name": {
            "type": "string",
            "description": "The name of the node.",
            "example": "Supervisor node"
          },
          "description": {
            "type": "string",
            "description": "The description of the node."
          }
        }
      },
      "PG_Flow_Multilanguage": {
        "type": "object",
        "properties": {
          "default": {
            "type": "string",
            "description": "The default response.",
            "example": "Hello"
          },
          "whatsapp": {
            "type": "string",
            "description": "The WhatsApp response.",
            "example": "Hello"
          },
          "web": {
            "type": "string",
            "description": "The WebChat response.",
            "example": "Hello"
          },
          "es": {
            "type": "string",
            "description": "The Spanish response.",
            "example": "Hola"
          },
          "en": {
            "type": "string",
            "description": "The English response.",
            "example": "Hello"
          },
          "pt": {
            "type": "string",
            "description": "The Portuguese response.",
            "example": "Ola"
          },
          "de": {
            "type": "string",
            "description": "The German response.",
            "example": "Hallo"
          },
          "fr": {
            "type": "string",
            "description": "The French response.",
            "example": "Bonjour"
          },
          "it": {
            "type": "string",
            "description": "The Italian response.",
            "example": "Ciao"
          },
          "esWhatsapp": {
            "type": "string",
            "description": "The Spanish WhatsApp response.",
            "example": "Hola"
          },
          "enWhatsapp": {
            "type": "string",
            "description": "The English WhatsApp response.",
            "example": "Hello"
          },
          "ptWhatsapp": {
            "type": "string",
            "description": "The Portuguese WhatsApp response.",
            "example": "Ola"
          },
          "deWhatsapp": {
            "type": "string",
            "description": "The German WhatsApp response.",
            "example": "Hallo"
          },
          "frWhatsapp": {
            "type": "string",
            "description": "The French WhatsApp response.",
            "example": "Bonjour"
          },
          "itWhatsapp": {
            "type": "string",
            "description": "The Italian WhatsApp response.",
            "example": "Ciao"
          },
          "esWeb": {
            "type": "string",
            "description": "The Spanish WebChat response.",
            "example": "Hola"
          },
          "enWeb": {
            "type": "string",
            "description": "The English WebChat response.",
            "example": "Hello"
          },
          "ptWeb": {
            "type": "string",
            "description": "The Portuguese WebChat response.",
            "example": "Ola"
          },
          "deWeb": {
            "type": "string",
            "description": "The German WebChat response.",
            "example": "Hallo"
          },
          "frWeb": {
            "type": "string",
            "description": "The French WebChat response.",
            "example": "Bonjour"
          },
          "itWeb": {
            "type": "string",
            "description": "The Italian WebChat response.",
            "example": "Ciao"
          }
        }
      },
      "PG_Flow": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Unique identifier for the flow.",
            "example": 1
          },
          "name": {
            "type": "string",
            "description": "The name of the flow.",
            "example": "My Flow",
            "maxLength": 50
          },
          "description": {
            "type": "string",
            "description": "The description of the flow.",
            "example": "This is my flow",
            "maxLength": 10000
          },
          "recursionLimit": {
            "type": "integer",
            "format": "int64",
            "description": "The maximum number of times a flow can be executed.",
            "example": 15,
            "default": 15
          },
          "welcomeResponse": {
            "description": "Response to welcome the user. Keys must be 'default' (mandatory if object exists), language codes, \nchannel codes, or 'lang_channel' combinations.\n",
            "$ref": "#/components/schemas/PG_Flow_Multilanguage"
          },
          "semaphoreResponse": {
            "description": "Response while a request is being processed. Must contain 'default' key.",
            "$ref": "#/components/schemas/PG_Flow_Multilanguage"
          },
          "guardrailsResponse": {
            "description": "Response when guardrails are triggered. Must contain 'default' key.",
            "$ref": "#/components/schemas/PG_Flow_Multilanguage"
          },
          "bannedResponse": {
            "description": "Response when a user is banned. Must contain 'default' key.",
            "$ref": "#/components/schemas/PG_Flow_Multilanguage"
          },
          "costErrorResponse": {
            "description": "Response when a cost limit is reached. Must contain 'default' key.",
            "$ref": "#/components/schemas/PG_Flow_Multilanguage"
          },
          "appErrorResponse": {
            "description": "Response for general application errors. Must contain 'default' key.",
            "$ref": "#/components/schemas/PG_Flow_Multilanguage"
          },
          "unsupportedMediaResponse": {
            "description": "Response for unsupported media types. Must contain 'default' key.",
            "$ref": "#/components/schemas/PG_Flow_Multilanguage"
          },
          "state": {
            "type": "object",
            "description": "The state of the flow."
          },
          "enabled": {
            "type": "boolean",
            "description": "Flag indicating whether the flow is enabled.",
            "example": true
          },
          "isDev": {
            "type": "boolean",
            "description": "Flag indicating whether the flow is a development flow.",
            "example": true
          },
          "isInternal": {
            "type": "boolean",
            "description": "Flag indicating whether the flow is an internal flow.",
            "example": false
          },
          "forceErrorResponse": {
            "type": "boolean",
            "description": "Flag indicating whether to force an error response.",
            "example": false
          },
          "applicationId": {
            "type": "integer",
            "format": "int64",
            "description": "Unique identifier for the application.",
            "example": 1
          },
          "flowTemplateId": {
            "type": "integer",
            "format": "int64",
            "description": "Unique identifier for the flow template.",
            "example": 1
          },
          "flowTemplateCode": {
            "type": "string",
            "description": "The code of the flow template.",
            "example": "my-flow-template"
          },
          "createdAt": {
            "type": "string",
            "description": "The creation date of the flow template.",
            "example": "2022-01-01T00:00:00.000Z"
          },
          "updatedAt": {
            "type": "string",
            "description": "The last update date of the flow template.",
            "example": "2022-01-01T00:00:00.000Z"
          },
          "nodes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PG_Node"
            }
          },
          "config": {
            "$ref": "#/components/schemas/PG_Flow_Config"
          }
        }
      },
      "PG_Flow_Config": {
        "type": "object",
        "description": "The configuration for the flow.",
        "nullable": true,
        "properties": {
          "replacements": {
            "type": "object",
            "description": "The replacements.",
            "properties": {
              "companyName": {
                "type": "string",
                "description": "The name of the company.",
                "example": "My Company"
              },
              "botName": {
                "type": "string",
                "description": "The name of the bot.",
                "example": "My Bot"
              },
              "industry": {
                "type": "string",
                "description": "The industry of the company.",
                "example": "Finance"
              },
              "role": {
                "type": "string",
                "description": "The role of the user.",
                "example": "Sales"
              },
              "personality": {
                "type": "string",
                "description": "The personality of the bot.",
                "example": "Friendly"
              }
            },
            "additionalProperties": true
          }
        },
        "required": [
          "replacements"
        ]
      },
      "PG_GeneralToolCatalogItem": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "example": 1
          },
          "name": {
            "type": "string",
            "example": "tool_1"
          },
          "description": {
            "type": "string",
            "example": "Tool 1"
          },
          "createdAt": {
            "type": "string",
            "example": "2022-01-01T00:00:00.000Z"
          },
          "updatedAt": {
            "type": "string",
            "example": "2022-01-01T00:00:00.000Z"
          }
        }
      },
      "PG_Tool": {
        "type": "object",
        "discriminator": {
          "propertyName": "toolTypeCode",
          "mapping": {
            "GENERAL": "#/components/schemas/PG_General_Tool",
            "API": "#/components/schemas/PG_Api_Tool",
            "RETRIEVAL": "#/components/schemas/PG_Retrieval_Tool",
            "MCP": "#/components/schemas/PG_MCP_Tool"
          }
        },
        "oneOf": [
          {
            "$ref": "#/components/schemas/PG_General_Tool"
          },
          {
            "$ref": "#/components/schemas/PG_Api_Tool"
          },
          {
            "$ref": "#/components/schemas/PG_Retrieval_Tool"
          },
          {
            "$ref": "#/components/schemas/PG_MCP_Tool"
          }
        ]
      },
      "PG_General_Tool": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The id of the tool."
          },
          "catalogId": {
            "type": "integer",
            "description": "ID of the catalog item this tool uses (e.g., references 'Contact Center', 'Dialogflow').",
            "example": 1
          },
          "config": {
            "type": "object",
            "description": "Configuration settings for the general tool, stored as JSON. This can include a 'custom output' key with a\nstring value. For specific catalog tools like 'Contact Center' or 'Dialogflow' (identified by catalog_id),\nthis 'config' field is mandatory and must contain a 'custom output' key with a non-empty string value.\nThis validation is performed by the service.\n"
          },
          "name": {
            "type": "string",
            "description": "Name of the tool configuration.",
            "example": "tool_1"
          },
          "description": {
            "type": "string",
            "description": "Description of the tool configuration.",
            "example": "Tool 1",
            "nullable": true
          },
          "humanReview": {
            "type": "boolean",
            "description": "Flag indicating if human review is required for this tool's output.",
            "example": true
          },
          "reviewMessage": {
            "type": "string",
            "description": "Message to display if human review is triggered.",
            "example": "Review message",
            "nullable": true
          },
          "reviewKeyword": {
            "type": "string",
            "description": "Keyword to approve the agent actions.",
            "example": "review keyword",
            "nullable": true
          },
          "argsSchema": {
            "$ref": "#/components/schemas/PG_ArgsSchema_Object"
          },
          "applicationId": {
            "type": "integer",
            "description": "The id of the application.",
            "example": 1
          },
          "toolTypeId": {
            "type": "integer",
            "description": "The id of the tool type.",
            "example": 1
          },
          "toolTypeCode": {
            "type": "string",
            "description": "The code of the tool type.",
            "enum": [
              "GENERAL"
            ]
          },
          "createdAt": {
            "type": "string",
            "description": "The creation time of the tool",
            "example": "2022-01-01T00:00:00.000Z"
          },
          "updatedAt": {
            "type": "string",
            "description": "The update time of the tool",
            "example": "2022-01-01T00:00:00.000Z"
          },
          "generalToolCatalog": {
            "$ref": "#/components/schemas/PG_GeneralToolCatalogItem"
          }
        }
      },
      "PG_Api_Tool": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The id of the tool."
          },
          "endpoint": {
            "type": "string",
            "description": "API endpoint URL.",
            "maxLength": 500,
            "example": "https://example.com"
          },
          "method": {
            "type": "string",
            "description": "HTTP method (e.g., GET, POST).",
            "example": "GET"
          },
          "headers": {
            "type": "object",
            "description": "HTTP headers.",
            "nullable": true
          },
          "params": {
            "type": "object",
            "description": "URL query parameters.",
            "nullable": true
          },
          "body": {
            "type": "object",
            "description": "Request body for methods like POST, PUT.",
            "nullable": true
          },
          "applicationId": {
            "type": "integer",
            "description": "The id of the application.",
            "example": 1
          },
          "toolTypeId": {
            "type": "integer",
            "description": "The id of the tool type.",
            "example": 1
          },
          "toolTypeCode": {
            "type": "string",
            "description": "The code of the tool type.",
            "enum": [
              "API"
            ]
          },
          "createdAt": {
            "type": "string",
            "description": "The creation time of the tool.",
            "example": "2022-01-01T00:00:00.000Z"
          },
          "updatedAt": {
            "type": "string",
            "description": "The update time of the tool.",
            "example": "2022-01-01T00:00:00.000Z"
          },
          "cacheEnabled": {
            "type": "boolean",
            "description": "Flag to enable caching for API responses.",
            "example": true
          },
          "cacheTtl": {
            "type": "integer",
            "description": "Cache Time-To-Live in seconds (if cache_enabled is true).",
            "example": 60,
            "nullable": true
          },
          "config": {
            "type": "object",
            "description": "Configuration settings for the general tool, stored as JSON.\nThis validation is performed by the service.\n"
          },
          "name": {
            "type": "string",
            "description": "Name of the tool configuration.",
            "example": "tool_1"
          },
          "description": {
            "type": "string",
            "description": "Description of the tool configuration.",
            "example": "Tool 1",
            "nullable": true
          },
          "humanReview": {
            "type": "boolean",
            "description": "Flag indicating if human review is required for this tool's output.",
            "example": true
          },
          "reviewMessage": {
            "type": "string",
            "description": "Message to display if human review is triggered.",
            "example": "Review message",
            "nullable": true
          },
          "reviewKeyword": {
            "type": "string",
            "description": "Keyword to approve the agent actions.",
            "example": "review keyword",
            "nullable": true
          },
          "argsSchema": {
            "$ref": "#/components/schemas/PG_ArgsSchema_Object"
          }
        }
      },
      "PG_Retrieval_Tool": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The id of the tool."
          },
          "applicationId": {
            "type": "integer",
            "description": "The id of the application.",
            "example": 1
          },
          "toolTypeId": {
            "type": "integer",
            "description": "The id of the tool type.",
            "example": 1
          },
          "toolTypeCode": {
            "type": "string",
            "description": "The code of the tool type.",
            "enum": [
              "RETRIEVAL"
            ]
          },
          "retrievalSettings": {
            "$ref": "#/components/schemas/PG_RetrievalSettings"
          },
          "timeAware": {
            "type": "boolean",
            "description": "Flag indicating if retrieval should be time-aware.",
            "example": true
          },
          "documentIds": {
            "type": "array",
            "description": "List of Document IDs to associate for creation/replacement.",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "config": {
            "type": "object",
            "description": "Configuration settings for the general tool, stored as JSON.\nThis validation is performed by the service.\n"
          },
          "name": {
            "type": "string",
            "description": "Name of the tool configuration.",
            "example": "tool_1"
          },
          "description": {
            "type": "string",
            "description": "Description of the tool configuration.",
            "example": "Tool 1",
            "nullable": true
          },
          "humanReview": {
            "type": "boolean",
            "description": "Flag indicating if human review is required for this tool's output.",
            "example": true
          },
          "reviewMessage": {
            "type": "string",
            "description": "Message to display if human review is triggered.",
            "example": "Review message",
            "nullable": true
          },
          "reviewKeyword": {
            "type": "string",
            "description": "Keyword to approve the agent actions.",
            "example": "review keyword",
            "nullable": true
          },
          "argsSchema": {
            "$ref": "#/components/schemas/PG_ArgsSchema_Object"
          },
          "documents": {
            "type": "array",
            "description": "Summary of linked documents.",
            "items": {
              "$ref": "#/components/schemas/PG_Document"
            },
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "description": "The creation time of the tool",
            "example": "2022-01-01T00:00:00.000Z"
          },
          "updatedAt": {
            "type": "string",
            "description": "The update time of the tool",
            "example": "2022-01-01T00:00:00.000Z"
          }
        }
      },
      "PG_MCP_Tool": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The id of the tool."
          },
          "applicationId": {
            "type": "integer",
            "description": "The id of the application.",
            "example": 1
          },
          "toolTypeId": {
            "type": "integer",
            "description": "The id of the tool type.",
            "example": 1
          },
          "toolTypeCode": {
            "type": "string",
            "description": "The code of the tool type.",
            "enum": [
              "MCP"
            ]
          },
          "mcpServerBaseUrl": {
            "type": "string",
            "description": "The base URL of the MCP server.",
            "example": "https://example.com/mcp"
          },
          "params": {
            "type": "object",
            "description": "The parameters for the MCP server.",
            "nullable": true
          },
          "headers": {
            "type": "object",
            "description": "The headers for the MCP server.",
            "nullable": true
          },
          "toolSelectionConfig": {
            "type": "object",
            "description": "The tool selection configuration for the MCP server.",
            "nullable": true
          },
          "isEnabled": {
            "type": "boolean",
            "description": "Flag indicating if the MCP tool is enabled.",
            "example": true
          },
          "config": {
            "type": "object",
            "description": "Configuration settings for the general tool, stored as JSON.\nThis validation is performed by the service.\n"
          },
          "name": {
            "type": "string",
            "description": "Name of the tool configuration.",
            "example": "tool mcp"
          },
          "description": {
            "type": "string",
            "description": "Description of the tool configuration.",
            "example": "Tool mcp",
            "nullable": true
          },
          "humanReview": {
            "type": "boolean",
            "description": "Flag indicating if human review is required for this tool's output.",
            "example": true
          },
          "reviewMessage": {
            "type": "string",
            "description": "Message to display if human review is triggered.",
            "example": "Review message",
            "nullable": true
          },
          "reviewKeyword": {
            "type": "string",
            "description": "Keyword to approve the agent actions.",
            "example": "review keyword",
            "nullable": true
          },
          "argsSchema": {
            "$ref": "#/components/schemas/PG_ArgsSchema_Object"
          },
          "createdAt": {
            "type": "string",
            "description": "The creation time of the tool",
            "example": "2022-01-01T00:00:00.000Z"
          },
          "updatedAt": {
            "type": "string",
            "description": "The update time of the tool",
            "example": "2022-01-01T00:00:00.000Z"
          }
        }
      },
      "PG_PUT_General_Tool_With_Id": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The ID of the tool configuration."
          },
          "toolTypeCode": {
            "type": "string",
            "description": "The code of the tool type.",
            "enum": [
              "GENERAL"
            ]
          },
          "config": {
            "type": "object",
            "description": "Configuration settings for the general tool, stored as JSON. This can include a 'custom output' key with a\nstring value. For specific catalog tools like 'Contact Center' or 'Dialogflow' (identified by catalog_id),\nthis 'config' field is mandatory and must contain a 'custom output' key with a non-empty string value.\nThis validation is performed by the service.\n"
          },
          "name": {
            "type": "string",
            "description": "Name of the tool configuration.",
            "example": "tool_1"
          },
          "description": {
            "type": "string",
            "description": "Description of the tool configuration.",
            "example": "Tool 1"
          },
          "humanReview": {
            "type": "boolean",
            "description": "Flag indicating if human review is required for this tool's output.",
            "example": true
          },
          "reviewMessage": {
            "type": "string",
            "description": "Message to display if human review is triggered.",
            "example": "Review message",
            "nullable": true
          },
          "reviewKeyword": {
            "type": "string",
            "description": "Keyword to approve the agent actions.",
            "example": "review keyword",
            "nullable": true
          },
          "argsSchema": {
            "$ref": "#/components/schemas/PG_ArgsSchema_Object"
          }
        },
        "required": [
          "id"
        ]
      },
      "PG_PUT_Api_Tool_With_Id": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The ID of the tool configuration."
          },
          "toolTypeCode": {
            "type": "string",
            "description": "The code of the tool type.",
            "enum": [
              "API"
            ]
          },
          "endpoint": {
            "type": "string",
            "description": "API endpoint URL.",
            "maxLength": 500,
            "example": "https://example.com"
          },
          "method": {
            "type": "string",
            "description": "HTTP method (e.g., GET, POST).",
            "example": "GET"
          },
          "headers": {
            "type": "object",
            "description": "HTTP headers.",
            "nullable": true
          },
          "params": {
            "type": "object",
            "description": "URL query parameters.",
            "nullable": true
          },
          "body": {
            "type": "object",
            "description": "Request body for methods like POST, PUT.",
            "nullable": true
          },
          "cacheEnabled": {
            "type": "boolean",
            "description": "Flag to enable caching for API responses.",
            "example": true
          },
          "cacheTtl": {
            "type": "integer",
            "description": "Cache Time-To-Live in seconds (if cache_enabled is true).",
            "example": 3600,
            "nullable": true
          },
          "config": {
            "type": "object",
            "description": "Configuration settings for the general tool, stored as JSON.\nThis validation is performed by the service.\n"
          },
          "name": {
            "type": "string",
            "description": "Name of the tool configuration.",
            "example": "tool_1"
          },
          "description": {
            "type": "string",
            "description": "Description of the tool configuration.",
            "example": "Tool 1"
          },
          "humanReview": {
            "type": "boolean",
            "description": "Flag indicating if human review is required for this tool's output.",
            "example": true
          },
          "reviewMessage": {
            "type": "string",
            "description": "Message to display if human review is triggered.",
            "example": "Review message",
            "nullable": true
          },
          "reviewKeyword": {
            "type": "string",
            "description": "Keyword to approve the agent actions.",
            "example": "review keyword",
            "nullable": true
          },
          "argsSchema": {
            "$ref": "#/components/schemas/PG_ArgsSchema_Object"
          }
        },
        "required": [
          "id"
        ]
      },
      "PG_PUT_Retrieval_Tool_With_Id": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The ID of the tool configuration."
          },
          "toolTypeCode": {
            "type": "string",
            "enum": [
              "RETRIEVAL"
            ]
          },
          "retrievalSettings": {
            "$ref": "#/components/schemas/PG_RetrievalSettings"
          },
          "timeAware": {
            "type": "boolean",
            "description": "Flag indicating if retrieval should be time-aware.",
            "example": true
          },
          "documentIds": {
            "type": "array",
            "description": "List of Document IDs to associate for creation/replacement.",
            "items": {
              "type": "string"
            },
            "nullable": true
          },
          "config": {
            "type": "object",
            "description": "Configuration settings for the general tool, stored as JSON.\nThis validation is performed by the service.\n"
          },
          "name": {
            "type": "string",
            "description": "Name of the tool configuration.",
            "example": "tool_1"
          },
          "description": {
            "type": "string",
            "description": "Description of the tool configuration.",
            "example": "Tool 1"
          },
          "humanReview": {
            "type": "boolean",
            "description": "Flag indicating if human review is required for this tool's output.",
            "example": true
          },
          "reviewMessage": {
            "type": "string",
            "description": "Message to display if human review is triggered.",
            "example": "Review message",
            "nullable": true
          },
          "reviewKeyword": {
            "type": "string",
            "description": "Keyword to approve the agent actions.",
            "example": "review keyword",
            "nullable": true
          },
          "argsSchema": {
            "$ref": "#/components/schemas/PG_ArgsSchema_Object"
          }
        },
        "required": [
          "id"
        ]
      },
      "PG_PUT_Mcp_Tool_With_Id": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The ID of the tool configuration."
          },
          "toolTypeCode": {
            "type": "string",
            "enum": [
              "MCP"
            ]
          },
          "mcpServerBaseUrl": {
            "type": "string",
            "description": "The base URL of the MCP server.",
            "example": "https://example.com/mcp"
          },
          "headers": {
            "type": "object",
            "description": "HTTP headers.",
            "nullable": true
          },
          "params": {
            "type": "object",
            "description": "URL query parameters.",
            "nullable": true
          },
          "isEnabled": {
            "type": "boolean",
            "description": "Flag indicating if the MCP tool is enabled.",
            "example": true
          },
          "config": {
            "type": "object",
            "description": "Configuration settings for the general tool, stored as JSON.\nThis validation is performed by the service.\n",
            "additionalProperties": true
          },
          "toolSelectionConfig": {
            "type": "object",
            "description": "Configuration settings for the tool selection",
            "properties": {
              "mode": {
                "type": "string",
                "description": "The mode of the tool selection"
              },
              "tools": {
                "type": "array",
                "description": "List of tools to be selected",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "name": {
            "type": "string",
            "description": "Name of the tool configuration.",
            "example": "tool mcp"
          },
          "description": {
            "type": "string",
            "description": "Description of the tool configuration.",
            "example": "Tool mcp"
          },
          "humanReview": {
            "type": "boolean",
            "description": "Flag indicating if human review is required for this tool's output.",
            "example": true
          },
          "reviewMessage": {
            "type": "string",
            "description": "Message to display if human review is triggered.",
            "example": "Review message",
            "nullable": true
          },
          "reviewKeyword": {
            "type": "string",
            "description": "Keyword to approve the agent actions.",
            "example": "review keyword",
            "nullable": true
          },
          "argsSchema": {
            "$ref": "#/components/schemas/PG_ArgsSchema_Object"
          }
        },
        "required": [
          "id"
        ]
      },
      "PG_ArgsSchema_Object": {
        "type": "object",
        "description": "JSON schema, defining expected input parameters. Tool-specific behavior: \n\nGENERAL tools: \n  - contactCenter, dialogflow, dummyTool: Must be null/empty, no custom args. \n  - webSearch: If null or empty, defaults to standard 'query' parameter (required). \n  - userProfileMemory: required custom argsSchema. \n  \nRETRIEVAL tools: If null or empty, defaults to standard 'query' parameter (required). \n\nAPI tools: Can be null/empty or customized. \nNOTE: For API tools, 'params' and 'argsSchema' must match (they represent the same data).\n\nMCP tools: Can be null/empty or customized. NOTE: For MCP tools, 'params' and 'argsSchema' must match (they represent the same data).\n",
        "nullable": true,
        "additionalProperties": true
      },
      "PG_RetrievalSettings": {
        "type": "object",
        "description": "Custom retrieval settings for the tool, including RBAC configuration.\n\n**RBAC Fields:**\n- `enforceDocumentFilters` (boolean): When true, applies RBAC filtering to retrieval results based on user permissions.\n- `filtersContextKey` (string): JSON path in the context object to extract user access filters (e.g., \"profile.allowedFilters\", \"docAccess\").\n\n**Other Common Fields:**\n- `strategy` (string): Retrieval strategy. Values: \"semantic\", \"keyword\", \"hybrid\".\n- `similarityThreshold` (number): Minimum similarity score for semantic matches (0-1).\n- `totalMatches` (integer): Maximum number of documents to retrieve.\n- `similarityMatches` (integer): Number of semantic similarity matches (used with hybrid strategy).\n- `keywordMatches` (integer): Number of keyword matches (used with hybrid strategy).\n- `includeMetadata` (boolean): Whether to include document metadata in results.\n\n**Example:**\n```json\n{\n  \"strategy\": \"hybrid\",\n  \"similarityMatches\": 8,\n  \"keywordMatches\": 4,\n  \"similarityThreshold\": 0.6,\n  \"totalMatches\": 15,\n  \"includeMetadata\": true,\n  \"enforceDocumentFilters\": true,\n  \"filtersContextKey\": \"profile.allowedFilters\"\n}\n```\n\n**RBAC Behavior:**\n- When `enforceDocumentFilters` is false or not set, all documents are retrieved (no RBAC filtering).\n- When `enforceDocumentFilters` is true:\n  - Retrieves user filters from the path specified in `filtersContextKey` in the context object.\n  - Only returns chunks from documents where:\n    - `visibilityMode` is \"public\", OR\n    - `visibilityMode` is \"restricted\" AND at least one of the document's `accessFilters` matches the user's filters.\n  - If user has no filters or the context key doesn't exist, only \"public\" documents are returned.\n",
        "properties": {
          "enforceDocumentFilters": {
            "type": "boolean",
            "description": "Enable RBAC filtering based on user permissions",
            "default": false,
            "example": true
          },
          "filtersContextKey": {
            "type": "string",
            "description": "JSON path in context to extract user access filters (e.g., \"profile.allowedFilters\")",
            "example": "profile.allowedFilters"
          },
          "strategy": {
            "type": "string",
            "description": "Retrieval strategy",
            "enum": [
              "semantic",
              "keyword",
              "hybrid"
            ],
            "example": "hybrid"
          },
          "similarityThreshold": {
            "type": "number",
            "description": "Minimum similarity score for semantic matches (0-1)",
            "minimum": 0,
            "maximum": 1,
            "example": 0.6
          },
          "totalMatches": {
            "type": "integer",
            "description": "Maximum number of documents to retrieve",
            "minimum": 1,
            "example": 15
          },
          "similarityMatches": {
            "type": "integer",
            "description": "Number of semantic similarity matches (for hybrid strategy)",
            "minimum": 0,
            "example": 8
          },
          "keywordMatches": {
            "type": "integer",
            "description": "Number of keyword matches (for hybrid strategy)",
            "minimum": 0,
            "example": 4
          },
          "includeMetadata": {
            "type": "boolean",
            "description": "Whether to include document metadata in results",
            "default": true,
            "example": true
          }
        },
        "additionalProperties": true
      },
      "PG_POST_IngestionSourceDocument_Body": {
        "type": "object",
        "properties": {
          "maxDepth": {
            "type": "integer",
            "description": "The maximum depth of the ingestion source document.",
            "example": 10,
            "nullable": true
          },
          "startUrlTag": {
            "type": "string",
            "description": "The start URL tag for the ingestion source document.",
            "example": "start_url",
            "nullable": true
          },
          "tagMetadata": {
            "type": "object",
            "description": "Metadata for tags in the ingestion source document.",
            "nullable": true
          },
          "skipWordsScraper": {
            "type": "string",
            "description": "Skip words scraper for the ingestion source document.",
            "nullable": true
          },
          "includeMetadataSource": {
            "type": "boolean",
            "description": "Include custom tags for metadata in chunks (title and source).",
            "nullable": true
          },
          "shortenUrls": {
            "type": "boolean",
            "description": "To activate shorten of urls.",
            "nullable": true
          },
          "isDynamic": {
            "type": "boolean",
            "description": "To activate when there are problems with Javascript and cookies.",
            "nullable": true
          },
          "cookiesAcceptTag": {
            "type": "string",
            "description": "The cookies accept tag for the ingestion source document.",
            "nullable": true
          },
          "useStealth": {
            "type": "boolean",
            "description": "To activate when there are problems with Javascript and cookies.",
            "nullable": true
          },
          "relatedDocuments": {
            "type": "object",
            "description": "A JSON object of related documents, e.g., {\"youtube_videos\": [\"link1\", \"link2\"]}",
            "nullable": true
          }
        }
      },
      "PG_Document": {
        "type": "object",
        "discriminator": {
          "propertyName": "sourceType",
          "mapping": {
            "URL": "#/components/schemas/PG_Document_Url",
            "SITEMAP": "#/components/schemas/PG_Document_Sitemap"
          }
        },
        "oneOf": [
          {
            "$ref": "#/components/schemas/PG_Document_Url"
          },
          {
            "$ref": "#/components/schemas/PG_Document_Sitemap"
          }
        ]
      },
      "PG_Document_Url": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the document.",
            "example": "123e4567-e89b-12d3-a456-426655440000"
          },
          "name": {
            "type": "string",
            "description": "The name of the document.",
            "example": "My Document"
          },
          "applicationId": {
            "type": "integer",
            "format": "int64",
            "description": "The ID of the application associated with the document.",
            "example": 1
          },
          "sourceType": {
            "type": "string",
            "description": "The source type of the document.",
            "example": "URL",
            "enum": [
              "URL",
              "TXT",
              "MARKDOWN",
              "SALESFORCE",
              "PDF"
            ]
          },
          "source": {
            "type": "string",
            "description": "The source of the document.",
            "example": "https://example.com"
          },
          "refreshInterval": {
            "type": "string",
            "description": "The refresh interval of the document.",
            "example": "DAILY",
            "enum": [
              "DAILY",
              "WEEKLY",
              "MONTHLY",
              "NEVER"
            ]
          },
          "splitLength": {
            "type": "integer",
            "format": "int64",
            "description": "Target length for document chunks (used by internal processing).",
            "minimum": 200,
            "maximum": 4000
          },
          "splitOverlap": {
            "type": "integer",
            "format": "int64",
            "description": "Overlap size between document chunks (used by internal processing).",
            "minimum": 0,
            "maximum": 2000
          },
          "config": {
            "type": "object",
            "description": "Source-specific configuration options.",
            "properties": {
              "maxDepth": {
                "type": "integer",
                "description": "The maximum depth of the document.",
                "nullable": true
              },
              "tagMetadata": {
                "type": "object",
                "description": "Metadata for tags in the document.",
                "nullable": true
              },
              "includeMetadataSource": {
                "type": "boolean",
                "description": "Include custom tags for metadata in chunks (title and source).",
                "nullable": true
              },
              "shortenUrls": {
                "type": "boolean",
                "description": "To activate shorten of urls.",
                "nullable": true
              },
              "isDynamic": {
                "type": "boolean",
                "description": "To activate when there are problems with Javascript and cookies.",
                "nullable": true
              },
              "useStealth": {
                "type": "boolean",
                "description": "To use anti bot evasiones when it requires JS and cookies. It requires isDynamic = true",
                "nullable": true
              }
            },
            "additionalProperties": true
          },
          "documentMetadata": {
            "$ref": "#/components/schemas/PG_DocumentMetadata"
          },
          "timeToUpdate": {
            "type": "string",
            "description": "The date and time the document was last updated.",
            "example": "15:00:00"
          },
          "checksum": {
            "type": "string",
            "description": "The checksum of the document.",
            "example": 123456789
          },
          "lastErrorAt": {
            "type": "string",
            "description": "The date and time the document was last updated.",
            "example": "2025-06-04T07:21:32.443Z",
            "nullable": true
          },
          "lastUpdatedAt": {
            "type": "string",
            "description": "The date and time the document was last updated.",
            "example": "2025-06-04T07:21:32.443Z",
            "nullable": true
          },
          "createdAt": {
            "type": "string",
            "description": "The date and time the document was created.",
            "example": "2025-06-04T07:21:32.443Z"
          },
          "updatedAt": {
            "type": "string",
            "description": "The date and time the document was last updated.",
            "example": "2025-06-04T07:21:32.443Z"
          },
          "entityType": {
            "type": "string",
            "description": "The entity type of the document.",
            "example": "document"
          },
          "familyId": {
            "type": "string",
            "description": "The family ID of the document.",
            "nullable": true,
            "example": "123e4567-e89b-12d3-a456-426655440000"
          },
          "status": {
            "type": "string",
            "description": "The status of the document.",
            "example": "READY"
          },
          "lastErrorType": {
            "type": "string",
            "description": "The type of the last error.",
            "example": "GENERAL",
            "nullable": true
          }
        }
      },
      "PG_Document_Sitemap": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "The ID of the ingestion source."
          },
          "name": {
            "type": "string",
            "description": "The name of the ingestion source."
          },
          "applicationId": {
            "type": "integer",
            "description": "The ID of the application associated with the ingestion source."
          },
          "entityType": {
            "type": "string",
            "description": "The entity type of the ingestion source.",
            "example": "ingestion_source"
          },
          "config": {
            "type": "object",
            "description": "Source-specific configuration options.",
            "properties": {
              "maxDepth": {
                "type": "integer",
                "description": "The maximum depth of the document.",
                "nullable": true
              },
              "startUrlTag": {
                "type": "string",
                "description": "The start URL tag for the document.",
                "nullable": true
              },
              "tagMetadata": {
                "type": "object",
                "description": "Metadata for tags in the document.",
                "nullable": true
              },
              "includeMetadataSource": {
                "type": "boolean",
                "description": "Include custom tags for metadata in chunks (title and source).",
                "nullable": true
              },
              "shortenUrls": {
                "type": "boolean",
                "description": "To activate shorten of urls.",
                "nullable": true
              },
              "isDynamic": {
                "type": "boolean",
                "description": "To activate when there are problems with Javascript and cookies.",
                "nullable": true
              },
              "cookiesAcceptTag": {
                "type": "string",
                "description": "When isDynamic = true, accept cookies clicking this HTML class button.",
                "nullable": true
              },
              "useStealth": {
                "type": "boolean",
                "description": "To use anti bot evasiones when it requires JS and cookies. It requires isDynamic = true",
                "nullable": true
              },
              "maxRetries": {
                "type": "integer",
                "description": "The max number of retries when dynamic web scraping.",
                "nullable": true
              },
              "relatedDocuments": {
                "type": "object",
                "description": "A JSON object of related documents, e.g., {\"youtube_videos\": [\"link1\", \"link2\"]}",
                "nullable": true
              }
            },
            "additionalProperties": true
          },
          "sourceType": {
            "type": "string",
            "description": "The type of the ingestion source."
          },
          "entrypoint": {
            "type": "string",
            "description": "The entrypoint of the ingestion source."
          },
          "refreshInterval": {
            "type": "string",
            "description": "How frequently to refresh children derived from this source."
          },
          "splitLength": {
            "type": "integer",
            "description": "The split length of the ingestion source."
          },
          "splitOverlap": {
            "type": "integer",
            "description": "The split overlap of the ingestion source."
          },
          "documentConfig": {
            "$ref": "#/components/schemas/PG_POST_IngestionSourceDocument_Body"
          },
          "documentMetadata": {
            "$ref": "#/components/schemas/PG_DocumentMetadata"
          },
          "includePatterns": {
            "type": "array",
            "description": "Include patterns for the ingestion source.",
            "items": {
              "type": "string"
            }
          },
          "excludePatterns": {
            "type": "array",
            "description": "Exclude patterns for the ingestion source.",
            "items": {
              "type": "string"
            }
          },
          "ingestionSettings": {
            "type": "object",
            "description": "Ingestion settings for the ingestion source."
          },
          "inheritChildSettings": {
            "type": "boolean",
            "description": "Whether to inherit child settings from the ingestion source."
          },
          "createdAt": {
            "type": "string",
            "description": "The creation date of the ingestion source.",
            "example": "2021-01-01T00:00:00.000Z"
          },
          "updatedAt": {
            "type": "string",
            "description": "The last update date of the ingestion source.",
            "example": "2021-01-01T00:00:00.000Z"
          },
          "lastIngestSummary": {
            "type": "object",
            "properties": {
              "finishedAt": {
                "type": "string",
                "description": "The date and time the document was last updated.",
                "example": "2025-06-04T07:21:32.443Z"
              },
              "forceRefresh": {
                "type": "boolean",
                "description": "The force refresh of the document.",
                "example": true
              },
              "counts": {
                "type": "object",
                "properties": {
                  "requested": {
                    "type": "integer",
                    "description": "The number of documents requested.",
                    "example": 10
                  },
                  "created": {
                    "type": "integer",
                    "description": "The number of documents created.",
                    "example": 5
                  },
                  "updated": {
                    "type": "integer",
                    "description": "The number of documents updated.",
                    "example": 5
                  },
                  "deleted": {
                    "type": "integer",
                    "description": "The number of documents deleted.",
                    "example": 5
                  },
                  "conflicts": {
                    "type": "integer",
                    "description": "The number of conflicts.",
                    "example": 5
                  },
                  "dispatched": {
                    "type": "integer",
                    "description": "The number of documents dispatched.",
                    "example": 5
                  }
                }
              },
              "conflicts": {
                "type": "array",
                "description": "The conflicts of the document.",
                "items": {
                  "type": "object",
                  "properties": {
                    "source": {
                      "type": "string",
                      "description": "The source of the conflict.",
                      "example": "https://example.com"
                    },
                    "documentId": {
                      "type": "string",
                      "description": "The ID of the document.",
                      "example": "123e4567-e89b-12d3-a456-426655440000"
                    },
                    "name": {
                      "type": "string",
                      "description": "The name of the document.",
                      "example": "My Document"
                    },
                    "currentParentId": {
                      "type": "string",
                      "description": "The current parent ID of the document.",
                      "example": "123e4567-e89b-12d3-a456-426655440000"
                    },
                    "reason": {
                      "type": "string",
                      "description": "The reason for the conflict.",
                      "example": "Duplicate"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "PG_DocumentMetadata": {
        "type": "object",
        "description": "Document metadata including RBAC (Role-Based Access Control) configuration.\n\n**RBAC Fields:**\n- `visibilityMode` (string): Controls document visibility. Values: \"public\" (default) or \"restricted\".\n- `accessFilters` (array of strings): Access control tags/labels for filtering. Required when visibilityMode is \"restricted\".\n\n**Default behavior:** If not provided, defaults to `{\"visibilityMode\":\"public\",\"accessFilters\":[]}`.\n\n**Validation:** Documents with `visibilityMode: \"restricted\"` MUST include at least one value in `accessFilters`, otherwise the API will reject the request with a 422 error.\n\n**Additional fields:** You can include other custom metadata fields (e.g., `source`, `relatedDocuments`, etc.) as needed.\n\n**Example:**\n```json\n{\n  \"visibilityMode\": \"restricted\",\n  \"accessFilters\": [\"tier1\", \"compliance\", \"rrhh\"],\n  \"source\": \"intranet\",\n  \"category\": \"policies\"\n}\n```\n",
        "properties": {
          "visibilityMode": {
            "type": "string",
            "description": "Controls document visibility",
            "enum": [
              "public",
              "restricted"
            ],
            "default": "public",
            "example": "restricted"
          },
          "accessFilters": {
            "type": "array",
            "description": "Access control tags/labels for filtering (required when visibilityMode is \"restricted\")",
            "items": {
              "type": "string"
            },
            "example": [
              "tier1",
              "compliance"
            ]
          }
        },
        "additionalProperties": true
      }
    },
    "responses": {
      "BadRequest": {
        "description": "The request could not be understood or was missing required parameters.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "statusCode": {
                  "type": "integer",
                  "description": "The HTTP status code indicating a bad request.",
                  "example": 400
                },
                "message": {
                  "type": "string",
                  "description": "A brief message describing the reason for the bad request.",
                  "example": "Bad Request"
                },
                "errorCode": {
                  "type": "string",
                  "description": "A specific error code for the bad request."
                }
              },
              "required": [
                "statusCode",
                "message",
                "errorCode"
              ],
              "additionalProperties": false
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Authentication failed or user does not have permissions for the desired action.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "statusCode": {
                  "type": "integer",
                  "description": "The HTTP status code indicating an unauthorized request.",
                  "example": 401
                },
                "message": {
                  "type": "string",
                  "description": "A brief message indicating that authentication is required and has failed or has not yet been provided.",
                  "example": "Unauthorized"
                },
                "errorCode": {
                  "type": "string",
                  "description": "A specific error code for the unauthorized request."
                }
              },
              "required": [
                "statusCode",
                "message",
                "errorCode"
              ],
              "additionalProperties": false
            }
          }
        }
      },
      "Forbidden": {
        "description": "The server understood the request, but refuses to authorize it.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "statusCode": {
                  "type": "integer",
                  "description": "The HTTP status code indicating that the server understood the request but refuses to authorize it.",
                  "example": 403
                },
                "message": {
                  "type": "string",
                  "description": "A brief message indicating that the server refuses to authorize the request.",
                  "example": "Forbidden"
                },
                "errorCode": {
                  "type": "string",
                  "description": "A specific error code for the forbidden request."
                }
              },
              "required": [
                "statusCode",
                "message",
                "errorCode"
              ],
              "additionalProperties": false
            }
          }
        }
      },
      "NotFound": {
        "description": "The requested resource could not be found.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "statusCode": {
                  "type": "integer",
                  "description": "The HTTP status code indicating that the requested resource could not be found.",
                  "example": 404
                },
                "message": {
                  "type": "string",
                  "description": "A brief message indicating that the requested resource could not be found.",
                  "example": "Not found"
                },
                "errorCode": {
                  "type": "string",
                  "description": "A specific error code for the not found request."
                }
              },
              "required": [
                "statusCode",
                "message",
                "errorCode"
              ],
              "additionalProperties": false
            }
          }
        }
      },
      "Error": {
        "description": "The server encountered an unexpected condition that prevented it from fulfilling the request.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "statusCode": {
                  "type": "integer",
                  "description": "The HTTP status code indicating an internal server error.",
                  "example": 500
                },
                "message": {
                  "type": "string",
                  "description": "A brief message indicating that the server encountered an unexpected condition that prevented it from fulfilling the request.",
                  "example": "Internal Server Error"
                }
              },
              "required": [
                "statusCode",
                "message"
              ],
              "additionalProperties": false
            }
          }
        }
      },
      "Default": {
        "description": "An unexpected error occurred.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "statusCode": {
                  "type": "integer",
                  "description": "The HTTP status code indicating an error.",
                  "example": 500
                },
                "message": {
                  "type": "string",
                  "description": "A brief message describing the error.",
                  "example": "An unexpected error occurred."
                }
              },
              "required": [
                "statusCode",
                "message"
              ],
              "additionalProperties": false
            }
          }
        }
      },
      "UnprocessableEntity": {
        "description": "The server understands the content type of the request entity, and the syntax of the request entity is correct, but it was unable to process the contained instructions.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "statusCode": {
                  "type": "integer",
                  "description": "The HTTP status code indicating an unprocessable entity.",
                  "example": 422
                },
                "message": {
                  "type": "string",
                  "description": "A brief message indicating that the request was well-formed but was unable to be followed due to semantic errors.",
                  "example": "Unprocessable Entity"
                }
              },
              "required": [
                "statusCode",
                "message"
              ]
            }
          }
        }
      },
      "PG_GET_Flow_OK": {
        "description": "Flow details",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "statusCode": {
                  "type": "integer",
                  "description": "HTTP status code",
                  "example": 200
                },
                "message": {
                  "type": "string",
                  "description": "Response message",
                  "example": "OK"
                },
                "data": {
                  "$ref": "#/components/schemas/PG_Flow"
                }
              }
            }
          }
        }
      }
    },
    "requestBodies": {
      "PG_PUT_Agent_Body": {
        "required": true,
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "salesforceAccountConfig": {
                  "type": "object",
                  "description": "The configuration for the Salesforce account as a object.",
                  "nullable": true
                },
                "alertEmails": {
                  "type": "array",
                  "description": "A list of email addresses to notify when an alert is triggered.",
                  "items": {
                    "type": "string",
                    "description": "The email addresses to send alerts to.",
                    "example": "0xHvT@example.com"
                  }
                },
                "sttEnabled": {
                  "type": "boolean",
                  "description": "Flag to enable or disable Speech-to-Text (STT) services.",
                  "example": true
                },
                "documentEnabled": {
                  "type": "boolean",
                  "description": "Flag to enable or disable Document services.",
                  "example": true
                },
                "costSettings": {
                  "type": "object",
                  "description": "Initial cost settings for the application.",
                  "properties": {
                    "costLimit": {
                      "type": "number",
                      "description": "Only **superadmin** users can set this. Initial monthly cost limit (USD).",
                      "example": 100
                    }
                  }
                },
                "flowId": {
                  "type": "integer",
                  "format": "int64",
                  "description": "Unique identifier for the flow.",
                  "example": 1
                },
                "name": {
                  "type": "string",
                  "description": "The name of the flow.",
                  "example": "My Flow",
                  "maxLength": 50
                },
                "description": {
                  "type": "string",
                  "description": "The description of the flow.",
                  "example": "This is my flow",
                  "maxLength": 10000
                },
                "recursionLimit": {
                  "type": "integer",
                  "format": "int64",
                  "description": "The maximum number of times a flow can be executed.",
                  "example": 15
                },
                "welcomeResponse": {
                  "nullable": true,
                  "$ref": "#/components/schemas/PG_Flow_Multilanguage"
                },
                "semaphoreResponse": {
                  "$ref": "#/components/schemas/PG_Flow_Multilanguage"
                },
                "guardrailsResponse": {
                  "$ref": "#/components/schemas/PG_Flow_Multilanguage"
                },
                "bannedResponse": {
                  "$ref": "#/components/schemas/PG_Flow_Multilanguage"
                },
                "costErrorResponse": {
                  "$ref": "#/components/schemas/PG_Flow_Multilanguage"
                },
                "appErrorResponse": {
                  "$ref": "#/components/schemas/PG_Flow_Multilanguage"
                },
                "unsupportedMediaResponse": {
                  "$ref": "#/components/schemas/PG_Flow_Multilanguage"
                },
                "state": {
                  "type": "object",
                  "description": "The state of the flow."
                },
                "enabled": {
                  "type": "boolean",
                  "description": "Flag indicating whether the flow is enabled.",
                  "example": true
                },
                "isDev": {
                  "type": "boolean",
                  "description": "Flag indicating whether the flow is a development flow.",
                  "example": true
                },
                "isInternal": {
                  "type": "boolean",
                  "description": "Flag indicating whether the flow is an internal flow.",
                  "example": false
                },
                "forceErrorResponse": {
                  "type": "boolean",
                  "description": "Flag indicating whether to force an error response.",
                  "example": false
                },
                "actionTrigger": {
                  "type": "array",
                  "nullable": true,
                  "items": {
                    "type": "object",
                    "properties": {
                      "action": {
                        "type": "string",
                        "description": "The action to be executed. send_to_parent will escalate the conversation back to the parent bot."
                      },
                      "keyword": {
                        "type": "string",
                        "description": "The case-insensitive keyword that triggers the action. The user's message must be an exact match."
                      }
                    }
                  }
                },
                "config": {
                  "$ref": "#/components/schemas/PG_Flow_Config"
                },
                "nodes": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "discriminator": {
                      "propertyName": "nodeTypeCode",
                      "mapping": {
                        "FRONTRAILS": "#/components/schemas/PG_PUT_Frontrails_Node_With_Id",
                        "AGENT": "#/components/schemas/PG_PUT_Agent_Node_With_Id",
                        "SUPERVISOR": "#/components/schemas/PG_PUT_Supervisor_Node_With_Id",
                        "BACKRAILS": "#/components/schemas/PG_PUT_Backrails_Node_With_Id"
                      }
                    },
                    "oneOf": [
                      {
                        "$ref": "#/components/schemas/PG_PUT_Frontrails_Node_With_Id"
                      },
                      {
                        "$ref": "#/components/schemas/PG_PUT_Agent_Node_With_Id"
                      },
                      {
                        "$ref": "#/components/schemas/PG_PUT_Supervisor_Node_With_Id"
                      },
                      {
                        "$ref": "#/components/schemas/PG_PUT_Backrails_Node_With_Id"
                      }
                    ]
                  }
                }
              },
              "required": [
                "flowId"
              ]
            }
          }
        }
      }
    }
  }
}
````