{
  "openapi": "3.0.1",
  "info": {
    "title": "SuperAgentes.ai | API OpenAPI specifications",
    "description": "",
    "termsOfService": "https://superagentes.ai/",
    "contact": {
      "email": "support@superagentes.ai" 
    },
    "license": {
      "name": "Apache 2.0",
      "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
    },
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://dash.superagentes.ai/api"
    }
  ],
  "tags": [
    {
      "name": "Agentes"
    },
    {
      "name": "Conteúdo"
    },
    {
      "name": "Fonte de Conteúdo"
    },
    {
      "name": "Logs"
    },
    {
      "name": "Conversas"
    },
    {
      "name": "Campanhas"
    }
  ],
  "paths": {
    "/agents/{id}/query": {
      "post": {
        "tags": [
          "Agentes"
        ],
        "summary": "Pergunte ao Agente",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "description": "ID do agente"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "Esta é a pergunta que você deseja fazer ao seu agente."
                  },
                  "conversationId": {
                    "type": "string",
                    "description": "ID da conversa (Se não for fornecido, uma nova conversa será criada)"
                  },
                  "visitorId": {
                    "type": "string",
                    "description": "ID do participante que está enviando a pergunta (Se não for fornecido, um novo ID será criado)"
                  },
                  "temperature": {
                    "type": "number",
                    "description": "Temperatura do modelo (mínimo 0.0, máximo 1.0)"
                  },
                  "streaming": {
                    "type": "boolean",
                    "description": "Habilitar streaming"
                  },
                  "modelName": {
                    "description": "Substituir o modelo do agente",
                    "enum": [
                      "groq",
                      "gpt_4o",
                      "gpt_4o_mini",
                      "claude_3_5_sonnet",
                      "..."
                    ]
                  },
                  "maxTokens": {
                    "type": "number",
                    "description": "O número máximo de tokens a serem gerados na conclusão do chat."
                  },
                  "presencePenalty": {
                    "type": "number",
                    "description": "Número entre -2.0 e 2.0. Valores positivos penalizam novos tokens com base em sua presença no texto até o momento, aumentando a probabilidade do modelo falar sobre novos tópicos."
                  },
                  "frequencyPenalty": {
                    "type": "number",
                    "description": "Número entre -2.0 e 2.0. Valores positivos penalizam novos tokens com base em sua frequência existente no texto até o momento, diminuindo a probabilidade do modelo repetir a mesma linha literalmente."
                  },
                  "topP": {
                    "type": "number",
                    "description": "Uma alternativa à amostragem com temperatura, chamada amostragem de núcleo, onde o modelo considera os resultados dos tokens com massa de probabilidade top_p. Então 0.1 significa que apenas os tokens que compõem os 10% superiores da massa de probabilidade são considerados. Geralmente recomendamos alterar isso ou a temperatura, mas não ambos."
                  },
                  "filters": {
                    "type": "object",
                    "properties": {
                      "custom_ids": {
                        "type": "array",
                        "description": "Filtrar por IDs personalizados",
                        "items": {
                          "type": "string"
                        }
                      },
                      "datasource_ids": {
                        "type": "array",
                        "description": "Filtrar por IDs de Fonte de Conteúdo",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "systemPrompt": {
                    "description": "Prompt do sistema do agente",
                    "type": "string"
                  },
                  "userPrompt": {
                    "description": "Prompt do usuário do agente",
                    "type": "string"
                  }
                },
                "required": [
                  "query"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "answer": {
                      "type": "string",
                      "description": "A resposta do agente."
                    },
                    "conversationId": {
                      "type": "string",
                      "description": "ID da conversa"
                    },
                    "visitorId": {
                      "type": "string",
                      "description": "ID do participante que está enviando a pergunta"
                    },
                    "sources": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "description": "Fragmentos de Fonte de Conteúdo que foram usados para gerar a resposta"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Body inválido"
          },
          "403": {
            "description": "Não autorizado"
          }
        }
      }
    },
    "/agents": {
      "post": {
        "tags": [
          "Agentes"
        ],
        "summary": "Criar Agente",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "modelName": {
                    "enum": [
                      "groq",
                      "gpt_4o",
                      "gpt_4o_mini",
                      "claude_3_5_sonnet"
                    ]
                  },
                  "temperature": {
                    "type": "number",
                    "description": "Temperatura do modelo (mínimo 0.0, máximo 1.0)"
                  },
                  "systemPrompt": {
                    "description": "Prompt do sistema do agente",
                    "type": "string"
                  },
                  "userPrompt": {
                    "description": "Prompt do usuário do agente",
                    "type": "string"
                  },
                  "visibility": {
                    "enum": [
                      "public",
                      "private"
                    ]
                  }
                },
                "required": [
                  "description"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "modelName": {
                      "enum": [
                        "groq",
                        "gpt_4o",
                        "gpt_4o_mini",
                        "claude_3_5_sonnet"
                      ]
                    },
                    "temperature": {
                      "type": "number",
                      "description": "Temperatura do modelo (mínimo 0.0, máximo 1.0)"
                    },
                    "visibility": {
                      "enum": [
                        "public",
                        "private"
                      ]
                    },
                    "systemPrompt": {
                      "description": "Prompt do Sistema",
                      "type": "string"
                    },
                    "userPrompt": {
                      "description": "Prompt do Usuário",
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Body inválido"
          },
          "403": {
            "description": "Não autorizado"
          }
        }
      }
    },
    "/agents/{id}": {
      "get": {
        "tags": [
          "Agentes"
        ],
        "summary": "Obter Agente",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "description": "ID do Agente"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "modelName": {
                      "enum": [
                        "groq",
                        "gpt_4o",
                        "gpt_4o_mini",
                        "claude_3_5_sonnet"
                      ]
                    },
                    "temperature": {
                      "type": "number",
                      "description": "Temperatura do modelo (mínimo 0.0, máximo 1.0)"
                    },
                    "visibility": {
                      "enum": [
                        "public",
                        "private"
                      ]
                    },
                    "systemPrompt": {
                      "description": "Prompt do Sistema",
                      "type": "string"
                    },
                    "userPrompt": {
                      "description": "Prompt do Usuário",
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Não autorizado"
          }
        }
      },
      "patch": {
        "tags": [
          "Agentes"
        ],
        "summary": "Atualizar Agente",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "modelName": {
                    "enum": [
                      "groq",
                      "gpt_4o",
                      "gpt_4o_mini",
                      "claude_3_5_sonnet"
                    ]
                  },
                  "temperature": {
                    "type": "number",
                    "description": "Temperatura do modelo (mínimo 0.0, máximo 1.0)"
                  },
                  "systemPrompt": {
                    "description": "Prompt do sistema do agente",
                    "type": "string"
                  },
                  "userPrompt": {
                    "description": "Prompt do usuário do agente",
                    "type": "string"
                  },
                  "visibility": {
                    "enum": [
                      "public",
                      "private"
                    ]
                  }
                },
                "required": [
                  "description"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "modelName": {
                      "enum": [
                        "groq",
                        "gpt_4o",
                        "gpt_4o_mini",
                        "claude_3_5_sonnet"
                      ]
                    },
                    "temperature": {
                      "type": "number",
                      "description": "Temperatura do modelo (mínimo 0.0, máximo 1.0)"
                    },
                    "visibility": {
                      "enum": [
                        "public",
                        "private"
                      ]
                    },
                    "systemPrompt": {
                      "description": "Prompt do Sistema",
                      "type": "string"
                    },
                    "userPrompt": {
                      "description": "Prompt do Usuário",
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Body inválido"
          },
          "403": {
            "description": "Não autorizado"
          }
        }
      },
      "delete": {
        "tags": [
          "Agentes"
        ],
        "summary": "Deletar Agente",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "description": "ID do Agente"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "modelName": {
                      "enum": [
                        "groq",
                        "gpt_4o",
                        "gpt_4o_mini",
                        "claude_3_5_sonnet"
                      ]
                    },
                    "temperature": {
                      "type": "number",
                      "description": "Temperatura do modelo (mínimo 0.0, máximo 1.0)"
                    },
                    "visibility": {
                      "enum": [
                        "public",
                        "private"
                      ]
                    },
                    "systemPrompt": {
                      "description": "Prompt do Sistema",
                      "type": "string"
                    },
                    "userPrompt": {
                      "description": "Prompt do Usuário",
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Não autorizado"
          }
        }
      }
    },
    "/datastores": {
      "post": {
        "tags": [
          "Conteúdo"
        ],
        "summary": "Criar Conteúdo",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "type": {
                    "enum": [
                      "qdrant"
                    ]
                  }
                },
                "required": [
                  "description",
                  "type"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "type": {
                      "enum": [
                        "qdrant"
                      ]
                    },
                    "visibility": {
                      "enum": [
                        "public",
                        "private"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Body inválido"
          },
          "403": {
            "description": "Não autorizado"
          }
        }
      }
    },
    "/datastores/{id}": {
      "get": {
        "tags": [
          "Conteúdo"
        ],
        "summary": "Obter Conteúdo",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "description": "ID do Conteúdo"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "type": {
                      "enum": [
                        "qdrant"
                      ]
                    },
                    "visibility": {
                      "enum": [
                        "public",
                        "private"
                      ]
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Não autorizado"
          }
        }
      },
      "patch": {
        "tags": [
          "Conteúdo"
        ],
        "summary": "Atualizar Conteúdo",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "description": {
                    "type": "string"
                  },
                  "type": {
                    "enum": [
                      "qdrant"
                    ]
                  }
                },
                "required": [
                  "description",
                  "type"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "type": {
                      "enum": [
                        "qdrant"
                      ]
                    },
                    "visibility": {
                      "enum": [
                        "public",
                        "private"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Body inválido"
          },
          "403": {
            "description": "Não autorizado"
          }
        }
      },
      "delete": {
        "tags": [
          "Conteúdo"
        ],
        "summary": "Deletar Conteúdo",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "description": "ID do Conteúdo"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "description": {
                      "type": "string"
                    },
                    "type": {
                      "enum": [
                        "qdrant"
                      ]
                    },
                    "visibility": {
                      "enum": [
                        "public",
                        "private"
                      ]
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Não autorizado"
          }
        }
      }
    },
    "/datastores/{id}/query": {
      "post": {
        "tags": [
          "Conteúdo"
        ],
        "summary": "Perguntar ao seu Conteúdo",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "description": "ID do Conteúdo"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "query": {
                    "type": "string",
                    "description": "Pergunta para fazer ao seu agente."
                  },
                  "topK": {
                    "type": "number",
                    "description": "O número máximo de resultados a serem recuperados."
                  },
                  "filters": {
                    "type": "object",
                    "properties": {
                      "custom_ids": {
                        "type": "array",
                        "description": "Filtrar por IDs personalizados",
                        "items": {
                          "type": "string"
                        }
                      },
                      "datasource_ids": {
                        "type": "array",
                        "description": "Filtrar por IDs de Fonte de Conteúdo",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                },
                "required": [
                  "query"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "text": {
                        "type": "string",
                        "description": "Texto do fragmento do documento."
                      },
                      "score": {
                        "type": "number",
                        "description": "Pontuação de similaridade do fragmento do documento."
                      },
                      "source": {
                        "type": "string",
                        "description": "URL de origem do fragmento do documento."
                      },
                      "datasource_id": {
                        "type": "string",
                        "description": "ID da Fonte de Conteúdo à qual o fragmento do documento pertence."
                      },
                      "datasource_name": {
                        "type": "string",
                        "description": "Nome da Fonte de Conteúdo à qual o fragmento do documento pertence."
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Body inválido"
          },
          "403": {
            "description": "Não autorizado"
          }
        }
      }
    },
    "/datasources": {
      "post": {
        "tags": [
          "Fonte de Conteúdo"
        ],
        "summary": "Criar Fonte de Conteúdo",
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "file": {
                    "type": "string",
                    "format": "binary"
                  },
                  "fileName": {
                    "type": "string"
                  },
                  "type": {
                    "enum": [
                      "file"
                    ]
                  },
                  "datastoreId": {
                    "type": "string"
                  },
                  "custom_id": {
                    "type": "string",
                    "description": "Útil para configurações multi-tenant"
                  }
                },
                "required": [
                  "type",
                  "datastoreId",
                  "file"
                ]
              }
            },
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "type": {
                    "enum": [
                      "web_page",
                      "web_site"
                    ]
                  },
                  "datastoreId": {
                    "type": "string"
                  },
                  "custom_id": {
                    "type": "string",
                    "description": "Útil para configurações multi-tenant"
                  },
                  "config": {
                    "type": "object",
                    "properties": {
                      "source_url": {
                        "type": "string",
                        "format": "url",
                        "description": "web_page, web_site"
                      },
                      "sitemap": {
                        "type": "string",
                        "format": "url",
                        "description": "web_site"
                      }
                    }
                  }
                },
                "required": [
                  "type",
                  "datastoreId",
                  "config"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "status": {
                      "enum": [
                        "unsynched",
                        "pending",
                        "running",
                        "synched",
                        "error",
                        "usage_limit_reached"
                      ]
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string",
                      "format": "date"
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date"
                    },
                    "lastSynch": {
                      "type": "string",
                      "format": "date"
                    },
                    "config": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Body inválido"
          },
          "403": {
            "description": "Não autorizado"
          }
        }
      }
    },
    "/datasources/{id}": {
      "get": {
        "tags": [
          "Fonte de Conteúdo"
        ],
        "summary": "Obter Fonte de Conteúdo",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "description": "ID da Fonte de Conteúdo"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "status": {
                      "enum": [
                        "unsynched",
                        "pending",
                        "running",
                        "synched",
                        "error",
                        "usage_limit_reached"
                      ]
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string",
                      "format": "date"
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date"
                    },
                    "lastSynch": {
                      "type": "string",
                      "format": "date"
                    },
                    "config": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Não autorizado"
          }
        }
      },
      "delete": {
        "tags": [
          "Fonte de Conteúdo"
        ],
        "summary": "Deletar Fonte de Conteúdo",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "description": "ID da Fonte de Conteúdo"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "type": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "status": {
                      "enum": [
                        "unsynched",
                        "pending",
                        "running",
                        "synched",
                        "error",
                        "usage_limit_reached"
                      ]
                    },
                    "groupId": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string",
                      "format": "date"
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date"
                    },
                    "lastSynch": {
                      "type": "string",
                      "format": "date"
                    },
                    "config": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "Não autorizado"
          }
        }
      }
    },
    "/logs": {
      "get": {
        "tags": [
          "Logs"
        ],
        "summary": "Listar Logs",
        "parameters": [
          {
            "in": "query",
            "name": "cursor",
            "schema": {
              "type": "string",
              "description": "ID do último log retornado na página anterior para paginação"
            },
            "required": false
          },
          {
            "in": "query",
            "name": "eval",
            "schema": {
              "type": "string",
              "description": "Filtrar por avaliação da mensagem",
              "enum": ["GOOD", "BAD"]
            },
            "required": false
          },
          {
            "in": "query",
            "name": "agentId",
            "schema": {
              "type": "string",
              "description": "Filtrar por ID do agente"
            },
            "required": false
          },
          {
            "in": "query",
            "name": "channel",
            "schema": {
              "type": "string",
              "description": "Filtrar por canal de comunicação",
              "enum": ["dashboard", "whatsapp", "website", "email"]
            },
            "required": false
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string",
              "description": "Filtrar por status da conversa",
              "enum": ["UNRESOLVED", "HUMAN_REQUESTED", "RESOLVED"]
            },
            "required": false
          },
          {
            "in": "query",
            "name": "priority",
            "schema": {
              "type": "string",
              "description": "Filtrar por prioridade da conversa",
              "enum": ["LOW", "MEDIUM", "HIGH"]
            },
            "required": false
          },
          {
            "in": "query",
            "name": "assigneeId",
            "schema": {
              "type": "string",
              "description": "Filtrar por ID do responsável atribuído"
            },
            "required": false
          },
          {
            "in": "query",
            "name": "unread",
            "schema": {
              "type": "boolean",
              "description": "Filtrar por mensagens não lidas"
            },
            "required": false
          },
          {
            "in": "query",
            "name": "search",
            "schema": {
              "type": "string",
              "description": "Pesquisar por texto no título, nome do contato ou conteúdo das mensagens"
            },
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Log"
                      }
                    },
                    "nextCursor": {
                      "type": "string",
                      "description": "Cursor para a próxima página de resultados"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Não autorizado"
          },
          "500": {
            "description": "Erro interno do servidor"
          }
        }
      }
    },
    "/logs/{id}": {
      "get": {
        "tags": [
          "Logs"
        ],
        "summary": "Obter Log por ID",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "description": "ID do log"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LogDetail"
                }
              }
            }
          },
          "404": {
            "description": "Log não encontrado"
          },
          "401": {
            "description": "Não autorizado"
          },
          "500": {
            "description": "Erro interno do servidor"
          }
        }
      },
      "patch": {
        "tags": [
          "Logs"
        ],
        "summary": "Atualizar Log",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "description": "ID do log"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": ["UNRESOLVED", "HUMAN_REQUESTED", "RESOLVED"],
                    "description": "Novo status do log"
                  },
                  "priority": {
                    "type": "string",
                    "enum": ["LOW", "MEDIUM", "HIGH"],
                    "description": "Nova prioridade do log"
                  },
                  "title": {
                    "type": "string",
                    "description": "Novo título do log"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": ["UNRESOLVED", "HUMAN_REQUESTED", "RESOLVED"]
                    },
                    "priority": {
                      "type": "string",
                      "enum": ["LOW", "MEDIUM", "HIGH"]
                    },
                    "title": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Log não encontrado"
          },
          "401": {
            "description": "Não autorizado"
          },
          "400": {
            "description": "Requisição inválida"
          },
          "500": {
            "description": "Erro interno do servidor"
          }
        }
      }
    },
    "/logs/count-unread": {
      "get": {
        "tags": [
          "Logs"
        ],
        "summary": "Contar Logs Não Lidos",
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer",
                      "description": "Número de logs não lidos"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Não autorizado"
          },
          "500": {
            "description": "Erro interno do servidor"
          }
        }
      }
    },
    "/logs/{id}/mark-as-read": {
      "post": {
        "tags": [
          "Logs"
        ],
        "summary": "Marcar Mensagens como Lidas",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string",
              "description": "ID do log"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer",
                      "description": "Número de mensagens marcadas como lidas"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Log não encontrado"
          },
          "401": {
            "description": "Não autorizado"
          },
          "500": {
            "description": "Erro interno do servidor"
          }
        }
      }
    },
    "/conversations": {
      "get": {
        "tags": [
          "Conversas"
        ],
        "summary": "Listar Conversas",
        "description": "Retorna uma lista paginada de conversas com base nos filtros fornecidos.",
        "parameters": [
          {
            "in": "query",
            "name": "agentId",
            "schema": {
              "type": "string"
            },
            "description": "ID do agente para filtrar conversas"
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string",
              "enum": ["UNRESOLVED", "HUMAN_REQUESTED", "RESOLVED"]
            },
            "description": "Status para filtrar conversas"
          },
          {
            "in": "query",
            "name": "channel",
            "schema": {
              "type": "string",
              "enum": ["dashboard", "whatsapp", "website", "email"]
            },
            "description": "Canal para filtrar conversas"
          },
          {
            "in": "query",
            "name": "page",
            "schema": {
              "type": "integer",
              "default": 1
            },
            "description": "Número da página para paginação"
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "default": 10
            },
            "description": "Número de itens por página"
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de conversas",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Conversation"
                  }
                }
              }
            }
          },
          "401": {
            "description": "Não autorizado"
          },
          "500": {
            "description": "Erro interno do servidor"
          }
        }
      }
    },
    "/conversations/{id}": {
      "get": {
        "tags": [
          "Conversas"
        ],
        "summary": "Obter Conversa por ID",
        "description": "Retorna detalhes completos de uma conversa específica pelo seu ID.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "ID da conversa"
          }
        ],
        "responses": {
          "200": {
            "description": "Detalhes da conversa",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Conversation"
                }
              }
            }
          },
          "404": {
            "description": "Conversa não encontrada"
          },
          "401": {
            "description": "Não autorizado"
          },
          "500": {
            "description": "Erro interno do servidor"
          }
        }
      },
      "patch": {
        "tags": [
          "Conversas"
        ],
        "summary": "Atualizar Conversa",
        "description": "Atualiza informações de uma conversa específica, incluindo desativação do agente.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "ID da conversa"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "title": {
                    "type": "string",
                    "description": "Novo título da conversa"
                  },
                  "priority": {
                    "type": "string",
                    "enum": ["LOW", "MEDIUM", "HIGH"],
                    "description": "Nova prioridade da conversa"
                  },
                  "assigneeIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "IDs dos membros da equipe para atribuir à conversa"
                  },
                  "status": {
                    "type": "string",
                    "enum": ["UNRESOLVED", "HUMAN_REQUESTED", "RESOLVED"],
                    "description": "Novo status da conversa"
                  },
                  "isAiEnabled": {
                    "type": "boolean",
                    "description": "Define se o agente está ativo na conversa (false para desativar)"
                  },
                  "metadata": {
                    "type": "object",
                    "properties": {
                      "isFormSubmitted": {
                        "type": "boolean",
                        "description": "Indica se um formulário foi submetido"
                      }
                    },
                    "description": "Metadados adicionais da conversa"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Conversa atualizada",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "title": {
                      "type": "string"
                    },
                    "priority": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string",
                      "enum": ["UNRESOLVED", "HUMAN_REQUESTED", "RESOLVED"]
                    },
                    "isAiEnabled": {
                      "type": "boolean"
                    },
                    "metadata": {
                      "type": "object"
                    },
                    "updatedAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "assignees": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "user": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    },
                    "agent": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "iconUrl": {
                          "type": "string"
                        }
                      }
                    },
                    "lead": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "email": {
                          "type": "string"
                        },
                        "phoneNumber": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Conversa não encontrada"
          },
          "401": {
            "description": "Não autorizado"
          },
          "500": {
            "description": "Erro interno do servidor"
          }
        }
      },
      "delete": {
        "tags": [
          "Conversas"
        ],
        "summary": "Excluir Conversa",
        "description": "Exclui permanentemente uma conversa específica do sistema.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "ID da conversa"
          }
        ],
        "responses": {
          "200": {
            "description": "Conversa excluída",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "deleted": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Conversa não encontrada"
          },
          "401": {
            "description": "Não autorizado"
          },
          "500": {
            "description": "Erro interno do servidor"
          }
        }
      }
    },
    "/conversations/{conversationId}/message": {
      "post": {
        "tags": [
          "Conversas"
        ],
        "summary": "Enviar Mensagem para Conversa",
        "description": "Envia uma nova mensagem para uma conversa existente.",
        "parameters": [
          {
            "in": "path",
            "name": "conversationId",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "ID da conversa"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["message", "from", "channel"],
                "properties": {
                  "message": {
                    "type": "string",
                    "description": "Texto da mensagem"
                  },
                  "from": {
                    "type": "string",
                    "enum": ["agent", "human"],
                    "description": "Origem da mensagem"
                  },
                  "channel": {
                    "type": "string",
                    "enum": ["dashboard", "whatsapp", "website", "email"],
                    "description": "Canal da mensagem"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Mensagem enviada",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Message"
                }
              }
            }
          },
          "404": {
            "description": "Conversa não encontrada"
          },
          "401": {
            "description": "Não autorizado"
          },
          "500": {
            "description": "Erro interno do servidor"
          }
        }
      }
    },
    "/conversations/update-status": {
      "post": {
        "tags": [
          "Conversas"
        ],
        "summary": "Atualizar Status de Múltiplas Conversas",
        "description": "Atualiza o status de múltiplas conversas simultaneamente com base em filtros de canal ou agente.",
        "parameters": [
          {
            "in": "query",
            "name": "channel",
            "schema": {
              "type": "string",
              "enum": ["dashboard", "whatsapp", "website", "email", "telegram"]
            },
            "description": "Filtrar conversas por canal específico (opcional)"
          },
          {
            "in": "query", 
            "name": "agentId",
            "schema": {
              "type": "string"
            },
            "description": "Filtrar conversas por agente específico (opcional)"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": ["UNRESOLVED", "HUMAN_REQUESTED", "RESOLVED"],
                    "description": "Novo status para as conversas filtradas"
                  }
                },
                "required": ["status"]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Status atualizado",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer",
                      "description": "Número de conversas atualizadas"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Não autorizado"
          },
          "500": {
            "description": "Erro interno do servidor"
          }
        }
      }
    },
    "/conversations/eval-answer": {
      "post": {
        "tags": [
          "Conversas"
        ],
        "summary": "Avaliar Resposta",
        "description": "Avalia a qualidade de uma resposta em uma conversa, marcando-a como boa ou ruim.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["messageId", "eval"],
                "properties": {
                  "messageId": {
                    "type": "string",
                    "description": "ID da mensagem a ser avaliada"
                  },
                  "eval": {
                    "type": "string",
                    "enum": ["GOOD", "BAD"],
                    "description": "Avaliação da mensagem"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Resposta avaliada",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "eval": {
                      "type": "string",
                      "enum": ["GOOD", "BAD"]
                    },
                    "updatedAt": {
                      "type": "string",
                      "format": "date-time"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Mensagem não encontrada"
          },
          "401": {
            "description": "Não autorizado"
          },
          "500": {
            "description": "Erro interno do servidor"
          }
        }
      }
    },
    "/conversations/export": {
      "get": {
        "tags": [
          "Conversas"
        ],
        "summary": "Exportar Conversa",
        "description": "Exporta uma conversa em formato PDF ou CSV para análise ou arquivamento.",
        "parameters": [
          {
            "in": "query",
            "name": "conversationId",
            "schema": {
              "type": "string"
            },
            "required": true,
            "description": "ID da conversa a ser exportada"
          },
          {
            "in": "query",
            "name": "format",
            "schema": {
              "type": "string",
              "enum": ["pdf", "csv"],
              "default": "pdf"
            },
            "description": "Formato do arquivo exportado"
          }
        ],
        "responses": {
          "200": {
            "description": "Arquivo exportado",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "Conversa não encontrada"
          },
          "401": {
            "description": "Não autorizado"
          },
          "500": {
            "description": "Erro interno do servidor"
          }
        }
      }
    },
    "/campaigns/new": {
      "post": {
        "tags": [
          "Campanhas"
        ],
        "summary": "Criar e Disparar Campanha",
        "description": "Cria e dispara uma nova campanha de mensagens via WhatsApp",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["agentId", "message", "autoDispatch"],
                "properties": {
                  "agentId": {
                    "type": "string",
                    "description": "ID do agente que fará o disparo"
                  },
                  "name": {
                    "type": "string",
                    "description": "Nome da campanha. Se não informado, será usado um nome padrão"
                  },
                  "useAgentContacts": {
                    "type": "boolean",
                    "description": "Define se deve usar os contatos do agente. Padrão: false",
                    "default": false
                  },
                  "manualPhoneNumbers": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "Array de números de telefone para disparo manual"
                  },
                  "preferredProvider": {
                    "type": "string",
                    "enum": ["official", "evolution", "evolution-qr", "z-api"],
                    "description": "Provedor preferido para o disparo"
                  },
                  "message": {
                    "type": "string",
                    "description": "Conteúdo da mensagem a ser enviada"
                  },
                  "autoDispatch": {
                    "type": "boolean",
                    "description": "Define se a campanha será disparada automaticamente ou apenas criada"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sucesso",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Campaign"
                }
              }
            }
          },
          "400": {
            "description": "Erro de validação ou dados inválidos",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "details": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Não autorizado (token inválido ou ausente)"
          },
          "403": {
            "description": "Proibido (sem permissão)"
          },
          "404": {
            "description": "Agente não encontrado"
          },
          "500": {
            "description": "Erro interno do servidor"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Datasource": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "enum": [
              "unsynched",
              "pending",
              "running",
              "synched",
              "error",
              "usage_limit_reached"
            ]
          },
          "groupId": {
            "type": "string"
          },
          "updatedAt": {
            "type": "string",
            "format": "date"
          },
          "createdAt": {
            "type": "string",
            "format": "date"
          },
          "lastSynch": {
            "type": "string",
            "format": "date"
          },
          "config": {
            "type": "object"
          }
        }
      },
      "Agent": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "modelName": {
            "enum": [
              "groq",
              "gpt_4o",
              "gpt_4o_mini",
              "claude_3_5_sonnet"
            ]
          },
          "temperature": {
            "type": "number",
            "description": "Temperatura do modelo (mínimo 0.0, máximo 1.0)"
          },
          "visibility": {
            "enum": [
              "public",
              "private"
            ]
          },
          "systemPrompt": {
            "description": "Prompt do Sistema",
            "type": "string"
          },
          "userPrompt": {
            "description": "Prompt do Usuário",
            "type": "string"
          }
        }
      },
      "Datastore": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "type": {
            "enum": [
              "qdrant"
            ]
          },
          "visibility": {
            "enum": [
              "public",
              "private"
            ]
          }
        }
      },
      "DatasourceConfigWebPage": {
        "type": "object",
        "properties": {
          "source_url": {
            "type": "string",
            "format": "url"
          }
        }
      },
      "DatasourceConfigWebSite": {
        "type": "object",
        "properties": {
          "source_url": {
            "type": "string",
            "format": "url"
          },
          "sitemap": {
            "type": "string",
            "format": "url"
          }
        }
      },
      "Log": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": ["UNRESOLVED", "HUMAN_REQUESTED", "RESOLVED"]
          },
          "channel": {
            "type": "string",
            "enum": ["dashboard", "whatsapp", "website", "email"]
          },
          "priority": {
            "type": "string",
            "enum": ["LOW", "MEDIUM", "HIGH"]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "agent": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "iconUrl": {
                "type": "string"
              }
            }
          },
          "_count": {
            "type": "object",
            "properties": {
              "messages": {
                "type": "integer"
              }
            }
          }
        }
      },
      "LogDetail": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": ["UNRESOLVED", "HUMAN_REQUESTED", "RESOLVED"]
          },
          "channel": {
            "type": "string",
            "enum": ["dashboard", "whatsapp", "website", "email"]
          },
          "priority": {
            "type": "string",
            "enum": ["LOW", "MEDIUM", "HIGH"]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "agent": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "iconUrl": {
                "type": "string"
              }
            }
          },
          "messages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "text": {
                  "type": "string"
                },
                "from": {
                  "type": "string",
                  "enum": ["agent", "human"]
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time"
                },
                "read": {
                  "type": "boolean"
                },
                "eval": {
                  "type": "string",
                  "enum": ["GOOD", "BAD", null]
                }
              }
            }
          },
          "participants": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                }
              }
            }
          },
          "participantsUsers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              }
            }
          },
          "participantsVisitors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "contact": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "firstName": {
                      "type": "string"
                    },
                    "lastName": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "participantsContacts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "firstName": {
                  "type": "string"
                },
                "lastName": {
                  "type": "string"
                },
                "email": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "Conversation": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "ID único da conversa"
          },
          "title": {
            "type": "string",
            "description": "Título da conversa"
          },
          "status": {
            "type": "string",
            "enum": ["UNRESOLVED", "HUMAN_REQUESTED", "RESOLVED"],
            "description": "Status atual da conversa"
          },
          "channel": {
            "type": "string",
            "enum": ["dashboard", "whatsapp", "website", "email"],
            "description": "Canal de comunicação da conversa"
          },
          "priority": {
            "type": "string",
            "enum": ["LOW", "MEDIUM", "HIGH"],
            "description": "Prioridade da conversa"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "Data e hora de criação da conversa"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Data e hora da última atualização da conversa"
          },
          "agent": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "ID do agente"
              },
              "name": {
                "type": "string",
                "description": "Nome do agente"
              },
              "iconUrl": {
                "type": "string",
                "description": "URL do ícone do agente"
              }
            }
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Message"
            },
            "description": "Lista de mensagens da conversa"
          },
          "participants": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "ID do participante"
                },
                "type": {
                  "type": "string",
                  "description": "Tipo do participante"
                }
              }
            },
            "description": "Lista de participantes da conversa"
          },
          "participantsUsers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "ID do usuário"
                },
                "name": {
                  "type": "string",
                  "description": "Nome do usuário"
                }
              }
            },
            "description": "Lista de usuários participantes da conversa"
          },
          "participantsVisitors": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "ID do visitante"
                },
                "contact": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "description": "ID do contato"
                    },
                    "firstName": {
                      "type": "string",
                      "description": "Primeiro nome do contato"
                    },
                    "lastName": {
                      "type": "string",
                      "description": "Sobrenome do contato"
                    }
                  }
                }
              }
            },
            "description": "Lista de visitantes participantes da conversa"
          },
          "participantsContacts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "description": "ID do contato"
                },
                "firstName": {
                  "type": "string",
                  "description": "Primeiro nome do contato"
                },
                "lastName": {
                  "type": "string",
                  "description": "Sobrenome do contato"
                },
                "email": {
                  "type": "string",
                  "description": "Email do contato"
                }
              }
            },
            "description": "Lista de contatos participantes da conversa"
          }
        }
      },
      "Message": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "ID único da mensagem"
          },
          "text": {
            "type": "string",
            "description": "Texto da mensagem"
          },
          "from": {
            "type": "string",
            "enum": ["agent", "human"],
            "description": "Origem da mensagem"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "description": "Data e hora de criação da mensagem"
          },
          "read": {
            "type": "boolean",
            "description": "Indica se a mensagem foi lida"
          },
          "eval": {
            "type": "string",
            "enum": ["GOOD", "BAD", null],
            "description": "Avaliação da mensagem"
          },
          "attachments": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "Anexos da mensagem"
          }
        }
      },
      "Campaign": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "ID único da campanha"
          },
          "name": {
            "type": "string",
            "description": "Nome da campanha"
          },
          "status": {
            "type": "string",
            "enum": ["DRAFT", "IN_PROGRESS", "COMPLETED", "FAILED"],
            "description": "Status atual da campanha"
          },
          "message": {
            "type": "string",
            "description": "Conteúdo da mensagem"
          },
          "startedAt": {
            "type": "string",
            "format": "date-time",
            "description": "Data e hora de início da campanha"
          },
          "usedPhoneNumbers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Números de telefone utilizados na campanha"
          },
          "manualPhoneNumbers": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Números de telefone fornecidos manualmente"
          },
          "agentId": {
            "type": "string",
            "description": "ID do agente responsável pela campanha"
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ]
}