Endpoints
Every endpoint of the v1 API. All take an API key in the Authorization header (see
Authentication), answer JSON unless they say otherwise, and live under
https://insulengine.com. The same is in the OpenAPI spec,
which Postman, Insomnia and client generators can import.
| Endpoint | What it does |
|---|---|
| GET /v1/jobs | List your company's jobs |
| POST /v1/jobs | Send drawings; the takeoff starts |
| GET /v1/jobs/{id} | A job's status and price |
| GET /v1/jobs/{id}/takeoff | Every quantity, by page, with its place |
| GET /v1/jobs/{id}/estimate | The priced estimate, line by line |
| GET /v1/jobs/{id}/workbook | The takeoff workbook (.xlsx) |
| POST /v1/jobs/{id}/markup | Have the marked-up drawings drawn |
| GET /v1/jobs/{id}/markup | Download the marked-up drawings (PDF) |
List jobs
GET/v1/jobs
Your company's jobs, newest first.
| Query | Default | What it is |
|---|---|---|
limit | 50 | How many, 1 to 200. |
curl "https://insulengine.com/v1/jobs?limit=20" \
-H "Authorization: Bearer $INSULENGINE_API_KEY"
jobs = requests.get(f"{BASE}/v1/jobs", headers=auth, params={"limit": 20}).json()["jobs"]
const { jobs } = await (await fetch(`${BASE}/v1/jobs?limit=20`, { headers: auth })).json();
Answers 200 with a job list.
Create a job
POST/v1/jobs
A new job from its drawings, sent as multipart/form-data. The takeoff starts as soon as the upload
finishes.
| Field | Required | What it is |
|---|---|---|
name | Yes | The job's name, unique in your company. |
drawings | Yes | One or more PDFs; send the field once per file. |
specification | No | The specification PDF. |
systems | No | Systems to take off, comma-separated. CW,HW,HWR,STORM when left out. |
request_id | No | Your id for this upload; a retry with the same one never starts the job twice. |
curl -X POST https://insulengine.com/v1/jobs \
-H "Authorization: Bearer $INSULENGINE_API_KEY" \
-F name="TCO Blaine" -F systems=CW,HW,HWR,STORM,SA,RA \
-F drawings=@plumbing.pdf -F drawings=@mechanical.pdf \
-F specification=@spec.pdf -F request_id=bid-4471
files = [("drawings", open("plumbing.pdf", "rb")), ("drawings", open("mechanical.pdf", "rb")),
("specification", open("spec.pdf", "rb"))]
job = requests.post(f"{BASE}/v1/jobs", headers=auth, files=files,
data={"name": "TCO Blaine", "systems": "CW,HW,HWR,STORM,SA,RA",
"request_id": "bid-4471"}).json()
const form = new FormData();
form.append("name", "TCO Blaine");
form.append("systems", "CW,HW,HWR,STORM,SA,RA");
form.append("request_id", "bid-4471");
form.append("drawings", await openAsBlob("plumbing.pdf"), "plumbing.pdf");
form.append("drawings", await openAsBlob("mechanical.pdf"), "mechanical.pdf");
form.append("specification", await openAsBlob("spec.pdf"), "spec.pdf");
const job = await (await fetch(`${BASE}/v1/jobs`, { method: "POST", headers: auth, body: form })).json();
Answers 202 with the new job's status, usually
analyzing. Errors: 400 a file that is not a PDF, 402 your plan allows no
more jobs, 403 a viewer's key, 409 the name is taken, 413 over 400 MB,
422 a missing field. The system codes are on Jobs.
Get a job
GET/v1/jobs/{id}
Where the job is, and its price once it has one.
curl https://insulengine.com/v1/jobs/$JOB_ID \
-H "Authorization: Bearer $INSULENGINE_API_KEY"
job = requests.get(f"{BASE}/v1/jobs/{job_id}", headers=auth).json()
if job["status"] == "ready":
print(job["estimate"]["sell_price"])
const job = await (await fetch(`${BASE}/v1/jobs/${jobId}`, { headers: auth })).json();
if (job.status === "ready") console.log(job.estimate.sell_price);
Answers 200 with the job's status; 404 if no such job
is in your company.
Get the takeoff
GET/v1/jobs/{id}/takeoff
Every measured line of the takeoff the app shows, grouped by drawing page, with its points on the page, and the allowances that have no place on a page.
curl https://insulengine.com/v1/jobs/$JOB_ID/takeoff \
-H "Authorization: Bearer $INSULENGINE_API_KEY"
takeoff = requests.get(f"{BASE}/v1/jobs/{job_id}/takeoff", headers=auth).json()
for page in takeoff["pages"]:
feet = sum(i["quantity"] or 0 for i in page["items"] if i["unit"] == "LF")
print(page["sheet_number"], round(feet), "LF")
const takeoff = await (await fetch(`${BASE}/v1/jobs/${jobId}/takeoff`, { headers: auth })).json();
for (const page of takeoff.pages) {
const feet = page.items.filter((i) => i.unit === "LF").reduce((sum, i) => sum + (i.quantity || 0), 0);
console.log(page.sheet_number, Math.round(feet), "LF");
}
Answers 200 with the takeoff; 409 before the first
takeoff is done, with the job's status in detail.status.
Get the estimate
GET/v1/jobs/{id}/estimate
The estimate priced from the takeoff the app shows: totals, how the price is built, and every line.
curl https://insulengine.com/v1/jobs/$JOB_ID/estimate \
-H "Authorization: Bearer $INSULENGINE_API_KEY"
estimate = requests.get(f"{BASE}/v1/jobs/{job_id}/estimate", headers=auth).json()
for line in estimate["lines"]:
print(line["description"], line["quantity"], line["unit"], line["material_cost"], line["labor_hours"])
const estimate = await (await fetch(`${BASE}/v1/jobs/${jobId}/estimate`, { headers: auth })).json();
for (const line of estimate.lines) console.log(line.description, line.quantity, line.unit, line.material_cost);
Answers 200 with the estimate; 409 before it is
priced.
Download the workbook
GET/v1/jobs/{id}/workbook
The takeoff workbook (.xlsx) of the version shown, the same file the app downloads.
curl -o takeoff.xlsx https://insulengine.com/v1/jobs/$JOB_ID/workbook \
-H "Authorization: Bearer $INSULENGINE_API_KEY"
with open("takeoff.xlsx", "wb") as out:
out.write(requests.get(f"{BASE}/v1/jobs/{job_id}/workbook", headers=auth).content)
const xlsx = await fetch(`${BASE}/v1/jobs/${jobId}/workbook`, { headers: auth });
require("node:fs").writeFileSync("takeoff.xlsx", Buffer.from(await xlsx.arrayBuffer()));
Answers 200 with the file; 409 before the estimate is priced.
Have the marked-up drawings drawn
POST/v1/jobs/{id}/markup
Starts drawing the marked-up drawings: every page of the set, with the measured lines on them. Answers
{"ready": false} while they are drawn, about a minute for most sets, and {"ready": true}
once they are. Ask again until they are ready; asking again does not start a second drawing.
Download the marked-up drawings
GET/v1/jobs/{id}/markup
The marked-up drawings as a PDF, once POST says they are ready.
# Ask until "ready" is true, then download.
curl -X POST https://insulengine.com/v1/jobs/$JOB_ID/markup -H "Authorization: Bearer $INSULENGINE_API_KEY"
curl -o markup.pdf https://insulengine.com/v1/jobs/$JOB_ID/markup -H "Authorization: Bearer $INSULENGINE_API_KEY"
while not requests.post(f"{BASE}/v1/jobs/{job_id}/markup", headers=auth).json()["ready"]:
time.sleep(15)
with open("markup.pdf", "wb") as out:
out.write(requests.get(f"{BASE}/v1/jobs/{job_id}/markup", headers=auth).content)
const markup = `${BASE}/v1/jobs/${jobId}/markup`;
while (!(await (await fetch(markup, { method: "POST", headers: auth })).json()).ready) {
await new Promise((resolve) => setTimeout(resolve, 15_000));
}
const pdf = await fetch(markup, { headers: auth });
require("node:fs").writeFileSync("markup.pdf", Buffer.from(await pdf.arrayBuffer()));
Conventions
- The examples above assume
BASE = "https://insulengine.com"andauthholding theAuthorizationheader, as in the Quickstart. - Errors answer JSON with a
detail; see Errors and versioning. - Every JSON answer carries
api_version, the date of the version it follows. - Webhooks are set up on the Settings page, not through the API; see Webhooks.