{
  "openapi": "3.1.0",
  "info": {
    "title": "Jamille Ovadia Moraes — API de Psicologia Clínica",
    "version": "1.0.0",
    "description": "API pública e interface de function calling para agentes de inteligência artificial consultarem informações clínicas, serviços, especialidades, dúvidas frequentes e obterem links de agendamento da psicóloga Jamille Ovadia Moraes (CRP-04/75728).",
    "contact": {
      "name": "Jamille Ovadia Moraes",
      "email": "psijamilleom@gmail.com",
      "url": "https://www.psijamilleom.com.br"
    }
  },
  "servers": [
    {
      "url": "https://www.psijamilleom.com.br",
      "description": "Servidor de Produção Oficial"
    }
  ],
  "paths": {
    "/api/v1/profile": {
      "get": {
        "operationId": "getPsychologistProfile",
        "summary": "Obter perfil profissional, credenciais e endereço de Jamille Ovadia Moraes",
        "description": "Retorna informações detalhadas sobre a psicóloga Jamille Ovadia Moraes, incluindo registro CRP-04/75728, especializações clínicas, abordagens terapêuticas (Terapia Sistêmica, Terapia do Esquema), endereço físico no Edifício Acaiaca em Belo Horizonte, horários de atendimento e canais de contato.",
        "parameters": [
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "Nível de detalhamento do perfil retornado.",
            "schema": {
              "type": "string",
              "enum": ["full", "compact"],
              "default": "full"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Perfil profissional retornado com sucesso.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PsychologistProfile"
                }
              }
            }
          },
          "default": {
            "description": "Resposta de erro estruturada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/services": {
      "get": {
        "operationId": "getTherapyServices",
        "summary": "Consultar serviços e modalidades de psicoterapia disponíveis",
        "description": "Retorna a lista de modalidades de atendimento disponíveis (Psicoterapia Individual, Terapia de Casal, Vínculos Não Monogâmicos), duração das sessões (50 minutos), formato (Presencial em BH ou Online) e política de honorários particulares com recibo para reembolso em plano de saúde.",
        "parameters": [
          {
            "name": "modality",
            "in": "query",
            "required": false,
            "description": "Filtrar por modalidade específica de atendimento.",
            "schema": {
              "type": "string",
              "enum": ["all", "individual", "casal", "vinculos_nao_monogamicos"],
              "default": "all"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de modalidades de atendimento retornada com sucesso.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServicesList"
                }
              }
            }
          },
          "default": {
            "description": "Resposta de erro estruturada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/faq": {
      "get": {
        "operationId": "getFrequentlyAskedQuestions",
        "summary": "Consultar dúvidas frequentes sobre o processo terapêutico",
        "description": "Retorna esclarecimentos sobre funcionamento da primeira sessão de acolhimento, frequência semanal, duração das sessões (50 min), política de convênios/reembolso e sigilo terapêutico.",
        "parameters": [
          {
            "name": "topic",
            "in": "query",
            "required": false,
            "description": "Filtrar dúvidas por tema específico.",
            "schema": {
              "type": "string",
              "enum": ["all", "primeira_sessao", "valores", "convenio", "duracao"],
              "default": "all"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Lista de dúvidas frequentes retornada com sucesso.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FaqResponse"
                }
              }
            }
          },
          "default": {
            "description": "Resposta de erro estruturada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/inquire": {
      "post": {
        "operationId": "submitAppointmentInquiry",
        "summary": "Submeter interesse inicial de agendamento ou consulta",
        "description": "Permite que um agente de inteligência artificial ou usuário formule um pedido inicial de agendamento psicoterapêutico, retornando confirmação e o link direto formatado para WhatsApp com a psicóloga Jamille.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AppointmentInquiryRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Confirmação gerada com link direto de WhatsApp retornado.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentInquiryResponse"
                }
              }
            }
          },
          "default": {
            "description": "Resposta de erro estruturada.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      },
      "get": {
        "operationId": "getAppointmentInstructions",
        "summary": "Obter instruções e links diretos para agendamento",
        "description": "Retorna o link formatado para WhatsApp e instruções para agendamento direto de sessão.",
        "parameters": [
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "description": "Canal de agendamento de preferência.",
            "schema": {
              "type": "string",
              "enum": ["whatsapp", "email", "all"],
              "default": "whatsapp"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Instruções de agendamento retornadas.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppointmentInquiryResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "PsychologistProfile": {
        "type": "object",
        "required": ["name", "title", "crp", "council", "contact", "location"],
        "properties": {
          "name": {
            "type": "string",
            "example": "Jamille Ovadia Moraes"
          },
          "title": {
            "type": "string",
            "example": "Psicóloga Clínica"
          },
          "crp": {
            "type": "string",
            "example": "CRP-04/75728"
          },
          "council": {
            "type": "string",
            "example": "Conselho Regional de Psicologia de Minas Gerais (4ª Região)"
          },
          "yearsOfExperience": {
            "type": "integer",
            "example": 14
          },
          "bio": {
            "type": "string",
            "example": "Psicóloga clínica com 14 anos de experiência em Belo Horizonte e atendimento online. Atuação baseada na ética, escuta humanizada e acolhimento afirmativo LGBTQIAPN+."
          },
          "credentials": {
            "type": "array",
            "items": {
              "type": "object",
              "required": ["type", "name"],
              "properties": {
                "type": { "type": "string" },
                "name": { "type": "string" },
                "issuer": { "type": "string" },
                "verificationUrl": { "type": "string", "format": "uri" }
              }
            }
          },
          "approaches": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "contact": {
            "type": "object",
            "required": ["phone", "email", "whatsappUrl"],
            "properties": {
              "phone": { "type": "string" },
              "formattedPhone": { "type": "string" },
              "email": { "type": "string", "format": "email" },
              "whatsappUrl": { "type": "string", "format": "uri" },
              "website": { "type": "string", "format": "uri" },
              "linkedin": { "type": "string", "format": "uri" }
            }
          },
          "location": {
            "type": "object",
            "required": ["streetAddress", "city", "state", "country"],
            "properties": {
              "type": { "type": "string" },
              "building": { "type": "string" },
              "streetAddress": { "type": "string" },
              "neighborhood": { "type": "string" },
              "city": { "type": "string" },
              "state": { "type": "string" },
              "postalCode": { "type": "string" },
              "country": { "type": "string" },
              "coordinates": {
                "type": "object",
                "properties": {
                  "latitude": { "type": "number" },
                  "longitude": { "type": "number" }
                }
              }
            }
          },
          "operatingHours": {
            "type": "object",
            "properties": {
              "days": { "type": "string" },
              "time": { "type": "string" },
              "timezone": { "type": "string" }
            }
          }
        }
      },
      "ServicesList": {
        "type": "object",
        "required": ["services", "bookingInstruction"],
        "properties": {
          "services": {
            "type": "array",
            "items": {
              "type": "object",
              "required": ["id", "name", "description", "durationMinutes", "modalities", "paymentPolicy"],
              "properties": {
                "id": { "type": "string" },
                "name": { "type": "string" },
                "description": { "type": "string" },
                "durationMinutes": { "type": "integer" },
                "frequency": { "type": "string" },
                "modalities": {
                  "type": "array",
                  "items": { "type": "string" }
                },
                "paymentPolicy": { "type": "string" }
              }
            }
          },
          "bookingInstruction": { "type": "string" }
        }
      },
      "FaqResponse": {
        "type": "object",
        "required": ["faq"],
        "properties": {
          "faq": {
            "type": "array",
            "items": {
              "type": "object",
              "required": ["question", "answer"],
              "properties": {
                "question": { "type": "string" },
                "answer": { "type": "string" }
              }
            }
          }
        }
      },
      "AppointmentInquiryRequest": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Nome da pessoa interessada no atendimento."
          },
          "modality": {
            "type": "string",
            "enum": ["individual", "casal", "vinculos_nao_monogamicos"],
            "description": "Modalidade terapêutica de interesse."
          },
          "format": {
            "type": "string",
            "enum": ["presencial_bh", "online"],
            "description": "Preferência de atendimento presencial em Belo Horizonte ou online."
          },
          "message": {
            "type": "string",
            "description": "Breve mensagem opcional sobre a demanda ou preferência de horários."
          }
        }
      },
      "AppointmentInquiryResponse": {
        "type": "object",
        "required": ["status", "message", "whatsappUrl", "whatsappNumber", "email"],
        "properties": {
          "status": { "type": "string", "example": "success" },
          "message": { "type": "string" },
          "whatsappUrl": { "type": "string", "format": "uri" },
          "whatsappNumber": { "type": "string" },
          "email": { "type": "string", "format": "email" },
          "actionHint": { "type": "string" }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "required": ["error"],
        "properties": {
          "error": {
            "type": "object",
            "required": ["code", "message", "resolution"],
            "properties": {
              "code": {
                "type": "string",
                "example": "RESOURCE_NOT_FOUND"
              },
              "message": {
                "type": "string",
                "example": "O endpoint solicitado não foi encontrado nesta API."
              },
              "resolution": {
                "type": "string",
                "example": "Consulte a documentação completa da API em https://www.psijamilleom.com.br/docs ou a especificação OpenAPI em https://www.psijamilleom.com.br/openapi.json."
              }
            }
          }
        }
      }
    }
  }
}
