{
  "openapi": "3.1.0",
  "info": {
    "title": "Top1031 Public Catalog API",
    "version": "1.0.0",
    "description": "Public name lookup for Top1031 Trust and Sponsor records. Follow each result's href for source citations, dates, disclosures, gated-surface presentation, and the complete record context. This API does not provide investment, tax, or legal advice and does not confirm that an Offering remains available."
  },
  "servers": [
    {
      "url": "https://www.top1031.com"
    }
  ],
  "paths": {
    "/api/catalog/search/": {
      "get": {
        "operationId": "searchTop1031Catalog",
        "summary": "Find public Top1031 records by name",
        "description": "Returns up to ten public Trust and Sponsor matches. Use this endpoint for name lookup, then follow href for the complete source-linked record.",
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "required": true,
            "description": "Part or all of a Trust marketing title or Sponsor display name. Fewer than two characters returns an empty result set.",
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 80
            },
            "example": "nexpoint"
          },
          {
            "in": "query",
            "name": "scope",
            "required": false,
            "description": "Restrict results to Active Trusts. Omit to include public Historical Trusts and Sponsors.",
            "schema": {
              "type": "string",
              "enum": [
                "active-offerings"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching public catalog records",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CatalogSearchResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CatalogSearchResponse": {
        "type": "object",
        "required": [
          "results"
        ],
        "properties": {
          "results": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "$ref": "#/components/schemas/CatalogSearchResult"
            }
          }
        }
      },
      "CatalogSearchResult": {
        "type": "object",
        "required": [
          "href",
          "id",
          "kind",
          "meta",
          "title"
        ],
        "properties": {
          "href": {
            "type": "string",
            "description": "Canonical path to the complete public Top1031 record."
          },
          "id": {
            "type": "integer",
            "description": "Catalog record identifier. Use href as the canonical public identity."
          },
          "kind": {
            "type": "string",
            "enum": [
              "trust",
              "sponsor"
            ]
          },
          "meta": {
            "type": "string",
            "description": "Short catalog context such as Asset Bucket and location or Sponsor Program count."
          },
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string",
            "description": "Trust marketing title or Sponsor display name."
          }
        }
      }
    }
  }
}
