{
  "components": {
    "headers": {
      "Idempotent-Replayed": {
        "description": "`true` when this is the stored answer to an earlier request.",
        "schema": {
          "enum": [
            "true"
          ],
          "type": "string"
        }
      },
      "RateLimit": {
        "description": "The tightest budget: `r` requests remaining, `t` seconds to reset.",
        "schema": {
          "type": "string"
        }
      },
      "RateLimit-Policy": {
        "description": "Every budget the request spent from, e.g. `\"burst\";q=10;w=1, \"minute\";q=300;w=60`.",
        "schema": {
          "type": "string"
        }
      },
      "Retry-After": {
        "description": "Seconds to wait before retrying.",
        "schema": {
          "type": "integer"
        }
      },
      "X-RateLimit-Limit": {
        "description": "The tightest budget's quota.",
        "schema": {
          "type": "integer"
        }
      },
      "X-RateLimit-Remaining": {
        "description": "Requests left in the tightest budget.",
        "schema": {
          "type": "integer"
        }
      },
      "X-RateLimit-Reset": {
        "description": "Seconds until the tightest budget is full again.",
        "schema": {
          "type": "integer"
        }
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "description": "Any unique string (1-255 characters). A retry with the same key and body replays the first answer for 24 hours, with `Idempotent-Replayed: true`.",
        "in": "header",
        "name": "Idempotency-Key",
        "required": false,
        "schema": {
          "maxLength": 255,
          "minLength": 1,
          "type": "string"
        }
      },
      "WebhookId": {
        "description": "The event `id`; the same on every retry and redelivery.",
        "in": "header",
        "name": "webhook-id",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "WebhookSignature": {
        "description": "`v1,` and the base64 HMAC-SHA256 of `{webhook-id}.{webhook-timestamp}.{body}`, keyed with the base64-decoded part of the endpoint's `whsec_` secret.",
        "in": "header",
        "name": "webhook-signature",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "WebhookTimestamp": {
        "description": "When this attempt was sent, in Unix seconds.",
        "in": "header",
        "name": "webhook-timestamp",
        "required": true,
        "schema": {
          "type": "integer"
        }
      }
    },
    "responses": {
      "Conflict": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "A request with this Idempotency-Key is still running."
      },
      "Forbidden": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "The API Key lacks the scope this operation needs."
      },
      "NotFound": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "Nothing with that id in this Tenant."
      },
      "PaymentRequired": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "The Tenant's subscription is read-only; reads still work."
      },
      "ServiceUnavailable": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "The Tenant's account is suspended."
      },
      "TooManyRequests": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "A rate budget is spent; retry after `Retry-After` seconds.",
        "headers": {
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          },
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimit-Policy"
          },
          "Retry-After": {
            "$ref": "#/components/headers/Retry-After"
          },
          "X-RateLimit-Limit": {
            "$ref": "#/components/headers/X-RateLimit-Limit"
          },
          "X-RateLimit-Remaining": {
            "$ref": "#/components/headers/X-RateLimit-Remaining"
          },
          "X-RateLimit-Reset": {
            "$ref": "#/components/headers/X-RateLimit-Reset"
          }
        }
      },
      "Unauthorized": {
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        },
        "description": "No API Key, or one that is unknown, expired or revoked.",
        "headers": {
          "WWW-Authenticate": {
            "schema": {
              "enum": [
                "Bearer"
              ],
              "type": "string"
            }
          }
        }
      }
    },
    "schemas": {
      "ActivityCompletedEvent": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/WebhookActivity"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "tenant": {
            "$ref": "#/components/schemas/WebhookTenant"
          },
          "type": {
            "const": "activity.completed",
            "title": "Type",
            "type": "string"
          },
          "version": {
            "const": 1,
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "type",
          "version",
          "created_at",
          "tenant",
          "data"
        ],
        "title": "ActivityCompletedEvent",
        "type": "object"
      },
      "ActivityCreate": {
        "description": "A new activity on the path's Lead. ``due_at`` is required for tasks, visits\nand meetings.",
        "properties": {
          "assignee_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assignee User Id"
          },
          "body": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Body"
          },
          "due_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Due At"
          },
          "kind": {
            "$ref": "#/components/schemas/ActivityKind"
          },
          "property_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Property Id"
          },
          "reminder_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reminder At"
          },
          "title": {
            "maxLength": 255,
            "minLength": 1,
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "kind",
          "title"
        ],
        "title": "ActivityCreate",
        "type": "object"
      },
      "ActivityKind": {
        "description": "What a CRM Activity on a Lead is. Tasks, visits and meetings are scheduled, so\nthey carry a ``due_at``; a call or a note may be logged undated.",
        "enum": [
          "task",
          "call",
          "visit",
          "meeting",
          "note"
        ],
        "title": "ActivityKind",
        "type": "string"
      },
      "ActivityUpdate": {
        "description": "A partial edit — only the fields present change. ``completed`` completes or\nreopens the activity.",
        "properties": {
          "assignee_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assignee User Id"
          },
          "body": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Body"
          },
          "completed": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed"
          },
          "due_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Due At"
          },
          "kind": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ActivityKind"
              },
              {
                "type": "null"
              }
            ]
          },
          "property_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Property Id"
          },
          "reminder_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reminder At"
          },
          "title": {
            "anyOf": [
              {
                "maxLength": 255,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          }
        },
        "title": "ActivityUpdate",
        "type": "object"
      },
      "AreaKind": {
        "description": "What a Tenant's Area names: a broad ``region``, a town or beach ``zone``, a\n``neighborhood``, or a gated ``community`` (manual membership only).",
        "enum": [
          "region",
          "zone",
          "neighborhood",
          "community"
        ],
        "title": "AreaKind",
        "type": "string"
      },
      "AreaRefOut": {
        "properties": {
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/AreaKind"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "id",
          "kind",
          "name"
        ],
        "title": "AreaRefOut",
        "type": "object"
      },
      "AreaVia": {
        "description": "How a listing belongs to an Area: its Place falls under the Area's rule, a\nperson added it, or a person took it out (a tombstone a recompute respects).",
        "enum": [
          "rule",
          "manual",
          "excluded"
        ],
        "title": "AreaVia",
        "type": "string"
      },
      "EnrichmentStatus": {
        "description": "Where a Property's AI Enrichment is: queued to run, done, given up on after its\nretries, held by the Tenant's off-switch, or waiting out the AI Spend Ceiling.",
        "enum": [
          "pending",
          "enriched",
          "failed",
          "off",
          "paused"
        ],
        "title": "EnrichmentStatus",
        "type": "string"
      },
      "Error": {
        "properties": {
          "detail": {
            "title": "Detail",
            "type": "string"
          }
        },
        "required": [
          "detail"
        ],
        "title": "Error",
        "type": "object"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "title": "Detail",
            "type": "array"
          }
        },
        "title": "HTTPValidationError",
        "type": "object"
      },
      "IngestPersonIn": {
        "description": "Who got in touch; at least one of ``email`` / ``phone``.",
        "properties": {
          "email": {
            "anyOf": [
              {
                "maxLength": 320,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "locale": {
            "anyOf": [
              {
                "maxLength": 35,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Locale"
          },
          "name": {
            "maxLength": 255,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "phone": {
            "anyOf": [
              {
                "maxLength": 50,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          }
        },
        "required": [
          "name"
        ],
        "title": "IngestPersonIn",
        "type": "object"
      },
      "IngestWarningOut": {
        "description": "Something the ingestion could not honour, without refusing it:\n``property_ref_unmatched``, ``property_ref_ambiguous``, ``property_not_found`` or\n``agent_unmatched``.",
        "properties": {
          "code": {
            "title": "Code",
            "type": "string"
          },
          "detail": {
            "title": "Detail",
            "type": "string"
          }
        },
        "required": [
          "code",
          "detail"
        ],
        "title": "IngestWarningOut",
        "type": "object"
      },
      "InquiryChannel": {
        "description": "How a website Inquiry was sent: a contact form, or a Concierge handoff.",
        "enum": [
          "form",
          "concierge"
        ],
        "title": "InquiryChannel",
        "type": "string"
      },
      "InquiryCreatedEvent": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/WebhookInquiry"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "tenant": {
            "$ref": "#/components/schemas/WebhookTenant"
          },
          "type": {
            "const": "inquiry.created",
            "title": "Type",
            "type": "string"
          },
          "version": {
            "const": 1,
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "type",
          "version",
          "created_at",
          "tenant",
          "data"
        ],
        "title": "InquiryCreatedEvent",
        "type": "object"
      },
      "LeadArchivedEvent": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/WebhookLead"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "tenant": {
            "$ref": "#/components/schemas/WebhookTenant"
          },
          "type": {
            "const": "lead.archived",
            "title": "Type",
            "type": "string"
          },
          "version": {
            "const": 1,
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "type",
          "version",
          "created_at",
          "tenant",
          "data"
        ],
        "title": "LeadArchivedEvent",
        "type": "object"
      },
      "LeadAssignedEvent": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/WebhookLeadAssigned"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "tenant": {
            "$ref": "#/components/schemas/WebhookTenant"
          },
          "type": {
            "const": "lead.assigned",
            "title": "Type",
            "type": "string"
          },
          "version": {
            "const": 1,
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "type",
          "version",
          "created_at",
          "tenant",
          "data"
        ],
        "title": "LeadAssignedEvent",
        "type": "object"
      },
      "LeadBuyerType": {
        "enum": [
          "investor",
          "retiree",
          "vacation_home",
          "relocation",
          "renter",
          "local_buyer",
          "unknown"
        ],
        "title": "LeadBuyerType",
        "type": "string"
      },
      "LeadCreatedEvent": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/WebhookLead"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "tenant": {
            "$ref": "#/components/schemas/WebhookTenant"
          },
          "type": {
            "const": "lead.created",
            "title": "Type",
            "type": "string"
          },
          "version": {
            "const": 1,
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "type",
          "version",
          "created_at",
          "tenant",
          "data"
        ],
        "title": "LeadCreatedEvent",
        "type": "object"
      },
      "LeadCriteriaIn": {
        "description": "The Lead's whole criteria — omitted fields are cleared. A price bound needs a\n``currency``; ``property_types`` are stored lowercased; ``amenities`` must all be\npresent on a match.",
        "properties": {
          "amenities": {
            "items": {
              "type": "string"
            },
            "title": "Amenities",
            "type": "array"
          },
          "area_ids": {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "maxItems": 50,
            "title": "Area Ids",
            "type": "array"
          },
          "currency": {
            "anyOf": [
              {
                "pattern": "^[A-Za-z]{3}$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Currency"
          },
          "listing_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ListingType"
              },
              {
                "type": "null"
              }
            ]
          },
          "max_price": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "number"
              },
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Price"
          },
          "min_baths": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "number"
              },
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Min Baths"
          },
          "min_beds": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Min Beds"
          },
          "min_price": {
            "anyOf": [
              {
                "minimum": 0.0,
                "type": "number"
              },
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Min Price"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "place_codes": {
            "items": {
              "maxLength": 32,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 50,
            "title": "Place Codes",
            "type": "array"
          },
          "property_types": {
            "items": {
              "maxLength": 100,
              "minLength": 1,
              "type": "string"
            },
            "maxItems": 20,
            "title": "Property Types",
            "type": "array"
          }
        },
        "title": "LeadCriteriaIn",
        "type": "object"
      },
      "LeadCriteriaOut": {
        "description": "The Lead's criteria; ``updated_at`` is null while none have been saved.\n``places`` and ``areas`` label ``place_codes`` and ``area_ids`` (one no longer\nknown is left out).",
        "properties": {
          "amenities": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Amenities",
            "type": "array"
          },
          "area_ids": {
            "default": [],
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "title": "Area Ids",
            "type": "array"
          },
          "areas": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/AreaRefOut"
            },
            "title": "Areas",
            "type": "array"
          },
          "currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Currency"
          },
          "listing_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ListingType"
              },
              {
                "type": "null"
              }
            ]
          },
          "max_price": {
            "anyOf": [
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Max Price"
          },
          "min_baths": {
            "anyOf": [
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Min Baths"
          },
          "min_beds": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Min Beds"
          },
          "min_price": {
            "anyOf": [
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Min Price"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "place_codes": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Place Codes",
            "type": "array"
          },
          "places": {
            "default": [],
            "items": {
              "$ref": "#/components/schemas/PlaceHitOut"
            },
            "title": "Places",
            "type": "array"
          },
          "property_types": {
            "default": [],
            "items": {
              "type": "string"
            },
            "title": "Property Types",
            "type": "array"
          },
          "updated_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Updated At"
          }
        },
        "title": "LeadCriteriaOut",
        "type": "object"
      },
      "LeadIngestIn": {
        "description": "One event from an integration. ``source`` and ``campaign`` are free-text\nattribution (e.g. \"Encuentra24\"). A Property is named by ``property_id`` or by\n``property_ref`` (its slug or the agency's own reference), an Agent by\n``agent_id`` or ``agent_email``. ``occurred_at`` defaults to now.",
        "properties": {
          "agent_email": {
            "anyOf": [
              {
                "maxLength": 320,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Email"
          },
          "agent_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Id"
          },
          "campaign": {
            "anyOf": [
              {
                "maxLength": 255,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Campaign"
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          },
          "occurred_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Occurred At"
          },
          "person": {
            "$ref": "#/components/schemas/IngestPersonIn"
          },
          "property_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Property Id"
          },
          "property_ref": {
            "anyOf": [
              {
                "maxLength": 255,
                "minLength": 1,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Property Ref"
          },
          "source": {
            "maxLength": 255,
            "minLength": 1,
            "title": "Source",
            "type": "string"
          },
          "type": {
            "enum": [
              "inquiry",
              "registration",
              "note"
            ],
            "title": "Type",
            "type": "string"
          }
        },
        "required": [
          "source",
          "type",
          "person"
        ],
        "title": "LeadIngestIn",
        "type": "object"
      },
      "LeadIngestOut": {
        "description": "The Lead created or matched, and what was recorded on it: an Inquiry, or an\nActivity for a ``note``.",
        "properties": {
          "activity_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Activity Id"
          },
          "inquiry_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Inquiry Id"
          },
          "lead": {
            "$ref": "#/components/schemas/PublicLead"
          },
          "warnings": {
            "items": {
              "$ref": "#/components/schemas/IngestWarningOut"
            },
            "title": "Warnings",
            "type": "array"
          }
        },
        "required": [
          "lead",
          "inquiry_id",
          "activity_id",
          "warnings"
        ],
        "title": "LeadIngestOut",
        "type": "object"
      },
      "LeadManualCreate": {
        "description": "The console's walk-in add. ``source`` is always ``manual`` (never client-set) and\na repeat email or phone dedups onto the existing Lead server-side, so only the contact fields\nand the owner ride here. An omitted ``assigned_agent_id`` defaults to the creator's\nlinked Agent; ``null`` leaves the Lead Unassigned.",
        "properties": {
          "assigned_agent_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assigned Agent Id"
          },
          "email": {
            "anyOf": [
              {
                "maxLength": 320,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "name": {
            "maxLength": 255,
            "minLength": 1,
            "title": "Name",
            "type": "string"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "phone": {
            "anyOf": [
              {
                "maxLength": 50,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          }
        },
        "required": [
          "name"
        ],
        "title": "LeadManualCreate",
        "type": "object"
      },
      "LeadMatchOut": {
        "description": "A matching listing, the criteria it met, and when it was sent (null if never).",
        "properties": {
          "bathrooms": {
            "anyOf": [
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bathrooms"
          },
          "bedrooms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bedrooms"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Currency"
          },
          "listing_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ListingType"
              },
              {
                "type": "null"
              }
            ]
          },
          "place_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Place Code"
          },
          "price": {
            "anyOf": [
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price"
          },
          "property_id": {
            "format": "uuid",
            "title": "Property Id",
            "type": "string"
          },
          "property_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Property Type"
          },
          "reasons": {
            "items": {
              "type": "string"
            },
            "title": "Reasons",
            "type": "array"
          },
          "rent_price": {
            "anyOf": [
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rent Price"
          },
          "sent_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sent At"
          },
          "slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Slug"
          },
          "title": {
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "property_id",
          "title",
          "slug",
          "listing_type",
          "property_type",
          "price",
          "rent_price",
          "currency",
          "bedrooms",
          "bathrooms",
          "place_code",
          "created_at",
          "reasons",
          "sent_at"
        ],
        "title": "LeadMatchOut",
        "type": "object"
      },
      "LeadPropertyCreate": {
        "properties": {
          "property_id": {
            "format": "uuid",
            "title": "Property Id",
            "type": "string"
          },
          "role": {
            "$ref": "#/components/schemas/LeadPropertyRole"
          }
        },
        "required": [
          "property_id",
          "role"
        ],
        "title": "LeadPropertyCreate",
        "type": "object"
      },
      "LeadPropertyOut": {
        "description": "One of a Lead's links, labelled with the Property's title.",
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "property_id": {
            "format": "uuid",
            "title": "Property Id",
            "type": "string"
          },
          "property_title": {
            "title": "Property Title",
            "type": "string"
          },
          "role": {
            "$ref": "#/components/schemas/LeadPropertyRole"
          },
          "source": {
            "$ref": "#/components/schemas/LeadPropertySource"
          }
        },
        "required": [
          "property_id",
          "property_title",
          "role",
          "source",
          "created_at"
        ],
        "title": "LeadPropertyOut",
        "type": "object"
      },
      "LeadPropertyRole": {
        "description": "How a Lead relates to a Property: shows interest in it, owns it, or rents it.",
        "enum": [
          "interested",
          "owner",
          "tenant"
        ],
        "title": "LeadPropertyRole",
        "type": "string"
      },
      "LeadPropertySource": {
        "description": "What created a Lead↔Property link: a property inquiry, a console user, or a\nmatch suggestion.",
        "enum": [
          "inquiry",
          "manual",
          "match"
        ],
        "title": "LeadPropertySource",
        "type": "string"
      },
      "LeadRecommendedAction": {
        "enum": [
          "call_immediately",
          "send_comps",
          "nurture_sequence",
          "low_priority"
        ],
        "title": "LeadRecommendedAction",
        "type": "string"
      },
      "LeadScoreTier": {
        "description": "A Lead score's band: Hot 80+, Warm 60–79, Moderate 40–59, Cold below 40.",
        "enum": [
          "hot",
          "warm",
          "moderate",
          "cold"
        ],
        "title": "LeadScoreTier",
        "type": "string"
      },
      "LeadScoredEvent": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/WebhookLead"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "tenant": {
            "$ref": "#/components/schemas/WebhookTenant"
          },
          "type": {
            "const": "lead.scored",
            "title": "Type",
            "type": "string"
          },
          "version": {
            "const": 1,
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "type",
          "version",
          "created_at",
          "tenant",
          "data"
        ],
        "title": "LeadScoredEvent",
        "type": "object"
      },
      "LeadSource": {
        "description": "How a Lead entered the CRM: the public capture path (``website``), a console\nhand-entry (``manual``), a Concierge handoff (``concierge``), an integration pushing\nit through the Public API (``api``), or an integration backfilling one first seen\nlong ago (``import``).",
        "enum": [
          "website",
          "manual",
          "concierge",
          "api",
          "import"
        ],
        "title": "LeadSource",
        "type": "string"
      },
      "LeadStatus": {
        "description": "The Lead pipeline. A Lead is born ``new`` and advances toward one of the two\nterminal outcomes; the transition rules are the API's, not this enum's.",
        "enum": [
          "new",
          "contacted",
          "qualified",
          "negotiating",
          "closed_won",
          "closed_lost"
        ],
        "title": "LeadStatus",
        "type": "string"
      },
      "LeadStatusChangedEvent": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/WebhookLeadStatusChanged"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "tenant": {
            "$ref": "#/components/schemas/WebhookTenant"
          },
          "type": {
            "const": "lead.status_changed",
            "title": "Type",
            "type": "string"
          },
          "version": {
            "const": 1,
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "type",
          "version",
          "created_at",
          "tenant",
          "data"
        ],
        "title": "LeadStatusChangedEvent",
        "type": "object"
      },
      "LeadUpdate": {
        "description": "A partial edit — only the fields present are applied (PATCH semantics via\n``model_fields_set``), so ``notes: null`` clears the notes while an omitted ``notes``\nleaves them untouched. ``assigned_agent_id: null`` leaves the Lead Unassigned.",
        "properties": {
          "assigned_agent_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assigned Agent Id"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "status": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LeadStatus"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "title": "LeadUpdate",
        "type": "object"
      },
      "LeadUpdatedEvent": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/WebhookLeadUpdated"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "tenant": {
            "$ref": "#/components/schemas/WebhookTenant"
          },
          "type": {
            "const": "lead.updated",
            "title": "Type",
            "type": "string"
          },
          "version": {
            "const": 1,
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "type",
          "version",
          "created_at",
          "tenant",
          "data"
        ],
        "title": "LeadUpdatedEvent",
        "type": "object"
      },
      "ListingPlaceOut": {
        "description": "A listing's Place: its path root first, and the card and detail strings.",
        "properties": {
          "code": {
            "title": "Code",
            "type": "string"
          },
          "long": {
            "title": "Long",
            "type": "string"
          },
          "path": {
            "items": {
              "$ref": "#/components/schemas/PathEntryOut"
            },
            "title": "Path",
            "type": "array"
          },
          "short": {
            "title": "Short",
            "type": "string"
          }
        },
        "required": [
          "code",
          "path",
          "short",
          "long"
        ],
        "title": "ListingPlaceOut",
        "type": "object"
      },
      "ListingType": {
        "description": "Whether a Property is offered for sale or for rent (ported from ticaluxury).\nNullable on the model — an imported listing whose source omits the distinction\nstays unset rather than guessed — but a closed set the list-page filters key on.",
        "enum": [
          "sale",
          "rent"
        ],
        "title": "ListingType",
        "type": "string"
      },
      "LocationPrecision": {
        "description": "How precisely a Property's coordinates may be shown publicly: ``exact`` pins\nthe spot; ``approximate`` publishes them coarsened so the site draws an area.",
        "enum": [
          "exact",
          "approximate"
        ],
        "title": "LocationPrecision",
        "type": "string"
      },
      "MatchSiteOut": {
        "description": "Where links sent to the Lead point: the Customer Site ``origin`` (null while the\nTenant has no live customer host) and the ``locale`` to link in.",
        "properties": {
          "locale": {
            "title": "Locale",
            "type": "string"
          },
          "origin": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Origin"
          }
        },
        "required": [
          "origin",
          "locale"
        ],
        "title": "MatchSiteOut",
        "type": "object"
      },
      "MatchesSent": {
        "properties": {
          "channel": {
            "enum": [
              "whatsapp",
              "email"
            ],
            "title": "Channel",
            "type": "string"
          },
          "property_ids": {
            "items": {
              "format": "uuid",
              "type": "string"
            },
            "maxItems": 50,
            "minItems": 1,
            "title": "Property Ids",
            "type": "array"
          }
        },
        "required": [
          "property_ids",
          "channel"
        ],
        "title": "MatchesSent",
        "type": "object"
      },
      "MatchingLeadOut": {
        "description": "A Lead the listing matches, the criteria it met, and when it was sent to them.",
        "properties": {
          "lead_email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lead Email"
          },
          "lead_id": {
            "format": "uuid",
            "title": "Lead Id",
            "type": "string"
          },
          "lead_name": {
            "title": "Lead Name",
            "type": "string"
          },
          "lead_phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lead Phone"
          },
          "reasons": {
            "items": {
              "type": "string"
            },
            "title": "Reasons",
            "type": "array"
          },
          "sent_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sent At"
          }
        },
        "required": [
          "lead_id",
          "lead_name",
          "lead_email",
          "lead_phone",
          "reasons",
          "sent_at"
        ],
        "title": "MatchingLeadOut",
        "type": "object"
      },
      "Origin": {
        "description": "Provenance of a ported row (ADR-0011): a listing/agent the importer created\nfrom a source (``import``) versus one a Tenant added by hand in the console\n(``manual``). Shared by Property and Agent so an on-demand re-import can tell\n\"mine to refresh\" from \"hand-authored, never stomp\".",
        "enum": [
          "import",
          "manual"
        ],
        "title": "Origin",
        "type": "string"
      },
      "Page_PublicActivity_": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/PublicActivity"
            },
            "title": "Data",
            "type": "array"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          }
        },
        "required": [
          "data",
          "next_cursor"
        ],
        "title": "Page[PublicActivity]",
        "type": "object"
      },
      "Page_PublicEvent_": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/PublicEvent"
            },
            "title": "Data",
            "type": "array"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          }
        },
        "required": [
          "data",
          "next_cursor"
        ],
        "title": "Page[PublicEvent]",
        "type": "object"
      },
      "Page_PublicInquiry_": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/PublicInquiry"
            },
            "title": "Data",
            "type": "array"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          }
        },
        "required": [
          "data",
          "next_cursor"
        ],
        "title": "Page[PublicInquiry]",
        "type": "object"
      },
      "Page_PublicLead_": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/PublicLead"
            },
            "title": "Data",
            "type": "array"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          }
        },
        "required": [
          "data",
          "next_cursor"
        ],
        "title": "Page[PublicLead]",
        "type": "object"
      },
      "PathEntryOut": {
        "properties": {
          "code": {
            "title": "Code",
            "type": "string"
          },
          "level_key": {
            "title": "Level Key",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          }
        },
        "required": [
          "code",
          "name",
          "slug",
          "level_key"
        ],
        "title": "PathEntryOut",
        "type": "object"
      },
      "PingEvent": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "data": {
            "$ref": "#/components/schemas/WebhookPing"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "tenant": {
            "$ref": "#/components/schemas/WebhookTenant"
          },
          "type": {
            "const": "ping",
            "title": "Type",
            "type": "string"
          },
          "version": {
            "const": 1,
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "type",
          "version",
          "created_at",
          "tenant",
          "data"
        ],
        "title": "PingEvent",
        "type": "object"
      },
      "PlaceHitOut": {
        "description": "A Place with the label that tells it apart from its namesakes, and the codes\nof its path (root first, the Place last).",
        "properties": {
          "code": {
            "title": "Code",
            "type": "string"
          },
          "country": {
            "title": "Country",
            "type": "string"
          },
          "depth": {
            "title": "Depth",
            "type": "integer"
          },
          "level_key": {
            "title": "Level Key",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "path_codes": {
            "items": {
              "type": "string"
            },
            "title": "Path Codes",
            "type": "array"
          },
          "path_label": {
            "title": "Path Label",
            "type": "string"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          }
        },
        "required": [
          "code",
          "name",
          "slug",
          "depth",
          "level_key",
          "path_label",
          "path_codes",
          "country"
        ],
        "title": "PlaceHitOut",
        "type": "object"
      },
      "PropertyAreaOut": {
        "properties": {
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/AreaKind"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "via": {
            "$ref": "#/components/schemas/AreaVia"
          }
        },
        "required": [
          "id",
          "kind",
          "name",
          "via"
        ],
        "title": "PropertyAreaOut",
        "type": "object"
      },
      "PropertyList": {
        "description": "A page of listings plus the unpaginated total, so the console can render page\ncontrols, and how many live listings still need a location (the badge).",
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/PropertyListItem"
            },
            "title": "Items",
            "type": "array"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "needs_location_count": {
            "title": "Needs Location Count",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total",
          "limit",
          "offset",
          "needs_location_count"
        ],
        "title": "PropertyList",
        "type": "object"
      },
      "PropertyListItem": {
        "description": "A roster row: the listing plus what the list renders beside it without a\nper-row fetch — its primary image (the thumbnail, ``None`` when it has none) and\nthe name of the Agent it is attributed to, its storefront views over the last\n30 days, and its AI Enrichment status (``None`` until it is first queued).",
        "properties": {
          "address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Address"
          },
          "agent_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Id"
          },
          "agent_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Name"
          },
          "ai_status": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/EnrichmentStatus"
              },
              {
                "type": "null"
              }
            ]
          },
          "amenities": {
            "items": {
              "type": "string"
            },
            "title": "Amenities",
            "type": "array"
          },
          "archived": {
            "title": "Archived",
            "type": "boolean"
          },
          "area": {
            "anyOf": [
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Area"
          },
          "areas": {
            "items": {
              "$ref": "#/components/schemas/PropertyAreaOut"
            },
            "title": "Areas",
            "type": "array"
          },
          "bathrooms": {
            "anyOf": [
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bathrooms"
          },
          "bedrooms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bedrooms"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Currency"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "floor": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Floor"
          },
          "hoa_fee": {
            "anyOf": [
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hoa Fee"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "internal_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Internal Ref"
          },
          "is_featured": {
            "title": "Is Featured",
            "type": "boolean"
          },
          "latitude": {
            "anyOf": [
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latitude"
          },
          "listing_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ListingType"
              },
              {
                "type": "null"
              }
            ]
          },
          "location_precision": {
            "$ref": "#/components/schemas/LocationPrecision"
          },
          "longitude": {
            "anyOf": [
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Longitude"
          },
          "lot_area": {
            "anyOf": [
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lot Area"
          },
          "manually_edited": {
            "title": "Manually Edited",
            "type": "boolean"
          },
          "manually_featured": {
            "title": "Manually Featured",
            "type": "boolean"
          },
          "needs_location": {
            "title": "Needs Location",
            "type": "boolean"
          },
          "origin": {
            "$ref": "#/components/schemas/Origin"
          },
          "parking_spaces": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parking Spaces"
          },
          "place": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ListingPlaceOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "place_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Place Code"
          },
          "price": {
            "anyOf": [
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price"
          },
          "price_reduced_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Reduced At"
          },
          "price_reduced_from": {
            "anyOf": [
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Reduced From"
          },
          "primary_image_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Primary Image Url"
          },
          "private_notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Private Notes"
          },
          "property_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Property Type"
          },
          "rent_price": {
            "anyOf": [
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rent Price"
          },
          "slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Slug"
          },
          "source_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Url"
          },
          "syndication_opt_out": {
            "items": {
              "$ref": "#/components/schemas/SyndicationChannelKey"
            },
            "title": "Syndication Opt Out",
            "type": "array"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "tour_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tour Url"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "video_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Url"
          },
          "views_30d": {
            "title": "Views 30D",
            "type": "integer"
          },
          "year_built": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Year Built"
          }
        },
        "required": [
          "id",
          "title",
          "slug",
          "description",
          "price",
          "currency",
          "bedrooms",
          "bathrooms",
          "area",
          "property_type",
          "listing_type",
          "address",
          "latitude",
          "longitude",
          "location_precision",
          "parking_spaces",
          "year_built",
          "floor",
          "lot_area",
          "hoa_fee",
          "rent_price",
          "video_url",
          "tour_url",
          "internal_ref",
          "private_notes",
          "amenities",
          "syndication_opt_out",
          "is_featured",
          "manually_featured",
          "price_reduced_at",
          "price_reduced_from",
          "origin",
          "manually_edited",
          "source_url",
          "place_code",
          "agent_id",
          "archived",
          "created_at",
          "updated_at",
          "place",
          "areas",
          "needs_location",
          "primary_image_url",
          "agent_name",
          "views_30d",
          "ai_status"
        ],
        "title": "PropertyListItem",
        "type": "object"
      },
      "PropertyOut": {
        "description": "The full single-listing shape the console renders and the CRUD routes echo.\nProvenance flags (``origin`` / ``manually_edited`` / ``manually_featured``) and\nthe ``archived`` state (read off ``delisted_at``) are surfaced; the importer's\nidempotency identity (``source_key`` / ``external_id``) is not. ``place`` carries\nthe location strings; ``areas`` every Area the listing is in or was taken out of\n(``via``); ``needs_location`` is set while it has no Place, which keeps it off\nthe Customer Site and Feeds.",
        "properties": {
          "address": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Address"
          },
          "agent_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Id"
          },
          "amenities": {
            "items": {
              "type": "string"
            },
            "title": "Amenities",
            "type": "array"
          },
          "archived": {
            "title": "Archived",
            "type": "boolean"
          },
          "area": {
            "anyOf": [
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Area"
          },
          "areas": {
            "items": {
              "$ref": "#/components/schemas/PropertyAreaOut"
            },
            "title": "Areas",
            "type": "array"
          },
          "bathrooms": {
            "anyOf": [
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bathrooms"
          },
          "bedrooms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bedrooms"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "currency": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Currency"
          },
          "description": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Description"
          },
          "floor": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Floor"
          },
          "hoa_fee": {
            "anyOf": [
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Hoa Fee"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "internal_ref": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Internal Ref"
          },
          "is_featured": {
            "title": "Is Featured",
            "type": "boolean"
          },
          "latitude": {
            "anyOf": [
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latitude"
          },
          "listing_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ListingType"
              },
              {
                "type": "null"
              }
            ]
          },
          "location_precision": {
            "$ref": "#/components/schemas/LocationPrecision"
          },
          "longitude": {
            "anyOf": [
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Longitude"
          },
          "lot_area": {
            "anyOf": [
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Lot Area"
          },
          "manually_edited": {
            "title": "Manually Edited",
            "type": "boolean"
          },
          "manually_featured": {
            "title": "Manually Featured",
            "type": "boolean"
          },
          "needs_location": {
            "title": "Needs Location",
            "type": "boolean"
          },
          "origin": {
            "$ref": "#/components/schemas/Origin"
          },
          "parking_spaces": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Parking Spaces"
          },
          "place": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ListingPlaceOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "place_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Place Code"
          },
          "price": {
            "anyOf": [
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price"
          },
          "price_reduced_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Reduced At"
          },
          "price_reduced_from": {
            "anyOf": [
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Price Reduced From"
          },
          "private_notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Private Notes"
          },
          "property_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Property Type"
          },
          "rent_price": {
            "anyOf": [
              {
                "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rent Price"
          },
          "slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Slug"
          },
          "source_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Url"
          },
          "syndication_opt_out": {
            "items": {
              "$ref": "#/components/schemas/SyndicationChannelKey"
            },
            "title": "Syndication Opt Out",
            "type": "array"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "tour_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tour Url"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "video_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Video Url"
          },
          "year_built": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Year Built"
          }
        },
        "required": [
          "id",
          "title",
          "slug",
          "description",
          "price",
          "currency",
          "bedrooms",
          "bathrooms",
          "area",
          "property_type",
          "listing_type",
          "address",
          "latitude",
          "longitude",
          "location_precision",
          "parking_spaces",
          "year_built",
          "floor",
          "lot_area",
          "hoa_fee",
          "rent_price",
          "video_url",
          "tour_url",
          "internal_ref",
          "private_notes",
          "amenities",
          "syndication_opt_out",
          "is_featured",
          "manually_featured",
          "price_reduced_at",
          "price_reduced_from",
          "origin",
          "manually_edited",
          "source_url",
          "place_code",
          "agent_id",
          "archived",
          "created_at",
          "updated_at",
          "place",
          "areas",
          "needs_location"
        ],
        "title": "PropertyOut",
        "type": "object"
      },
      "PublicActivity": {
        "properties": {
          "assignee_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assignee User Id"
          },
          "body": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Body"
          },
          "completed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "created_by_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Created By User Id"
          },
          "due_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Due At"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/ActivityKind"
          },
          "lead_id": {
            "format": "uuid",
            "title": "Lead Id",
            "type": "string"
          },
          "property_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Property Id"
          },
          "reminder_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Reminder At"
          },
          "title": {
            "title": "Title",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "lead_id",
          "kind",
          "title",
          "body",
          "property_id",
          "assignee_user_id",
          "created_by_user_id",
          "due_at",
          "completed_at",
          "reminder_at",
          "created_at",
          "updated_at"
        ],
        "title": "PublicActivity",
        "type": "object"
      },
      "PublicEvent": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "data": {
            "additionalProperties": true,
            "title": "Data",
            "type": "object"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "type": {
            "enum": [
              "lead.created",
              "lead.updated",
              "lead.status_changed",
              "lead.assigned",
              "lead.scored",
              "lead.archived",
              "inquiry.created",
              "activity.completed"
            ],
            "title": "Type",
            "type": "string"
          },
          "version": {
            "title": "Version",
            "type": "integer"
          }
        },
        "required": [
          "id",
          "type",
          "version",
          "created_at",
          "data"
        ],
        "title": "PublicEvent",
        "type": "object"
      },
      "PublicInquiry": {
        "properties": {
          "agent_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Id"
          },
          "campaign": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Campaign"
          },
          "channel": {
            "$ref": "#/components/schemas/InquiryChannel"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "lead_id": {
            "format": "uuid",
            "title": "Lead Id",
            "type": "string"
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          },
          "notified_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notified At"
          },
          "property_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Property Id"
          },
          "source_detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Detail"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "lead_id",
          "property_id",
          "agent_id",
          "message",
          "source_detail",
          "campaign",
          "channel",
          "notified_at",
          "created_at",
          "updated_at"
        ],
        "title": "PublicInquiry",
        "type": "object"
      },
      "PublicLead": {
        "properties": {
          "assigned_agent_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assigned Agent Id"
          },
          "buyer_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LeadBuyerType"
              },
              {
                "type": "null"
              }
            ]
          },
          "campaign": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Campaign"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "recommended_action": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LeadRecommendedAction"
              },
              {
                "type": "null"
              }
            ]
          },
          "score": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Score"
          },
          "score_reasoning": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Score Reasoning"
          },
          "score_tier": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LeadScoreTier"
              },
              {
                "type": "null"
              }
            ]
          },
          "scored_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scored At"
          },
          "source": {
            "$ref": "#/components/schemas/LeadSource"
          },
          "source_detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Detail"
          },
          "status": {
            "$ref": "#/components/schemas/LeadStatus"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "email",
          "phone",
          "source",
          "source_detail",
          "campaign",
          "status",
          "notes",
          "assigned_agent_id",
          "score",
          "score_tier",
          "buyer_type",
          "recommended_action",
          "score_reasoning",
          "scored_at",
          "is_active",
          "created_at",
          "updated_at"
        ],
        "title": "PublicLead",
        "type": "object"
      },
      "PublicLeadPropertyLink": {
        "properties": {
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "lead_id": {
            "format": "uuid",
            "title": "Lead Id",
            "type": "string"
          },
          "property_id": {
            "format": "uuid",
            "title": "Property Id",
            "type": "string"
          },
          "role": {
            "$ref": "#/components/schemas/LeadPropertyRole"
          },
          "source": {
            "$ref": "#/components/schemas/LeadPropertySource"
          }
        },
        "required": [
          "lead_id",
          "property_id",
          "role",
          "source",
          "created_at"
        ],
        "title": "PublicLeadPropertyLink",
        "type": "object"
      },
      "PublicTenant": {
        "description": "``name`` is the slug for a Tenant onboarded before it had a display name.",
        "properties": {
          "name": {
            "title": "Name",
            "type": "string"
          },
          "slug": {
            "title": "Slug",
            "type": "string"
          }
        },
        "required": [
          "slug",
          "name"
        ],
        "title": "PublicTenant",
        "type": "object"
      },
      "ResolvedProperty": {
        "description": "A slug lookup through the redirect map (ADR-0016). ``is_canonical`` is true\nwhen the requested slug is the listing's current one (serve the page); false when\nit resolved via a redirect (the caller 301s to ``canonical_slug``).",
        "properties": {
          "canonical_slug": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Canonical Slug"
          },
          "is_canonical": {
            "title": "Is Canonical",
            "type": "boolean"
          },
          "property": {
            "$ref": "#/components/schemas/PropertyOut"
          },
          "requested_slug": {
            "title": "Requested Slug",
            "type": "string"
          }
        },
        "required": [
          "property",
          "requested_slug",
          "canonical_slug",
          "is_canonical"
        ],
        "title": "ResolvedProperty",
        "type": "object"
      },
      "SyndicationChannelKey": {
        "description": "A third-party portal a Tenant can publish its listings to.",
        "enum": [
          "meta_catalog",
          "luxuryestate",
          "encuentra24"
        ],
        "title": "SyndicationChannelKey",
        "type": "string"
      },
      "ValidationError": {
        "properties": {
          "ctx": {
            "title": "Context",
            "type": "object"
          },
          "input": {
            "title": "Input"
          },
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "title": "Location",
            "type": "array"
          },
          "msg": {
            "title": "Message",
            "type": "string"
          },
          "type": {
            "title": "Error Type",
            "type": "string"
          }
        },
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError",
        "type": "object"
      },
      "WebhookActivity": {
        "properties": {
          "assignee_user_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assignee User Id"
          },
          "body": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Body"
          },
          "completed_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "due_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Due At"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "kind": {
            "$ref": "#/components/schemas/ActivityKind"
          },
          "lead_id": {
            "format": "uuid",
            "title": "Lead Id",
            "type": "string"
          },
          "property_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Property Id"
          },
          "title": {
            "title": "Title",
            "type": "string"
          }
        },
        "required": [
          "id",
          "lead_id",
          "kind",
          "title",
          "body",
          "property_id",
          "assignee_user_id",
          "due_at",
          "completed_at"
        ],
        "title": "WebhookActivity",
        "type": "object"
      },
      "WebhookApiKeyOut": {
        "properties": {
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "name": {
            "title": "Name",
            "type": "string"
          }
        },
        "required": [
          "id",
          "name"
        ],
        "title": "WebhookApiKeyOut",
        "type": "object"
      },
      "WebhookDeliveryList": {
        "properties": {
          "items": {
            "items": {
              "$ref": "#/components/schemas/WebhookDeliveryOut"
            },
            "title": "Items",
            "type": "array"
          },
          "limit": {
            "title": "Limit",
            "type": "integer"
          },
          "offset": {
            "title": "Offset",
            "type": "integer"
          },
          "total": {
            "title": "Total",
            "type": "integer"
          }
        },
        "required": [
          "items",
          "total",
          "limit",
          "offset"
        ],
        "title": "WebhookDeliveryList",
        "type": "object"
      },
      "WebhookDeliveryOut": {
        "description": "One event bound for the endpoint. ``next_attempt_at`` is set while it is still\nto be sent or retried; ``delivered_at`` once the endpoint answered 2xx.",
        "properties": {
          "attempt": {
            "title": "Attempt",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "delivered_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivered At"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "event": {
            "title": "Event",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "next_attempt_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Attempt At"
          },
          "payload": {
            "additionalProperties": true,
            "title": "Payload",
            "type": "object"
          },
          "status_code": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Status Code"
          }
        },
        "required": [
          "id",
          "event",
          "payload",
          "attempt",
          "status_code",
          "error",
          "next_attempt_at",
          "delivered_at",
          "created_at"
        ],
        "title": "WebhookDeliveryOut",
        "type": "object"
      },
      "WebhookEndpointCreated": {
        "description": "The only response that carries the signing ``secret`` besides a rotate.",
        "properties": {
          "consecutive_failures": {
            "title": "Consecutive Failures",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "created_by_api_key": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WebhookApiKeyOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "disabled_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Disabled At"
          },
          "enabled": {
            "title": "Enabled",
            "type": "boolean"
          },
          "events": {
            "items": {
              "type": "string"
            },
            "title": "Events",
            "type": "array"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "secret": {
            "title": "Secret",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "url": {
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "id",
          "url",
          "events",
          "enabled",
          "consecutive_failures",
          "disabled_at",
          "created_at",
          "updated_at",
          "secret"
        ],
        "title": "WebhookEndpointCreated",
        "type": "object"
      },
      "WebhookEndpointIn": {
        "properties": {
          "enabled": {
            "default": true,
            "title": "Enabled",
            "type": "boolean"
          },
          "events": {
            "items": {
              "enum": [
                "lead.created",
                "lead.updated",
                "lead.status_changed",
                "lead.assigned",
                "lead.scored",
                "lead.archived",
                "inquiry.created",
                "activity.completed"
              ],
              "type": "string"
            },
            "minItems": 1,
            "title": "Events",
            "type": "array"
          },
          "url": {
            "maxLength": 2048,
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "url",
          "events"
        ],
        "title": "WebhookEndpointIn",
        "type": "object"
      },
      "WebhookEndpointOut": {
        "description": "``consecutive_failures`` counts failed attempts in a row; at 20 the endpoint is\ndisabled (``enabled`` false, ``disabled_at`` set) and the tenant admins are emailed.\n``created_by_api_key`` is the API Key that created the endpoint, if one did.",
        "properties": {
          "consecutive_failures": {
            "title": "Consecutive Failures",
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "created_by_api_key": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WebhookApiKeyOut"
              },
              {
                "type": "null"
              }
            ]
          },
          "disabled_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Disabled At"
          },
          "enabled": {
            "title": "Enabled",
            "type": "boolean"
          },
          "events": {
            "items": {
              "type": "string"
            },
            "title": "Events",
            "type": "array"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "updated_at": {
            "format": "date-time",
            "title": "Updated At",
            "type": "string"
          },
          "url": {
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "id",
          "url",
          "events",
          "enabled",
          "consecutive_failures",
          "disabled_at",
          "created_at",
          "updated_at"
        ],
        "title": "WebhookEndpointOut",
        "type": "object"
      },
      "WebhookEndpointPatch": {
        "description": "Only the fields present change. Enabling an endpoint clears its failure streak.",
        "properties": {
          "enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Enabled"
          },
          "events": {
            "anyOf": [
              {
                "items": {
                  "enum": [
                    "lead.created",
                    "lead.updated",
                    "lead.status_changed",
                    "lead.assigned",
                    "lead.scored",
                    "lead.archived",
                    "inquiry.created",
                    "activity.completed"
                  ],
                  "type": "string"
                },
                "minItems": 1,
                "type": "array"
              },
              {
                "type": "null"
              }
            ],
            "title": "Events"
          },
          "url": {
            "anyOf": [
              {
                "maxLength": 2048,
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Url"
          }
        },
        "title": "WebhookEndpointPatch",
        "type": "object"
      },
      "WebhookInquiry": {
        "properties": {
          "agent_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Id"
          },
          "campaign": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Campaign"
          },
          "channel": {
            "$ref": "#/components/schemas/InquiryChannel"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "lead": {
            "$ref": "#/components/schemas/WebhookLead"
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Message"
          },
          "property_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Property Id"
          },
          "source_detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Detail"
          }
        },
        "required": [
          "id",
          "message",
          "property_id",
          "agent_id",
          "source_detail",
          "campaign",
          "channel",
          "created_at",
          "lead"
        ],
        "title": "WebhookInquiry",
        "type": "object"
      },
      "WebhookLead": {
        "properties": {
          "assigned_agent_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assigned Agent Id"
          },
          "buyer_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LeadBuyerType"
              },
              {
                "type": "null"
              }
            ]
          },
          "campaign": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Campaign"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "recommended_action": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LeadRecommendedAction"
              },
              {
                "type": "null"
              }
            ]
          },
          "score": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Score"
          },
          "score_reasoning": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Score Reasoning"
          },
          "score_tier": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LeadScoreTier"
              },
              {
                "type": "null"
              }
            ]
          },
          "scored_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scored At"
          },
          "source": {
            "$ref": "#/components/schemas/LeadSource"
          },
          "source_detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Detail"
          },
          "status": {
            "$ref": "#/components/schemas/LeadStatus"
          }
        },
        "required": [
          "id",
          "name",
          "email",
          "phone",
          "source",
          "source_detail",
          "campaign",
          "status",
          "assigned_agent_id",
          "score",
          "score_tier",
          "buyer_type",
          "recommended_action",
          "score_reasoning",
          "scored_at",
          "is_active",
          "created_at"
        ],
        "title": "WebhookLead",
        "type": "object"
      },
      "WebhookLeadAssigned": {
        "properties": {
          "assigned_agent_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assigned Agent Id"
          },
          "buyer_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LeadBuyerType"
              },
              {
                "type": "null"
              }
            ]
          },
          "campaign": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Campaign"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "previous_assigned_agent_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Previous Assigned Agent Id"
          },
          "recommended_action": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LeadRecommendedAction"
              },
              {
                "type": "null"
              }
            ]
          },
          "score": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Score"
          },
          "score_reasoning": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Score Reasoning"
          },
          "score_tier": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LeadScoreTier"
              },
              {
                "type": "null"
              }
            ]
          },
          "scored_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scored At"
          },
          "source": {
            "$ref": "#/components/schemas/LeadSource"
          },
          "source_detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Detail"
          },
          "status": {
            "$ref": "#/components/schemas/LeadStatus"
          }
        },
        "required": [
          "id",
          "name",
          "email",
          "phone",
          "source",
          "source_detail",
          "campaign",
          "status",
          "assigned_agent_id",
          "score",
          "score_tier",
          "buyer_type",
          "recommended_action",
          "score_reasoning",
          "scored_at",
          "is_active",
          "created_at",
          "previous_assigned_agent_id"
        ],
        "title": "WebhookLeadAssigned",
        "type": "object"
      },
      "WebhookLeadStatusChanged": {
        "properties": {
          "assigned_agent_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assigned Agent Id"
          },
          "buyer_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LeadBuyerType"
              },
              {
                "type": "null"
              }
            ]
          },
          "campaign": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Campaign"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "previous_status": {
            "$ref": "#/components/schemas/LeadStatus"
          },
          "recommended_action": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LeadRecommendedAction"
              },
              {
                "type": "null"
              }
            ]
          },
          "score": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Score"
          },
          "score_reasoning": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Score Reasoning"
          },
          "score_tier": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LeadScoreTier"
              },
              {
                "type": "null"
              }
            ]
          },
          "scored_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scored At"
          },
          "source": {
            "$ref": "#/components/schemas/LeadSource"
          },
          "source_detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Detail"
          },
          "status": {
            "$ref": "#/components/schemas/LeadStatus"
          }
        },
        "required": [
          "id",
          "name",
          "email",
          "phone",
          "source",
          "source_detail",
          "campaign",
          "status",
          "assigned_agent_id",
          "score",
          "score_tier",
          "buyer_type",
          "recommended_action",
          "score_reasoning",
          "scored_at",
          "is_active",
          "created_at",
          "previous_status"
        ],
        "title": "WebhookLeadStatusChanged",
        "type": "object"
      },
      "WebhookLeadUpdated": {
        "properties": {
          "assigned_agent_id": {
            "anyOf": [
              {
                "format": "uuid",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assigned Agent Id"
          },
          "buyer_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LeadBuyerType"
              },
              {
                "type": "null"
              }
            ]
          },
          "campaign": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Campaign"
          },
          "changed_fields": {
            "description": "The Lead fields this edit changed.",
            "items": {
              "type": "string"
            },
            "title": "Changed Fields",
            "type": "array"
          },
          "created_at": {
            "format": "date-time",
            "title": "Created At",
            "type": "string"
          },
          "email": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Email"
          },
          "id": {
            "format": "uuid",
            "title": "Id",
            "type": "string"
          },
          "is_active": {
            "title": "Is Active",
            "type": "boolean"
          },
          "name": {
            "title": "Name",
            "type": "string"
          },
          "phone": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Phone"
          },
          "recommended_action": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LeadRecommendedAction"
              },
              {
                "type": "null"
              }
            ]
          },
          "score": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Score"
          },
          "score_reasoning": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Score Reasoning"
          },
          "score_tier": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/LeadScoreTier"
              },
              {
                "type": "null"
              }
            ]
          },
          "scored_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Scored At"
          },
          "source": {
            "$ref": "#/components/schemas/LeadSource"
          },
          "source_detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Source Detail"
          },
          "status": {
            "$ref": "#/components/schemas/LeadStatus"
          }
        },
        "required": [
          "id",
          "name",
          "email",
          "phone",
          "source",
          "source_detail",
          "campaign",
          "status",
          "assigned_agent_id",
          "score",
          "score_tier",
          "buyer_type",
          "recommended_action",
          "score_reasoning",
          "scored_at",
          "is_active",
          "created_at",
          "changed_fields"
        ],
        "title": "WebhookLeadUpdated",
        "type": "object"
      },
      "WebhookPing": {
        "properties": {
          "endpoint_id": {
            "format": "uuid",
            "title": "Endpoint Id",
            "type": "string"
          }
        },
        "required": [
          "endpoint_id"
        ],
        "title": "WebhookPing",
        "type": "object"
      },
      "WebhookSecretOut": {
        "properties": {
          "secret": {
            "title": "Secret",
            "type": "string"
          }
        },
        "required": [
          "secret"
        ],
        "title": "WebhookSecretOut",
        "type": "object"
      },
      "WebhookSubscriptionIn": {
        "properties": {
          "events": {
            "items": {
              "enum": [
                "lead.created",
                "lead.updated",
                "lead.status_changed",
                "lead.assigned",
                "lead.scored",
                "lead.archived",
                "inquiry.created",
                "activity.completed"
              ],
              "type": "string"
            },
            "minItems": 1,
            "title": "Events",
            "type": "array"
          },
          "url": {
            "maxLength": 2048,
            "title": "Url",
            "type": "string"
          }
        },
        "required": [
          "url",
          "events"
        ],
        "title": "WebhookSubscriptionIn",
        "type": "object"
      },
      "WebhookTenant": {
        "properties": {
          "slug": {
            "title": "Slug",
            "type": "string"
          }
        },
        "required": [
          "slug"
        ],
        "title": "WebhookTenant",
        "type": "object"
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "description": "An API Key, `lr_live_…`, created by a Tenant Admin.",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "Leads, Inquiries, Activities and webhooks for a letsrealty Tenant, called with an API Key. Changes inside `/v1` are additive only. Guides: https://www.letsrealty.io/en/developers",
    "title": "letsrealty Public API",
    "version": "1"
  },
  "openapi": "3.1.0",
  "paths": {
    "/v1/activities": {
      "get": {
        "description": "Activities across every Lead, soonest due first. ``overdue`` is open and due\nbefore now; ``today`` is the current UTC day; ``week`` is today plus six days.\n\nAn API Key gets a cursor page of every ``PublicActivity`` in change order instead,\nnarrowed by ``updated_since``; the console filters don't apply to it.",
        "operationId": "list_activities",
        "parameters": [
          {
            "description": "`me` or a User id",
            "in": "query",
            "name": "assignee",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "`me` or a User id",
              "title": "Assignee"
            }
          },
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "open",
                    "completed"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "in": "query",
            "name": "due",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "overdue",
                    "today",
                    "week"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Due"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "description": "For an API Key: the `next_cursor` of the previous page.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "For an API Key: the `next_cursor` of the previous page.",
              "title": "Cursor"
            }
          },
          {
            "description": "For an API Key: only what changed at or after this time.",
            "in": "query",
            "name": "updated_since",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "For an API Key: only what changed at or after this time.",
              "title": "Updated Since"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_PublicActivity_"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "List Activities",
        "tags": [
          "Activities"
        ]
      }
    },
    "/v1/activities/{activity_id}": {
      "delete": {
        "description": "Delete an activity — its creator or a ``tenant_admin`` only.",
        "operationId": "delete_activity",
        "parameters": [
          {
            "in": "path",
            "name": "activity_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Activity Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "Delete Activity",
        "tags": [
          "Activities"
        ]
      },
      "patch": {
        "description": "Edit an activity and/or complete or reopen it. Only the fields present change.",
        "operationId": "update_activity",
        "parameters": [
          {
            "in": "path",
            "name": "activity_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Activity Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActivityUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicActivity"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "Update Activity",
        "tags": [
          "Activities"
        ]
      }
    },
    "/v1/events": {
      "get": {
        "description": "Events oldest first. 403 when ``type`` is an event the key can't read; 422 for a\n``since`` that is neither a time nor an event of the last 30 days.",
        "operationId": "list_events",
        "parameters": [
          {
            "description": "An ISO 8601 time with an offset, or the `id` of the last event seen.",
            "in": "query",
            "name": "since",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "An ISO 8601 time with an offset, or the `id` of the last event seen.",
              "title": "Since"
            }
          },
          {
            "in": "query",
            "name": "type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "enum": [
                    "lead.created",
                    "lead.updated",
                    "lead.status_changed",
                    "lead.assigned",
                    "lead.scored",
                    "lead.archived",
                    "inquiry.created",
                    "activity.completed"
                  ],
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Type"
            }
          },
          {
            "description": "The `next_cursor` of the last page.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "The `next_cursor` of the last page.",
              "title": "Cursor"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_PublicEvent_"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "List Events",
        "tags": [
          "Events"
        ]
      }
    },
    "/v1/inquiries": {
      "get": {
        "description": "Inquiries least recently updated first, a cursor page at a time, optionally of\none Lead or about one Property.",
        "operationId": "list_inquiries",
        "parameters": [
          {
            "in": "query",
            "name": "lead_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Lead Id"
            }
          },
          {
            "in": "query",
            "name": "property_id",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Property Id"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "description": "For an API Key: the `next_cursor` of the previous page.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "For an API Key: the `next_cursor` of the previous page.",
              "title": "Cursor"
            }
          },
          {
            "description": "For an API Key: only what changed at or after this time.",
            "in": "query",
            "name": "updated_since",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "For an API Key: only what changed at or after this time.",
              "title": "Updated Since"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_PublicInquiry_"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "List Inquiries",
        "tags": [
          "Inquiries"
        ]
      }
    },
    "/v1/inquiries/{inquiry_id}": {
      "get": {
        "description": "One Inquiry. 404 if it isn't in this schema.",
        "operationId": "get_inquiry",
        "parameters": [
          {
            "in": "path",
            "name": "inquiry_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Inquiry Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicInquiry"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "Get Inquiry",
        "tags": [
          "Inquiries"
        ]
      }
    },
    "/v1/leads": {
      "get": {
        "description": "A filtered, paginated page of the flat pipeline (newest first) plus the total.\n``status`` (repeatable) narrows to those stages, ``q`` matches name/email/phone,\n``role`` keeps Leads linked to some Property in that role (``owner`` → Owners),\n``owner`` (repeatable, any of them) keeps the acting User's Leads (``me``, none\nwithout a linked Agent), the Unassigned ones, or one Agent's; ``tier`` (repeatable)\nkeeps Leads scored in those tiers; ``sort=score`` orders by score, highest first and\nthe Unscored last; each row carries its\n``inquiry_count`` + ``last_inquiry_at`` (aggregated in the query, no N+1), the\n``next_activity_due_at`` of its soonest open activity and its owner. Reads are\npipeline-wide for both roles — an ``agent`` sees every Lead. Archived Leads show\nwith ``include_archived`` (or ``include_inactive``).\n\nAn API Key gets a cursor page of ``PublicLead`` in change order instead, narrowed by\n``updated_since``; ``sort`` and ``offset`` don't apply to it.",
        "operationId": "list_leads",
        "parameters": [
          {
            "in": "query",
            "name": "status",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "items": {
                    "$ref": "#/components/schemas/LeadStatus"
                  },
                  "type": "array"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          },
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 255,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "in": "query",
            "name": "role",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/LeadPropertyRole"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Role"
            }
          },
          {
            "in": "query",
            "name": "owner",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "items": {
                    "anyOf": [
                      {
                        "enum": [
                          "me",
                          "unassigned"
                        ],
                        "type": "string"
                      },
                      {
                        "format": "uuid",
                        "type": "string"
                      }
                    ]
                  },
                  "type": "array"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Owner"
            }
          },
          {
            "in": "query",
            "name": "tier",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "items": {
                    "$ref": "#/components/schemas/LeadScoreTier"
                  },
                  "type": "array"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Tier"
            }
          },
          {
            "in": "query",
            "name": "include_inactive",
            "required": false,
            "schema": {
              "default": false,
              "title": "Include Inactive",
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "include_archived",
            "required": false,
            "schema": {
              "default": false,
              "title": "Include Archived",
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "default": "newest",
              "enum": [
                "newest",
                "score"
              ],
              "title": "Sort",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          },
          {
            "description": "For an API Key: the `next_cursor` of the previous page.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "For an API Key: the `next_cursor` of the previous page.",
              "title": "Cursor"
            }
          },
          {
            "description": "For an API Key: only what changed at or after this time.",
            "in": "query",
            "name": "updated_since",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "For an API Key: only what changed at or after this time.",
              "title": "Updated Since"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_PublicLead_"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "List Leads",
        "tags": [
          "Leads"
        ]
      },
      "post": {
        "description": "Add a manual (walk-in) Lead. ``source`` is ``manual``; a repeat email — or the\nsame phone in any format, under the Tenant's Default country — dedups onto the\nexisting Lead (returning it **untouched**, no duplicate row and no overwrite of its\nnotes or owner; a phone match only fills an empty email). No Inquiry is created (a\nwalk-in has no web inquiry). Open to both roles; an explicit owner follows the claim\nrules for an Unassigned Lead (403/422).",
        "operationId": "create_lead",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LeadManualCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicLead"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "Create Lead",
        "tags": [
          "Leads"
        ]
      }
    },
    "/v1/leads/{lead_id}": {
      "delete": {
        "description": "Archive a Lead: it leaves the pipeline but is kept, with its history. Archiving\nan archived Lead changes nothing. There is no hard delete.",
        "operationId": "archive_lead",
        "parameters": [
          {
            "in": "path",
            "name": "lead_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Lead Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "Archive Lead",
        "tags": [
          "Leads"
        ]
      },
      "get": {
        "description": "A single Lead in full — contact + notes, its inquiries (with resolved target\nlabels), its survey and owner report history (no tokens) and the Leads still flagged\nas its possible duplicates. 404 if the Lead isn't in this schema. An API Key gets\nthe ``PublicLead``; its Inquiries are at ``GET /v1/inquiries?lead_id=``.",
        "operationId": "get_lead",
        "parameters": [
          {
            "in": "path",
            "name": "lead_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Lead Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicLead"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "Get Lead",
        "tags": [
          "Leads"
        ]
      },
      "patch": {
        "description": "Work a Lead: move its ``status`` through the pipeline, edit its ``notes`` and/or\nchange its owner. Only the fields present in the body change; a status move logs a\nnote activity. Status and notes are open to both roles; an owner change follows the\nclaim/release rules (403 otherwise, 422 for an unknown or inactive Agent).",
        "operationId": "update_lead",
        "parameters": [
          {
            "in": "path",
            "name": "lead_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Lead Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LeadUpdate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicLead"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "Update Lead",
        "tags": [
          "Leads"
        ]
      }
    },
    "/v1/leads/{lead_id}/activities": {
      "get": {
        "description": "A Lead's timeline, newest first: its activities plus its inquiries, survey and\nowner report events as read-only items. An API Key gets a cursor page of the Lead's\n``PublicActivity`` in change order instead.",
        "operationId": "lead_timeline",
        "parameters": [
          {
            "in": "path",
            "name": "lead_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Lead Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "description": "For an API Key: the `next_cursor` of the previous page.",
            "in": "query",
            "name": "cursor",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "For an API Key: the `next_cursor` of the previous page.",
              "title": "Cursor"
            }
          },
          {
            "description": "For an API Key: only what changed at or after this time.",
            "in": "query",
            "name": "updated_since",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "date-time",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "For an API Key: only what changed at or after this time.",
              "title": "Updated Since"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_PublicActivity_"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "Lead Timeline",
        "tags": [
          "Leads"
        ]
      },
      "post": {
        "description": "Log an activity on a Lead, created by the calling User (none for an API Key).",
        "operationId": "create_activity",
        "parameters": [
          {
            "in": "path",
            "name": "lead_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Lead Id",
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActivityCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicActivity"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "Create Activity",
        "tags": [
          "Leads"
        ]
      }
    },
    "/v1/leads/{lead_id}/criteria": {
      "get": {
        "description": "The Lead's criteria — all empty when none are saved. 404 if the Lead is\nunknown.",
        "operationId": "get_lead_criteria",
        "parameters": [
          {
            "in": "path",
            "name": "lead_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Lead Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadCriteriaOut"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "Get Lead Criteria",
        "tags": [
          "Leads"
        ]
      },
      "put": {
        "description": "Replace the Lead's criteria. 404 if the Lead is unknown; 422 naming any unknown\nPlace, Area or amenity, or a price range without a currency.",
        "operationId": "put_lead_criteria",
        "parameters": [
          {
            "in": "path",
            "name": "lead_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Lead Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LeadCriteriaIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadCriteriaOut"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "Put Lead Criteria",
        "tags": [
          "Leads"
        ]
      }
    },
    "/v1/leads/{lead_id}/matches": {
      "get": {
        "description": "Live listings meeting the Lead's criteria — newest first, then closest to the\nmiddle of the price range — each with the criteria it met. Listings the Lead is\nalready interested in (inquired about or sent) are left out unless\n``include_sent``. Empty when the Lead has no criteria; 404 if it is unknown.",
        "operationId": "list_lead_matches",
        "parameters": [
          {
            "in": "path",
            "name": "lead_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Lead Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "include_sent",
            "required": false,
            "schema": {
              "default": false,
              "title": "Include Sent",
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/LeadMatchOut"
                  },
                  "title": "Response List Lead Matches V1 Leads  Lead Id  Matches Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "List Lead Matches",
        "tags": [
          "Leads"
        ]
      }
    },
    "/v1/leads/{lead_id}/matches/sent": {
      "post": {
        "description": "Record that these listings were sent to the Lead over ``channel``: each is\nlinked as ``interested`` (source ``match``; an existing link is kept as is) and one\nnote is logged, e.g. \"Sent 3 matches by WhatsApp\". By ``email`` the listings are\nmailed to the Lead here, and nothing is recorded unless the email goes: 422 for a\nLead without an email, 503 when email or the Customer Site is unconfigured or\ndelivery fails. 404 if the Lead or any listing is unknown.",
        "operationId": "record_matches_sent",
        "parameters": [
          {
            "in": "path",
            "name": "lead_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Lead Id",
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MatchesSent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/LeadPropertyOut"
                  },
                  "title": "Response Record Matches Sent V1 Leads  Lead Id  Matches Sent Post",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "Record Matches Sent",
        "tags": [
          "Leads"
        ]
      }
    },
    "/v1/leads/{lead_id}/matches/site": {
      "get": {
        "description": "The Customer Site origin and locale a send to this Lead links to — the language\nthe Lead was last surveyed in when the Tenant still serves it, else the Tenant's\ndefault. 404 if the Lead is unknown.",
        "operationId": "get_match_site",
        "parameters": [
          {
            "in": "path",
            "name": "lead_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Lead Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MatchSiteOut"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "Get Match Site",
        "tags": [
          "Leads"
        ]
      }
    },
    "/v1/leads/{lead_id}/properties": {
      "get": {
        "description": "The Lead's property links, oldest first. 404 if the Lead is unknown.",
        "operationId": "list_lead_properties",
        "parameters": [
          {
            "in": "path",
            "name": "lead_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Lead Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PublicLeadPropertyLink"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "List Lead Properties",
        "tags": [
          "Leads"
        ]
      },
      "post": {
        "description": "Link the Lead to a Property with a role (source ``manual``). 201 when created;\n200 with the existing link, untouched, when it already exists. 404 if the Lead or\nProperty is unknown.",
        "operationId": "link_lead_property",
        "parameters": [
          {
            "in": "path",
            "name": "lead_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Lead Id",
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LeadPropertyCreate"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicLeadPropertyLink"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicLeadPropertyLink"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "Link Lead Property",
        "tags": [
          "Leads"
        ]
      }
    },
    "/v1/leads/{lead_id}/properties/{property_id}": {
      "delete": {
        "description": "Remove the Lead's ``role`` link to the Property. 404 if the Lead or the link is\nunknown.",
        "operationId": "unlink_lead_property",
        "parameters": [
          {
            "in": "path",
            "name": "lead_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Lead Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "property_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Property Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "role",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/LeadPropertyRole"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "Unlink Lead Property",
        "tags": [
          "Leads"
        ]
      }
    },
    "/v1/leads:ingest": {
      "post": {
        "description": "Push a Lead in: dedup on email then phone, record the Inquiry (or the note),\nset the Lead Owner, notify and score it, as a Customer Site inquiry does. **201**\nwhen the Lead is new, **200** when it matched one. An unmatched Property or Agent\nreference still records the Inquiry, with a warning. An ``occurred_at`` more than\n24 hours ago records it at that time without notifying, scoring or assigning.",
        "operationId": "ingest_lead",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LeadIngestIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadIngestOut"
                }
              }
            },
            "description": "Matched an existing Lead",
            "headers": {
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LeadIngestOut"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "Ingest Lead",
        "tags": [
          "Leads"
        ]
      }
    },
    "/v1/properties": {
      "get": {
        "description": "A filtered, sorted (newest first by default), paginated page of the Tenant's\nlistings plus the total. Archived (delisted) listings are hidden unless\n``include_archived``. ``place`` keeps listings on that Place or beneath it,\n``area`` the Area's members, ``needs_location`` those without a Place. Reads are\ntenant-wide for both roles — the console shows the whole roster — so an agent\nsees every listing but may only *write* their own.",
        "operationId": "list_properties",
        "parameters": [
          {
            "in": "query",
            "name": "q",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 255,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Q"
            }
          },
          {
            "in": "query",
            "name": "listing_type",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/ListingType"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Listing Type"
            }
          },
          {
            "in": "query",
            "name": "is_featured",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Is Featured"
            }
          },
          {
            "in": "query",
            "name": "include_archived",
            "required": false,
            "schema": {
              "default": false,
              "title": "Include Archived",
              "type": "boolean"
            }
          },
          {
            "in": "query",
            "name": "needs_location",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "boolean"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Needs Location"
            }
          },
          {
            "in": "query",
            "name": "place",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "maxLength": 32,
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Place"
            }
          },
          {
            "in": "query",
            "name": "area",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "format": "uuid",
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Area"
            }
          },
          {
            "in": "query",
            "name": "sort",
            "required": false,
            "schema": {
              "default": "newest",
              "enum": [
                "newest",
                "updated",
                "price_asc",
                "price_desc",
                "title",
                "most_viewed"
              ],
              "title": "Sort",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 20,
              "maximum": 100,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PropertyList"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "List Properties",
        "tags": [
          "Properties"
        ]
      }
    },
    "/v1/properties/by-slug/{slug}": {
      "get": {
        "description": "Resolve a slug through the redirect map (ADR-0016): the current slug serves the\nlisting; a retired slug still resolves — with ``is_canonical`` false — so the\ncaller 301s to the current URL rather than 404ing a link that used to work.",
        "operationId": "resolve_property",
        "parameters": [
          {
            "in": "path",
            "name": "slug",
            "required": true,
            "schema": {
              "title": "Slug",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResolvedProperty"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "Resolve Property",
        "tags": [
          "Properties"
        ]
      }
    },
    "/v1/properties/{property_id}": {
      "get": {
        "description": "A single listing by id, or 404.",
        "operationId": "get_property",
        "parameters": [
          {
            "in": "path",
            "name": "property_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Property Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PropertyOut"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "Get Property",
        "tags": [
          "Properties"
        ]
      }
    },
    "/v1/properties/{property_id}/leads": {
      "get": {
        "description": "The Property's linked Leads, oldest first — every role, or just ``role`` (e.g.\nits owners). 404 if the Property is unknown.",
        "operationId": "list_property_leads",
        "parameters": [
          {
            "in": "path",
            "name": "property_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Property Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "role",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/LeadPropertyRole"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Role"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/PublicLeadPropertyLink"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "List Property Leads",
        "tags": [
          "Properties"
        ]
      }
    },
    "/v1/properties/{property_id}/matching-leads": {
      "get": {
        "description": "Active Leads whose criteria this listing meets, most recently updated criteria\nfirst — none for an archived listing. 404 if the Property is unknown.",
        "operationId": "list_matching_leads",
        "parameters": [
          {
            "in": "path",
            "name": "property_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Property Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/MatchingLeadOut"
                  },
                  "title": "Response List Matching Leads V1 Properties  Property Id  Matching Leads Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "List Matching Leads",
        "tags": [
          "Properties"
        ]
      }
    },
    "/v1/tenant": {
      "get": {
        "operationId": "get_tenant",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicTenant"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "Get Tenant",
        "tags": [
          "Tenant"
        ]
      }
    },
    "/v1/webhooks": {
      "get": {
        "operationId": "list_endpoints",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "$ref": "#/components/schemas/WebhookEndpointOut"
                  },
                  "title": "Response List Endpoints V1 Webhooks Get",
                  "type": "array"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "List Endpoints",
        "tags": [
          "Webhooks"
        ]
      },
      "post": {
        "description": "Register an endpoint. 422 unless the URL is https and resolves to public addresses.",
        "operationId": "create_endpoint",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEndpointIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointCreated"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "Create Endpoint",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/v1/webhooks/subscriptions": {
      "post": {
        "description": "Subscribe an endpoint owned by the calling API Key (a REST hook). 422 unless the\nURL is https and resolves to public addresses; 403 without an API Key.",
        "operationId": "subscribe",
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookSubscriptionIn"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointCreated"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "Subscribe",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/v1/webhooks/subscriptions/{endpoint_id}": {
      "delete": {
        "description": "Remove an endpoint the calling API Key subscribed, and its delivery log. 404 for\nany other endpoint.",
        "operationId": "unsubscribe",
        "parameters": [
          {
            "in": "path",
            "name": "endpoint_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Endpoint Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "Unsubscribe",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/v1/webhooks/{endpoint_id}": {
      "delete": {
        "description": "Remove the endpoint and its delivery log.",
        "operationId": "delete_endpoint",
        "parameters": [
          {
            "in": "path",
            "name": "endpoint_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Endpoint Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "Delete Endpoint",
        "tags": [
          "Webhooks"
        ]
      },
      "get": {
        "operationId": "get_endpoint",
        "parameters": [
          {
            "in": "path",
            "name": "endpoint_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Endpoint Id",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointOut"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "Get Endpoint",
        "tags": [
          "Webhooks"
        ]
      },
      "patch": {
        "operationId": "update_endpoint",
        "parameters": [
          {
            "in": "path",
            "name": "endpoint_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Endpoint Id",
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WebhookEndpointPatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointOut"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "Update Endpoint",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/v1/webhooks/{endpoint_id}/deliveries": {
      "get": {
        "description": "The endpoint's delivery log, newest first.",
        "operationId": "list_deliveries",
        "parameters": [
          {
            "in": "path",
            "name": "endpoint_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Endpoint Id",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "default": 50,
              "maximum": 200,
              "minimum": 1,
              "title": "Limit",
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "offset",
            "required": false,
            "schema": {
              "default": 0,
              "minimum": 0,
              "title": "Offset",
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryList"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "List Deliveries",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/v1/webhooks/{endpoint_id}/deliveries/{delivery_id}:redeliver": {
      "post": {
        "description": "Queue the delivery again for the next dispatch, as a new entry in the log that\ncarries the same event (so the same ``webhook-id``) and is retried like any other.\nA disabled endpoint receives it once enabled again.",
        "operationId": "redeliver",
        "parameters": [
          {
            "in": "path",
            "name": "endpoint_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Endpoint Id",
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "delivery_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Delivery Id",
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryOut"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "Redeliver",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/v1/webhooks/{endpoint_id}/rotate-secret": {
      "post": {
        "description": "Replace the signing secret at once; the old one stops verifying immediately.",
        "operationId": "rotate_secret",
        "parameters": [
          {
            "in": "path",
            "name": "endpoint_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Endpoint Id",
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSecretOut"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "Rotate Secret",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "/v1/webhooks/{endpoint_id}/test": {
      "post": {
        "description": "Queue a ``ping`` for the next dispatch (within a minute), even to a disabled\nendpoint; its result shows in the delivery log. A failed ping is not retried and does\nnot count toward disabling the endpoint.",
        "operationId": "send_test_ping",
        "parameters": [
          {
            "in": "path",
            "name": "endpoint_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "title": "Endpoint Id",
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "responses": {
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryOut"
                }
              }
            },
            "description": "Successful Response",
            "headers": {
              "Idempotent-Replayed": {
                "$ref": "#/components/headers/Idempotent-Replayed"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              },
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/X-RateLimit-Limit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/X-RateLimit-Remaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/X-RateLimit-Reset"
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            },
            "description": "Validation Error"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          }
        },
        "summary": "Send Test Ping",
        "tags": [
          "Webhooks"
        ]
      }
    }
  },
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "servers": [
    {
      "url": "https://api.letsrealty.io"
    }
  ],
  "webhooks": {
    "activity.completed": {
      "post": {
        "description": "An Activity was marked done.",
        "operationId": "webhook_activity_completed",
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookId"
          },
          {
            "$ref": "#/components/parameters/WebhookTimestamp"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ActivityCompletedEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Any 2xx within 10 seconds acknowledges the event. Anything else is retried for about three days."
          },
          "410": {
            "description": "Gone: turns the endpoint off."
          }
        },
        "security": [],
        "summary": "activity.completed",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "inquiry.created": {
      "post": {
        "description": "A Lead got in touch: a new Inquiry.",
        "operationId": "webhook_inquiry_created",
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookId"
          },
          {
            "$ref": "#/components/parameters/WebhookTimestamp"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InquiryCreatedEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Any 2xx within 10 seconds acknowledges the event. Anything else is retried for about three days."
          },
          "410": {
            "description": "Gone: turns the endpoint off."
          }
        },
        "security": [],
        "summary": "inquiry.created",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "lead.archived": {
      "post": {
        "description": "A Lead was archived.",
        "operationId": "webhook_lead_archived",
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookId"
          },
          {
            "$ref": "#/components/parameters/WebhookTimestamp"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LeadArchivedEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Any 2xx within 10 seconds acknowledges the event. Anything else is retried for about three days."
          },
          "410": {
            "description": "Gone: turns the endpoint off."
          }
        },
        "security": [],
        "summary": "lead.archived",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "lead.assigned": {
      "post": {
        "description": "A Lead got a new Lead Owner.",
        "operationId": "webhook_lead_assigned",
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookId"
          },
          {
            "$ref": "#/components/parameters/WebhookTimestamp"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LeadAssignedEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Any 2xx within 10 seconds acknowledges the event. Anything else is retried for about three days."
          },
          "410": {
            "description": "Gone: turns the endpoint off."
          }
        },
        "security": [],
        "summary": "lead.assigned",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "lead.created": {
      "post": {
        "description": "A Lead was created, by any capture path.",
        "operationId": "webhook_lead_created",
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookId"
          },
          {
            "$ref": "#/components/parameters/WebhookTimestamp"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LeadCreatedEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Any 2xx within 10 seconds acknowledges the event. Anything else is retried for about three days."
          },
          "410": {
            "description": "Gone: turns the endpoint off."
          }
        },
        "security": [],
        "summary": "lead.created",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "lead.scored": {
      "post": {
        "description": "A Lead was scored by AI.",
        "operationId": "webhook_lead_scored",
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookId"
          },
          {
            "$ref": "#/components/parameters/WebhookTimestamp"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LeadScoredEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Any 2xx within 10 seconds acknowledges the event. Anything else is retried for about three days."
          },
          "410": {
            "description": "Gone: turns the endpoint off."
          }
        },
        "security": [],
        "summary": "lead.scored",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "lead.status_changed": {
      "post": {
        "description": "A Lead moved to a new status.",
        "operationId": "webhook_lead_status_changed",
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookId"
          },
          {
            "$ref": "#/components/parameters/WebhookTimestamp"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LeadStatusChangedEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Any 2xx within 10 seconds acknowledges the event. Anything else is retried for about three days."
          },
          "410": {
            "description": "Gone: turns the endpoint off."
          }
        },
        "security": [],
        "summary": "lead.status_changed",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "lead.updated": {
      "post": {
        "description": "A Lead's contact or pipeline fields changed.",
        "operationId": "webhook_lead_updated",
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookId"
          },
          {
            "$ref": "#/components/parameters/WebhookTimestamp"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LeadUpdatedEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Any 2xx within 10 seconds acknowledges the event. Anything else is retried for about three days."
          },
          "410": {
            "description": "Gone: turns the endpoint off."
          }
        },
        "security": [],
        "summary": "lead.updated",
        "tags": [
          "Webhooks"
        ]
      }
    },
    "ping": {
      "post": {
        "description": "A test sent from the console; never subscribed to.",
        "operationId": "webhook_ping",
        "parameters": [
          {
            "$ref": "#/components/parameters/WebhookId"
          },
          {
            "$ref": "#/components/parameters/WebhookTimestamp"
          },
          {
            "$ref": "#/components/parameters/WebhookSignature"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PingEvent"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Any 2xx within 10 seconds acknowledges the event. Anything else is retried for about three days."
          },
          "410": {
            "description": "Gone: turns the endpoint off."
          }
        },
        "security": [],
        "summary": "ping",
        "tags": [
          "Webhooks"
        ]
      }
    }
  }
}
