{
  "openapi": "3.1.0",
  "info": {
    "title": "Dealport API (V4)",
    "version": "4.0.0",
    "description": "Dealport is the SMB knowledge layer for agents and humans: 28M+ US private companies, the buildings they own, and the human principals behind them, with primary public-filing citations.\n\nTwo ways to buy:\n- API (Pro) - Pay as you go: No subscription; new accounts start with a $5.00 free balance. Searching, market sizing, list matching, and 30-day repeat reads are $0.00; opening a record is $0.01; a Playbook check or monthly Project watch is $0.05; a verified human owner hit is $0.09; deep company research is $0.50; outreach by Avery (Dealport's AI outreach specialist) is $0.02 per email sent; an accepted double-opt-in Warm Yes introduction is $25.00.\n- Enterprise - Dealport runs it for you: Dealport's team runs origination end-to-end (searches, playbooks, custom domains, campaigns, pipeline, CRM sync). Talk to Dealport at https://dealport.com."
  },
  "servers": [
    {
      "url": "https://app.dealport.com/api/v1",
      "description": "Production"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Account",
      "description": "Workspace USD balance, spend caps, key scopes, and health."
    },
    {
      "name": "Companies & Buildings",
      "description": "Free market previews, 28M+ US company search, NYC building search, CSV list matching, and clean website Markdown."
    },
    {
      "name": "Records & Owners",
      "description": "Cited company and building records, primary filing evidence, verified human owners, and deep async company research."
    },
    {
      "name": "Projects & Playbooks",
      "description": "Projects, Playbooks, background playbook runs, annotations, weekly change monitoring, and signed push webhooks."
    },
    {
      "name": "Pipeline & Governance",
      "description": "Avery double-opt-in owner outreach, pipeline stages, touches, workspace corrections, curator fact flags, and exclusions."
    }
  ],
  "paths": {
    "/openapi.json": {
      "get": {
        "tags": [
          "Account"
        ],
        "operationId": "getOpenApiSpec",
        "summary": "Read Dealport OpenAPI 3.1 specification ($0.00)",
        "description": "Publicly returns the Dealport API (V4) OpenAPI 3.1.0 JSON document ($0.00).",
        "security": [],
        "x-price-usd": 0,
        "responses": {
          "200": {
            "description": "OpenAPI 3.1.0 specification document.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/health": {
      "get": {
        "tags": [
          "Account"
        ],
        "operationId": "getHealth",
        "summary": "Service health check ($0.00)",
        "description": "Returns platform and worker readiness status ($0.00, unauthenticated).",
        "security": [],
        "x-price-usd": 0,
        "parameters": [
          {
            "name": "X-Correlation-Id",
            "in": "header",
            "required": false,
            "description": "Optional caller correlation identifier echoed in diagnostics.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Platform is healthy.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "status",
                    "environment",
                    "release_sha"
                  ],
                  "properties": {
                    "status": {
                      "type": "string",
                      "enum": [
                        "ready",
                        "degraded"
                      ]
                    },
                    "environment": {
                      "type": "string"
                    },
                    "release_sha": {
                      "type": "string"
                    },
                    "worker": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "additionalProperties": true
                }
              }
            }
          },
          "503": {
            "description": "Platform or backing store is unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        }
      }
    },
    "/balance": {
      "get": {
        "tags": [
          "Account"
        ],
        "operationId": "getBalance",
        "summary": "Read workspace USD balance, spend caps, key scopes, and rates ($0.00)",
        "description": "Returns available USD balance, workspace and API key monthly spend caps, granted key scopes, and per-action USD rates ($0.00).",
        "x-price-usd": 0,
        "x-dealport-scope": "read",
        "responses": {
          "200": {
            "description": "Workspace balance and action rates.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BalanceEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/companies/preview": {
      "get": {
        "tags": [
          "Companies & Buildings"
        ],
        "operationId": "previewCompaniesGet",
        "summary": "Size a company market via query filters ($0.00)",
        "description": "Runs a free ($0.00) read-only market sizing count and returns up to 5 sample companies matching the buy-box query parameters.",
        "x-price-usd": 0,
        "x-dealport-scope": "read",
        "parameters": [
          {
            "name": "q",
            "in": "query",
            "description": "Company name prefix filter.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "description": "Two-letter US state code (e.g. OH, TX, FL).",
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 2
            }
          },
          {
            "name": "counties",
            "in": "query",
            "description": "Comma-separated county names within state.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cities",
            "in": "query",
            "description": "Comma-separated city names within state.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "markets",
            "in": "query",
            "description": "Additional state/county markets (e.g. IN|MI:Wayne,Oakland).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "domain",
            "in": "query",
            "description": "Company website host or registrable domain.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "naics",
            "in": "query",
            "description": "Comma-separated 2-to-6 digit NAICS codes (e.g. 238220,332710).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "min_revenue",
            "in": "query",
            "description": "Minimum annual revenue in USD.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "max_revenue",
            "in": "query",
            "description": "Maximum annual revenue in USD.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "filed_revenue_only",
            "in": "query",
            "description": "Restrict to primary filed revenue (CMS cost reports or PPP filings).",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "min_employees",
            "in": "query",
            "description": "Minimum headcount.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "max_employees",
            "in": "query",
            "description": "Maximum headcount.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "size_unknown",
            "in": "query",
            "description": "Include companies without reported size alongside sized matches.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "independent",
            "in": "query",
            "description": "Exclude SEC filers, nonprofits, government bodies, membership groups, and HOAs.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "owner_businesses",
            "in": "query",
            "description": "Minimum number of businesses associated with the same owner (2..25).",
            "schema": {
              "type": "integer",
              "minimum": 2,
              "maximum": 25
            }
          },
          {
            "name": "medicare",
            "in": "query",
            "description": "Require Medicare enrollment (CMS certification number).",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "owner_operated",
            "in": "query",
            "description": "Require owner-operated status in CMS filings.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "owner_contact",
            "in": "query",
            "description": "Require an owner phone or email already on file.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "licensed",
            "in": "query",
            "description": "Require an active state health license.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "care_types",
            "in": "query",
            "description": "Comma-separated NPI healthcare organization care types.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "adviser",
            "in": "query",
            "description": "Require SEC Form ADV investment adviser registration.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "wealth_adviser",
            "in": "query",
            "description": "Require individual wealth adviser profile (no private funds, >=20 clients).",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "online_store",
            "in": "query",
            "description": "Require an indexed online storefront.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sells",
            "in": "query",
            "description": "Comma-separated online store product categories.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "store_words",
            "in": "query",
            "description": "Storefront full-text search terms.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "min_reviews",
            "in": "query",
            "description": "Minimum online store review count.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "order",
            "in": "query",
            "description": "Storefront sort order.",
            "schema": {
              "type": "string",
              "enum": [
                "reviews",
                "products",
                "match"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size (1..50, default 25).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Market sizing count and 5 sample companies.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreviewCompaniesResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "tags": [
          "Companies & Buildings"
        ],
        "operationId": "previewCompanies",
        "summary": "Size a company market and inspect 5 sample companies ($0.00)",
        "description": "Runs a free ($0.00) read-only market sizing count across 28M+ US private companies and returns up to 5 sample companies before any paid record reads.",
        "x-price-usd": 0,
        "x-dealport-scope": "read",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompanyFilterBody"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Market sizing count and 5 sample companies.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PreviewCompaniesResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/companies": {
      "get": {
        "tags": [
          "Companies & Buildings"
        ],
        "operationId": "searchCompanies",
        "summary": "Search 28M+ US private companies ($0.01/record; $0.00 with preview=1 or 30d repeat)",
        "description": "Searches 28M+ US private business records across buy-box filters. Pass `preview=1` for a $0.00 market sizing preview; without `preview=1`, each returned record costs $0.01 ($0.00 on repeat reads in the same workspace within 30 days).",
        "x-price-usd": 0.01,
        "x-dealport-scope": "read",
        "parameters": [
          {
            "name": "preview",
            "in": "query",
            "description": "Set to `1` or `true` to run a $0.00 market sizing count and 5-company sample instead of unlocking records.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Company name prefix filter.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "state",
            "in": "query",
            "description": "Two-letter US state code (e.g. OH, TX, FL).",
            "schema": {
              "type": "string",
              "minLength": 2,
              "maxLength": 2
            }
          },
          {
            "name": "counties",
            "in": "query",
            "description": "Comma-separated county names within state.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "cities",
            "in": "query",
            "description": "Comma-separated city names within state.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "markets",
            "in": "query",
            "description": "Additional state/county markets (e.g. IN|MI:Wayne,Oakland).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "domain",
            "in": "query",
            "description": "Company website host or registrable domain.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "naics",
            "in": "query",
            "description": "Comma-separated 2-to-6 digit NAICS codes (e.g. 238220,332710).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "min_revenue",
            "in": "query",
            "description": "Minimum annual revenue in USD.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "max_revenue",
            "in": "query",
            "description": "Maximum annual revenue in USD.",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "filed_revenue_only",
            "in": "query",
            "description": "Restrict to primary filed revenue (CMS cost reports or PPP filings).",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "min_employees",
            "in": "query",
            "description": "Minimum headcount.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "max_employees",
            "in": "query",
            "description": "Maximum headcount.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "size_unknown",
            "in": "query",
            "description": "Include companies without reported size alongside sized matches.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "independent",
            "in": "query",
            "description": "Exclude SEC filers, nonprofits, government bodies, membership groups, and HOAs.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "owner_businesses",
            "in": "query",
            "description": "Minimum number of businesses associated with the same owner (2..25).",
            "schema": {
              "type": "integer",
              "minimum": 2,
              "maximum": 25
            }
          },
          {
            "name": "medicare",
            "in": "query",
            "description": "Require Medicare enrollment (CMS certification number).",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "owner_operated",
            "in": "query",
            "description": "Require owner-operated status in CMS filings.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "owner_contact",
            "in": "query",
            "description": "Require an owner phone or email already on file.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "licensed",
            "in": "query",
            "description": "Require an active state health license.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "care_types",
            "in": "query",
            "description": "Comma-separated NPI healthcare organization care types.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "adviser",
            "in": "query",
            "description": "Require SEC Form ADV investment adviser registration.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "wealth_adviser",
            "in": "query",
            "description": "Require individual wealth adviser profile (no private funds, >=20 clients).",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "online_store",
            "in": "query",
            "description": "Require an indexed online storefront.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "sells",
            "in": "query",
            "description": "Comma-separated online store product categories.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "store_words",
            "in": "query",
            "description": "Storefront full-text search terms.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "min_reviews",
            "in": "query",
            "description": "Minimum online store review count.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "order",
            "in": "query",
            "description": "Storefront sort order.",
            "schema": {
              "type": "string",
              "enum": [
                "reviews",
                "products",
                "match"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size (1..50, default 25).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Pagination offset cursor returned as `next_cursor` from the prior page.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching company records (or preview payload when `preview=1`).",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/CompanySearchResponse"
                    },
                    {
                      "$ref": "#/components/schemas/PreviewCompaniesResponse"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/companies/match": {
      "post": {
        "tags": [
          "Companies & Buildings"
        ],
        "operationId": "matchCompanyList",
        "summary": "Match CSV or structured company list against 28M+ US SMBs ($0.00; $0.05/mo if watched)",
        "description": "Matches 1 to 250 external company names/domains (JSON `items`, JSON `csv`, or `text/csv` body) against 28M+ US private companies via indexed domain match and fuzzy entity resolution at $0.00 (`read` scope). Optional `watch: true` adds matched companies to weekly Project monitoring at $0.05/company/month (`watch` scope).",
        "x-price-usd": 0,
        "x-dealport-scope": "read",
        "parameters": [
          {
            "name": "watch",
            "in": "query",
            "description": "When sending `text/csv`, set `true` to watch matched companies weekly ($0.05/company/month).",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "description": "Target Project UUID when sending `text/csv` with `watch=true`.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "project_name",
            "in": "query",
            "description": "Target Project name when sending `text/csv` with `watch=true`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "items": {
                    "type": "array",
                    "maxItems": 250,
                    "items": {
                      "type": "object",
                      "properties": {
                        "external_id": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "name": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "domain": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "city": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "state": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    }
                  },
                  "csv": {
                    "type": "string",
                    "description": "Raw CSV string with header row (name/company, website/domain, city, state, id)."
                  },
                  "watch": {
                    "type": "boolean",
                    "default": false
                  },
                  "project_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid"
                  },
                  "project_name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              }
            },
            "text/csv": {
              "schema": {
                "type": "string"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Entity match results and cached human owners.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyMatchResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/buildings": {
      "get": {
        "tags": [
          "Companies & Buildings"
        ],
        "operationId": "searchBuildings",
        "summary": "Search NYC multifamily and mixed-use buildings ($0.01/record; 30d repeat $0.00)",
        "description": "Searches NYC multifamily and mixed-use buildings by borough, unit count, ACRIS loan maturity, lender category, and distress or regulatory signals. Costs $0.01 per returned building ($0.00 on repeat reads within 30 days).",
        "x-price-usd": 0.01,
        "x-dealport-scope": "read",
        "parameters": [
          {
            "name": "borough",
            "in": "query",
            "required": true,
            "description": "NYC borough code.",
            "schema": {
              "type": "string",
              "enum": [
                "MN",
                "BK",
                "QN",
                "BX",
                "SI"
              ]
            }
          },
          {
            "name": "min_units",
            "in": "query",
            "description": "Minimum residential units (default 10).",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 10
            }
          },
          {
            "name": "q",
            "in": "query",
            "description": "Address or owner-of-record substring match.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "loan_due_by",
            "in": "query",
            "description": "Estimated loan maturity year ceiling (e.g. 2027).",
            "schema": {
              "type": "integer",
              "minimum": 1990,
              "maximum": 2100
            }
          },
          {
            "name": "loan_holder",
            "in": "query",
            "description": "Current mortgage holder type.",
            "schema": {
              "type": "string",
              "enum": [
                "agency",
                "cmbs",
                "bank"
              ]
            }
          },
          {
            "name": "signal",
            "in": "query",
            "description": "Regulatory, distress, or assisted-housing signal filter.",
            "schema": {
              "type": "string",
              "enum": [
                "rent_stabilized",
                "dob_penalties",
                "housing_court",
                "tax_lien",
                "ll97",
                "section8_expiring",
                "tax_credit_ending",
                "failing_inspection"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size (1..50, default 25).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 25
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "Pagination offset cursor.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Matching NYC building records.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BuildingSearchResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/buildings/owners": {
      "post": {
        "tags": [
          "Records & Owners"
        ],
        "operationId": "researchBuildingOwners",
        "summary": "Quote ($0.00) or research ($0.05/owner) human principals behind NYC buildings",
        "description": "Resolves distinct human owners and direct contacts across 1 to 50 NYC BBLs. Omit `confirm_max_usd` for a free ($0.00) quote (`200`); pass `confirm_max_usd` at or above `total_usd` to start research at $0.05 per distinct owner (`202`).",
        "x-price-usd": 0.05,
        "x-dealport-scope": "watch",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "bbls"
                ],
                "properties": {
                  "bbls": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 50,
                    "items": {
                      "type": "string",
                      "pattern": "^[1-5][0-9]{9}$"
                    }
                  },
                  "project_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid"
                  },
                  "project_name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "confirm_max_usd": {
                    "type": "number",
                    "minimum": 0
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Free quote (`quoted_only: true`, `cost_usd: 0`).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "202": {
            "description": "Building owner research started.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "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"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/records/{id}": {
      "get": {
        "tags": [
          "Records & Owners"
        ],
        "operationId": "getRecord",
        "summary": "Open a cited company or NYC building record ($0.01; 30d repeat $0.00)",
        "description": "Returns a complete cited company record (by Dealport UUID) or NYC building record (by 10-digit BBL), including primary filing facts (`filed`, `observed`, or `estimate`), principals, identifiers, sources, and freshness metadata. Costs $0.01 ($0.00 on repeat reads within 30 days).",
        "x-price-usd": 0.01,
        "x-dealport-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Dealport company UUID or 10-digit NYC BBL.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cited company or building record.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RecordResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/records/{id}/evidence": {
      "get": {
        "tags": [
          "Records & Owners"
        ],
        "operationId": "getRecordEvidence",
        "summary": "Export primary filing evidence for an opened company record ($0.00)",
        "description": "Returns the bounded primary-filing evidence snapshot for a company record already opened by this workspace within the last 30 days via `GET /records/{id}` ($0.01). Never initiates a new charge (`409 record_read_required` if not yet opened).",
        "x-price-usd": 0,
        "x-dealport-scope": "read",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Canonical Dealport company UUID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Primary filing evidence snapshot.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/UnprocessableEntity"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "description": "Evidence snapshot temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/pages": {
      "get": {
        "tags": [
          "Companies & Buildings"
        ],
        "operationId": "getCompanyPages",
        "summary": "Read clean company website Markdown via query params ($0.00 cached / $0.01 live)",
        "description": "Returns clean company website Markdown for 1..10 companies by UUID or domain. $0.00 when served from the 30-day cache or unreachable; $0.01 per company fetched live.",
        "x-price-usd": 0.01,
        "x-dealport-scope": "read",
        "parameters": [
          {
            "name": "company_ids",
            "in": "query",
            "description": "Comma-separated Dealport company UUIDs.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "domains",
            "in": "query",
            "description": "Comma-separated company domains.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "paths",
            "in": "query",
            "description": "Comma-separated relative paths (default `/,/about,/services,/capabilities`).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "force_refresh",
            "in": "query",
            "description": "Bypass 30-day cache and fetch live ($0.01/company).",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Company website Markdown pages.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyPagesResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "tags": [
          "Companies & Buildings"
        ],
        "operationId": "fetchCompanyPages",
        "summary": "Fetch clean company website Markdown ($0.00 cached / $0.01 live)",
        "description": "Fetches clean, SSRF-guarded company website Markdown (`company_ids` or `domains`). $0.00 when served from the 30-day cache or when unreachable; $0.01 per live company website fetch.",
        "x-price-usd": 0.01,
        "x-dealport-scope": "read",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "company_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "domains": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "targets": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "paths": {
                    "type": "array",
                    "maxItems": 5,
                    "items": {
                      "type": "string"
                    }
                  },
                  "force_refresh": {
                    "type": "boolean",
                    "default": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Company website Markdown pages.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CompanyPagesResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/owners": {
      "post": {
        "tags": [
          "Records & Owners"
        ],
        "operationId": "findOwner",
        "summary": "Resolve verified human company owner, direct contacts, and profile ($0.09/hit; $0.00 miss or 30d repeat)",
        "description": "Resolves the human principal behind a private company (filtering out corporate registered agents, law firms, and accounting firms), verifies direct mobile and direct phones and work or personal emails, and returns their professional profile (LinkedIn URL, headline, summary, location, career roles, education, skills, and certifications). Charges $0.09 strictly when a verified non-suppressed phone or email is returned; $0.00 on miss or 30-day workspace repeat.",
        "x-price-usd": 0.09,
        "x-dealport-scope": "owners",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OwnerLookupRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Resolved human owner, verified phones and emails, and professional profile.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OwnerLookupResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/contacts": {
      "post": {
        "tags": [
          "Records & Owners"
        ],
        "operationId": "findContact",
        "summary": "Find verified company owner phones, emails, and profile ($0.09/hit; $0.00 miss or 30d repeat)",
        "description": "Finds verified direct phones, work and personal emails, and professional profile details for a company owner or named principal. Charges $0.09 per verified contact hit; $0.00 when not found or on 30-day workspace repeat.",
        "x-price-usd": 0.09,
        "x-dealport-scope": "owners",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OwnerLookupRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verified principal contact details.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OwnerLookupResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/research": {
      "post": {
        "tags": [
          "Records & Owners"
        ],
        "operationId": "startCompanyResearch",
        "summary": "Start deep async cited company research ($0.50; 30d repeat $0.00)",
        "description": "Starts an asynchronous cited investigation on one company (`company_id`) covering operations, founding history, scale, ownership, and direct owner contact details. Costs $0.50 (`202` when newly started; `200` at $0.00 if researched in this workspace within 30 days). Poll status with `GET /research/{researchId}`.",
        "x-price-usd": 0.5,
        "x-dealport-scope": "watch",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "company_id"
                ],
                "properties": {
                  "company_id": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Existing 30-day workspace research returned at $0.00.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResearchResponse"
                }
              }
            }
          },
          "202": {
            "description": "Async company research started ($0.50).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResearchResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/research/{researchId}": {
      "get": {
        "tags": [
          "Records & Owners"
        ],
        "operationId": "getCompanyResearch",
        "summary": "Poll async company research status and cited findings ($0.00)",
        "description": "Reads the status (`running`, `done`, or `failed`) and cited fields of a company research run started by this workspace ($0.00).",
        "x-price-usd": 0,
        "x-dealport-scope": "read",
        "parameters": [
          {
            "name": "researchId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Company research status and cited fields.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResearchResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/annotations": {
      "get": {
        "tags": [
          "Projects & Playbooks"
        ],
        "operationId": "listAnnotations",
        "summary": "List workspace company scores, verdicts, and custom fields ($0.00)",
        "description": "Queries workspace-scoped 0-100 scores, verdicts, rationales, and structured custom fields ($0.00).",
        "x-price-usd": 0,
        "x-dealport-scope": "read",
        "parameters": [
          {
            "name": "company_ids",
            "in": "query",
            "description": "Comma-separated company UUIDs.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "verdict",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "priority",
                "qualified",
                "watch",
                "pass"
              ]
            }
          },
          {
            "name": "min_score",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 100
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workspace annotations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "tags": [
          "Projects & Playbooks"
        ],
        "operationId": "upsertAnnotations",
        "summary": "Save 0-100 scores, verdicts, and rationales into a Dealport Project ($0.00)",
        "description": "Upserts 1 to 100 company annotations (scores `0..100`, verdicts `priority | qualified | watch | pass`, rationales, and scalar `custom_fields`) into a Dealport Project at $0.00 (`watch: false` by default).",
        "x-price-usd": 0,
        "x-dealport-scope": "watch",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AnnotateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved annotations and Project URL.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "tags": [
          "Projects & Playbooks"
        ],
        "operationId": "deleteAnnotations",
        "summary": "Delete workspace annotations for specified companies ($0.00)",
        "description": "Removes workspace-private annotations for one or more `company_ids` ($0.00).",
        "x-price-usd": 0,
        "x-dealport-scope": "watch",
        "parameters": [
          {
            "name": "company_ids",
            "in": "query",
            "description": "Comma-separated company UUIDs.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "company_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deleted count.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/lists/save": {
      "get": {
        "tags": [
          "Projects & Playbooks"
        ],
        "operationId": "listSavedProjects",
        "summary": "List workspace Projects and weekly monitoring status ($0.00)",
        "description": "Returns workspace Projects with record counts and weekly monitoring flags ($0.00).",
        "x-price-usd": 0,
        "x-dealport-scope": "read",
        "parameters": [
          {
            "name": "workspace",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workspace Projects.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "tags": [
          "Projects & Playbooks"
        ],
        "operationId": "saveCompaniesToProject",
        "summary": "Save companies into a Dealport Project ($0.00 unwatched; $0.05/mo watched)",
        "description": "Adds 1 to 250 company UUIDs (or creates an empty Project when `createEmpty: true`) into a Dealport Project. Free ($0.00) when `watch: false`; $0.05/company/month if weekly monitoring is enabled.",
        "x-price-usd": 0,
        "x-dealport-scope": "watch",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspaceId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "companyIds": {
                    "type": "array",
                    "minItems": 1,
                    "maxItems": 250,
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "projectId": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid"
                  },
                  "projectName": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "watch": {
                    "type": "boolean"
                  },
                  "createEmpty": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved Project summary.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "patch": {
        "tags": [
          "Projects & Playbooks"
        ],
        "operationId": "toggleProjectWatch",
        "summary": "Enable or pause weekly monitoring on a Project ($0.00 pause / $0.05/company/mo enable)",
        "description": "Enables or pauses weekly company change monitoring on an existing Dealport Project.",
        "x-price-usd": 0,
        "x-dealport-scope": "watch",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "projectId",
                  "enabled"
                ],
                "properties": {
                  "workspaceId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "projectId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "enabled": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated Project monitoring state.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/playbooks": {
      "get": {
        "tags": [
          "Projects & Playbooks"
        ],
        "operationId": "listPlaybooks",
        "summary": "List Dealport library and workspace Playbooks ($0.00)",
        "description": "Returns Dealport's first-party Playbook library and workspace-authored Playbooks ($0.00).",
        "x-price-usd": 0,
        "x-dealport-scope": "read",
        "parameters": [
          {
            "name": "playbook_id",
            "in": "query",
            "description": "Optional Playbook definition or template identifier.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Library and workspace Playbooks.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "tags": [
          "Projects & Playbooks"
        ],
        "operationId": "savePlaybook",
        "summary": "Create or update a workspace Playbook ($0.00)",
        "description": "Creates or updates a workspace Playbook with qualification rules and ranking factors ($0.00).",
        "x-price-usd": 0,
        "x-dealport-scope": "watch",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "purpose": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "template_key": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "solution_version_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid"
                  },
                  "rules": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "ranking_factors": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Playbook saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/projects": {
      "get": {
        "tags": [
          "Projects & Playbooks"
        ],
        "operationId": "listProjects",
        "summary": "List workspace Projects ($0.00)",
        "description": "Returns all Projects in the workspace with their Playbook, evaluated record counts, and qualified lead counts ($0.00).",
        "x-price-usd": 0,
        "x-dealport-scope": "read",
        "responses": {
          "200": {
            "description": "Workspace Projects.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "tags": [
          "Projects & Playbooks"
        ],
        "operationId": "createProject",
        "summary": "Create a Project idempotently from a Playbook and saved search ($0.00)",
        "description": "Creates a Dealport Project from a library `template_key`, workspace `solution_version_id`, custom `rules`, or as a folder, optionally configuring its saved search, schedule, and `monthly_budget_usd` ($0.00).",
        "x-price-usd": 0,
        "x-dealport-scope": "watch",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "goal": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "template_key": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "solution_version_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid"
                  },
                  "rules": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "ranking_factors": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "additionalProperties": true
                    }
                  },
                  "company_search": {
                    "$ref": "#/components/schemas/CompanyFilterBody"
                  },
                  "property_search": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "additionalProperties": true
                  },
                  "enabled": {
                    "type": "boolean"
                  },
                  "weekly_quota": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "cadence": {
                    "type": "string",
                    "enum": [
                      "weekly",
                      "monthly"
                    ]
                  },
                  "monday_of_month": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 4
                  },
                  "recheck": {
                    "type": "boolean"
                  },
                  "monthly_budget_usd": {
                    "type": [
                      "number",
                      "null"
                    ],
                    "minimum": 0
                  },
                  "idempotency_key": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Existing idempotent Project returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "201": {
            "description": "Project created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/projects/{projectId}/leads": {
      "get": {
        "tags": [
          "Projects & Playbooks"
        ],
        "operationId": "getProjectLeads",
        "summary": "Read ranked leads and rule verdicts in a Project ($0.00)",
        "description": "Returns ranked leads in a workspace Project (`qualified`, `review`, or `all`), ordered best-first with scores, answers, and rule verdicts ($0.00).",
        "x-price-usd": 0,
        "x-dealport-scope": "read",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "show",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "qualified",
                "review",
                "all"
              ],
              "default": "qualified"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 25
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ranked Project leads.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/projects/{projectId}/source": {
      "get": {
        "tags": [
          "Projects & Playbooks"
        ],
        "operationId": "getProjectSource",
        "summary": "Read a Project's saved search, schedule, and monthly spending limit ($0.00)",
        "description": "Returns the saved company/property search, weekly or monthly schedule, and `monthly_budget_usd` for a Project ($0.00).",
        "x-price-usd": 0,
        "x-dealport-scope": "read",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Project saved search and schedule.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "patch": {
        "tags": [
          "Projects & Playbooks"
        ],
        "operationId": "patchProjectSource",
        "summary": "Update a Project's saved search, schedule, or monthly spending limit ($0.00)",
        "description": "Updates a Project's saved search, cadence, weekly quota, recheck toggle, or `monthly_budget_usd` ($0.00).",
        "x-price-usd": 0,
        "x-dealport-scope": "watch",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectSourceInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated Project source.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "put": {
        "tags": [
          "Projects & Playbooks"
        ],
        "operationId": "putProjectSource",
        "summary": "Replace a Project's saved search, schedule, and monthly spending limit ($0.00)",
        "description": "Saves a Project's search, cadence, quota, and `monthly_budget_usd` ($0.00).",
        "x-price-usd": 0,
        "x-dealport-scope": "watch",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectSourceInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved Project source.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/projects/{projectId}/records": {
      "post": {
        "tags": [
          "Projects & Playbooks"
        ],
        "operationId": "addRecordsToProject",
        "summary": "Add companies, buildings, or people to a Project ($0.00 unwatched; $0.05/mo watched)",
        "description": "Idempotently adds `company_ids`, NYC `bbls`, `property_keys`, or `people` into a Project. Buildings, people, and `watch: false` companies cost $0.00; weekly watched companies cost $0.05/company/month.",
        "x-price-usd": 0,
        "x-dealport-scope": "watch",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "company_ids": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "bbls": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[1-5][0-9]{9}$"
                    }
                  },
                  "property_keys": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "people": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "name"
                      ],
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "role": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "company": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "location": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "email": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "phone": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      }
                    }
                  },
                  "watch": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Added Project records.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/projects/{projectId}/runs": {
      "post": {
        "tags": [
          "Projects & Playbooks"
        ],
        "operationId": "runProject",
        "summary": "Quote ($0.00) or run ($0.05/record) a Project's Playbook on 1 to 500 search matches",
        "description": "Quotes (`200`, $0.00 when `confirm_max_usd` is omitted) or starts (`202`, $0.05/record when `confirm_max_usd` covers the quote) a background Playbook batch on the next 1 to 500 records of the Project's saved search.",
        "x-price-usd": 0.05,
        "x-dealport-scope": "watch",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "count"
                ],
                "properties": {
                  "count": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 500
                  },
                  "confirm_max_usd": {
                    "type": "number",
                    "minimum": 0
                  },
                  "idempotency_key": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Free quote or idempotent batch replay.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "202": {
            "description": "Background Playbook batch started.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "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"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/projects/{projectId}/runs/{batchId}": {
      "get": {
        "tags": [
          "Projects & Playbooks"
        ],
        "operationId": "getProjectRunStatus",
        "summary": "Read progress of a Project Playbook batch ($0.00)",
        "description": "Polls progress and qualified counts for a background batch started via `POST /projects/{projectId}/runs` ($0.00).",
        "x-price-usd": 0,
        "x-dealport-scope": "read",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "batchId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Batch progress.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/watch": {
      "get": {
        "tags": [
          "Projects & Playbooks"
        ],
        "operationId": "getWatchDiffs",
        "summary": "Read weekly cited changes across watched companies ($0.00)",
        "description": "Returns cited leadership, filing, website, and ownership changes detected over the past `days` (default 7) across watched companies ($0.00).",
        "x-price-usd": 0,
        "x-dealport-scope": "read",
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 90,
              "default": 7
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cited change diffs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "tags": [
          "Projects & Playbooks"
        ],
        "operationId": "watchCompanies",
        "summary": "Watch companies weekly in a Dealport Project ($0.05/company/month)",
        "description": "Adds companies to weekly change monitoring inside a Dealport Project at $0.05 per company per month ($0.00 if already watched this billing cycle).",
        "x-price-usd": 0.05,
        "x-dealport-scope": "watch",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "company_ids"
                ],
                "properties": {
                  "company_ids": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "type": "string",
                      "format": "uuid"
                    }
                  },
                  "project_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid"
                  },
                  "project_name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Watched companies summary.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PaymentRequired"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/watch/webhooks": {
      "get": {
        "tags": [
          "Projects & Playbooks"
        ],
        "operationId": "listWatchWebhooks",
        "summary": "List signed Project push webhooks and recent deliveries ($0.00)",
        "description": "Lists registered `X-Dealport-Signature` webhook listeners and their 20 most recent deliveries ($0.00).",
        "x-price-usd": 0,
        "x-dealport-scope": "read",
        "responses": {
          "200": {
            "description": "Registered webhooks and deliveries.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "tags": [
          "Projects & Playbooks"
        ],
        "operationId": "createOrTestWatchWebhook",
        "summary": "Register or test a signed Project push webhook ($0.00)",
        "description": "Creates a new signed Project push webhook (`target_url`, returning `signing_secret` for `X-Dealport-Signature` verification) or sends a test event when `action: \"test\"` ($0.00).",
        "x-price-usd": 0,
        "x-dealport-scope": "watch",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "create",
                      "test"
                    ],
                    "default": "create"
                  },
                  "target_url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "webhook_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "project_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid"
                  },
                  "event_types": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "watch.signal",
                        "avery.warm_yes"
                      ]
                    }
                  },
                  "signal_categories": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Test webhook delivery result.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "201": {
            "description": "Webhook created with signing secret.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "patch": {
        "tags": [
          "Projects & Playbooks"
        ],
        "operationId": "updateWatchWebhook",
        "summary": "Update a Project push webhook ($0.00)",
        "description": "Updates active status, name, Project filter, or event types for an existing Project webhook ($0.00).",
        "x-price-usd": 0,
        "x-dealport-scope": "watch",
        "parameters": [
          {
            "name": "webhook_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "webhook_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "active": {
                    "type": "boolean"
                  },
                  "name": {
                    "type": "string"
                  },
                  "project_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid"
                  },
                  "event_types": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "signal_categories": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated webhook.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "tags": [
          "Projects & Playbooks"
        ],
        "operationId": "deleteWatchWebhook",
        "summary": "Delete a Project push webhook ($0.00)",
        "description": "Deletes a Project push webhook by `webhook_id` ($0.00).",
        "x-price-usd": 0,
        "x-dealport-scope": "watch",
        "parameters": [
          {
            "name": "webhook_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "webhook_id": {
                    "type": "string",
                    "format": "uuid"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Webhook deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/blocklist": {
      "get": {
        "tags": [
          "Pipeline & Governance"
        ],
        "operationId": "listBlocklist",
        "summary": "List workspace do-not-contact exclusions ($0.00)",
        "description": "Lists workspace NDA, portfolio, CRM, passed-deal (`dead_deal`), and manual exclusions ($0.00).",
        "x-price-usd": 0,
        "x-dealport-scope": "read",
        "parameters": [
          {
            "name": "reason",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "nda",
                "portfolio",
                "crm",
                "dead_deal",
                "manual"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Blocklist entries.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "tags": [
          "Pipeline & Governance"
        ],
        "operationId": "addBlocklist",
        "summary": "Add domains or companies to workspace exclusions ($0.00)",
        "description": "Adds domains, company names, or Dealport company UUIDs to the workspace exclusion list so Avery and outreach workflows never contact them ($0.00).",
        "x-price-usd": 0,
        "x-dealport-scope": "blocklist",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "entries"
                ],
                "properties": {
                  "entries": {
                    "type": "array",
                    "minItems": 1,
                    "items": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "object",
                          "properties": {
                            "domain": {
                              "type": "string"
                            },
                            "company_name": {
                              "type": "string"
                            },
                            "company_id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "reason": {
                              "type": "string",
                              "enum": [
                                "nda",
                                "portfolio",
                                "crm",
                                "dead_deal",
                                "manual"
                              ]
                            },
                            "note": {
                              "type": "string"
                            }
                          }
                        }
                      ]
                    }
                  },
                  "default_reason": {
                    "type": "string",
                    "enum": [
                      "nda",
                      "portfolio",
                      "crm",
                      "dead_deal",
                      "manual"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Added exclusion entries.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "tags": [
          "Pipeline & Governance"
        ],
        "operationId": "removeBlocklist",
        "summary": "Remove an entry from workspace exclusions ($0.00)",
        "description": "Removes a domain, company name, or `block_id` from workspace exclusions ($0.00).",
        "x-price-usd": 0,
        "x-dealport-scope": "blocklist",
        "parameters": [
          {
            "name": "block_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "domain",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "company_name",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "block_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "domain": {
                    "type": "string"
                  },
                  "company_name": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Removed exclusion entry.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/flags": {
      "get": {
        "tags": [
          "Pipeline & Governance"
        ],
        "operationId": "listCompanyFlags",
        "summary": "List workspace curator company fact flags ($0.00)",
        "description": "Lists stale or changed company fact flags submitted in this workspace ($0.00).",
        "x-price-usd": 0,
        "x-dealport-scope": "read",
        "parameters": [
          {
            "name": "company_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "flag_type",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "acquired_or_merged",
                "owner_changed_or_retired",
                "wrong_contact",
                "closed_or_inactive",
                "capability_or_size_mismatch",
                "other"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "open",
                "promoted",
                "dismissed"
              ]
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Company fact flags.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "tags": [
          "Pipeline & Governance"
        ],
        "operationId": "flagCompanyFact",
        "summary": "Flag a stale or changed company fact ($0.00)",
        "description": "Submits a cited curator flag on a company record (`acquired_or_merged`, `owner_changed_or_retired`, `wrong_contact`, `closed_or_inactive`, `capability_or_size_mismatch`, or `other`) at $0.00.",
        "x-price-usd": 0,
        "x-dealport-scope": "read",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "company_id",
                  "flag_type",
                  "summary"
                ],
                "properties": {
                  "company_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "flag_type": {
                    "type": "string",
                    "enum": [
                      "acquired_or_merged",
                      "owner_changed_or_retired",
                      "wrong_contact",
                      "closed_or_inactive",
                      "capability_or_size_mismatch",
                      "other"
                    ]
                  },
                  "summary": {
                    "type": "string",
                    "minLength": 3
                  },
                  "field_name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "suggested_fix": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "source_url": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uri"
                  },
                  "agent_label": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Created fact flag.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "patch": {
        "tags": [
          "Pipeline & Governance"
        ],
        "operationId": "resolveCompanyFlag",
        "summary": "Promote or dismiss a company fact flag ($0.00)",
        "description": "Resolves an open company fact flag (`promoted` or `dismissed`; restricted to `workspace_owner`, `integration_admin`, or `admin`) at $0.00.",
        "x-price-usd": 0,
        "x-dealport-scope": "read",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "flag_id",
                  "status"
                ],
                "properties": {
                  "flag_id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "promoted",
                      "dismissed"
                    ]
                  },
                  "resolution_note": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Resolved fact flag.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/avery": {
      "get": {
        "tags": [
          "Pipeline & Governance"
        ],
        "operationId": "getAveryStatus",
        "summary": "Read Avery outreach status, funnel, allowance, and Warm Yes offers ($0.00)",
        "description": "Returns status for Avery (Dealport's AI outreach specialist), sample first-touch note, monthly outreach allowance, open owner suggestions, and ready Warm Yes introduction offers ($0.00).",
        "x-price-usd": 0,
        "x-dealport-scope": "read",
        "responses": {
          "200": {
            "description": "Avery status and ready Warm Yes offers.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "tags": [
          "Pipeline & Governance"
        ],
        "operationId": "runAveryAction",
        "summary": "Queue Avery owner outreach ($0.02/email) or accept a Warm Yes introduction ($25.00)",
        "description": "Executes an action with Avery (Dealport's AI outreach specialist): `reach_out` queues 1-to-1 owner outreach ($0.02 per email Avery sends, up to 150 owners/month self-serve, respecting workspace exclusions), `accept_intro` accepts a double-opt-in Warm Yes owner introduction ($25.00), and `set_auto_accept` configures automatic Warm Yes acceptance ($0.00, `workspace_owner` only).",
        "x-price-usd": 0.02,
        "x-dealport-scope": "avery",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "action"
                ],
                "properties": {
                  "action": {
                    "type": "string",
                    "enum": [
                      "reach_out",
                      "accept_intro",
                      "set_auto_accept"
                    ]
                  },
                  "company_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid"
                  },
                  "suggestion_id": {
                    "type": "string"
                  },
                  "company_name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "domain": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "intent": {
                    "type": "string",
                    "enum": [
                      "acquisition",
                      "commercial",
                      "supplier"
                    ]
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "avery",
                      "as_me"
                    ]
                  },
                  "allow_partnerships": {
                    "type": "boolean"
                  },
                  "message": {
                    "type": "string"
                  },
                  "conversation_id": {
                    "type": "string",
                    "description": "Required when `action` is `accept_intro`."
                  },
                  "enabled": {
                    "type": "boolean",
                    "description": "Required when `action` is `set_auto_accept`."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Avery action outcome.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "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"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/outcomes": {
      "get": {
        "tags": [
          "Pipeline & Governance"
        ],
        "operationId": "listOutcomes",
        "summary": "Read pipeline stage history and current stage ($0.00)",
        "description": "Returns pipeline stage history and current stages for a `run_id` or `project_id` ($0.00).",
        "x-price-usd": 0,
        "x-dealport-scope": "watch",
        "parameters": [
          {
            "name": "run_id",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Outcome events and current stage map.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "tags": [
          "Pipeline & Governance"
        ],
        "operationId": "setRecordStage",
        "summary": "Set a record's pipeline stage or follow-up date ($0.00)",
        "description": "Records a pipeline stage (`contacted`, `no_answer`, `replied`, `meeting`, `nda`, `cim`, `ioi`, `loi`, `closed_won`, or `dead`) and/or sets or clears `follow_up_on` (`YYYY-MM-DD` or `null`). Marking a record `dead` also holds unsent Avery outreach on that record ($0.00).",
        "x-price-usd": 0,
        "x-dealport-scope": "watch",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "run_id": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "project_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid"
                  },
                  "company_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid"
                  },
                  "record": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "stage": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "contacted",
                      "no_answer",
                      "replied",
                      "meeting",
                      "nda",
                      "cim",
                      "ioi",
                      "loi",
                      "closed_won",
                      "dead",
                      null
                    ]
                  },
                  "reason": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "note": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "occurred_at": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "follow_up_on": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date"
                  },
                  "follow_up_reason": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "idempotency_key": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated follow-up or idempotent duplicate stage.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "201": {
            "description": "Stage event recorded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/outcomes/crm/{crm}": {
      "get": {
        "tags": [
          "Pipeline & Governance"
        ],
        "operationId": "getCrmStageMap",
        "summary": "Read inbound CRM stage mapping ($0.00)",
        "description": "Reads the workspace stage mapping for an external CRM (`hubspot` or custom lowercase slug) ($0.00).",
        "x-price-usd": 0,
        "x-dealport-scope": "avery",
        "parameters": [
          {
            "name": "crm",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9_]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "CRM stage map.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "tags": [
          "Pipeline & Governance"
        ],
        "operationId": "ingestCrmOutcomes",
        "summary": "Ingest CRM deal stage webhook events ($0.00)",
        "description": "Applies mapped CRM stage change events into Dealport outcomes idempotently ($0.00).",
        "x-price-usd": 0,
        "x-dealport-scope": "avery",
        "parameters": [
          {
            "name": "crm",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9_]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": [
                  "object",
                  "array"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Applied and skipped CRM events.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "put": {
        "tags": [
          "Pipeline & Governance"
        ],
        "operationId": "putCrmStageMap",
        "summary": "Configure inbound CRM stage mapping ($0.00)",
        "description": "Maps external CRM stage names to Dealport pipeline stages ($0.00).",
        "x-price-usd": 0,
        "x-dealport-scope": "avery",
        "parameters": [
          {
            "name": "crm",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9_]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "stages"
                ],
                "properties": {
                  "stages": {
                    "type": "object",
                    "additionalProperties": {
                      "type": "string",
                      "enum": [
                        "contacted",
                        "no_answer",
                        "replied",
                        "meeting",
                        "loi",
                        "closed_won",
                        "dead"
                      ]
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved CRM stage map.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "delete": {
        "tags": [
          "Pipeline & Governance"
        ],
        "operationId": "deleteCrmStageMap",
        "summary": "Clear inbound CRM stage mapping ($0.00)",
        "description": "Disables inbound stage mapping for the given CRM ($0.00).",
        "x-price-usd": 0,
        "x-dealport-scope": "avery",
        "parameters": [
          {
            "name": "crm",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9_]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Cleared CRM stage map.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/touches": {
      "post": {
        "tags": [
          "Pipeline & Governance"
        ],
        "operationId": "logTouch",
        "summary": "Log a call, email, text, letter, meeting, or note on a record ($0.00)",
        "description": "Logs an external AI or team interaction (`call`, `email`, `text`, `letter`, `meeting`, or `note`) on a record in the workspace's Projects ($0.00, idempotent by `idempotency_key` or `Idempotency-Key` header).",
        "x-price-usd": 0,
        "x-dealport-scope": "watch",
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "record",
                  "how",
                  "said"
                ],
                "properties": {
                  "record": {
                    "type": "string",
                    "description": "Company UUID, 10-digit NYC BBL, property key, or person key."
                  },
                  "how": {
                    "type": "string",
                    "enum": [
                      "call",
                      "email",
                      "text",
                      "letter",
                      "meeting",
                      "note"
                    ]
                  },
                  "direction": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "in",
                      "out",
                      null
                    ]
                  },
                  "said": {
                    "type": "string"
                  },
                  "person": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "when": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time"
                  },
                  "idempotency_key": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Idempotent replay of logged touch.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "201": {
            "description": "Touch logged.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/corrections": {
      "get": {
        "tags": [
          "Pipeline & Governance"
        ],
        "operationId": "listCorrections",
        "summary": "Read workspace-scoped record fact corrections ($0.00)",
        "description": "Reads active workspace-scoped corrections on a company or person ($0.00).",
        "x-price-usd": 0,
        "x-dealport-scope": "read",
        "parameters": [
          {
            "name": "company_id",
            "in": "query",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "person_name",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "person_page",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Workspace corrections.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      },
      "post": {
        "tags": [
          "Pipeline & Governance"
        ],
        "operationId": "saveOrWithdrawCorrection",
        "summary": "Save or withdraw a workspace-scoped record correction ($0.00)",
        "description": "Saves a workspace-scoped owner, phone, email, or role correction on a company, building, or person, or withdraws an existing correction via `withdraw_correction_id` ($0.00).",
        "x-price-usd": 0,
        "x-dealport-scope": "watch",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "withdraw_correction_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid"
                  },
                  "company_id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid"
                  },
                  "bbl": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "person_name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "person_page": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "fact": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "wrong_value": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "right_value": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "right_role": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "how": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "note": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "look_again": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Correction withdrawn.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "201": {
            "description": "Correction saved.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DataEnvelope"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "dp_live_...",
        "description": "Workspace API key (`dp_live_...`) managed at https://app.dealport.com/connect?tab=keys. Scopes: `read`, `watch`, `owners`, `avery`, `blocklist`."
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Invalid query parameter or request JSON body.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Missing, invalid, or revoked workspace API key.",
        "headers": {
          "WWW-Authenticate": {
            "schema": {
              "type": "string",
              "example": "Bearer"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "PaymentRequired": {
        "description": "Insufficient workspace USD balance or monthly key/workspace USD spend cap reached.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "Forbidden": {
        "description": "Insufficient API key capability scope (`insufficient_key_scope`) or view-only workspace role (`viewer_cannot_spend`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "NotFound": {
        "description": "Requested record, Project, or research run was not found.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "Conflict": {
        "description": "Resource state conflict (e.g. `requote`, `record_read_required`, or `blocked`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "UnprocessableEntity": {
        "description": "Query exceeded bounded limits or statement timeout (`search_too_broad` or `evidence_too_large`).",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "RateLimited": {
        "description": "Per-key rate limit exceeded.",
        "headers": {
          "Retry-After": {
            "schema": {
              "type": "string"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      }
    },
    "schemas": {
      "ErrorResponse": {
        "type": "object",
        "required": [
          "error",
          "message"
        ],
        "properties": {
          "error": {
            "type": "string",
            "example": "bad_request"
          },
          "message": {
            "type": "string"
          },
          "required_scope": {
            "type": "string",
            "enum": [
              "read",
              "watch",
              "owners",
              "avery",
              "blocklist"
            ]
          },
          "granted_scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "balance_usd": {
            "type": "number"
          },
          "needed_usd": {
            "type": "number"
          },
          "spent_usd": {
            "type": "number"
          },
          "cap_usd": {
            "type": "number"
          }
        },
        "additionalProperties": true
      },
      "DataEnvelope": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "additionalProperties": true
          },
          "cost_usd": {
            "type": "number"
          },
          "remaining_balance_usd": {
            "type": "number"
          }
        },
        "additionalProperties": true
      },
      "BalanceEnvelope": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "billing",
              "balance_usd",
              "available_usd",
              "action_rates_usd",
              "billing_url"
            ],
            "properties": {
              "billing": {
                "type": "string",
                "example": "pay_as_you_go"
              },
              "balance_usd": {
                "type": "number",
                "example": 47.5
              },
              "available_usd": {
                "type": "number",
                "example": 47.5
              },
              "monthly_spend_cap_usd": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "key_spend_cap_usd": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "key_scopes": {
                "type": [
                  "array",
                  "null"
                ],
                "items": {
                  "type": "string",
                  "enum": [
                    "read",
                    "watch",
                    "owners",
                    "avery",
                    "blocklist"
                  ]
                }
              },
              "auto_reload_usd": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "auto_accept_warm_yes": {
                "type": "boolean"
              },
              "rates_usd": {
                "type": "object",
                "properties": {
                  "record": {
                    "type": "number",
                    "example": 0.01
                  },
                  "contact": {
                    "type": "number",
                    "example": 0.09
                  },
                  "research": {
                    "type": "number",
                    "example": 0.5
                  },
                  "watch_monthly": {
                    "type": "number",
                    "example": 0.05
                  },
                  "avery_email": {
                    "type": "number",
                    "example": 0.02
                  },
                  "avery_warm_yes": {
                    "type": "number",
                    "example": 25
                  }
                },
                "additionalProperties": true
              },
              "action_rates_usd": {
                "type": "object",
                "properties": {
                  "preview_companies": {
                    "type": "number",
                    "example": 0
                  },
                  "record": {
                    "type": "number",
                    "example": 0.01
                  },
                  "owner_hit": {
                    "type": "number",
                    "example": 0.09
                  },
                  "owner_miss": {
                    "type": "number",
                    "example": 0
                  },
                  "research": {
                    "type": "number",
                    "example": 0.5
                  },
                  "watch_monthly": {
                    "type": "number",
                    "example": 0.05
                  },
                  "watch_weekly_diff": {
                    "type": "number",
                    "example": 0
                  },
                  "avery_email": {
                    "type": "number",
                    "example": 0.02
                  },
                  "avery_warm_yes": {
                    "type": "number",
                    "example": 25
                  }
                },
                "additionalProperties": true
              },
              "billing_url": {
                "type": "string",
                "format": "uri"
              }
            },
            "additionalProperties": true
          }
        }
      },
      "CompanyFilterBody": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "q": {
            "type": [
              "string",
              "null"
            ]
          },
          "state": {
            "type": [
              "string",
              "null"
            ],
            "description": "Two-letter US state code (e.g. OH)."
          },
          "counties": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "cities": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "markets": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "state"
              ],
              "properties": {
                "state": {
                  "type": "string"
                },
                "counties": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "domain": {
            "type": [
              "string",
              "null"
            ]
          },
          "naics": {
            "oneOf": [
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              {
                "type": "string"
              }
            ]
          },
          "min_revenue": {
            "type": [
              "number",
              "null"
            ]
          },
          "max_revenue": {
            "type": [
              "number",
              "null"
            ]
          },
          "filed_revenue_only": {
            "type": "boolean"
          },
          "min_employees": {
            "type": [
              "integer",
              "null"
            ]
          },
          "max_employees": {
            "type": [
              "integer",
              "null"
            ]
          },
          "size_unknown": {
            "type": "boolean"
          },
          "independent": {
            "type": "boolean"
          },
          "owner_businesses": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 2,
            "maximum": 25
          },
          "medicare": {
            "type": "boolean"
          },
          "owner_operated": {
            "type": "boolean"
          },
          "owner_contact": {
            "type": "boolean"
          },
          "licensed": {
            "type": "boolean"
          },
          "care_types": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "adviser": {
            "type": "boolean"
          },
          "wealth_adviser": {
            "type": "boolean"
          },
          "online_store": {
            "type": "boolean"
          },
          "sells": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "store_words": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "min_reviews": {
            "type": [
              "integer",
              "null"
            ]
          },
          "order": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "reviews",
              "products",
              "match",
              null
            ]
          },
          "limit": {
            "type": "integer",
            "minimum": 1,
            "maximum": 50,
            "default": 25
          },
          "offset": {
            "type": "integer",
            "minimum": 0,
            "default": 0
          }
        },
        "additionalProperties": true
      },
      "PreviewCompaniesResponse": {
        "type": "object",
        "required": [
          "matching_count",
          "matching_count_more",
          "sample",
          "cost_usd",
          "remaining_balance_usd",
          "board_url"
        ],
        "properties": {
          "matching_count": {
            "type": "integer",
            "example": 912
          },
          "matching_count_more": {
            "type": "boolean",
            "example": false
          },
          "sample": {
            "type": "array",
            "maxItems": 5,
            "items": {
              "type": "object",
              "required": [
                "id",
                "name",
                "independent"
              ],
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "name": {
                  "type": "string"
                },
                "city": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "state": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "industry": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "employee_band": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "revenue_band": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "independent": {
                  "type": "boolean"
                }
              }
            }
          },
          "cost_usd": {
            "type": "number",
            "const": 0
          },
          "remaining_balance_usd": {
            "type": "number"
          },
          "board_url": {
            "type": "string",
            "format": "uri"
          }
        },
        "additionalProperties": true
      },
      "CompanySummary": {
        "type": "object",
        "required": [
          "id",
          "name",
          "naics",
          "industry",
          "revenue",
          "employees",
          "sources"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "city": {
            "type": [
              "string",
              "null"
            ]
          },
          "state": {
            "type": [
              "string",
              "null"
            ]
          },
          "zip": {
            "type": [
              "string",
              "null"
            ]
          },
          "naics": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "industry": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "industryLabel": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "website": {
            "type": [
              "string",
              "null"
            ]
          },
          "revenue": {
            "type": "object",
            "properties": {
              "value": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "low": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "high": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "basis": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "filed",
                  "observed",
                  "estimate",
                  null
                ]
              }
            }
          },
          "employees": {
            "type": "object",
            "properties": {
              "value": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "low": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "high": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "basis": {
                "type": [
                  "string",
                  "null"
                ],
                "enum": [
                  "filed",
                  "observed",
                  "estimate",
                  null
                ]
              }
            }
          },
          "owner": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "role": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "sources": {
            "type": "integer"
          },
          "foundedYear": {
            "type": [
              "integer",
              "null"
            ]
          }
        },
        "additionalProperties": true
      },
      "CompanySearchResponse": {
        "type": "object",
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CompanySummary"
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "additionalProperties": true
      },
      "CompanyMatchResponse": {
        "type": "object",
        "required": [
          "data",
          "cost_usd",
          "remaining_balance_usd"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "total_input",
              "matched_count",
              "unmatched_count",
              "results"
            ],
            "properties": {
              "total_input": {
                "type": "integer"
              },
              "matched_count": {
                "type": "integer"
              },
              "unmatched_count": {
                "type": "integer"
              },
              "domain_matched_count": {
                "type": "integer"
              },
              "fuzzy_matched_count": {
                "type": "integer"
              },
              "cached_owners_count": {
                "type": "integer"
              },
              "matched_company_ids": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "results": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            },
            "additionalProperties": true
          },
          "cost_usd": {
            "type": "number"
          },
          "remaining_balance_usd": {
            "type": "number"
          }
        },
        "additionalProperties": true
      },
      "BuildingSearchResponse": {
        "type": "object",
        "required": [
          "data",
          "next_cursor"
        ],
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "bbl",
                "borough",
                "address",
                "residential_units"
              ],
              "properties": {
                "bbl": {
                  "type": "string",
                  "example": "1008350041"
                },
                "borough": {
                  "type": "string",
                  "enum": [
                    "MN",
                    "BK",
                    "QN",
                    "BX",
                    "SI"
                  ]
                },
                "address": {
                  "type": "string"
                },
                "owner_of_record": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "residential_units": {
                  "type": "integer"
                },
                "building_class": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "year_built": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "zoning": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "rent_stabilized_units": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "loan": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "holder_type": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "estimated_due_year": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "additionalProperties": true
      },
      "RecordResponse": {
        "type": "object",
        "required": [
          "data",
          "cost_usd",
          "remaining_balance_usd",
          "record_url"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "id",
              "kind",
              "name",
              "facts",
              "people",
              "identifiers",
              "sources"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "company",
                  "property",
                  "person"
                ]
              },
              "name": {
                "type": "string"
              },
              "summary": {
                "type": "string"
              },
              "website": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "phone": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "facts": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              "people": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              "identifiers": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              "sources": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              "capsule_freshness": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": true
              }
            },
            "additionalProperties": true
          },
          "cost_usd": {
            "type": "number"
          },
          "remaining_balance_usd": {
            "type": "number"
          },
          "record_url": {
            "type": "string",
            "format": "uri"
          }
        },
        "additionalProperties": true
      },
      "CompanyPagesResponse": {
        "type": "object",
        "required": [
          "data",
          "cost_usd",
          "remaining_balance_usd"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "count",
              "cached_count",
              "live_fetched_count",
              "items"
            ],
            "properties": {
              "count": {
                "type": "integer"
              },
              "cached_count": {
                "type": "integer"
              },
              "live_fetched_count": {
                "type": "integer"
              },
              "unreachable_count": {
                "type": "integer"
              },
              "items": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            },
            "additionalProperties": true
          },
          "cost_usd": {
            "type": "number"
          },
          "remaining_balance_usd": {
            "type": "number"
          }
        },
        "additionalProperties": true
      },
      "OwnerLookupRequest": {
        "type": "object",
        "required": [
          "company_id"
        ],
        "properties": {
          "company_id": {
            "type": "string",
            "format": "uuid",
            "description": "Dealport company UUID."
          },
          "person": {
            "type": [
              "string",
              "null"
            ],
            "description": "Optional full name of a specific principal on the company record."
          }
        }
      },
      "OwnerLookupResponse": {
        "type": "object",
        "required": [
          "company",
          "person",
          "phone",
          "email",
          "sources",
          "cost_usd",
          "remaining_balance_usd",
          "record_url"
        ],
        "properties": {
          "company": {
            "type": "object",
            "required": [
              "id",
              "name"
            ],
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "name": {
                "type": "string"
              }
            }
          },
          "person": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "role": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "headline": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "summary": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "linkedin_url": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "photo_url": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "location": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "City and state/country only (street addresses stripped)."
              },
              "seniority": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "department": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "decision_role": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "phones": {
            "type": "array",
            "description": "All verified direct and mobile phone numbers for the person (switchboards and suppressed numbers excluded).",
            "items": {
              "type": "object",
              "required": [
                "number",
                "kind"
              ],
              "properties": {
                "number": {
                  "type": "string"
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "mobile",
                    "direct",
                    "landline"
                  ]
                },
                "label": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "dnc": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          },
          "emails": {
            "type": "array",
            "description": "All work and personal email addresses for the person (shared role mailboxes and suppressed addresses excluded).",
            "items": {
              "type": "object",
              "required": [
                "address",
                "kind"
              ],
              "properties": {
                "address": {
                  "type": "string"
                },
                "kind": {
                  "type": "string",
                  "enum": [
                    "work",
                    "personal"
                  ]
                },
                "verified": {
                  "type": "boolean"
                },
                "status": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "checked_at": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              }
            }
          },
          "profile": {
            "type": [
              "object",
              "null"
            ],
            "description": "Rich professional profile including LinkedIn URL, headline, summary, career roles, education, skills, and certifications.",
            "properties": {
              "headline": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "summary": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "linkedin_url": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "photo_url": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "location": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "seniority": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "department": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "decision_role": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "company": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "name": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "domain": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "industry": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                }
              },
              "roles": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "title": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "company": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "domain": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "start": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "end": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "current": {
                      "type": "boolean"
                    }
                  }
                }
              },
              "education": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "school"
                  ],
                  "properties": {
                    "school": {
                      "type": "string"
                    },
                    "degree": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "field": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "start": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "end": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              },
              "skills": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "certifications": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "languages": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "organizations": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            }
          },
          "sources": {
            "type": "array",
            "items": {
              "type": "object",
              "required": [
                "url",
                "title"
              ],
              "properties": {
                "url": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                }
              }
            }
          },
          "cost_usd": {
            "type": "number"
          },
          "remaining_balance_usd": {
            "type": "number"
          },
          "record_url": {
            "type": "string",
            "format": "uri"
          },
          "note": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "ResearchResponse": {
        "type": "object",
        "required": [
          "data"
        ],
        "properties": {
          "data": {
            "type": "object",
            "required": [
              "research_id",
              "company",
              "status",
              "fields",
              "sources"
            ],
            "properties": {
              "research_id": {
                "type": "string",
                "format": "uuid"
              },
              "company": {
                "type": "object",
                "required": [
                  "id",
                  "name"
                ],
                "properties": {
                  "id": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "uuid"
                  },
                  "name": {
                    "type": "string"
                  }
                }
              },
              "status": {
                "type": "string",
                "enum": [
                  "running",
                  "done",
                  "failed"
                ]
              },
              "fields": {
                "type": "object",
                "additionalProperties": true
              },
              "sources": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                }
              },
              "note": {
                "type": "string"
              }
            },
            "additionalProperties": true
          }
        }
      },
      "AnnotateRequest": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "type": "object",
              "required": [
                "company_id"
              ],
              "properties": {
                "company_id": {
                  "type": "string",
                  "format": "uuid"
                },
                "score": {
                  "type": [
                    "integer",
                    "null"
                  ],
                  "minimum": 0,
                  "maximum": 100
                },
                "verdict": {
                  "type": [
                    "string",
                    "null"
                  ],
                  "enum": [
                    "priority",
                    "qualified",
                    "watch",
                    "pass",
                    null
                  ]
                },
                "rationale": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "custom_fields": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "additionalProperties": {
                    "type": [
                      "string",
                      "number",
                      "boolean",
                      "null"
                    ]
                  }
                }
              }
            }
          },
          "company_id": {
            "type": "string",
            "format": "uuid",
            "description": "Single-company shorthand when `items` is omitted."
          },
          "score": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 100
          },
          "verdict": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "priority",
              "qualified",
              "watch",
              "pass",
              null
            ]
          },
          "rationale": {
            "type": [
              "string",
              "null"
            ]
          },
          "custom_fields": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": {
              "type": [
                "string",
                "number",
                "boolean",
                "null"
              ]
            }
          },
          "project_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid"
          },
          "project_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "agent_label": {
            "type": [
              "string",
              "null"
            ]
          },
          "watch": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "ProjectSourceInput": {
        "type": "object",
        "properties": {
          "company_search": {
            "$ref": "#/components/schemas/CompanyFilterBody"
          },
          "property_search": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "enabled": {
            "type": "boolean"
          },
          "weekly_quota": {
            "type": "integer",
            "minimum": 1
          },
          "cadence": {
            "type": "string",
            "enum": [
              "weekly",
              "monthly"
            ]
          },
          "monday_of_month": {
            "type": "integer",
            "minimum": 1,
            "maximum": 4
          },
          "recheck": {
            "type": "boolean"
          },
          "monthly_budget_usd": {
            "type": [
              "number",
              "null"
            ],
            "minimum": 0
          }
        }
      }
    }
  }
}
