{
  "openapi": "3.1.0",
  "info": {
    "title": "Tradehaus API",
    "version": "1.0.0",
    "description": "Read a company’s pipeline, Directory, notes, quotes and activity, and write notes and deal stages. Each key belongs to one company and sees only that company’s records. Keys are issued by Tradehaus. Field definitions and data rules: docs/api/data-dictionary.md."
  },
  "servers": [
    {
      "url": "/api/v1",
      "description": "This deployment"
    }
  ],
  "security": [
    {
      "apiKey": []
    }
  ],
  "tags": [
    {
      "name": "Key"
    },
    {
      "name": "Pipeline",
      "description": "Customer Data"
    },
    {
      "name": "Directory",
      "description": "Customer Data"
    },
    {
      "name": "Firms",
      "description": "The company’s relationships with firms"
    },
    {
      "name": "Notes",
      "description": "Customer Data"
    },
    {
      "name": "Quotes",
      "description": "Customer Data"
    },
    {
      "name": "Activity",
      "description": "Customer Data"
    },
    {
      "name": "Projects",
      "description": "Tradehaus Data, one at a time"
    }
  ],
  "paths": {
    "/key": {
      "get": {
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "read",
        "tags": [
          "Key"
        ],
        "operationId": "getKey",
        "summary": "The key making the request",
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until the minute window restarts"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Key"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "key_80b42f8f54812408",
                    "prefix": "th_test_xxxxxxxx…",
                    "label": "Test",
                    "scopes": [
                      "read",
                      "write"
                    ],
                    "created_at": "2026-11-21T18:41:26.000Z",
                    "company": {
                      "id": "biz_example",
                      "name": "Example Flooring Co."
                    },
                    "limits": {
                      "requests_per_minute": 60,
                      "requests_per_day": 10000,
                      "project_reads_per_day": 500,
                      "max_page_size": 100
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope, or the company is paused",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Retry-After says how many seconds to wait.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deals": {
      "get": {
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "read",
        "tags": [
          "Pipeline"
        ],
        "operationId": "listDeals",
        "summary": "Deals in the pipeline, oldest change first",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Items per page, 1 to 100. Default 50. A larger number is read as 100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "The next_cursor from the previous page. Opaque; only valid for the list it came from.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "description": "Only items changed at or after this time. A date (YYYY-MM-DD, midnight UTC) or an ISO 8601 time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "stage",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "new",
                "shortlist",
                "connected",
                "specified",
                "quoted",
                "won",
                "delivered",
                "lost",
                "passed"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until the minute window restarts"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "next_cursor"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Deal"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as cursor for the next page. Null on the last page."
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "a3071226a1",
                      "project_id": "a3071226a1",
                      "stage": "new",
                      "stage_label": "New",
                      "starred": false,
                      "lost_reason": null,
                      "lost_reason_label": null,
                      "expected_order": null,
                      "expected_delivery": null,
                      "category": null,
                      "tags": [],
                      "note_count": 3,
                      "last_note_at": "2026-09-30T22:03:53.078Z",
                      "added_by_company": false,
                      "archived": false,
                      "project": {
                        "id": "a3071226a1",
                        "name": null,
                        "address": "2150 Coastal Sage Ln",
                        "city": "Encinitas",
                        "state": "CA",
                        "zip": "92024",
                        "region": "sd",
                        "region_label": "San Diego County"
                      },
                      "updated_at": "2026-10-02T00:46:46.407Z",
                      "updated_by": {
                        "id": "rep_8k2m4q",
                        "name": "Sam Rivera"
                      }
                    },
                    {
                      "id": "c6b6afb962",
                      "project_id": "c6b6afb962",
                      "stage": "new",
                      "stage_label": "New",
                      "starred": false,
                      "lost_reason": null,
                      "lost_reason_label": null,
                      "expected_order": null,
                      "expected_delivery": null,
                      "category": null,
                      "tags": [],
                      "note_count": 0,
                      "last_note_at": null,
                      "added_by_company": false,
                      "archived": false,
                      "project": {
                        "id": "c6b6afb962",
                        "name": null,
                        "address": "845 Mariposa Avenue",
                        "city": "Los Angeles",
                        "state": "CA",
                        "zip": "90063",
                        "region": "la",
                        "region_label": "Los Angeles"
                      },
                      "updated_at": "2026-10-02T17:45:33.855Z",
                      "updated_by": {
                        "id": "rep_8k2m4q",
                        "name": "Sam Rivera"
                      }
                    }
                  ],
                  "next_cursor": "eyJsIjoiZGVhbHMiLCJhIjoiMjAyNi0xMC0wMlQxNzo0NTozMy44NTVaIiwiaSI6ImM2YjZhZmI5NjIifQ"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope, or the company is paused",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Retry-After says how many seconds to wait.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{project_id}": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "description": "The id of the project the deal is on",
          "schema": {
            "type": "string",
            "maxLength": 200
          }
        }
      ],
      "get": {
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "read",
        "tags": [
          "Pipeline"
        ],
        "operationId": "getDeal",
        "summary": "One deal",
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until the minute window restarts"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Deal"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "6c41738038",
                    "project_id": "6c41738038",
                    "stage": "quoted",
                    "stage_label": "Quoted",
                    "starred": false,
                    "lost_reason": null,
                    "lost_reason_label": null,
                    "expected_order": null,
                    "expected_delivery": null,
                    "category": null,
                    "tags": [],
                    "note_count": 1,
                    "last_note_at": "2026-11-21T18:41:52.232Z",
                    "added_by_company": false,
                    "archived": false,
                    "project": {
                      "id": "6c41738038",
                      "name": null,
                      "address": "1180 NW Ridgeline Dr",
                      "city": "Bend",
                      "state": "OR",
                      "zip": "97703",
                      "region": "bnd",
                      "region_label": "Bend"
                    },
                    "updated_at": "2026-11-21T18:41:53.193Z",
                    "updated_by": null
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope, or the company is paused",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No deal on that project",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Retry-After says how many seconds to wait.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "write",
        "tags": [
          "Pipeline"
        ],
        "operationId": "setDealStage",
        "summary": "Move a deal to a stage",
        "description": "Works only on a project the company has already acted on in the app, or added itself. The change is recorded in the project’s history as made through the API.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "stage"
                ],
                "additionalProperties": false,
                "properties": {
                  "stage": {
                    "type": "string",
                    "enum": [
                      "new",
                      "shortlist",
                      "connected",
                      "specified",
                      "quoted",
                      "won",
                      "delivered",
                      "lost",
                      "passed"
                    ]
                  },
                  "lost_reason": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "enum": [
                      "price",
                      "competitor",
                      "stalled",
                      "no_response",
                      "timing",
                      "other",
                      null
                    ],
                    "description": "Only with stage lost"
                  }
                }
              },
              "example": {
                "stage": "quoted"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until the minute window restarts"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Deal"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "6c41738038",
                    "project_id": "6c41738038",
                    "stage": "quoted",
                    "stage_label": "Quoted",
                    "starred": false,
                    "lost_reason": null,
                    "lost_reason_label": null,
                    "expected_order": null,
                    "expected_delivery": null,
                    "category": null,
                    "tags": [],
                    "note_count": 1,
                    "last_note_at": "2026-11-21T18:41:52.232Z",
                    "added_by_company": false,
                    "archived": false,
                    "project": {
                      "id": "6c41738038",
                      "name": null,
                      "address": "1180 NW Ridgeline Dr",
                      "city": "Bend",
                      "state": "OR",
                      "zip": "97703",
                      "region": "bnd",
                      "region_label": "Bend"
                    },
                    "updated_at": "2026-11-21T18:41:53.193Z",
                    "updated_by": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "A field is not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope, or the company is paused",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No project with that id among the ones the company has acted on",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 4 KB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Retry-After says how many seconds to wait.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/accounts": {
      "get": {
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "read",
        "tags": [
          "Directory"
        ],
        "operationId": "listAccounts",
        "summary": "Directory companies, oldest change first",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Items per page, 1 to 100. Default 50. A larger number is read as 100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "The next_cursor from the previous page. Opaque; only valid for the list it came from.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "description": "Only items changed at or after this time. A date (YYYY-MM-DD, midnight UTC) or an ISO 8601 time.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until the minute window restarts"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "next_cursor"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Account"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as cursor for the next page. Null on the last page."
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "7f5865cc-6872-41ca-99fc-30145018838d",
                      "name": "Northfield Architecture",
                      "dba": null,
                      "type": "other",
                      "type_label": "Other",
                      "roles": [],
                      "status": "prospect",
                      "status_label": "Prospect",
                      "tier": null,
                      "market": null,
                      "owner": {
                        "id": "member_d2cb721288a873b1bfd2338da169a7c7",
                        "name": "Alex (Admin)"
                      },
                      "source": "permit",
                      "source_note": null,
                      "phone": null,
                      "email": null,
                      "website": null,
                      "instagram": null,
                      "locations": [],
                      "commercial": {
                        "customer_number": null,
                        "default_discount_pct": null,
                        "payment_terms": null,
                        "credit_limit": null,
                        "resale_cert_number": null,
                        "resale_cert_expires": null,
                        "billing_email": null,
                        "tax_id": null,
                        "po_required": false,
                        "displays": null,
                        "brands_carried": [],
                        "annual_sf_potential": null
                      },
                      "firm_key": "firm|northfield architecture",
                      "project_ids": [
                        "a7d08005bf",
                        "1f3ee52594",
                        "d1c6bc1a03"
                      ],
                      "notes": null,
                      "archived": false,
                      "created_at": "2026-11-05T21:37:39.844Z",
                      "updated_at": "2026-11-05T21:38:09.816Z",
                      "created_by": {
                        "id": "member_d2cb721288a873b1bfd2338da169a7c7",
                        "name": "Alex (Admin)"
                      }
                    }
                  ],
                  "next_cursor": "eyJsIjoiYWNjb3VudHMiLCJhIjoiMjAyNi0xMS0wNVQyMTozODowOS44MTZaIiwiaSI6IjdmNTg2NWNjLTY4NzItNDFjYS05OWZjLTMwMTQ1MDE4ODM4ZCJ9"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope, or the company is paused",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Retry-After says how many seconds to wait.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/contacts": {
      "get": {
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "read",
        "tags": [
          "Directory"
        ],
        "operationId": "listContacts",
        "summary": "Directory people, oldest change first",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Items per page, 1 to 100. Default 50. A larger number is read as 100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "The next_cursor from the previous page. Opaque; only valid for the list it came from.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "description": "Only items changed at or after this time. A date (YYYY-MM-DD, midnight UTC) or an ISO 8601 time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "account_id",
            "in": "query",
            "description": "Only people at this company",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until the minute window restarts"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "next_cursor"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Contact"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as cursor for the next page. Null on the last page."
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "c2f1a7e0-5b8d-4f2e-9a61-3d0c7b9e4a12",
                      "account_id": "7f5865cc-6872-41ca-99fc-30145018838d",
                      "first_name": "Dana",
                      "last_name": "Morrow",
                      "title": "Principal",
                      "buying_role": "specifier",
                      "buying_role_label": "Specifier",
                      "roles": [
                        "specifier"
                      ],
                      "primary": true,
                      "email": "dana@example.com",
                      "mobile": "555-0142",
                      "office": null,
                      "preferred_channel": "email",
                      "best_time": "Mornings",
                      "linkedin": null,
                      "instagram": null,
                      "location_id": null,
                      "status": "active",
                      "do_not_contact": false,
                      "notes": null,
                      "created_at": "2026-11-05T21:40:12.511Z",
                      "updated_at": "2026-11-05T21:40:12.511Z",
                      "created_by": {
                        "id": "member_d2cb721288a873b1bfd2338da169a7c7",
                        "name": "Alex (Admin)"
                      }
                    }
                  ],
                  "next_cursor": null
                }
              }
            }
          },
          "400": {
            "description": "A parameter is not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope, or the company is paused",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Retry-After says how many seconds to wait.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/firms": {
      "get": {
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "read",
        "tags": [
          "Firms"
        ],
        "operationId": "listFirms",
        "summary": "Firms the company has a relationship with, oldest change first",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Items per page, 1 to 100. Default 50. A larger number is read as 100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "The next_cursor from the previous page. Opaque; only valid for the list it came from.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "description": "Only items changed at or after this time. A date (YYYY-MM-DD, midnight UTC) or an ISO 8601 time.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until the minute window restarts"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "next_cursor"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Firm"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as cursor for the next page. Null on the last page."
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "key": "firm|harbor line builders",
                      "name": "harbor line builders",
                      "relationship": "intro",
                      "relationship_label": "Intro",
                      "relationship_set_by": null,
                      "relationship_at": null,
                      "follow": false,
                      "labels": [],
                      "account_id": null,
                      "updated_at": "2026-10-07T02:50:49.338Z"
                    },
                    {
                      "key": "firm|oak and stone studio",
                      "name": "oak and stone studio",
                      "relationship": "active",
                      "relationship_label": "Active",
                      "relationship_set_by": null,
                      "relationship_at": null,
                      "follow": false,
                      "labels": [],
                      "account_id": null,
                      "updated_at": "2026-10-21T14:58:58.300Z"
                    }
                  ],
                  "next_cursor": "eyJsIjoiZmlybXMiLCJhIjoiMjAyNi0xMC0yMVQxNDo1ODo1OC4zMDBaIiwiaSI6ImZpcm18b2FrIGFuZCBzdG9uZSBzdHVkaW8ifQ"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope, or the company is paused",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Retry-After says how many seconds to wait.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/notes": {
      "get": {
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "read",
        "tags": [
          "Notes"
        ],
        "operationId": "listNotes",
        "summary": "A project’s notes, oldest first",
        "parameters": [
          {
            "name": "project_id",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Items per page, 1 to 100. Default 50. A larger number is read as 100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "The next_cursor from the previous page. Opaque; only valid for the list it came from.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until the minute window restarts"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "next_cursor"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Note"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as cursor for the next page. Null on the last page."
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "2026-11-21T18:41:52.232Z",
                      "project_id": "6c41738038",
                      "kind": "text",
                      "body": "Measured the great room; revised quote goes out Friday.",
                      "transcript": null,
                      "has_media": false,
                      "duration_ms": null,
                      "via": "api",
                      "created_at": "2026-11-21T18:41:52.232Z",
                      "created_by": null
                    }
                  ],
                  "next_cursor": null
                }
              }
            }
          },
          "400": {
            "description": "project_id is missing",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope, or the company is paused",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Retry-After says how many seconds to wait.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "write",
        "tags": [
          "Notes"
        ],
        "operationId": "createNote",
        "summary": "Add a text note to a project",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "project_id",
                  "body"
                ],
                "additionalProperties": false,
                "properties": {
                  "project_id": {
                    "type": "string",
                    "maxLength": 200
                  },
                  "body": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 8000,
                    "description": "Up to 8,000 characters, counted as characters, not bytes. Longer text is refused with 400, never cut short."
                  }
                }
              },
              "example": {
                "project_id": "6c41738038",
                "body": "Measured the great room; revised quote goes out Friday."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Note"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "2026-11-21T18:41:52.232Z",
                    "project_id": "6c41738038",
                    "kind": "text",
                    "body": "Measured the great room; revised quote goes out Friday.",
                    "transcript": null,
                    "has_media": false,
                    "duration_ms": null,
                    "via": "api",
                    "created_at": "2026-11-21T18:41:52.232Z",
                    "created_by": null
                  }
                }
              }
            }
          },
          "400": {
            "description": "A field is not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope, or the company is paused",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No project with that id among the ones the company has acted on",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "The body is larger than 64 KB",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Retry-After says how many seconds to wait.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/quotes": {
      "get": {
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "read",
        "tags": [
          "Quotes"
        ],
        "operationId": "listQuotes",
        "summary": "Saved quotes, oldest first",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Items per page, 1 to 100. Default 50. A larger number is read as 100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "The next_cursor from the previous page. Opaque; only valid for the list it came from.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "updated_since",
            "in": "query",
            "description": "Only quotes saved at or after this time. Quotes never change once saved.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "description": "Only this project’s quotes (its latest 100)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until the minute window restarts"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "next_cursor"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Quote"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as cursor for the next page. Null on the last page."
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "77106a391d~2026-10-02T02:02:26.351Z",
                      "project_id": "77106a391d",
                      "number": null,
                      "created_at": "2026-10-02T02:02:26.351Z",
                      "created_by": {
                        "id": "rep_8k2m4q",
                        "name": "Sam Rivera"
                      },
                      "brand_id": "example",
                      "product_id": "oak-natural",
                      "product_name": "Oak · Natural",
                      "format": "plank",
                      "thickness_in": null,
                      "width_in": null,
                      "length": "3'6 1/2\"-9'10\"",
                      "grade": "Select",
                      "list_usd_per_sf": 38.59,
                      "discount_pct": 43,
                      "area_mode": "exact",
                      "home_sf": 2974,
                      "exact_area_sf": 1800,
                      "coverage": 1,
                      "value_low": 43553,
                      "value_high": 43553,
                      "currency": "USD",
                      "note": null
                    }
                  ],
                  "next_cursor": "eyJsIjoicXVvdGVzIiwiayI6eyJjcmVhdGVkQXQiOiIyMDI2LTEwLTAyVDAyOjAyOjI2LjM1MVoiLCJidXNpbmVzc0lkIjoiYml6X2V4YW1wbGUiLCJidXNpbmVzc1Byb2plY3QiOiJiaXpfZXhhbXBsZSM3NzEwNmEzOTFkIn19"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope, or the company is paused",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Retry-After says how many seconds to wait.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/activity": {
      "get": {
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "read",
        "tags": [
          "Activity"
        ],
        "operationId": "listActivity",
        "summary": "Logged activity, oldest first",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Items per page, 1 to 100. Default 50. A larger number is read as 100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "The next_cursor from the previous page. Opaque; only valid for the list it came from.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "occurred_since",
            "in": "query",
            "description": "Only activity that happened at or after this time (the at field). A date or an ISO 8601 time.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "description": "One project’s timeline (its latest 500)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "account_id",
            "in": "query",
            "description": "One Directory company’s timeline (its latest 500)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until the minute window restarts"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data",
                    "next_cursor"
                  ],
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Activity"
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": "Pass as cursor for the next page. Null on the last page."
                    }
                  }
                },
                "example": {
                  "data": [
                    {
                      "id": "085c475a-1267-6114-becf-9bb63fa217dc",
                      "kind": "visit",
                      "kind_label": "Visit",
                      "at": "2026-10-08T15:21:26.528Z",
                      "body": null,
                      "duration_min": null,
                      "project_id": "d3911e484d",
                      "project_label": "410 Harbor View",
                      "account_id": null,
                      "account_label": null,
                      "contact_id": null,
                      "contact_label": null,
                      "linked_account_ids": [],
                      "samples": null,
                      "visit": {
                        "auto": false,
                        "stopIndex": 0,
                        "routeDay": "2026-10-08",
                        "arrivedAt": "2026-10-08T15:21:26.528Z",
                        "leftAt": "2026-10-08T15:38:02.033Z"
                      },
                      "via": "field",
                      "created_by": {
                        "id": "rep_8k2m4q",
                        "name": "Sam Rivera"
                      },
                      "created_at": "2026-10-08T15:21:26.637Z",
                      "updated_at": "2026-10-08T15:38:02.147Z"
                    }
                  ],
                  "next_cursor": "eyJsIjoiYWN0aXZpdHkiLCJrIjp7ImJ1c2luZXNzSWQiOiJiaXpfZXhhbXBsZSIsInNrIjoiMjAyNi0xMC0wOFQxNToyMToyNi41MjhaIzA4NWM0NzVhLTEyNjctNjExNC1iZWNmLTliYjYzZmEyMTdkYyJ9fQ"
                }
              }
            }
          },
          "400": {
            "description": "A parameter is not valid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope, or the company is paused",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Retry-After says how many seconds to wait.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/projects/{id}": {
      "get": {
        "security": [
          {
            "apiKey": []
          }
        ],
        "x-scope": "read",
        "tags": [
          "Projects"
        ],
        "operationId": "getProject",
        "summary": "One project the company has acted on",
        "description": "Counts against the key’s daily project reads. There is no list of projects.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-RateLimit-Limit": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Remaining": {
                "schema": {
                  "type": "integer"
                }
              },
              "X-RateLimit-Reset": {
                "schema": {
                  "type": "integer"
                },
                "description": "Seconds until the minute window restarts"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "data"
                  ],
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Project"
                    }
                  }
                },
                "example": {
                  "data": {
                    "id": "6c41738038",
                    "source": "tradehaus",
                    "name": null,
                    "address": "1180 NW Ridgeline Dr",
                    "city": "Bend",
                    "state": "OR",
                    "zip": "97703",
                    "region": "bnd",
                    "region_label": "Bend",
                    "kind": "new_build",
                    "kind_label": "New build",
                    "phase": "plan_check",
                    "phase_label": "Plan check",
                    "valuation": 273000,
                    "sqft": 3102,
                    "units": 1,
                    "description": "New single-family home, two stories with attached garage",
                    "first_filed": "2026-10-01",
                    "last_activity": "2026-10-01",
                    "permit_count": 1,
                    "parties": [
                      {
                        "name": "Northfield Architecture",
                        "role": "architect"
                      }
                    ],
                    "deal": {
                      "stage": "quoted",
                      "starred": false,
                      "updated_at": "2026-11-21T18:41:53.193Z"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "description": "Missing, unknown or revoked key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The key lacks the scope, or the company is paused",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No project with that id among the ones the company has acted on",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Rate limited. Retry-After says how many seconds to wait.",
            "headers": {
              "Retry-After": {
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Server error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "apiKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "Authorization: Bearer th_live_… (th_test_… outside production)"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "Stable, machine-readable",
                "enum": [
                  "unauthorized",
                  "key_revoked",
                  "insufficient_scope",
                  "company_unavailable",
                  "method_not_allowed",
                  "invalid_parameter",
                  "invalid_cursor",
                  "payload_too_large",
                  "not_found",
                  "rate_limited",
                  "server_error"
                ]
              },
              "message": {
                "type": "string",
                "description": "For a person to read"
              }
            },
            "required": [
              "code",
              "message"
            ]
          }
        }
      },
      "Person": {
        "type": "object",
        "description": "A member of the company",
        "properties": {
          "id": {
            "type": "string",
            "description": "Member id"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Their name in Tradehaus"
          }
        },
        "required": [
          "id",
          "name"
        ]
      },
      "Key": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Key id"
          },
          "prefix": {
            "type": "string",
            "description": "The start of the key"
          },
          "label": {
            "type": "string",
            "description": "What staff named it"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "read",
                "write"
              ]
            }
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When it was made"
          },
          "company": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "description": "Company id"
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Company name"
              }
            },
            "required": [
              "id",
              "name"
            ]
          },
          "limits": {
            "type": "object",
            "properties": {
              "requests_per_minute": {
                "type": "integer"
              },
              "requests_per_day": {
                "type": "integer"
              },
              "project_reads_per_day": {
                "type": "integer"
              },
              "max_page_size": {
                "type": "integer"
              }
            },
            "required": [
              "requests_per_minute",
              "requests_per_day",
              "project_reads_per_day",
              "max_page_size"
            ]
          }
        },
        "required": [
          "id",
          "prefix",
          "label",
          "scopes",
          "created_at",
          "company",
          "limits"
        ]
      },
      "DealProject": {
        "type": "object",
        "description": "Where the deal is",
        "properties": {
          "id": {
            "type": "string",
            "description": "Project id"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Project name"
          },
          "address": {
            "type": [
              "string",
              "null"
            ],
            "description": "Street address"
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "description": "City"
          },
          "state": {
            "type": [
              "string",
              "null"
            ],
            "description": "State"
          },
          "zip": {
            "type": [
              "string",
              "null"
            ],
            "description": "ZIP"
          },
          "region": {
            "type": [
              "string",
              "null"
            ],
            "description": "Market id"
          },
          "region_label": {
            "type": [
              "string",
              "null"
            ],
            "description": "Market name"
          }
        },
        "required": [
          "id",
          "name",
          "address",
          "city",
          "state",
          "zip",
          "region",
          "region_label"
        ]
      },
      "Deal": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Same as project_id"
          },
          "project_id": {
            "type": "string",
            "description": "The project the deal is on"
          },
          "stage": {
            "type": "string",
            "description": "Pipeline stage",
            "enum": [
              "new",
              "shortlist",
              "connected",
              "specified",
              "quoted",
              "won",
              "delivered",
              "lost",
              "passed"
            ]
          },
          "stage_label": {
            "type": "string",
            "description": "As the app shows it"
          },
          "starred": {
            "type": "boolean",
            "description": "Starred in the app"
          },
          "lost_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why it was lost",
            "enum": [
              "price",
              "competitor",
              "stalled",
              "no_response",
              "timing",
              "other",
              null
            ]
          },
          "lost_reason_label": {
            "type": [
              "string",
              "null"
            ],
            "description": "As the app shows it"
          },
          "expected_order": {
            "type": [
              "string",
              "null"
            ],
            "description": "Expected order day, YYYY-MM-DD"
          },
          "expected_delivery": {
            "type": [
              "string",
              "null"
            ],
            "description": "Expected delivery day, YYYY-MM-DD"
          },
          "category": {
            "type": [
              "string",
              "null"
            ],
            "description": "The company’s own category for the project, when set",
            "enum": [
              "new_build",
              "rebuild",
              "addition",
              "remodel",
              "adu",
              "design_review",
              "planning",
              "demo",
              "pool",
              "mdu",
              "mixed_use",
              "tract",
              "commercial",
              "other",
              null
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Tags"
          },
          "note_count": {
            "type": "integer"
          },
          "last_note_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Newest note"
          },
          "added_by_company": {
            "type": "boolean",
            "description": "The company entered this project itself"
          },
          "archived": {
            "type": "boolean",
            "description": "An added project that was archived"
          },
          "project": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/DealProject"
              },
              {
                "type": "null"
              }
            ],
            "description": "Null when the project is outside the company’s current view"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "Last change"
          },
          "updated_by": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Person"
              },
              {
                "type": "null"
              }
            ],
            "description": "Who made the last change; null for the API or the system"
          }
        },
        "required": [
          "id",
          "project_id",
          "stage",
          "stage_label",
          "starred",
          "lost_reason",
          "lost_reason_label",
          "expected_order",
          "expected_delivery",
          "category",
          "tags",
          "note_count",
          "last_note_at",
          "added_by_company",
          "archived",
          "project",
          "updated_at",
          "updated_by"
        ]
      },
      "Location": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": ""
          },
          "label": {
            "type": [
              "string",
              "null"
            ],
            "description": "",
            "enum": [
              "office",
              "showroom",
              "warehouse",
              "studio",
              "billing",
              "ship_to",
              "site",
              null
            ]
          },
          "line1": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "state": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "zip": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "hours": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "primary": {
            "type": "boolean",
            "description": ""
          },
          "lat": {
            "type": [
              "number",
              "null"
            ],
            "description": ""
          },
          "lon": {
            "type": [
              "number",
              "null"
            ],
            "description": ""
          }
        },
        "required": [
          "id",
          "label",
          "line1",
          "city",
          "state",
          "zip",
          "hours",
          "notes",
          "primary",
          "lat",
          "lon"
        ]
      },
      "Commercial": {
        "type": "object",
        "properties": {
          "customer_number": {
            "type": [
              "string",
              "null"
            ],
            "description": "Customer number in the company’s ERP"
          },
          "default_discount_pct": {
            "type": [
              "number",
              "null"
            ],
            "description": ""
          },
          "payment_terms": {
            "type": [
              "string",
              "null"
            ],
            "description": "",
            "enum": [
              "prepaid",
              "cod",
              "net15",
              "net30",
              "net45",
              "net60",
              null
            ]
          },
          "credit_limit": {
            "type": [
              "number",
              "null"
            ],
            "description": "USD"
          },
          "resale_cert_number": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "resale_cert_expires": {
            "type": [
              "string",
              "null"
            ],
            "description": "YYYY-MM-DD"
          },
          "billing_email": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "tax_id": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "po_required": {
            "type": "boolean",
            "description": ""
          },
          "displays": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "brands_carried": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "annual_sf_potential": {
            "type": [
              "number",
              "null"
            ],
            "description": "Square feet a year"
          }
        },
        "required": [
          "customer_number",
          "default_discount_pct",
          "payment_terms",
          "credit_limit",
          "resale_cert_number",
          "resale_cert_expires",
          "billing_email",
          "tax_id",
          "po_required",
          "displays",
          "brands_carried",
          "annual_sf_potential"
        ]
      },
      "Account": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": ""
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "dba": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "type": {
            "type": [
              "string",
              "null"
            ],
            "description": "",
            "enum": [
              "dealer",
              "flooring_contractor",
              "builder",
              "developer",
              "architect",
              "designer",
              "homeowner",
              "other",
              null
            ]
          },
          "type_label": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "buyer",
                "specifier"
              ]
            }
          },
          "status": {
            "type": [
              "string",
              "null"
            ],
            "description": "",
            "enum": [
              "prospect",
              "active",
              "dormant",
              "do_not_sell",
              null
            ]
          },
          "status_label": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "tier": {
            "type": [
              "string",
              "null"
            ],
            "description": "",
            "enum": [
              "A",
              "B",
              "C",
              null
            ]
          },
          "market": {
            "type": [
              "string",
              "null"
            ],
            "description": "Market id"
          },
          "owner": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Person"
              },
              {
                "type": "null"
              }
            ],
            "description": "Account owner"
          },
          "source": {
            "type": [
              "string",
              "null"
            ],
            "description": "",
            "enum": [
              "permit",
              "referral",
              "trade_show",
              "showroom",
              "website",
              "campaign",
              "existing",
              "other",
              null
            ]
          },
          "source_note": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "phone": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "website": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "instagram": {
            "type": [
              "string",
              "null"
            ],
            "description": "Handle"
          },
          "locations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Location"
            }
          },
          "commercial": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Commercial"
              },
              {
                "type": "null"
              }
            ],
            "description": "Terms, when entered"
          },
          "firm_key": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Tradehaus firm this company lies over, when linked"
          },
          "project_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Projects linked to it"
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "archived": {
            "type": "boolean",
            "description": ""
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": ""
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": ""
          },
          "created_by": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Person"
              },
              {
                "type": "null"
              }
            ],
            "description": ""
          }
        },
        "required": [
          "id",
          "name",
          "dba",
          "type",
          "type_label",
          "roles",
          "status",
          "status_label",
          "tier",
          "market",
          "owner",
          "source",
          "source_note",
          "phone",
          "email",
          "website",
          "instagram",
          "locations",
          "commercial",
          "firm_key",
          "project_ids",
          "notes",
          "archived",
          "created_at",
          "updated_at",
          "created_by"
        ]
      },
      "Contact": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": ""
          },
          "account_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Their company"
          },
          "first_name": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "last_name": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "title": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "buying_role": {
            "type": [
              "string",
              "null"
            ],
            "description": "",
            "enum": [
              "decision_maker",
              "specifier",
              "purchaser",
              "accounts_payable",
              "project_manager",
              "site_lead",
              "front_desk",
              "other",
              null
            ]
          },
          "buying_role_label": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "roles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "primary": {
            "type": "boolean",
            "description": "Main contact at the company"
          },
          "email": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "mobile": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "office": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "preferred_channel": {
            "type": [
              "string",
              "null"
            ],
            "description": "",
            "enum": [
              "call",
              "text",
              "email",
              null
            ]
          },
          "best_time": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "linkedin": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "instagram": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "location_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Which of the company’s locations"
          },
          "status": {
            "type": "string",
            "description": "",
            "enum": [
              "active",
              "left"
            ]
          },
          "do_not_contact": {
            "type": "boolean",
            "description": ""
          },
          "notes": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": ""
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": ""
          },
          "created_by": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Person"
              },
              {
                "type": "null"
              }
            ],
            "description": ""
          }
        },
        "required": [
          "id",
          "account_id",
          "first_name",
          "last_name",
          "title",
          "buying_role",
          "buying_role_label",
          "roles",
          "primary",
          "email",
          "mobile",
          "office",
          "preferred_channel",
          "best_time",
          "linkedin",
          "instagram",
          "location_id",
          "status",
          "do_not_contact",
          "notes",
          "created_at",
          "updated_at",
          "created_by"
        ]
      },
      "Firm": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string",
            "description": "Firm key, firm|<normalised name>"
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": "From the linked Directory company, else from the key"
          },
          "relationship": {
            "type": "string",
            "description": "",
            "enum": [
              "none",
              "intro",
              "active",
              "partner"
            ]
          },
          "relationship_label": {
            "type": "string",
            "description": ""
          },
          "relationship_set_by": {
            "type": [
              "string",
              "null"
            ],
            "description": "",
            "enum": [
              "person",
              "first_contact",
              null
            ]
          },
          "relationship_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": ""
          },
          "follow": {
            "type": "boolean",
            "description": "New filings go to the Digest"
          },
          "labels": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Lead categories"
          },
          "account_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The Directory company over this firm"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": ""
          }
        },
        "required": [
          "key",
          "name",
          "relationship",
          "relationship_label",
          "relationship_set_by",
          "relationship_at",
          "follow",
          "labels",
          "account_id",
          "updated_at"
        ]
      },
      "Note": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique within the project"
          },
          "project_id": {
            "type": "string",
            "description": ""
          },
          "kind": {
            "type": "string",
            "description": "text for a written note; photo, voice or video for one with media"
          },
          "body": {
            "type": "string",
            "description": ""
          },
          "transcript": {
            "type": [
              "string",
              "null"
            ],
            "description": "For a voice or video note"
          },
          "has_media": {
            "type": "boolean",
            "description": "A photo or recording stays in Tradehaus"
          },
          "duration_ms": {
            "type": [
              "number",
              "null"
            ],
            "description": ""
          },
          "via": {
            "type": [
              "string",
              "null"
            ],
            "description": "api when written through the API"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": ""
          },
          "created_by": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Person"
              },
              {
                "type": "null"
              }
            ],
            "description": "Null for a note written through the API"
          }
        },
        "required": [
          "id",
          "project_id",
          "kind",
          "body",
          "transcript",
          "has_media",
          "duration_ms",
          "via",
          "created_at",
          "created_by"
        ]
      },
      "Quote": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "project_id~created_at"
          },
          "project_id": {
            "type": "string",
            "description": ""
          },
          "number": {
            "type": [
              "integer",
              "null"
            ]
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": ""
          },
          "created_by": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Person"
              },
              {
                "type": "null"
              }
            ],
            "description": ""
          },
          "brand_id": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "product_id": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "product_name": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "format": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "thickness_in": {
            "type": [
              "number",
              "null"
            ],
            "description": ""
          },
          "width_in": {
            "type": [
              "number",
              "null"
            ],
            "description": ""
          },
          "length": {
            "description": "As entered"
          },
          "grade": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "list_usd_per_sf": {
            "type": [
              "number",
              "null"
            ],
            "description": "List price per square foot"
          },
          "discount_pct": {
            "type": [
              "number",
              "null"
            ],
            "description": "Off list"
          },
          "area_mode": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "home_sf": {
            "type": [
              "number",
              "null"
            ],
            "description": ""
          },
          "exact_area_sf": {
            "type": [
              "number",
              "null"
            ],
            "description": ""
          },
          "coverage": {
            "description": "As entered"
          },
          "value_low": {
            "type": [
              "number",
              "null"
            ],
            "description": "Net value, low"
          },
          "value_high": {
            "type": [
              "number",
              "null"
            ],
            "description": "Net value, high"
          },
          "currency": {
            "type": "string",
            "description": ""
          },
          "note": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          }
        },
        "required": [
          "id",
          "project_id",
          "number",
          "created_at",
          "created_by",
          "brand_id",
          "product_id",
          "product_name",
          "format",
          "thickness_in",
          "width_in",
          "length",
          "grade",
          "list_usd_per_sf",
          "discount_pct",
          "area_mode",
          "home_sf",
          "exact_area_sf",
          "coverage",
          "value_low",
          "value_high",
          "currency",
          "note"
        ]
      },
      "Activity": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": ""
          },
          "kind": {
            "type": [
              "string",
              "null"
            ],
            "description": "",
            "enum": [
              "visit",
              "call",
              "email",
              "meeting",
              "sample",
              "note",
              null
            ]
          },
          "kind_label": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When it happened"
          },
          "body": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "duration_min": {
            "type": [
              "number",
              "null"
            ],
            "description": ""
          },
          "project_id": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "project_label": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "account_id": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "account_label": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "contact_id": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "contact_label": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "linked_account_ids": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Directory companies it also shows on"
          },
          "samples": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "items": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": ""
                    },
                    "detail": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "description": ""
                    },
                    "qty": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "name",
                    "detail",
                    "qty"
                  ]
                }
              },
              "follow_up_days": {
                "type": [
                  "number",
                  "null"
                ],
                "description": ""
              }
            }
          },
          "visit": {
            "type": [
              "object",
              "null"
            ],
            "description": "Arrival and departure for a visit"
          },
          "via": {
            "type": [
              "string",
              "null"
            ],
            "description": "How it was logged"
          },
          "created_by": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Person"
              },
              {
                "type": "null"
              }
            ],
            "description": ""
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": ""
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": ""
          }
        },
        "required": [
          "id",
          "kind",
          "kind_label",
          "at",
          "body",
          "duration_min",
          "project_id",
          "project_label",
          "account_id",
          "account_label",
          "contact_id",
          "contact_label",
          "linked_account_ids",
          "samples",
          "visit",
          "via",
          "created_by",
          "created_at",
          "updated_at"
        ]
      },
      "Party": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": ""
          },
          "role": {
            "type": [
              "string",
              "null"
            ],
            "description": "architect, designer, builder, contractor and so on"
          }
        },
        "required": [
          "name",
          "role"
        ]
      },
      "Project": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": ""
          },
          "source": {
            "type": "string",
            "description": "tradehaus for a permit project, company for one the company added",
            "enum": [
              "tradehaus",
              "company"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "address": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "city": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "state": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "zip": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "region": {
            "type": [
              "string",
              "null"
            ],
            "description": "Market id"
          },
          "region_label": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "kind": {
            "type": [
              "string",
              "null"
            ],
            "description": "",
            "enum": [
              "new_build",
              "rebuild",
              "addition",
              "remodel",
              "adu",
              "design_review",
              "planning",
              "demo",
              "pool",
              "mdu",
              "mixed_use",
              "tract",
              "commercial",
              "other",
              null
            ]
          },
          "kind_label": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "phase": {
            "type": [
              "string",
              "null"
            ],
            "description": "Permit phase",
            "enum": [
              "design_review",
              "entitlement",
              "plan_check",
              "construction",
              "complete",
              "inactive",
              null
            ]
          },
          "phase_label": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "valuation": {
            "type": [
              "number",
              "null"
            ],
            "description": "Permit valuation in USD. Not revenue."
          },
          "sqft": {
            "type": [
              "number",
              "null"
            ],
            "description": ""
          },
          "units": {
            "type": [
              "number",
              "null"
            ],
            "description": ""
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "description": ""
          },
          "first_filed": {
            "type": [
              "string",
              "null"
            ],
            "description": "YYYY-MM-DD"
          },
          "last_activity": {
            "type": [
              "string",
              "null"
            ],
            "description": "YYYY-MM-DD"
          },
          "permit_count": {
            "type": [
              "number",
              "null"
            ],
            "description": ""
          },
          "parties": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Party"
            },
            "description": "Firms named on the work"
          },
          "deal": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "stage": {
                "type": "string"
              },
              "starred": {
                "type": "boolean"
              },
              "updated_at": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "description": "The company’s deal on it, if any"
          }
        },
        "required": [
          "id",
          "source",
          "name",
          "address",
          "city",
          "state",
          "zip",
          "region",
          "region_label",
          "kind",
          "kind_label",
          "phase",
          "phase_label",
          "valuation",
          "sqft",
          "units",
          "description",
          "first_filed",
          "last_activity",
          "permit_count",
          "parties",
          "deal"
        ]
      }
    }
  }
}
