{
 "openapi": "3.1.0",
 "info": {
  "title": "InsulEngine API",
  "version": "2026-11-21",
  "summary": "Send drawings, get every insulation quantity back page by page with its place on the drawing, and the priced estimate.",
  "description": "Guides and examples: https://insulengine.com/developers. Within v1, fields are only ever added: ignore fields and events you do not know.",
  "contact": {
   "name": "InsulEngine",
   "email": "info@insulengine.com",
   "url": "https://insulengine.com/developers"
  },
  "termsOfService": "https://insulengine.com/terms",
  "license": {
   "name": "InsulEngine Terms of Service",
   "url": "https://insulengine.com/terms"
  }
 },
 "servers": [
  {
   "url": "https://insulengine.com"
  }
 ],
 "security": [
  {
   "apiKey": []
  }
 ],
 "tags": [
  {
   "name": "Jobs",
   "description": "Send drawings and follow a takeoff."
  },
  {
   "name": "Takeoff",
   "description": "Quantities by drawing page, with their place on the page."
  },
  {
   "name": "Estimate",
   "description": "The priced estimate and its downloads."
  }
 ],
 "paths": {
  "/v1/jobs": {
   "get": {
    "tags": [
     "Jobs"
    ],
    "operationId": "listJobs",
    "summary": "List jobs",
    "description": "Your company's jobs, newest first.",
    "parameters": [
     {
      "name": "limit",
      "in": "query",
      "description": "How many, 1 to 200.",
      "schema": {
       "type": "integer",
       "minimum": 1,
       "maximum": 200,
       "default": 50
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The jobs.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/JobList"
        }
       }
      }
     },
     "401": {
      "description": "No key, or a key that is not valid or was revoked.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key's role may not do this.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   },
   "post": {
    "tags": [
     "Jobs"
    ],
    "operationId": "createJob",
    "summary": "Create a job",
    "description": "A new job from its drawings; the takeoff starts as soon as the upload finishes.",
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "type": "object",
        "required": [
         "name",
         "drawings"
        ],
        "properties": {
         "name": {
          "type": "string",
          "description": "The job's name, unique in your company (ignoring case)."
         },
         "drawings": {
          "type": "array",
          "items": {
           "type": "string",
           "format": "binary"
          },
          "description": "One or more PDFs, read as one set in the order sent. Up to 400 MB together."
         },
         "specification": {
          "type": "string",
          "format": "binary",
          "description": "The specification PDF."
         },
         "systems": {
          "type": "string",
          "description": "Comma-separated system codes to take off. CW,HW,HWR,STORM when left out.",
          "examples": [
           "CW,HW,HWR,STORM,SA,RA"
          ]
         },
         "request_id": {
          "type": "string",
          "description": "Any string unique to this upload: a retry with the same one never starts the job twice."
         }
        }
       },
       "encoding": {
        "drawings": {
         "contentType": "application/pdf"
        }
       }
      }
     }
    },
    "responses": {
     "202": {
      "description": "Created; the takeoff has started.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/JobStatus"
        }
       }
      }
     },
     "400": {
      "description": "A file that is not a PDF, or no drawings.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "402": {
      "description": "Your plan does not allow another job.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "401": {
      "description": "No key, or a key that is not valid or was revoked.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key's role may not do this.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "A job with that name already exists.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "413": {
      "description": "The drawings are over 400 MB together.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "422": {
      "description": "A field is missing or the wrong type.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/jobs/{job_id}": {
   "get": {
    "tags": [
     "Jobs"
    ],
    "operationId": "getJob",
    "summary": "Get a job's status",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "description": "The job's id.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Where the job is, and its price when it has one.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/JobStatus"
        }
       }
      }
     },
     "401": {
      "description": "No key, or a key that is not valid or was revoked.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key's role may not do this.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "No such job in your company.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/v1/jobs/{job_id}/takeoff": {
   "get": {
    "tags": [
     "Takeoff"
    ],
    "operationId": "getTakeoff",
    "summary": "Get the takeoff by page",
    "description": "Every measured line of the takeoff the app shows, grouped by drawing page, with its points on the page.",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "description": "The job's id.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The takeoff.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Takeoff"
        }
       }
      }
     },
     "401": {
      "description": "No key, or a key that is not valid or was revoked.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key's role may not do this.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "No such job in your company.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "The takeoff is not done yet; `detail.status` says where the job is.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/NotReady"
        }
       }
      }
     }
    }
   }
  },
  "/v1/jobs/{job_id}/estimate": {
   "get": {
    "tags": [
     "Estimate"
    ],
    "operationId": "getEstimate",
    "summary": "Get the priced estimate",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "description": "The job's id.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The estimate, line by line.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Estimate"
        }
       }
      }
     },
     "401": {
      "description": "No key, or a key that is not valid or was revoked.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key's role may not do this.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "No such job in your company.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "The takeoff is not done yet; `detail.status` says where the job is.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/NotReady"
        }
       }
      }
     }
    }
   }
  },
  "/v1/jobs/{job_id}/workbook": {
   "get": {
    "tags": [
     "Estimate"
    ],
    "operationId": "getWorkbook",
    "summary": "Download the takeoff workbook",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "description": "The job's id.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The takeoff workbook.",
      "content": {
       "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": {
        "schema": {
         "type": "string",
         "format": "binary"
        }
       }
      }
     },
     "401": {
      "description": "No key, or a key that is not valid or was revoked.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key's role may not do this.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "No such job in your company.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "The takeoff is not done yet; `detail.status` says where the job is.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/NotReady"
        }
       }
      }
     }
    }
   }
  },
  "/v1/jobs/{job_id}/markup": {
   "post": {
    "tags": [
     "Estimate"
    ],
    "operationId": "prepareMarkup",
    "summary": "Have the marked-up drawings drawn",
    "description": "Answers ready false while they are drawn (about a minute), ready true once they are. Call again until ready.",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "description": "The job's id.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Whether they are ready.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Markup"
        }
       }
      }
     },
     "401": {
      "description": "No key, or a key that is not valid or was revoked.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key's role may not do this.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "No such job in your company.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "The takeoff is not done yet; `detail.status` says where the job is.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/NotReady"
        }
       }
      }
     }
    }
   },
   "get": {
    "tags": [
     "Estimate"
    ],
    "operationId": "getMarkup",
    "summary": "Download the marked-up drawings",
    "description": "Every page of the drawings, the measured lines drawn on them. Ask POST first.",
    "parameters": [
     {
      "name": "job_id",
      "in": "path",
      "required": true,
      "description": "The job's id.",
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "The marked-up drawings.",
      "content": {
       "application/pdf": {
        "schema": {
         "type": "string",
         "format": "binary"
        }
       }
      }
     },
     "401": {
      "description": "No key, or a key that is not valid or was revoked.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "403": {
      "description": "The key's role may not do this.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "No such job in your company.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "409": {
      "description": "The takeoff is not done yet; `detail.status` says where the job is.",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/NotReady"
        }
       }
      }
     }
    }
   }
  }
 },
 "webhooks": {
  "takeoff.completed": {
   "post": {
    "summary": "A takeoff is done and shown in the app",
    "operationId": "takeoffCompleted",
    "parameters": [
     {
      "name": "X-InsulEngine-Event",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "X-InsulEngine-Delivery",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "X-InsulEngine-Signature",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TakeoffEvent"
       }
      }
     }
    },
    "responses": {
     "2XX": {
      "description": "Received. Anything else, or no answer in 10 seconds, is retried."
     }
    }
   }
  },
  "estimate.priced": {
   "post": {
    "summary": "A takeoff's estimate is priced",
    "operationId": "estimatePriced",
    "parameters": [
     {
      "name": "X-InsulEngine-Event",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "X-InsulEngine-Delivery",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "X-InsulEngine-Signature",
      "in": "header",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "requestBody": {
     "content": {
      "application/json": {
       "schema": {
        "$ref": "#/components/schemas/TakeoffEvent"
       }
      }
     }
    },
    "responses": {
     "2XX": {
      "description": "Received."
     }
    }
   }
  }
 },
 "components": {
  "securitySchemes": {
   "apiKey": {
    "type": "http",
    "scheme": "bearer",
    "bearerFormat": "ie_live_…",
    "description": "An API key made on Settings → API & webhooks."
   }
  },
  "schemas": {
   "Job": {
    "type": "object",
    "required": [
     "id",
     "name"
    ],
    "properties": {
     "id": {
      "type": "string",
      "description": "The job's id."
     },
     "name": {
      "type": "string"
     },
     "location": {
      "type": [
       "string",
       "null"
      ]
     },
     "created_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     }
    }
   },
   "JobList": {
    "type": "object",
    "required": [
     "jobs",
     "api_version"
    ],
    "properties": {
     "jobs": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Job"
      }
     },
     "api_version": {
      "type": "string",
      "description": "The date of the version this answer follows."
     }
    }
   },
   "JobStatus": {
    "type": "object",
    "required": [
     "job",
     "status",
     "api_version"
    ],
    "properties": {
     "job": {
      "$ref": "#/components/schemas/Job"
     },
     "status": {
      "type": "string",
      "enum": [
       "no_drawings",
       "analyzing",
       "ready",
       "needs_review",
       "failed"
      ]
     },
     "message": {
      "type": [
       "string",
       "null"
      ]
     },
     "takeoff_version": {
      "type": [
       "integer",
       "null"
      ]
     },
     "estimate": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/EstimateSummary"
       },
       {
        "type": "null"
       }
      ]
     },
     "api_version": {
      "type": "string"
     }
    }
   },
   "EstimateSummary": {
    "type": "object",
    "required": [
     "id",
     "version"
    ],
    "properties": {
     "id": {
      "type": "string"
     },
     "version": {
      "type": "integer"
     },
     "status": {
      "type": [
       "string",
       "null"
      ]
     },
     "sell_price": {
      "type": [
       "number",
       "null"
      ]
     },
     "material_total": {
      "type": [
       "number",
       "null"
      ]
     },
     "labor_hours": {
      "type": [
       "number",
       "null"
      ]
     },
     "labor_total": {
      "type": [
       "number",
       "null"
      ]
     },
     "updated_at": {
      "type": [
       "string",
       "null"
      ],
      "format": "date-time"
     }
    }
   },
   "Takeoff": {
    "type": "object",
    "required": [
     "job_id",
     "pages",
     "allowances",
     "api_version"
    ],
    "properties": {
     "job_id": {
      "type": "string"
     },
     "takeoff_version": {
      "type": [
       "integer",
       "null"
      ]
     },
     "run_id": {
      "type": "string",
      "description": "The run that read this version."
     },
     "pages": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Page"
      }
     },
     "allowances": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Item"
      },
      "description": "Priced footage with no line on a page: drops, leaders, risers."
     },
     "totals": {
      "type": [
       "object",
       "null"
      ],
      "additionalProperties": {
       "type": [
        "number",
        "null"
       ]
      },
      "properties": {
       "scaled_LF": {
        "type": [
         "number",
         "null"
        ]
       },
       "allowance_LF": {
        "type": [
         "number",
         "null"
        ]
       },
       "known_estimate_LF": {
        "type": [
         "number",
         "null"
        ]
       },
       "complete_estimate_LF": {
        "type": [
         "number",
         "null"
        ]
       },
       "complete_estimate_EA": {
        "type": [
         "number",
         "null"
        ]
       }
      }
     },
     "api_version": {
      "type": "string"
     }
    }
   },
   "Page": {
    "type": "object",
    "required": [
     "page",
     "items"
    ],
    "properties": {
     "page": {
      "type": [
       "integer",
       "null"
      ],
      "description": "The page number in its PDF, 1 first."
     },
     "sheet_number": {
      "type": [
       "string",
       "null"
      ]
     },
     "drawing": {
      "type": [
       "string",
       "null"
      ],
      "description": "The file the page is in."
     },
     "sheet_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "width": {
      "type": [
       "number",
       "null"
      ],
      "description": "The page as displayed, in PDF points, rotation applied."
     },
     "height": {
      "type": [
       "number",
       "null"
      ]
     },
     "rotation": {
      "type": [
       "integer",
       "null"
      ],
      "enum": [
       0,
       90,
       180,
       270,
       null
      ]
     },
     "items": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Item"
      }
     }
    }
   },
   "Item": {
    "type": "object",
    "required": [
     "id",
     "service",
     "quantity",
     "unit"
    ],
    "properties": {
     "id": {
      "type": "string",
      "description": "Unique within this takeoff version."
     },
     "service": {
      "type": [
       "string",
       "null"
      ]
     },
     "size": {
      "type": [
       "string",
       "null"
      ]
     },
     "quantity": {
      "type": [
       "number",
       "null"
      ]
     },
     "unit": {
      "type": [
       "string",
       "null"
      ],
      "examples": [
       "LF",
       "EA"
      ]
     },
     "item_type": {
      "type": [
       "string",
       "null"
      ]
     },
     "description": {
      "type": [
       "string",
       "null"
      ]
     },
     "state": {
      "type": [
       "string",
       "null"
      ],
      "examples": [
       "provisional",
       "excluded"
      ]
     },
     "work_scope": {
      "type": [
       "string",
       "null"
      ],
      "examples": [
       "new",
       "existing"
      ]
     },
     "assumed_size": {
      "type": [
       "string",
       "null"
      ]
     },
     "size_source": {
      "type": [
       "string",
       "null"
      ]
     },
     "trade": {
      "type": "string",
      "description": "Mechanical lines: ductwork, hydronic, refrigerant…"
     },
     "square_feet": {
      "type": [
       "number",
       "null"
      ]
     },
     "location": {
      "type": [
       "string",
       "null"
      ],
      "examples": [
       "indoor",
       "outdoor"
      ]
     },
     "vertical": {
      "type": "boolean"
     },
     "points": {
      "type": "array",
      "items": {
       "type": "array",
       "items": {
        "type": "number"
       },
       "minItems": 2,
       "maxItems": 2
      },
      "description": "Displayed page coordinates: PDF points from the top-left, y down."
     },
     "pdf_points": {
      "type": "array",
      "items": {
       "type": "array",
       "items": {
        "type": "number"
       },
       "minItems": 2,
       "maxItems": 2
      },
      "description": "The same places in the PDF's own user space."
     }
    }
   },
   "Estimate": {
    "type": "object",
    "required": [
     "job_id",
     "estimate",
     "lines",
     "api_version"
    ],
    "properties": {
     "job_id": {
      "type": "string"
     },
     "estimate": {
      "$ref": "#/components/schemas/EstimateSummary"
     },
     "unpriced_reason": {
      "type": [
       "string",
       "null"
      ]
     },
     "totals": {
      "type": [
       "object",
       "null"
      ],
      "properties": {
       "material": {
        "type": [
         "number",
         "null"
        ]
       },
       "labor": {
        "type": [
         "number",
         "null"
        ]
       },
       "labor_hours": {
        "type": [
         "number",
         "null"
        ]
       },
       "installed_cost": {
        "type": [
         "number",
         "null"
        ]
       },
       "sell_price": {
        "type": [
         "number",
         "null"
        ]
       }
      }
     },
     "price_breakdown": {
      "anyOf": [
       {
        "$ref": "#/components/schemas/PriceBreakdown"
       },
       {
        "type": "null"
       }
      ]
     },
     "lines": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Line"
      }
     },
     "workbook_url": {
      "type": "string"
     },
     "markup_url": {
      "type": "string"
     },
     "api_version": {
      "type": "string"
     }
    }
   },
   "PriceBreakdown": {
    "type": "object",
    "properties": {
     "partial": {
      "type": "boolean"
     },
     "material": {
      "type": [
       "number",
       "null"
      ]
     },
     "material_markup_rate": {
      "type": [
       "number",
       "null"
      ]
     },
     "material_markup": {
      "type": [
       "number",
       "null"
      ]
     },
     "labor": {
      "type": [
       "number",
       "null"
      ]
     },
     "labor_hours": {
      "type": [
       "number",
       "null"
      ]
     },
     "labor_rate": {
      "type": [
       "number",
       "null"
      ]
     },
     "overhead_and_profit_rate": {
      "type": [
       "number",
       "null"
      ]
     },
     "overhead_and_profit": {
      "type": [
       "number",
       "null"
      ]
     },
     "job_minimum_adjustment": {
      "type": [
       "number",
       "null"
      ]
     },
     "total": {
      "type": [
       "number",
       "null"
      ]
     }
    }
   },
   "Line": {
    "type": "object",
    "properties": {
     "id": {
      "type": "string"
     },
     "description": {
      "type": [
       "string",
       "null"
      ]
     },
     "unit": {
      "type": [
       "string",
       "null"
      ]
     },
     "quantity": {
      "type": [
       "number",
       "null"
      ]
     },
     "waste_factor": {
      "type": [
       "number",
       "null"
      ]
     },
     "quantity_with_waste": {
      "type": [
       "number",
       "null"
      ]
     },
     "unit_price": {
      "type": [
       "number",
       "null"
      ]
     },
     "material_cost": {
      "type": [
       "number",
       "null"
      ]
     },
     "labor_hours": {
      "type": [
       "number",
       "null"
      ]
     },
     "labor_cost": {
      "type": [
       "number",
       "null"
      ]
     },
     "insulation_spec": {
      "type": [
       "string",
       "null"
      ]
     },
     "requirement_source": {
      "type": [
       "string",
       "null"
      ]
     },
     "pricing_gap": {},
     "labor_gap": {},
     "service": {
      "type": [
       "string",
       "null"
      ]
     },
     "size": {
      "type": [
       "string",
       "null"
      ]
     },
     "item_type": {
      "type": [
       "string",
       "null"
      ]
     },
     "takeoff_item_id": {
      "type": [
       "string",
       "null"
      ]
     },
     "phase": {}
    }
   },
   "Markup": {
    "type": "object",
    "required": [
     "ready"
    ],
    "properties": {
     "ready": {
      "type": "boolean"
     }
    }
   },
   "Error": {
    "type": "object",
    "required": [
     "detail"
    ],
    "properties": {
     "detail": {
      "description": "What went wrong, in words (or, for 422, a list naming each field).",
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "array"
       },
       {
        "type": "object"
       }
      ]
     }
    }
   },
   "NotReady": {
    "type": "object",
    "required": [
     "detail"
    ],
    "properties": {
     "detail": {
      "type": "object",
      "required": [
       "reason",
       "status"
      ],
      "properties": {
       "reason": {
        "type": "string",
        "examples": [
         "no takeoff yet",
         "no estimate yet"
        ]
       },
       "status": {
        "type": "string",
        "enum": [
         "no_drawings",
         "analyzing",
         "ready",
         "needs_review",
         "failed"
        ]
       }
      }
     }
    }
   },
   "TakeoffEvent": {
    "type": "object",
    "required": [
     "id",
     "type",
     "created",
     "data"
    ],
    "properties": {
     "id": {
      "type": "string",
      "description": "Stable for the thing that happened: a retry carries the same id."
     },
     "type": {
      "type": "string",
      "examples": [
       "takeoff.completed",
       "estimate.priced",
       "webhook.test"
      ]
     },
     "created": {
      "type": "integer",
      "description": "Unix seconds."
     },
     "data": {
      "type": "object",
      "properties": {
       "job_id": {
        "type": "string"
       },
       "job_name": {
        "type": "string"
       },
       "takeoff_version": {
        "type": [
         "integer",
         "null"
        ]
       },
       "run_id": {
        "type": "string"
       },
       "estimate": {
        "anyOf": [
         {
          "type": "object",
          "properties": {
           "id": {
            "type": "string"
           },
           "version": {
            "type": "integer"
           },
           "sell_price": {
            "type": [
             "number",
             "null"
            ]
           }
          }
         },
         {
          "type": "null"
         }
        ]
       },
       "links": {
        "type": "object",
        "properties": {
         "job": {
          "type": "string"
         },
         "takeoff": {
          "type": "string"
         },
         "estimate": {
          "type": "string"
         }
        }
       }
      }
     }
    }
   }
  }
 }
}
