{
  "openapi": "3.1.0",
  "info": {
    "title": "CRE Events API",
    "version": "1.0.0",
    "description": "Commercial real estate conferences, each checked against the organizer's own page. Free, no key. Calendar data CC BY 4.0 (attribute CRE Events, cre.events).",
    "contact": { "email": "hello@cre.events", "url": "https://cre.events/developers/" }
  },
  "servers": [{ "url": "https://cre.events" }],
  "paths": {
    "/api/v1/events": {
      "get": {
        "summary": "List upcoming events",
        "parameters": [
          { "name": "q", "in": "query", "schema": { "type": "string" }, "description": "Text match on name, organizer, city, description" },
          { "name": "sectors", "in": "query", "schema": { "type": "string" }, "description": "Comma list: investment, multifamily, development, lending, general, retail, office, proptech, industrial, hospitality, senior housing, affordable, data centers, self storage, student housing, life science" },
          { "name": "region", "in": "query", "schema": { "type": "string", "enum": ["national", "regional"] } },
          { "name": "state", "in": "query", "schema": { "type": "string" } },
          { "name": "country", "in": "query", "schema": { "type": "string" }, "description": "ISO-2, e.g. US" },
          { "name": "city", "in": "query", "schema": { "type": "string" } },
          { "name": "organizer", "in": "query", "schema": { "type": "string" } },
          { "name": "from", "in": "query", "schema": { "type": "string", "format": "date" } },
          { "name": "to", "in": "query", "schema": { "type": "string", "format": "date" } },
          { "name": "max_price_usd", "in": "query", "schema": { "type": "number" } },
          { "name": "open_only", "in": "query", "schema": { "type": "boolean" } },
          { "name": "include_past", "in": "query", "schema": { "type": "boolean" } },
          { "name": "sort", "in": "query", "schema": { "type": "string", "enum": ["date", "price", "size", "name"] } },
          { "name": "limit", "in": "query", "schema": { "type": "integer", "maximum": 500 } }
        ],
        "responses": { "200": { "description": "Events", "content": { "application/json": { "schema": { "type": "object", "properties": { "count": { "type": "integer" }, "events": { "type": "array", "items": { "$ref": "#/components/schemas/Event" } } } } } } } }
      }
    },
    "/api/v1/events/{id}": {
      "get": {
        "summary": "One event",
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "type": "string" } }],
        "responses": { "200": { "description": "Event", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Event" } } } }, "404": { "description": "Not found" } }
      }
    },
    "/api/v1/sectors": { "get": { "summary": "Sector tags with event counts", "responses": { "200": { "description": "Sectors" } } } },
    "/api/v1/deadlines": {
      "get": {
        "summary": "Upcoming registration deadlines",
        "parameters": [{ "name": "days", "in": "query", "schema": { "type": "integer", "default": 60 } }],
        "responses": { "200": { "description": "Deadlines, soonest first" } }
      }
    },
    "/api/subscribe": {
      "post": {
        "summary": "Create a personal calendar feed",
        "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "sectors": { "type": "array", "items": { "type": "string" } }, "region": { "type": "string" }, "state": { "type": "string" }, "ids": { "type": "array", "items": { "type": "string" } }, "q": { "type": "string" }, "deadlines": { "type": "boolean", "description": "Include deadline reminders (default true)" }, "name": { "type": "string" } } } } } },
        "responses": { "200": { "description": "Feed links: feed_url, webcal_url, google_url, outlook_url" } }
      }
    }
  },
  "components": {
    "schemas": {
      "Event": {
        "type": "object",
        "properties": {
          "id": { "type": "string" }, "name": { "type": "string" }, "organizer": { "type": "string" }, "organizer_url": { "type": "string" },
          "event_url": { "type": "string", "description": "The organizer's page; register there" },
          "start": { "type": ["string", "null"], "format": "date" }, "end": { "type": ["string", "null"], "format": "date" },
          "dates_status": { "type": "string", "enum": ["confirmed", "announced-month-only", "not-announced"] },
          "city": { "type": "string" }, "state_or_country": { "type": "string" }, "country": { "type": "string" }, "venue": { "type": ["string", "null"] },
          "price_notes": { "type": ["string", "null"] }, "price_min_usd": { "type": ["integer", "null"] }, "price_max_usd": { "type": ["integer", "null"] },
          "deadlines": { "type": "array", "items": { "type": "object", "properties": { "date": { "type": "string" }, "label": { "type": "string" } } } },
          "audience": { "type": "string" }, "why_go": { "type": "string" }, "sectors": { "type": "array", "items": { "type": "string" } },
          "region": { "type": "string" }, "members_only": { "type": "boolean" }, "attendance_claim": { "type": ["string", "null"] },
          "source_accessed": { "type": "string", "format": "date" }, "page_url": { "type": "string" }, "ics_url": { "type": ["string", "null"] },
          "best_for": { "type": "array", "items": { "type": "string" } }, "skip_if": { "type": "array", "items": { "type": "string" } },
          "takes": { "type": "array", "items": { "type": "object" } }
        }
      }
    }
  }
}
