PDF report
Room material quantities
Measured room areas, pooled paint, flooring with waste, casing and trim quantities, and room dimensions from the plan takeoff.
Room Studio has no public screen on htcalc.com. Its renovation handoff uses this planner for project costs. This HT Calc screen includes a Plus sample for visitors.
View a sample PDF · Generated from the inputs below.
- Cost per success
- 1 calculation credit + 1 PDF report
- Production plans
- Business, Scale, Enterprise
Plan allowances - Free sandbox
- Not available
Integration example
Request a PDF
Before your first report
- Open Widgets & reports in your paid workspace.
Save your brand name, accent and at least one exact HTTPS origin, such as
https://app.example.com. The origins identify sites allowed to embed your widgets. - Under Report credentials, name a credential, select
room-material-takeoffand choose Create report credential. Save the secret shown once in your server’sHT_REPORT_KEY. - Run the example on your server against
accounts.hasstechapi.com, without anOriginheader. A successful request returns a PDF and uses 1 calculation credit and 1 PDF report. Running the example again starts a new paid request.
What if the PDF doesn’t arrive?
For 400 INVALID_INPUT, inspect error.details when present. Paths for template fields start with input. Fix the indicated field and send a new request. This validation error uses zero credits and zero reports.
Open the .pdf.request.json file the example saved before sending. Within 24 hours, open
Request lookup in the same workspace, choose
Production, and paste the file’s requestId. The response’s X-Request-Id is a separate support identifier.
A settled request shows the calculation credits and report used. The service doesn’t keep the PDF for download. Check your saved file first. A replacement with a new ID uses 1 calculation credit and 1 PDF report on success.
If the outcome is unclear, check the workspace and ID, then look it up again before requesting a replacement.
Set HT_REPORT_KEY on your server. Save as example.mjs and run node example.mjs with Node.js 18 or later.
import { randomUUID } from "node:crypto";
import { writeFile } from "node:fs/promises";
const key = process.env.HT_REPORT_KEY;
if (!key) throw new Error("Set HT_REPORT_KEY on your server.");
const endpoint = "https://accounts.hasstechapi.com/v2/reports/room-material-takeoff";
const input = {
"rooms": [
{
"id": "A",
"label": "Hall",
"unit": "ft",
"height": 8,
"shape": {
"type": "rectangle",
"width": 10,
"depth": 12
},
"fixtureCount": 2,
"openings": [
{
"type": "door",
"width": 3,
"height": 7,
"wallIndex": 0
},
{
"type": "window",
"width": 2,
"height": 3,
"wallIndex": 1,
"sillHeight": 3
},
{
"type": "opening",
"width": 2,
"height": 7,
"wallIndex": 2
}
]
},
{
"id": "B",
"label": "Den",
"unit": "ft",
"height": 10,
"shape": {
"type": "rectangle",
"width": 6,
"depth": 4
}
}
]
};
const requestId = Date.now() + "." + randomUUID();
const output = "room-material-takeoff-" + requestId + ".pdf";
await writeFile(output + ".request.json", JSON.stringify({ requestId, endpoint }), {
flag: "wx", mode: 0o600
});
console.error("Usage lookup ID:", requestId);
const response = await fetch(endpoint, {
method: "POST",
redirect: "error",
headers: {
"Authorization": "Bearer " + key,
"Content-Type": "application/json"
},
body: JSON.stringify({ requestId, 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 {
if (response.headers.get("content-type")?.split(";")[0] !== "application/pdf") {
throw new Error("Expected a PDF. Look up request " + requestId);
}
await writeFile(output, new Uint8Array(await response.arrayBuffer()), { flag: "wx" });
console.log("Saved", output);
} Output
PDF output
A successful request returns the PDF file as application/pdf. The example writes a file named room-material-takeoff-<requestId>.pdf.
Open the sample PDF · Generated with the example inputs.
See the Full-plan material takeoff calculation and example result.
Request contract
Accepted inputs
Fields for this example. Expand the schema for all supported combinations and limits.
FieldType, units and limits
roomsRequiredRooms in caller order, each with a unique id. Shared walls count once per room face.
Min items 1 · Max items 12rooms[].idRequiredCaller-assigned stable room identifier, unique in the plan.
Min length 1 · Max length 80rooms[].labelRequiredDisplay label for the room.
Min length 1 · Max length 160rooms[].unitRequiredUnit of every input coordinate, length, height, sill and offset in this room. Use decimal feet for feet/inches (6 ft 8 in = 6 + 8/12).
Allowed: "ft", "m"rooms[].heightOptionalCeiling height in input units; defaults to 8 feet if omitted.
Max 1000 · Greater than 0rooms[].shapeRequiredRectangle, right-angle perimeter walk, or measured ordered polygon.
rooms[].shape.typeRequiredrooms[].shape.widthRequiredLength in room input units.
Max 1000 · Greater than 0rooms[].shape.depthRequiredLength in room input units.
Max 1000 · Greater than 0rooms[].openingsOptionalCaller-measured apertures. Missing list means none.
Min items 0 · Max items 32rooms[].openings[].typeRequiredA hinged door, window or uncased pass-through.
Allowed: "door", "window", "opening"rooms[].openings[].wallIndexRequiredZero-based host wall index in the room.
Min 0 · Max 63rooms[].openings[].widthRequiredLength in room input units.
Max 1000 · Greater than 0rooms[].openings[].heightRequiredLength in room input units.
Max 1000 · Greater than 0rooms[].openings[].offsetOptionalOffset from the start of the host wall in input units. Defaults to 0.
Min 0 · Max 1000rooms[].openings[].sillHeightOptionalDistance above the floor in input units. Defaults to 0. The manual wizard uses a sill only for windows.
Min 0 · Max 1000rooms[].fixtureCountOptionalCount of caller-identified fixtures; defaults to 0.
Min 0 · Max 64Example input (JSON)
The server example adds a fresh requestId to this input.
{
"input": {
"rooms": [
{
"id": "A",
"label": "Hall",
"unit": "ft",
"height": 8,
"shape": {
"type": "rectangle",
"width": 10,
"depth": 12
},
"fixtureCount": 2,
"openings": [
{
"type": "door",
"width": 3,
"height": 7,
"wallIndex": 0
},
{
"type": "window",
"width": 2,
"height": 3,
"wallIndex": 1,
"sillHeight": 3
},
{
"type": "opening",
"width": 2,
"height": 7,
"wallIndex": 2
}
]
},
{
"id": "B",
"label": "Den",
"unit": "ft",
"height": 10,
"shape": {
"type": "rectangle",
"width": 6,
"depth": 4
}
}
]
}
} Full JSON schema
{
"type": "object",
"properties": {
"rooms": {
"type": "array",
"description": "Rooms in caller order, each with a unique id. Shared walls count once per room face.",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Caller-assigned stable room identifier, unique in the plan.",
"minLength": 1,
"maxLength": 80
},
"label": {
"type": "string",
"description": "Display label for the room.",
"minLength": 1,
"maxLength": 160
},
"unit": {
"type": "string",
"description": "Unit of every input coordinate, length, height, sill and offset in this room. Use decimal feet for feet/inches (6 ft 8 in = 6 + 8/12).",
"enum": [
"ft",
"m"
]
},
"height": {
"type": "number",
"description": "Ceiling height in input units; defaults to 8 feet if omitted.",
"exclusiveMinimum": 0,
"maximum": 1000
},
"shape": {
"description": "Rectangle, right-angle perimeter walk, or measured ordered polygon.",
"oneOf": [
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "rectangle"
},
"width": {
"type": "number",
"description": "Length in room input units.",
"exclusiveMinimum": 0,
"maximum": 1000
},
"depth": {
"type": "number",
"description": "Length in room input units.",
"exclusiveMinimum": 0,
"maximum": 1000
}
},
"required": [
"type",
"width",
"depth"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "perimeter"
},
"segments": {
"type": "array",
"description": "Ordered wall lengths; start along positive X and turn after each wall.",
"items": {
"type": "object",
"properties": {
"length": {
"type": "number",
"description": "Length in room input units.",
"exclusiveMinimum": 0,
"maximum": 1000
},
"turn": {
"type": "string",
"description": "Turn after the segment.",
"enum": [
"left",
"right"
]
}
},
"required": [
"length",
"turn"
],
"additionalProperties": false
},
"minItems": 3,
"maxItems": 64
}
},
"required": [
"type",
"segments"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "polygon"
},
"corners": {
"type": "array",
"description": "Ordered corners (clockwise or counterclockwise); omit the repeated final vertex. Wall i connects corner i to the next corner.",
"items": {
"type": "array",
"description": "Wall-start point [x,y] on the floor plane.",
"items": {
"type": "number",
"description": "Signed coordinate in room input units.",
"minimum": -1000,
"maximum": 1000
},
"minItems": 2,
"maxItems": 2
},
"minItems": 3,
"maxItems": 64
},
"wallHeights": {
"type": "array",
"description": "Optional per-wall heights in input units, one per corner. A zero wall height falls back to room height in the takeoff.",
"items": {
"type": "number",
"description": "Wall height in input units.",
"minimum": 0,
"maximum": 1000
},
"minItems": 3,
"maxItems": 64
}
},
"required": [
"type",
"corners"
],
"additionalProperties": false
}
]
},
"openings": {
"type": "array",
"description": "Caller-measured apertures. Missing list means none.",
"items": {
"type": "object",
"properties": {
"type": {
"type": "string",
"description": "A hinged door, window or uncased pass-through.",
"enum": [
"door",
"window",
"opening"
]
},
"wallIndex": {
"type": "integer",
"description": "Zero-based host wall index in the room.",
"minimum": 0,
"maximum": 63
},
"width": {
"type": "number",
"description": "Length in room input units.",
"exclusiveMinimum": 0,
"maximum": 1000
},
"height": {
"type": "number",
"description": "Length in room input units.",
"exclusiveMinimum": 0,
"maximum": 1000
},
"offset": {
"type": "number",
"description": "Offset from the start of the host wall in input units. Defaults to 0.",
"minimum": 0,
"maximum": 1000
},
"sillHeight": {
"type": "number",
"description": "Distance above the floor in input units. Defaults to 0. The manual wizard uses a sill only for windows.",
"minimum": 0,
"maximum": 1000
}
},
"required": [
"type",
"wallIndex",
"width",
"height"
],
"additionalProperties": false
},
"minItems": 0,
"maxItems": 32
},
"fixtureCount": {
"type": "integer",
"description": "Count of caller-identified fixtures; defaults to 0.",
"minimum": 0,
"maximum": 64
}
},
"required": [
"id",
"label",
"unit",
"shape"
],
"additionalProperties": false
},
"minItems": 1,
"maxItems": 12
}
},
"required": [
"rooms"
],
"additionalProperties": false
}Production endpoint: POST https://accounts.hasstechapi.com/v2/reports/room-material-takeoff
Formula: room-studio-v1 · Report version: 1.0.0