API reference

Create an order, read its status, and fetch the result. All requests use HTTPS and JSON. Lengths are in feet and areas are in square feet.

Create an API key in the dashboard on the Settings page. Send it in the Authorization header. A key acts for one workspace.

Authorization: Bearer pk.key_...

POST/v1/reports

Order a report. Send address, or lat and lng, or all three. An order uses one credit.

  • options.detached_structures (boolean, default false): include detached structures such as a garage.
  • options.waste_pct (whole number, 0 to 40): use this waste percent in place of the recommended value.
  • options.webhook_url (https URL): send events for the workspace to this URL. The first time a URL is used, the response has its webhook_secret.
curl https://YOUR_HOST/v1/reports \
  -H "Authorization: Bearer $RAFTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "address": "123 Main St, Springfield, IL",
    "options": { "detached_structures": true, "webhook_url": "https://example.com/hooks/rafter" }
  }'

Response, status 201:

{ "id": "0000000000000000...", "status": "queued", "webhook_secret": "whsec_..." }

GET/v1/reports/{id}

Read an order. totals and structures are present when status is completed.

{
  "id": "...",
  "status": "completed",
  "address": "123 Main St, Springfield, IL 62701, USA",
  "location": { "lat": 39.8, "lng": -89.65 },
  "confidence": 0.86,
  "review_state": "ai_reviewed",
  "review_notes": [],
  "low_confidence": false,
  "imagery": { "source": "Google Solar API", "date": "2024-06-11" },
  "elevation": { "source": "solar", "dataset": null, "date": null },
  "pitch_survey": { "source": "usgs_lidar", "dataset": "...", "date": "2019-04-21" },
  "waste_pct": 13,
  "totals": {
    "total_area_sqft": 2140.5, "sloped_area_sqft": 2140.5, "flat_area_sqft": 0,
    "squares": 21.41, "section_count": 4, "main_pitch": 5,
    "lengths_ft": { "eave": 148, "ridge": 14, "hip": 92.4, "valley": 0 },
    "recommended_waste_pct": 13
  },
  "structures": [{
    "id": "...", "label": "House",
    "sections": [{ "id": "...", "polygon": [[x, y, z]], "pitch": 5, "azimuth_deg": 180, "area_sqft": 715.0, "flat": false }],
    "edges": [{ "id": "...", "type": "eave", "start": [x, y, z], "end": [x, y, z], "length_ft": 44, "upper_roof": false }]
  }]
}

elevation.source is solar or usgs_lidar. Rafter uses public USGS lidar for the roof heights when the imagery provider has no roof at the address, for example under tree cover. elevation.date is then the last day of the lidar survey.

pitch_survey names the USGS lidar survey that Rafter measured the section pitches from, when one covers the address. It is null when the pitches are from the imagery provider only.

Coordinates are local feet: x is east, y is north, z is up, and z is 0 at the ground. pitch is the rise in inches for each 12 inches of run.

review_state is ai_reviewed when the AI review compared the measured roof with the photo and applied its corrections. It is auto when there was no photo to compare with. review_notes lists what the review saw and could not correct, in plain words. Check those parts of the roof on site.

low_confidence is true when an automatic check of the delivered roof did not pass. The report is delivered with a notice. Check the measurements on site before you order material.

Where a higher roof meets a lower roof, the line has two edges. One is the flashing on the lower roof. The other is the eave of the higher roof and has upper_roof: true. The totals count both. An edge with estimated: true was not measured: it is under a tree, and Rafter carried the roof plane on to it. The diagram draws it with short dashes.

queuedThe order is accepted.
processingRafter is fetching data, measuring, checking, or rendering.
completedThe report is ready.
failedThe report could not be made. failure_reason says why. The credit was returned.

Edge types: eave, rake, ridge, hip, valley, step_flashing, wall_flashing, transition, parapet, curb_flashing, unspecified. For example, step_flashing is step flashing where a sloped edge meets a taller wall.

GET/v1/reports

The most recent reports of the workspace, newest first. limit is 1 to 100, default 25.

{ "reports": [{ "id": "...", "status": "completed", "address": "...", "requested_at": "...", "delivered_at": "..." }] }

GET/v1/reports/{id}/pdf

Redirects (302) to the PDF with the workspace logo. The link is valid for 5 minutes. Use curl -L to follow it.

GET/v1/reports/{id}/materials?catalog=gaf

The material list for one brand at four waste levels. catalog is a brand slug, for example gaf, owens-corning or certainteed. Without it, the workspace default is used. waste_pct sets the waste percent for this request.

{
  "id": "...", "catalog": "gaf", "waste_pct": 13, "waste_levels_pct": [0, 13, 16, 18],
  "items": [
    { "category": "shingle", "brand": "GAF", "product": "Timberline HDZ", "unit": "bundle",
      "coverage_per_unit": 33.3, "measured": 2140.5, "quantities": [65, 73, 75, 76] }
  ]
}

POSTWebhooks

Rafter sends report.completed and report.failed to each endpoint of the workspace. Add endpoints on the Settings page or with options.webhook_url. A failed delivery is sent again, up to 7 times in 28 hours.

{ "id": "evt_...", "type": "report.completed", "occurredAt": "2026-11-21T15:04:05.000Z", "data": { "id": "...", "status": "completed" } }

Each request is signed with HMAC-SHA256 in the webhook-id, webhook-timestamp and webhook-signature headers. The format is the Standard Webhooks format, so a Svix verifier with the endpoint secret accepts it. Check the signature before you trust the body.

Errors

An error has a JSON body with a code and a message.

{ "error": { "code": "NO_CREDITS", "message": "The workspace has no report credits. Buy credits to order a report." } }
401UNAUTHENTICATED, INVALID_API_KEYThe API key is missing, malformed, or revoked.
402NO_CREDITSThe workspace has no report credits.
404NOT_FOUNDNo report with that id belongs to the workspace.
409NOT_READYThe report is not completed.
422INVALID_ARGSA field has the wrong type or value.