{
  "openapi": "3.1.0",
  "info": {
    "title": "Danielle Bento — API pública",
    "version": "1.0.0",
    "summary": "Mapa de Desenho Humano gratuito, catálogo de serviços de Constelação Familiar e terapias integrativas, e contato oficial.",
    "description": "API pública do site de Danielle Bento (Instituto Danielle Bento Terapias e Treinamentos). Use para calcular o mapa de Desenho Humano de uma pessoa, listar os serviços oferecidos (Constelação Familiar, Terapias Integrativas, cursos) e obter os canais oficiais de agendamento. Sem autenticação. Erros seguem RFC 9457 (application/problem+json). Documentação: https://danibentoconstelacao.com.br/docs/",
    "contact": {
      "name": "Instituto Danielle Bento Terapias e Treinamentos",
      "email": "ola@danibentoconstelacao.com.br",
      "url": "https://danibentoconstelacao.com.br/contato/"
    }
  },
  "externalDocs": {
    "description": "Documentação da API e guia para agentes de IA",
    "url": "https://danibentoconstelacao.com.br/docs/"
  },
  "servers": [
    {
      "url": "https://danibentoconstelacao.com.br",
      "description": "Produção"
    }
  ],
  "security": [],
  "tags": [
    {
      "name": "desenho-humano",
      "description": "Cálculo do mapa de Desenho Humano"
    },
    {
      "name": "catalogo",
      "description": "Serviços e contato do instituto"
    },
    {
      "name": "descoberta",
      "description": "Índice e metadados da API"
    }
  ],
  "paths": {
    "/desenho-humano/api/calculate/": {
      "post": {
        "operationId": "calculateHumanDesignChart",
        "tags": [
          "desenho-humano"
        ],
        "summary": "Calcular mapa de Desenho Humano",
        "description": "Calcula o mapa de Desenho Humano (Tipo, Estratégia, Autoridade, Perfil, Definição, Centros e Canais) a partir da data, hora e cidade de nascimento. O mapa fica salvo e recebe um link público exclusivo em /desenho-humano/r/{slug}/. Cada e-mail tem um único mapa: repetir o e-mail devolve o mapa existente com existing=true. Só envie dados com autorização da pessoa.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CalculateRequest"
              },
              "example": {
                "name": "Maria Silva",
                "email": "maria@example.com",
                "date": "1990-05-17",
                "hour": "14",
                "minute": "30",
                "city": "São Paulo, SP"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Mapa calculado (ou mapa existente para o e-mail).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CalculateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Corpo inválido: invalid_json, missing_fields ou invalid_field.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "405": {
            "description": "Método não permitido — use POST.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "502": {
            "description": "engine_unavailable: o motor de cálculo não respondeu. Tente novamente.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/services/": {
      "get": {
        "operationId": "listServices",
        "tags": [
          "catalogo"
        ],
        "summary": "Listar serviços",
        "description": "Lista os serviços de Danielle Bento — Constelação Familiar (individual, grupo, na água, online e presencial em São Paulo e São José dos Campos), Terapias Integrativas, Desenho Humano, diagnóstico, cursos e palestras — com formatos e como agendar.",
        "responses": {
          "200": {
            "description": "Catálogo de serviços.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "services"
                  ],
                  "properties": {
                    "services": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Service"
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/contact/": {
      "get": {
        "operationId": "getContactInfo",
        "tags": [
          "catalogo"
        ],
        "summary": "Obter contato oficial",
        "description": "Retorna os canais oficiais para agendar sessões: WhatsApp, e-mail, cidades de atendimento presencial e redes sociais.",
        "responses": {
          "200": {
            "description": "Canais de contato.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactInfo"
                }
              }
            }
          }
        }
      }
    },
    "/api/": {
      "get": {
        "operationId": "getApiIndex",
        "tags": [
          "descoberta"
        ],
        "summary": "Índice da API",
        "description": "Lista os endpoints disponíveis e os links para documentação, OpenAPI e llms.txt.",
        "responses": {
          "200": {
            "description": "Índice da API.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiIndex"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CalculateRequest": {
        "type": "object",
        "required": [
          "name",
          "email",
          "date",
          "hour",
          "minute",
          "city"
        ],
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "description": "Nome da pessoa."
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "E-mail da pessoa; identifica o mapa salvo."
          },
          "date": {
            "type": "string",
            "format": "date",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
            "description": "Data de nascimento (AAAA-MM-DD)."
          },
          "hour": {
            "type": "string",
            "pattern": "^([01]?\\d|2[0-3])$",
            "description": "Hora de nascimento, 0–23. Use \"12\" se desconhecida."
          },
          "minute": {
            "type": "string",
            "pattern": "^[0-5]?\\d$",
            "description": "Minuto de nascimento, 0–59."
          },
          "city": {
            "type": "string",
            "minLength": 2,
            "description": "Cidade de nascimento com estado/país, ex.: \"Recife, PE\"."
          },
          "time_unknown": {
            "type": "boolean",
            "default": false,
            "description": "true quando a hora de nascimento é desconhecida."
          }
        }
      },
      "CalculateResponse": {
        "type": "object",
        "required": [
          "existing",
          "result",
          "source"
        ],
        "properties": {
          "existing": {
            "type": "boolean",
            "description": "true quando o e-mail já tinha um mapa salvo."
          },
          "slug": {
            "type": [
              "string",
              "null"
            ],
            "description": "Identificador do link público do mapa: /desenho-humano/r/{slug}/."
          },
          "source": {
            "type": "string",
            "enum": [
              "http-engine",
              "local-spawn",
              "demo",
              "cached",
              "race-recovered"
            ]
          },
          "result": {
            "$ref": "#/components/schemas/HumanDesignResult"
          }
        }
      },
      "HumanDesignResult": {
        "type": "object",
        "required": [
          "type",
          "strategy",
          "authority",
          "profile",
          "definition",
          "signature",
          "notSelfTheme",
          "definedCenters",
          "openCenters",
          "channels"
        ],
        "properties": {
          "type": {
            "type": "string",
            "examples": [
              "Projetor"
            ]
          },
          "strategy": {
            "type": "string"
          },
          "authority": {
            "type": "string"
          },
          "profile": {
            "type": "string"
          },
          "definition": {
            "type": "string"
          },
          "signature": {
            "type": "string"
          },
          "notSelfTheme": {
            "type": "string"
          },
          "definedCenters": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "openCenters": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "channels": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "incarnationCross": {
            "type": "object",
            "properties": {
              "label": {
                "type": "string"
              },
              "gates": {
                "type": "array",
                "items": {
                  "type": "integer"
                }
              },
              "type": {
                "type": "string"
              }
            }
          }
        }
      },
      "Service": {
        "type": "object",
        "required": [
          "id",
          "name",
          "summary",
          "url",
          "formats",
          "howToBook",
          "free"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "formats": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "name",
                "modality",
                "details"
              ],
              "properties": {
                "name": {
                  "type": "string"
                },
                "modality": {
                  "type": "string",
                  "enum": [
                    "online",
                    "presencial",
                    "online-ou-presencial"
                  ]
                },
                "details": {
                  "type": "string"
                }
              }
            }
          },
          "howToBook": {
            "type": "string"
          },
          "free": {
            "type": "boolean"
          }
        }
      },
      "ContactInfo": {
        "type": "object",
        "required": [
          "organization",
          "therapist",
          "whatsapp",
          "email"
        ],
        "properties": {
          "organization": {
            "type": "string"
          },
          "therapist": {
            "type": "string"
          },
          "whatsapp": {
            "type": "string",
            "description": "Telefone E.164."
          },
          "whatsappUrl": {
            "type": "string",
            "format": "uri"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "citiesServed": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "onlineService": {
            "type": "string"
          },
          "language": {
            "type": "string"
          },
          "social": {
            "type": "object",
            "additionalProperties": {
              "type": "string",
              "format": "uri"
            }
          },
          "contactPage": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "ApiIndex": {
        "type": "object",
        "required": [
          "name",
          "docs",
          "openapi",
          "endpoints"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "docs": {
            "type": "string",
            "format": "uri"
          },
          "openapi": {
            "type": "string",
            "format": "uri"
          },
          "llms": {
            "type": "string",
            "format": "uri"
          },
          "endpoints": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "method",
                "path",
                "operationId",
                "description"
              ],
              "properties": {
                "method": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "operationId": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "Problem": {
        "type": "object",
        "description": "RFC 9457 Problem Details.",
        "required": [
          "type",
          "title",
          "status",
          "code",
          "detail",
          "hint"
        ],
        "properties": {
          "type": {
            "type": "string",
            "format": "uri"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "code": {
            "type": "string",
            "enum": [
              "invalid_json",
              "missing_fields",
              "invalid_field",
              "method_not_allowed",
              "not_found",
              "engine_unavailable"
            ]
          },
          "detail": {
            "type": "string"
          },
          "hint": {
            "type": "string",
            "description": "Como resolver o erro."
          },
          "instance": {
            "type": "string"
          },
          "fields": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "allow": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "docs": {
            "type": "string",
            "format": "uri"
          },
          "openapi": {
            "type": "string",
            "format": "uri"
          },
          "error": {
            "type": "string",
            "description": "Cópia de detail (compatibilidade)."
          }
        }
      }
    }
  }
}