{
  "openapi": "3.1.0",
  "info": {
    "title": "Altis public API",
    "version": "1.0.0",
    "summary": "Public, unauthenticated endpoints of the Altis website (altis.online).",
    "description": "Read the Altis product catalog and reach the Altis team. Product APIs for embedded lending (FIPE, Auto Equity, Income Estimator) are documented separately at https://dev.altis.online and require credentials; see https://www.altis.online/developers. All errors use the Error schema: a human-readable `error`, a stable machine-readable `code`, a resolution `hint` and a `docs` link.",
    "contact": {
      "name": "Altis",
      "email": "contato@altis.online",
      "url": "https://www.altis.online/contact"
    },
    "termsOfService": "https://www.altis.online/termos-de-uso"
  },
  "externalDocs": {
    "description": "Altis developer portal",
    "url": "https://www.altis.online/developers"
  },
  "servers": [
    {
      "url": "https://www.altis.online",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "Discovery",
      "description": "API index and metadata."
    },
    {
      "name": "Products",
      "description": "Public product catalog."
    },
    {
      "name": "Contact",
      "description": "Human-facing forms protected by Cloudflare Turnstile."
    }
  ],
  "paths": {
    "/api": {
      "get": {
        "operationId": "getApiIndex",
        "tags": [
          "Discovery"
        ],
        "summary": "API index",
        "description": "Returns links to this OpenAPI document, the developer docs, llms.txt and a list of the available endpoints. Use it as an entry point for discovery.",
        "responses": {
          "200": {
            "description": "API index.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiIndex"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/products": {
      "get": {
        "operationId": "listProducts",
        "tags": [
          "Products"
        ],
        "summary": "List Altis products",
        "description": "Lists Altis software products, financial products (offered through regulated partner institutions) and developer APIs, with a short description and the URL of each product page. Use it to answer which products Altis offers or to find the right page for a use case.",
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Only return products of this category.",
            "schema": {
              "$ref": "#/components/schemas/ProductCategory"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Product list.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProductList"
                }
              }
            }
          },
          "400": {
            "description": "Unknown category (code `invalid_parameter`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/contact": {
      "post": {
        "operationId": "submitContactForm",
        "tags": [
          "Contact"
        ],
        "summary": "Send a message to the Altis sales team",
        "description": "Sends the contact form to the Altis team by e-mail. Requires a Cloudflare Turnstile token obtained by a human in the browser, so autonomous agents cannot call it directly: direct the user to https://www.altis.online/contact or to contato@altis.online instead.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Message sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Success"
                }
              }
            }
          },
          "400": {
            "description": "Missing required fields (code `missing_fields`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing or invalid Turnstile token (code `captcha_failed`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Could not send the message (code `internal_error`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/api/vagas": {
      "post": {
        "operationId": "submitJobApplication",
        "tags": [
          "Contact"
        ],
        "summary": "Apply for a job at Altis",
        "description": "Submits a job application with a résumé attachment. Requires a Cloudflare Turnstile token obtained by a human in the browser; direct candidates to https://www.altis.online/vagas.",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/JobApplicationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Application sent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Success"
                }
              }
            }
          },
          "400": {
            "description": "Missing fields or file, or file too large (codes `missing_fields`, `missing_file`, `file_too_large`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Missing or invalid Turnstile token (code `captcha_failed`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "Method not allowed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Could not send the application (code `internal_error`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error",
          "code",
          "hint",
          "docs"
        ],
        "properties": {
          "error": {
            "type": "string",
            "description": "Human-readable message (may be in Portuguese).",
            "examples": [
              "Missing required fields"
            ]
          },
          "code": {
            "type": "string",
            "description": "Stable machine-readable error code.",
            "enum": [
              "not_found",
              "method_not_allowed",
              "missing_fields",
              "invalid_parameter",
              "captcha_failed",
              "missing_file",
              "file_too_large",
              "internal_error"
            ]
          },
          "hint": {
            "type": "string",
            "description": "How to resolve the error."
          },
          "docs": {
            "type": "string",
            "format": "uri",
            "description": "Documentation URL."
          }
        }
      },
      "Success": {
        "type": "object",
        "required": [
          "success",
          "message"
        ],
        "properties": {
          "success": {
            "type": "boolean",
            "const": true
          },
          "message": {
            "type": "string"
          }
        }
      },
      "ProductCategory": {
        "type": "string",
        "enum": [
          "software",
          "financial_product",
          "developer_api"
        ],
        "description": "`software`: Altis SaaS products; `financial_product`: credit products operated with regulated partners; `developer_api`: APIs documented at dev.altis.online."
      },
      "Product": {
        "type": "object",
        "required": [
          "id",
          "name",
          "category",
          "description",
          "url"
        ],
        "properties": {
          "id": {
            "type": "string",
            "examples": [
              "credit-engine"
            ]
          },
          "name": {
            "type": "string"
          },
          "category": {
            "$ref": "#/components/schemas/ProductCategory"
          },
          "description": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "ProductList": {
        "type": "object",
        "required": [
          "data",
          "count"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Product"
            }
          },
          "count": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "ApiIndex": {
        "type": "object",
        "required": [
          "name",
          "openapi",
          "docs",
          "endpoints"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "openapi": {
            "type": "string",
            "format": "uri"
          },
          "docs": {
            "type": "string",
            "format": "uri"
          },
          "llms_txt": {
            "type": "string",
            "format": "uri"
          },
          "endpoints": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "method",
                "path",
                "description"
              ],
              "properties": {
                "method": {
                  "type": "string"
                },
                "path": {
                  "type": "string"
                },
                "description": {
                  "type": "string"
                }
              }
            }
          }
        }
      },
      "ContactRequest": {
        "type": "object",
        "required": [
          "name",
          "email",
          "message",
          "turnstileToken"
        ],
        "properties": {
          "name": {
            "type": "string",
            "description": "Full name."
          },
          "email": {
            "type": "string",
            "format": "email",
            "description": "Work e-mail."
          },
          "company": {
            "type": "string",
            "description": "Company name (optional)."
          },
          "phone": {
            "type": "string",
            "description": "Phone number (optional)."
          },
          "message": {
            "type": "string",
            "description": "Message to the Altis team."
          },
          "turnstileToken": {
            "type": "string",
            "description": "Cloudflare Turnstile response token from the browser widget."
          }
        }
      },
      "JobApplicationRequest": {
        "type": "object",
        "required": [
          "name",
          "email",
          "phone",
          "position",
          "resume",
          "turnstileToken"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "phone": {
            "type": "string"
          },
          "position": {
            "type": "string",
            "description": "Position of interest."
          },
          "location": {
            "type": "string"
          },
          "linkedin": {
            "type": "string",
            "format": "uri"
          },
          "message": {
            "type": "string"
          },
          "resume": {
            "type": "string",
            "contentMediaType": "application/pdf",
            "description": "Résumé file (PDF, DOC or DOCX, up to 5 MB)."
          },
          "turnstileToken": {
            "type": "string",
            "description": "Cloudflare Turnstile response token from the browser widget."
          }
        }
      }
    }
  }
}
