{
  "openapi": "3.1.0",
  "info": {
    "title": "Evolua ERP Public API (v1)",
    "version": "1.0.0",
    "description": "Public read-only REST API (v1) for Evolua ERP subscription plans, documentation metadata, and real-time online booking slot availability. URL paths use major version prefix /api/v1 alongside optional X-API-Version header negotiation. Breaking changes move to a new major path (/api/v2) with RFC 9745 Deprecation/Sunset notices at least 90 days in advance.",
    "termsOfService": "https://www.evoluaerp.com.br/terms",
    "contact": {
      "name": "Evolua ERP Developer Support",
      "url": "https://www.evoluaerp.com.br/docs",
      "email": "suporte@evoluaerp.com.br"
    }
  },
  "servers": [
    {
      "url": "https://evoluaerp.vercel.app",
      "description": "Evolua ERP Web App API (v1)"
    },
    {
      "url": "https://www.evoluaerp.com.br",
      "description": "Evolua ERP Production API (v1)"
    }
  ],
  "externalDocs": {
    "description": "Evolua ERP API docs, versioning/deprecation policy, and rate limits",
    "url": "https://evoluaerp.vercel.app/docs#versioning-and-deprecation"
  },
  "tags": [
    {
      "name": "Catalog",
      "description": "Public read-only product plans and add-on module pricing."
    },
    {
      "name": "Booking",
      "description": "Real-time appointment slot availability for registered establishments."
    }
  ],
  "paths": {
    "/api/v1/planos": {
      "get": {
        "operationId": "listPublicPlansV1",
        "tags": [
          "Catalog"
        ],
        "summary": "List Evolua ERP public subscription plans and automation add-ons",
        "description": "Returns the complete public catalog of Evolua ERP plans (Essencial, Profissional, Evolua) and optional WhatsApp/Pix add-ons in BRL. Requires no authentication and no mandatory query parameters.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersionHeader"
          },
          {
            "name": "plano",
            "in": "query",
            "required": false,
            "description": "Optional plan slug filter.",
            "schema": {
              "type": "string",
              "enum": [
                "essencial",
                "profissional",
                "evolua"
              ]
            },
            "example": "profissional"
          }
        ],
        "responses": {
          "200": {
            "description": "Public plans catalog returned successfully.",
            "headers": {
              "RateLimit-Policy": {
                "description": "Quota policy in current IETF RateLimit structured-field format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Current remaining quota and reset window in IETF RateLimit format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Maximum requests allowed in the active quota window.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Remaining requests allowed before throttling.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Delta seconds until the active quota window resets.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-API-Version": {
                "description": "Resolved major API version handling the request.",
                "schema": {
                  "type": "string"
                }
              },
              "Link": {
                "description": "RFC 8288 discovery links (service-desc, api-catalog, service-doc, deprecation).",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PlansCatalogResponse"
                }
              }
            }
          },
          "400": {
            "description": "Invalid plan filter or unsupported X-API-Version header.",
            "headers": {
              "RateLimit-Policy": {
                "description": "Quota policy in current IETF RateLimit structured-field format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Current remaining quota and reset window in IETF RateLimit format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Maximum requests allowed in the active quota window.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Remaining requests allowed before throttling.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Delta seconds until the active quota window resets.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-API-Version": {
                "description": "Resolved major API version handling the request.",
                "schema": {
                  "type": "string"
                }
              },
              "Link": {
                "description": "RFC 8288 discovery links (service-desc, api-catalog, service-doc, deprecation).",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "405": {
            "description": "HTTP method not allowed on this read-only resource.",
            "headers": {
              "RateLimit-Policy": {
                "description": "Quota policy in current IETF RateLimit structured-field format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Current remaining quota and reset window in IETF RateLimit format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Maximum requests allowed in the active quota window.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Remaining requests allowed before throttling.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Delta seconds until the active quota window resets.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-API-Version": {
                "description": "Resolved major API version handling the request.",
                "schema": {
                  "type": "string"
                }
              },
              "Link": {
                "description": "RFC 8288 discovery links (service-desc, api-catalog, service-doc, deprecation).",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "IP rate limit exceeded (120 requests per 60 seconds).",
            "headers": {
              "RateLimit-Policy": {
                "description": "Quota policy in current IETF RateLimit structured-field format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Current remaining quota and reset window in IETF RateLimit format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Maximum requests allowed in the active quota window.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Remaining requests allowed before throttling.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Delta seconds until the active quota window resets.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-API-Version": {
                "description": "Resolved major API version handling the request.",
                "schema": {
                  "type": "string"
                }
              },
              "Link": {
                "description": "RFC 8288 discovery links (service-desc, api-catalog, service-doc, deprecation).",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/horarios-disponiveis": {
      "get": {
        "operationId": "listAvailableBookingSlotsV1",
        "tags": [
          "Booking"
        ],
        "summary": "List available booking time slots for an establishment",
        "description": "Calculates open HH:mm booking slots and remaining simultaneous capacities for a registered establishment on a target calendar date given the total service duration.",
        "security": [],
        "parameters": [
          {
            "$ref": "#/components/parameters/ApiVersionHeader"
          },
          {
            "name": "estabelecimento_id",
            "in": "query",
            "required": true,
            "description": "UUID of the target establishment.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "data",
            "in": "query",
            "required": true,
            "description": "Target calendar date in YYYY-MM-DD format.",
            "schema": {
              "type": "string",
              "format": "date",
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
            },
            "example": "2026-11-15"
          },
          {
            "name": "duracao_total",
            "in": "query",
            "required": true,
            "description": "Total duration of the requested service(s) in minutes.",
            "schema": {
              "type": "integer",
              "minimum": 1
            },
            "example": 60
          },
          {
            "name": "profissional_id",
            "in": "query",
            "required": false,
            "description": "Optional UUID of a specific professional to filter availability.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Available slots returned successfully.",
            "headers": {
              "RateLimit-Policy": {
                "description": "Quota policy in current IETF RateLimit structured-field format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Current remaining quota and reset window in IETF RateLimit format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Maximum requests allowed in the active quota window.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Remaining requests allowed before throttling.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Delta seconds until the active quota window resets.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-API-Version": {
                "description": "Resolved major API version handling the request.",
                "schema": {
                  "type": "string"
                }
              },
              "Link": {
                "description": "RFC 8288 discovery links (service-desc, api-catalog, service-doc, deprecation).",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AvailableSlotsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid query parameters or unsupported API version header.",
            "headers": {
              "RateLimit-Policy": {
                "description": "Quota policy in current IETF RateLimit structured-field format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Current remaining quota and reset window in IETF RateLimit format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Maximum requests allowed in the active quota window.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Remaining requests allowed before throttling.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Delta seconds until the active quota window resets.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-API-Version": {
                "description": "Resolved major API version handling the request.",
                "schema": {
                  "type": "string"
                }
              },
              "Link": {
                "description": "RFC 8288 discovery links (service-desc, api-catalog, service-doc, deprecation).",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "405": {
            "description": "HTTP method not allowed on this read-only resource.",
            "headers": {
              "RateLimit-Policy": {
                "description": "Quota policy in current IETF RateLimit structured-field format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Current remaining quota and reset window in IETF RateLimit format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Maximum requests allowed in the active quota window.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Remaining requests allowed before throttling.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Delta seconds until the active quota window resets.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-API-Version": {
                "description": "Resolved major API version handling the request.",
                "schema": {
                  "type": "string"
                }
              },
              "Link": {
                "description": "RFC 8288 discovery links (service-desc, api-catalog, service-doc, deprecation).",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "IP rate limit exceeded (maximum 50 requests per 60 seconds).",
            "headers": {
              "RateLimit-Policy": {
                "description": "Quota policy in current IETF RateLimit structured-field format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Current remaining quota and reset window in IETF RateLimit format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Maximum requests allowed in the active quota window.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Remaining requests allowed before throttling.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Delta seconds until the active quota window resets.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-API-Version": {
                "description": "Resolved major API version handling the request.",
                "schema": {
                  "type": "string"
                }
              },
              "Link": {
                "description": "RFC 8288 discovery links (service-desc, api-catalog, service-doc, deprecation).",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Seconds to wait before retrying.",
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "headers": {
              "RateLimit-Policy": {
                "description": "Quota policy in current IETF RateLimit structured-field format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Current remaining quota and reset window in IETF RateLimit format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Maximum requests allowed in the active quota window.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Remaining requests allowed before throttling.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Delta seconds until the active quota window resets.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-API-Version": {
                "description": "Resolved major API version handling the request.",
                "schema": {
                  "type": "string"
                }
              },
              "Link": {
                "description": "RFC 8288 discovery links (service-desc, api-catalog, service-doc, deprecation).",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/horarios-disponiveis": {
      "get": {
        "operationId": "listAvailableBookingSlotsLegacyAlias",
        "tags": [
          "Booking"
        ],
        "deprecated": true,
        "summary": "Deprecated compatibility alias for /api/v1/horarios-disponiveis",
        "description": "Legacy unversioned compatibility path retained for backward compatibility. Emits RFC 9745 Deprecation header and Link rel=\"successor-version\" pointing to /api/v1/horarios-disponiveis.",
        "security": [],
        "parameters": [
          {
            "name": "estabelecimento_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "data",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "duracao_total",
            "in": "query",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "profissional_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Available slots returned successfully (with RFC 9745 Deprecation headers).",
            "headers": {
              "RateLimit-Policy": {
                "description": "Quota policy in current IETF RateLimit structured-field format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Current remaining quota and reset window in IETF RateLimit format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Maximum requests allowed in the active quota window.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Remaining requests allowed before throttling.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Delta seconds until the active quota window resets.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-API-Version": {
                "description": "Resolved major API version handling the request.",
                "schema": {
                  "type": "string"
                }
              },
              "Link": {
                "description": "RFC 8288 discovery links (service-desc, api-catalog, service-doc, deprecation).",
                "schema": {
                  "type": "string"
                }
              },
              "Deprecation": {
                "description": "RFC 9745 deprecation timestamp indicating legacy alias status.",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AvailableSlotsResponse"
                }
              }
            }
          },
          "400": {
            "description": "Missing or invalid query parameters.",
            "headers": {
              "RateLimit-Policy": {
                "description": "Quota policy in current IETF RateLimit structured-field format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Current remaining quota and reset window in IETF RateLimit format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Maximum requests allowed in the active quota window.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Remaining requests allowed before throttling.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Delta seconds until the active quota window resets.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-API-Version": {
                "description": "Resolved major API version handling the request.",
                "schema": {
                  "type": "string"
                }
              },
              "Link": {
                "description": "RFC 8288 discovery links (service-desc, api-catalog, service-doc, deprecation).",
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "IP rate limit exceeded.",
            "headers": {
              "RateLimit-Policy": {
                "description": "Quota policy in current IETF RateLimit structured-field format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit": {
                "description": "Current remaining quota and reset window in IETF RateLimit format.",
                "schema": {
                  "type": "string"
                }
              },
              "RateLimit-Limit": {
                "description": "Maximum requests allowed in the active quota window.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Remaining": {
                "description": "Remaining requests allowed before throttling.",
                "schema": {
                  "type": "integer"
                }
              },
              "RateLimit-Reset": {
                "description": "Delta seconds until the active quota window resets.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-API-Version": {
                "description": "Resolved major API version handling the request.",
                "schema": {
                  "type": "string"
                }
              },
              "Link": {
                "description": "RFC 8288 discovery links (service-desc, api-catalog, service-doc, deprecation).",
                "schema": {
                  "type": "string"
                }
              },
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "parameters": {
      "ApiVersionHeader": {
        "name": "X-API-Version",
        "in": "header",
        "required": false,
        "description": "Optional API version header. Supported values: \"1\" or \"2026-11-01\". URL path versioning (/api/v1) takes precedence for breaking major changes.",
        "schema": {
          "type": "string",
          "enum": [
            "1",
            "v1",
            "2026-11-01"
          ],
          "default": "1"
        }
      }
    },
    "schemas": {
      "AvailableSlotsResponse": {
        "type": "object",
        "required": [
          "horarios",
          "vagasPorHorario"
        ],
        "properties": {
          "horarios": {
            "type": "array",
            "description": "Sorted list of available HH:mm start times.",
            "items": {
              "type": "string",
              "pattern": "^\\d{2}:\\d{2}$"
            }
          },
          "vagasPorHorario": {
            "type": "object",
            "description": "Map from HH:mm slot string to remaining simultaneous capacity count.",
            "additionalProperties": {
              "type": "integer",
              "minimum": 1
            }
          }
        }
      },
      "PlansCatalogResponse": {
        "type": "object",
        "required": [
          "apiVersion",
          "product",
          "currency",
          "trialDays",
          "requiresCreditCard",
          "plans",
          "addons"
        ],
        "properties": {
          "apiVersion": {
            "type": "string"
          },
          "product": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "trialDays": {
            "type": "integer"
          },
          "requiresCreditCard": {
            "type": "boolean"
          },
          "plansUrl": {
            "type": "string",
            "format": "uri"
          },
          "docsUrl": {
            "type": "string",
            "format": "uri"
          },
          "plans": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "name",
                "monthlyPrice",
                "currency",
                "limits",
                "features"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "schemaName": {
                  "type": "string"
                },
                "audience": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                },
                "currency": {
                  "type": "string"
                },
                "monthlyPrice": {
                  "type": "number"
                },
                "yearlyMonthlyEquivalent": {
                  "type": "number"
                },
                "yearlySavings": {
                  "type": "string"
                },
                "limits": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "features": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "addons": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "id",
                "name",
                "monthlyPrice",
                "currency",
                "description"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "badge": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "currency": {
                  "type": "string"
                },
                "monthlyPrice": {
                  "type": "number"
                },
                "yearlyMonthlyEquivalent": {
                  "type": "number"
                },
                "description": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "ProblemDetails": {
        "type": "object",
        "required": [
          "type",
          "title",
          "status",
          "code",
          "detail",
          "error"
        ],
        "properties": {
          "type": {
            "type": "string",
            "format": "uri"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "code": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "error": {
            "type": "string"
          }
        }
      }
    }
  }
}