Skip to content

Investment · Calculation

Rehab scope, contingency and construction schedule

Category budgets yield direct, carry, contingency and overrun amounts. Quantity and rate rows support dependencies, tax, cash draws, change orders and bid comparison. Dependencies use one-based row numbers. Rates and their date come from the caller.

Example result · state: available See output

Cost per success
20 calculation credits
Production plans
Standard, Business, Scale, Enterprise
Plan allowances
Free sandbox
Not available

Integration example

Make a request

Use a production key scoped to investor-rehab-scope.

Keep the key on your server. A successful call uses 20 calculation credits.

Production request

Set HT_PRODUCTION_KEY on your server. Save as example.mjs and run node example.mjs with Node.js 18 or later.

import { randomUUID } from "node:crypto";

const key = process.env.HT_PRODUCTION_KEY;
if (!key) throw new Error("Set HT_PRODUCTION_KEY on your server.");
const endpoint = "https://calc.hasstechapi.com/v2/calc/investor-rehab-scope";
const input = {
  "mode": "category-budget",
  "demolition": 3000,
  "exterior": 5000,
  "interior": 10000,
  "mechanicals": 8000,
  "permitsAndDesign": 2000,
  "contingencyPct": 10,
  "monthlyCarryingCost": 1000,
  "projectMonths": 3,
  "overrunStressPct": 15,
  "calculationDate": "2026-03-01",
  "ratesAsOf": "2026-02-10"
};
const requestId = process.env.HT_REQUEST_ID || Date.now() + "." + randomUUID();
// Keep this ID to look up usage if the connection is interrupted.
console.error("Usage lookup ID:", requestId);

const response = await fetch(endpoint, {
  method: "POST",
  redirect: "error",
  headers: {
    "Authorization": "Bearer " + key,
    "Content-Type": "application/json",
    "Idempotency-Key": requestId
  },
  body: JSON.stringify(input)
});
if (!response.ok) {
  const problem = await response.json().catch(() => null);
  const code = problem?.error?.code || response.statusText;
  const delay = response.headers.get("retry-after");
  if (delay) console.error("Retry-After (seconds):", delay);
  console.error("HTTP " + response.status + " " + code + ". Usage lookup ID: " + requestId);
  if (Array.isArray(problem?.error?.details)) {
    for (const issue of problem.error.details) console.error("Input issue:", JSON.stringify(issue));
  }
  process.exitCode = 1;
} else {
  console.log(JSON.stringify(await response.json(), null, 2));
}
cURL (shell)

Set HT_PRODUCTION_KEY on your server. Run in a POSIX shell with cURL 7.76+ and Python 3.7+ to create a request ID.

(
  set -eu
  : "${HT_PRODUCTION_KEY:?Set HT_PRODUCTION_KEY on your server}"
  request_id="${HT_REQUEST_ID:-}"
  if [ -z "$request_id" ]; then
    request_id=$(python3 -c 'import time, uuid; print(str(time.time_ns() // 1000000) + "." + str(uuid.uuid4()))')
  fi
  printf 'Usage lookup ID: %s\n' "$request_id" >&2
  # On INVALID_INPUT, read error.details in the JSON response body.
  curl --disable --silent --show-error --fail-with-body --include \
    --request POST 'https://calc.hasstechapi.com/v2/calc/investor-rehab-scope' \
    --header "Authorization: Bearer $HT_PRODUCTION_KEY" \
    --header 'Content-Type: application/json' \
    --header "Idempotency-Key: $request_id" \
    --data-binary @- <<'HT_INPUT'
{
  "mode": "category-budget",
  "demolition": 3000,
  "exterior": 5000,
  "interior": 10000,
  "mechanicals": 8000,
  "permitsAndDesign": 2000,
  "contingencyPct": 10,
  "monthlyCarryingCost": 1000,
  "projectMonths": 3,
  "overrunStressPct": 15,
  "calculationDate": "2026-03-01",
  "ratesAsOf": "2026-02-10"
}
HT_INPUT
)
If your request fails
400 INVALID_INPUT

Read error.details when present. Node prints each issue. cURL returns the JSON body. Each path points into your request. An empty path refers to the whole body.

Check the accepted inputs for required fields, units and ranges. Send the corrected JSON as a new request.

401 or 403
Check that the server has the bearer key for the endpoint’s environment and that the key includes investor-rehab-scope.
429
Read the service error code, check your allowance, and wait for the Retry-After interval when supplied before trying again.
Lost response, 409 or 503
Open Request lookup, select the same environment and enter the printed usage lookup ID. A settled ID has already consumed credits. To retry the same calculation, set HT_REQUEST_ID to the original ID and reuse the same inputs. A settled request does not return its result again. Unset the variable for a new request, which can consume credits.

The usage lookup ID is the Idempotency-Key your server sends. The response’s x-request-id identifies the HTTP exchange for support.

Output

Example result

These values come from running this operation on the example inputs.

state
available
budget.directBudget
28000
budget.contingencyReserve
2800
How to interpret this result
  • Category budgets yield direct, carry, contingency and overrun amounts. Quantity and rate rows support dependencies, tax, cash draws, change orders and bid comparison. Dependencies use one-based row numbers. Rates and their date come from the caller.
Full example response (JSON)
{
  "status": "available",
  "result": {
    "state": "available",
    "warnings": [],
    "budget": {
      "directBudget": 28000,
      "contingencyReserve": 2800,
      "carryReserve": 3000,
      "baseProjectNeed": 33800,
      "stressedDirectBudget": 32199.999999999996,
      "stressedProjectNeed": 38000,
      "recommendedCashReserve": 7000,
      "contingencyCoveragePct": 25
    },
    "ledger": {
      "state": "available",
      "fieldErrors": {},
      "warnings": [],
      "assumptions": [
        {
          "key": "overrunStressPct",
          "value": "15",
          "source": "user"
        },
        {
          "key": "lineItemQuantity",
          "value": "1 aggregate scope per category",
          "source": "default"
        },
        {
          "key": "taxPct",
          "value": "0",
          "unit": "%",
          "source": "default"
        },
        {
          "key": "dependencyOrder",
          "value": "demolition -> exterior -> interior -> mechanicals",
          "source": "default"
        },
        {
          "key": "calculationTimeZone",
          "value": "UTC",
          "source": "default"
        }
      ],
      "provenance": [
        {
          "source": "Caller unit-rate assumptions",
          "asOf": "2026-02-10"
        }
      ],
      "formulaVersion": "rehab-scope-critical-path-1.1.0",
      "ruleVersions": [],
      "auditTrail": [
        "4 quantity x rate rows reconciled with tax, permits, contingency, carry, and change orders.",
        "The 15.0000% overrun stress adds 4200.00 to the base project need.",
        "Compatibility adapter: legacy category budgets become explicit quantity x rate rows with a disclosed sequential schedule."
      ],
      "value": {
        "items": [
          {
            "id": "demolition",
            "description": "Demolition / cleanout",
            "quantity": "1",
            "unitRate": "3000",
            "subtotal": "3000",
            "tax": "0",
            "total": "3000",
            "startDay": 0,
            "finishDay": 23
          },
          {
            "id": "exterior",
            "description": "Exterior / structure",
            "quantity": "1",
            "unitRate": "5000",
            "subtotal": "5000",
            "tax": "0",
            "total": "5000",
            "startDay": 23,
            "finishDay": 46
          },
          {
            "id": "interior",
            "description": "Interior scope",
            "quantity": "1",
            "unitRate": "10000",
            "subtotal": "10000",
            "tax": "0",
            "total": "10000",
            "startDay": 46,
            "finishDay": 69
          },
          {
            "id": "mechanicals",
            "description": "Mechanical systems",
            "quantity": "1",
            "unitRate": "8000",
            "subtotal": "8000",
            "tax": "0",
            "total": "8000",
            "startDay": 69,
            "finishDay": 92
          }
        ],
        "subtotal": "26000",
        "tax": "0",
        "permits": "2000",
        "contingency": "2800",
        "carryCost": "3000",
        "changeOrders": "0",
        "total": "33800",
        "overrunStressPct": "15",
        "stressOverrun": "4200",
        "stressedTotal": "38000",
        "criticalPathDays": 92,
        "drawSchedule": [
          {
            "day": 0,
            "amount": "3000",
            "lineItemId": "demolition"
          },
          {
            "day": 23,
            "amount": "5000",
            "lineItemId": "exterior"
          },
          {
            "day": 46,
            "amount": "10000",
            "lineItemId": "interior"
          },
          {
            "day": 69,
            "amount": "8000",
            "lineItemId": "mechanicals"
          }
        ],
        "bids": [],
        "exportRows": [
          [
            "demolition",
            "Demolition / cleanout",
            "1",
            "3000",
            "3000.00",
            "0.00",
            "3000.00"
          ],
          [
            "exterior",
            "Exterior / structure",
            "1",
            "5000",
            "5000.00",
            "0.00",
            "5000.00"
          ],
          [
            "interior",
            "Interior scope",
            "1",
            "10000",
            "10000.00",
            "0.00",
            "10000.00"
          ],
          [
            "mechanicals",
            "Mechanical systems",
            "1",
            "8000",
            "8000.00",
            "0.00",
            "8000.00"
          ]
        ],
        "reconciliationDifference": "0"
      }
    }
  },
  "formulaVersion": "investor-rehab-scope-1.0.0",
  "units": {
    "monetaryAmounts": "USD",
    "calendarDates": "YYYY-MM-DD",
    "unitRate": "USD/unit",
    "quantity": "units",
    "durationDays": "days",
    "dependsOn": "one-based line indexes",
    "monthlyCarryingCost": "USD/month",
    "projectMonths": "months",
    "taxPct": "percent",
    "overrunStressPct": "percent"
  },
  "assumptions": [
    "Category budgets yield direct, carry, contingency and overrun amounts. Quantity and rate rows support dependencies, tax, cash draws, change orders and bid comparison. Dependencies use one-based row numbers. Rates and their date come from the caller."
  ],
  "warnings": [],
  "creditCost": 20
}

Request contract

Accepted inputs

Fields for this example. Expand the schema for all supported combinations and limits.

FieldType, units and limits

modeRequired
stringMust equal "category-budget"
demolitionRequired
number

Demolition/cleanout budget, USD.

Min 0 · Max 1000000000
exteriorRequired
number

Exterior/structure budget, USD.

Min 0 · Max 1000000000
interiorRequired
number

Interior budget, USD.

Min 0 · Max 1000000000
mechanicalsRequired
number

Mechanical systems budget, USD.

Min 0 · Max 1000000000
permitsAndDesignRequired
number

Permit/design budget, USD.

Min 0 · Max 1000000000
contingencyPctRequired
number

Reserve, percent of direct scope including tax and permits.

Min 0 · Max 100
monthlyCarryingCostRequired
number

Carrying costs, USD/month.

Min 0 · Max 1000000000
projectMonthsRequired
integer

Project duration, whole months.

Min 1 · Max 120
overrunStressPctRequired
number

Stress allowance, percent of direct scope including tax and permits.

Min 0 · Max 100
calculationDateRequired
string

Gregorian calendar date, YYYY-MM-DD.

Format: date · Min length 10 · Max length 10
ratesAsOfRequired
string

Gregorian calendar date, YYYY-MM-DD.

Format: date · Min length 10 · Max length 10
Example request body (JSON)
{
  "mode": "category-budget",
  "demolition": 3000,
  "exterior": 5000,
  "interior": 10000,
  "mechanicals": 8000,
  "permitsAndDesign": 2000,
  "contingencyPct": 10,
  "monthlyCarryingCost": 1000,
  "projectMonths": 3,
  "overrunStressPct": 15,
  "calculationDate": "2026-03-01",
  "ratesAsOf": "2026-02-10"
}
Full JSON schema
{
  "anyOf": [
    {
      "type": "object",
      "properties": {
        "mode": {
          "const": "category-budget"
        },
        "demolition": {
          "type": "number",
          "minimum": 0,
          "maximum": 1000000000,
          "description": "Demolition/cleanout budget, USD."
        },
        "exterior": {
          "type": "number",
          "minimum": 0,
          "maximum": 1000000000,
          "description": "Exterior/structure budget, USD."
        },
        "interior": {
          "type": "number",
          "minimum": 0,
          "maximum": 1000000000,
          "description": "Interior budget, USD."
        },
        "mechanicals": {
          "type": "number",
          "minimum": 0,
          "maximum": 1000000000,
          "description": "Mechanical systems budget, USD."
        },
        "permitsAndDesign": {
          "type": "number",
          "minimum": 0,
          "maximum": 1000000000,
          "description": "Permit/design budget, USD."
        },
        "contingencyPct": {
          "type": "number",
          "minimum": 0,
          "maximum": 100,
          "description": "Reserve, percent of direct scope including tax and permits."
        },
        "monthlyCarryingCost": {
          "type": "number",
          "minimum": 0,
          "maximum": 1000000000,
          "description": "Carrying costs, USD/month."
        },
        "projectMonths": {
          "type": "integer",
          "minimum": 1,
          "maximum": 120,
          "description": "Project duration, whole months."
        },
        "overrunStressPct": {
          "type": "number",
          "minimum": 0,
          "maximum": 100,
          "description": "Stress allowance, percent of direct scope including tax and permits."
        },
        "calculationDate": {
          "type": "string",
          "format": "date",
          "minLength": 10,
          "maxLength": 10,
          "pattern": "^(?!00)\\d{4}-\\d{2}-\\d{2}$",
          "description": "Gregorian calendar date, YYYY-MM-DD."
        },
        "ratesAsOf": {
          "type": "string",
          "format": "date",
          "minLength": 10,
          "maxLength": 10,
          "pattern": "^(?!00)\\d{4}-\\d{2}-\\d{2}$",
          "description": "Gregorian calendar date, YYYY-MM-DD."
        }
      },
      "required": [
        "mode",
        "demolition",
        "exterior",
        "interior",
        "mechanicals",
        "permitsAndDesign",
        "contingencyPct",
        "monthlyCarryingCost",
        "projectMonths",
        "overrunStressPct",
        "calculationDate",
        "ratesAsOf"
      ],
      "additionalProperties": false
    },
    {
      "type": "object",
      "properties": {
        "mode": {
          "const": "line-items"
        },
        "lineItems": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "quantity": {
                "type": "number",
                "minimum": 0,
                "maximum": 1000000,
                "description": "Number of billable units of this work item."
              },
              "unitRate": {
                "type": "number",
                "minimum": 0,
                "maximum": 1000000000,
                "description": "Cost per billable unit, USD/unit."
              },
              "taxPct": {
                "type": "number",
                "minimum": 0,
                "maximum": 100,
                "description": "Tax as percent of pre-tax line subtotal."
              },
              "durationDays": {
                "type": "integer",
                "minimum": 1,
                "maximum": 1000,
                "description": "Duration, whole days."
              },
              "dependsOn": {
                "type": "array",
                "items": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 80,
                  "description": "One-based row number of prerequisite work."
                },
                "minItems": 0,
                "maxItems": 80
              }
            },
            "required": [
              "quantity",
              "unitRate",
              "taxPct",
              "durationDays"
            ],
            "additionalProperties": false
          },
          "minItems": 1,
          "maxItems": 80
        },
        "permits": {
          "type": "number",
          "minimum": 0,
          "maximum": 1000000000,
          "description": "Permit costs, USD."
        },
        "contingencyPct": {
          "type": "number",
          "minimum": 0,
          "maximum": 100,
          "description": "Reserve, percent of direct scope including tax and permits."
        },
        "carryCost": {
          "type": "number",
          "minimum": 0,
          "maximum": 1000000000,
          "description": "Total project carrying costs, USD."
        },
        "overrunStressPct": {
          "type": "number",
          "minimum": 0,
          "maximum": 100,
          "description": "Stress allowance, percent of direct scope including tax and permits."
        },
        "calculationDate": {
          "type": "string",
          "format": "date",
          "minLength": 10,
          "maxLength": 10,
          "pattern": "^(?!00)\\d{4}-\\d{2}-\\d{2}$",
          "description": "Gregorian calendar date, YYYY-MM-DD."
        },
        "ratesAsOf": {
          "type": "string",
          "format": "date",
          "minLength": 10,
          "maxLength": 10,
          "pattern": "^(?!00)\\d{4}-\\d{2}-\\d{2}$",
          "description": "Gregorian calendar date, YYYY-MM-DD."
        },
        "changeOrders": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string",
                "format": "date",
                "minLength": 10,
                "maxLength": 10,
                "pattern": "^(?!00)\\d{4}-\\d{2}-\\d{2}$",
                "description": "Gregorian calendar date, YYYY-MM-DD."
              },
              "amount": {
                "type": "number",
                "minimum": 0,
                "maximum": 1000000000,
                "description": "Added project cost, positive USD."
              }
            },
            "required": [
              "date",
              "amount"
            ],
            "additionalProperties": false
          },
          "minItems": 0,
          "maxItems": 80
        },
        "bids": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "amount": {
                "type": "number",
                "minimum": 0,
                "maximum": 1000000000,
                "description": "Total amount bid, USD."
              },
              "receivedDate": {
                "type": "string",
                "format": "date",
                "minLength": 10,
                "maxLength": 10,
                "pattern": "^(?!00)\\d{4}-\\d{2}-\\d{2}$",
                "description": "Gregorian calendar date, YYYY-MM-DD."
              }
            },
            "required": [
              "amount",
              "receivedDate"
            ],
            "additionalProperties": false
          },
          "minItems": 0,
          "maxItems": 80
        }
      },
      "required": [
        "mode",
        "lineItems",
        "permits",
        "contingencyPct",
        "carryCost",
        "overrunStressPct",
        "calculationDate",
        "ratesAsOf"
      ],
      "additionalProperties": false
    }
  ],
  "description": "Category budgets yield direct, carry, contingency and overrun amounts. Quantity and rate rows support dependencies, tax, cash draws, change orders and bid comparison. Dependencies use one-based row numbers. Rates and their date come from the caller."
}

Production endpoint: POST https://calc.hasstechapi.com/v2/calc/investor-rehab-scope
Formula: investor-rehab-scope-1.0.0

Related PDF reports