{"openapi":"3.1.0","info":{"title":"Roof Manager API","version":"1","description":"Order roof measurement reports, read the results, and receive events (webhooks or polling) for what happens on the account. The same operations are available to AI assistants as an MCP connector at https://www.roofmanager.ca/mcp. Keys: Settings → API on roofmanager.ca (rm_live_… spends credits; rm_test_… returns free sample reports); each key carries the modules its owner chose. Webhooks are signed with Standard Webhooks (webhook-id, webhook-timestamp, webhook-signature). Docs: https://www.roofmanager.ca/ai-connector","contact":{"email":"support@roofmanager.ca","url":"https://www.roofmanager.ca/ai-connector"}},"servers":[{"url":"https://www.roofmanager.ca/v1"}],"security":[{"apiKey":[]}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"Authorization: Bearer rm_live_… or rm_test_…"}},"schemas":{"Job":{"type":"object","properties":{"job_id":{"type":"string"},"status":{"type":"string","enum":["queued","tracing","generating","ready","failed","cancelled"]},"address":{"type":"string"},"resolved_address":{"type":["string","null"]},"address_match":{"type":["string","null"]},"latitude":{"type":["number","null"]},"longitude":{"type":["number","null"]},"client_reference":{"type":["string","null"]},"created_at":{"type":"integer"},"finalized_at":{"type":["integer","null"]},"status_url":{"type":"string"},"estimated_ready_at":{"type":"integer"},"pdf_url":{"type":"string"},"pdf_expires_at":{"type":"integer"},"measurements":{"type":"object"},"measurements_url":{"type":"string"},"error_code":{"type":"string"},"error_message":{"type":"string"},"credit_balance":{"type":"integer"},"charged":{"type":"boolean"},"test":{"type":"boolean"}},"required":["job_id","status","address"]},"Error":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]},"ToolResult":{"type":"object","properties":{"status":{"type":"string","enum":["success","warning","error"],"description":"success = done; warning = done, read summary; error = not done, read hint."},"summary":{"type":"string","description":"One sentence to lead with."},"data":{"type":"object","description":"The answer (same fields as the REST API)."},"next_actions":{"type":"array","items":{"type":"object","properties":{"tool":{"type":"string"},"why":{"type":"string"}},"required":["tool","why"]}},"code":{"type":"string"},"message":{"type":"string"},"hint":{"type":"string"},"retry":{"type":"string","enum":["safe","after_fix","never"]},"retry_after_seconds":{"type":"integer"}},"required":["status","next_actions"]}}},"paths":{"/address/preview":{"post":{"operationId":"check_address","summary":"Check an address (free)","description":"Free — spends no credit. Use it BEFORE ordering, every time: it shows which building an address lands on and returns an address_token that a Live order needs. address_match \"exact\" means a specific rooftop. \"approximate\" means a street range or parcel centre, so the report could measure the wrong building: show the user the resolved address and map_preview_url and ask them to confirm. \"unresolved\" means the address was not found. Returns resolved_address, latitude, longitude, map_preview_url and address_token (valid 15 minutes).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"address":{"type":"string","minLength":5,"maxLength":300,"description":"Full street address with city and state/province, e.g. \"8123 104 St NW, Edmonton, AB T6E 4E4\"."}},"required":["address"],"additionalProperties":false}}}},"responses":{"200":{"description":"Where the address lands","content":{"application/json":{"schema":{"type":"object","properties":{"address_match":{"type":"string","enum":["exact","approximate","unresolved"]},"resolved_address":{"type":["string","null"]},"latitude":{"type":["number","null"]},"longitude":{"type":["number","null"]},"map_preview_url":{"type":["string","null"]},"address_token":{"type":"string"},"address_token_expires_at":{"type":"integer"},"advice":{"type":"string"},"charged":{"type":"boolean"}}}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"401":{"description":"Bad key","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}}}},"/reports/quote":{"post":{"operationId":"quote_roof_report","summary":"Price a report order (free)","description":"Free — orders nothing. Prices a report order before it is placed: one report credit covers a residential main building; a commercial / flat roof, a multi-family building and each additional structure cost extra (plus GST), billed to the account by a payment link after the order. Call it whenever the order has building_type other than residential or additional_structures, show the user the total it returns, and only after they agree pass its quote_token to order_roof_report. Send the same building_type, additional_structures and notes you will order with.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"building_type":{"description":"The main building: residential (default), commercial / flat roof, or multi_family.","type":"string","enum":["residential","commercial","multi_family"]},"additional_structures":{"description":"Other buildings on the lot to measure too (a detached garage, a shop).","type":"integer","minimum":0,"maximum":4},"notes":{"description":"The notes you will order with (lines naming another building count as additional structures).","type":"string","maxLength":500}},"additionalProperties":false}}}},"responses":{"200":{"description":"The price of the order, before it is placed","content":{"application/json":{"schema":{"type":"object","properties":{"credits":{"type":"integer"},"building_type":{"type":"string"},"building_label":{"type":"string"},"additional_structures":{"type":"integer"},"extras":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string"},"cents":{"type":"integer"}}}},"extras_cents":{"type":"integer"},"tax_cents":{"type":"integer"},"total_cents":{"type":"integer"},"currency":{"type":"string"},"billed":{"type":"string","enum":["payment_link_after_order","nothing_extra"]},"summary":{"type":"string"},"quote_token":{"type":"string"},"quote_token_expires_at":{"type":"integer"}}}}}},"400":{"description":"Bad request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}}}},"/reports":{"post":{"operationId":"order_roof_report","summary":"Order a roof report","description":"Orders a roof measurement report for one property. On a Live connection this SPENDS ONE REPORT CREDIT and queues work for a person, so: (1) call check_address first, (2) show the user the resolved address and that it costs one credit, (3) only after they agree, call this with the address_token from check_address. If the order has extras (building_type commercial or multi_family, or additional_structures), call quote_roof_report first, show the user the total and send its quote_token here; a Live order with extras is refused without it. On a Practice connection it is free and returns a finished sample report at once (no token needed). Always send idempotency_key (a new UUID per user request) and client_reference (your CRM job id) so a retry never charges twice. The report is not instant: the job starts \"queued\"; follow it with get_roof_report or wait_for_roof_report. Also accepts the Idempotency-Key header.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"address":{"type":"string","minLength":5,"maxLength":300,"description":"Full street address with city and state/province, e.g. \"8123 104 St NW, Edmonton, AB T6E 4E4\"."},"address_token":{"description":"From check_address (valid 15 min). REQUIRED on a Live connection; it orders at exactly the building the user confirmed.","type":"string"},"idempotency_key":{"description":"Your own unique id for THIS call (any string, e.g. a UUID). Repeating a call with the same key returns the first result instead of acting twice. Always send one on a write.","type":"string","minLength":1,"maxLength":128},"client_reference":{"description":"Your own id for this job (e.g. the CRM job number). Re-ordering with the same value returns the existing job instead of charging again.","type":"string","minLength":1,"maxLength":200},"latitude":{"description":"Optional: a point on the roof itself (send with longitude) when the user gives a map pin.","type":"number","minimum":-90,"maximum":90},"longitude":{"description":"Optional: send together with latitude.","type":"number","minimum":-180,"maximum":180},"strict_address":{"description":"If true, refuse the order (no charge) unless the address resolves to a specific rooftop or coordinates are given.","type":"boolean"},"email_report":{"description":"Also email the account when the report is ready. Default true.","type":"boolean"},"allow_duplicate":{"description":"Set true only if the user wants a second report for an address that already has one queued.","type":"boolean"},"notes":{"description":"Optional notes for the person tracing the roof. Measuring more than the main building costs extra: say so with additional_structures, not only in the notes.","type":"string","maxLength":500},"building_type":{"description":"The main building: residential (default), commercial / flat roof (+$10 + GST) or multi_family (+$15 + GST). A credit covers residential only; the extra is billed to the account by a payment link after the order and the report is released once it is paid. Price it with quote_roof_report first.","type":"string","enum":["residential","commercial","multi_family"]},"quote_token":{"description":"From quote_roof_report (valid 15 min). REQUIRED on a Live order with extras: it proves the user was shown the total.","type":"string","maxLength":1000},"additional_structures":{"description":"Other buildings on the lot to measure too (a detached garage, a shop): +$5 + GST each, billed to the account by a payment link before the report is delivered. Tell the user before ordering.","type":"integer","minimum":0,"maximum":4},"measure_only":{"description":"Optional: measure only PART of a large building — say which part (e.g. \"the east wing, flat roof over the warehouse\"). The report covers that part only and says so.","type":"string","minLength":3,"maxLength":300}},"required":["address"],"additionalProperties":false}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}}],"responses":{"200":{"description":"Already ordered: the existing job for this idempotency_key / client_reference","content":{"application/json":{"schema":{"type":"object","properties":{"job_id":{"type":"string"},"status":{"type":"string","enum":["queued","tracing","generating","ready","failed","cancelled"]},"address":{"type":"string"},"resolved_address":{"type":["string","null"]},"address_match":{"type":["string","null"]},"latitude":{"type":["number","null"]},"longitude":{"type":["number","null"]},"client_reference":{"type":["string","null"]},"created_at":{"type":"integer"},"finalized_at":{"type":["integer","null"]},"status_url":{"type":"string"},"estimated_ready_at":{"type":"integer"},"pdf_url":{"type":"string"},"pdf_expires_at":{"type":"integer"},"measurements":{"type":"object"},"measurements_url":{"type":"string"},"error_code":{"type":"string"},"error_message":{"type":"string"},"credit_balance":{"type":"integer"},"charged":{"type":"boolean"},"test":{"type":"boolean"}},"required":["job_id","status","address"]}}}},"202":{"description":"Queued (or a finished sample with a test key)","content":{"application/json":{"schema":{"type":"object","properties":{"job_id":{"type":"string"},"status":{"type":"string","enum":["queued","tracing","generating","ready","failed","cancelled"]},"address":{"type":"string"},"resolved_address":{"type":["string","null"]},"address_match":{"type":["string","null"]},"latitude":{"type":["number","null"]},"longitude":{"type":["number","null"]},"client_reference":{"type":["string","null"]},"created_at":{"type":"integer"},"finalized_at":{"type":["integer","null"]},"status_url":{"type":"string"},"estimated_ready_at":{"type":"integer"},"pdf_url":{"type":"string"},"pdf_expires_at":{"type":"integer"},"measurements":{"type":"object"},"measurements_url":{"type":"string"},"error_code":{"type":"string"},"error_message":{"type":"string"},"credit_balance":{"type":"integer"},"charged":{"type":"boolean"},"test":{"type":"boolean"}},"required":["job_id","status","address"]}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"No paid credits","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Too many active jobs","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"429":{"description":"Rate limited","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}}},"get":{"operationId":"list_roof_reports","summary":"List roof reports","description":"Reports this account ordered through the API, newest first (job_id, address, status, created_at, client_reference). Filter by status or client_reference to find the job for a CRM record. Use this whenever you need a job_id you do not have. Pass next_cursor back as cursor for the next page.","parameters":[{"name":"status","in":"query","required":false,"schema":{"description":"Only jobs in this status.","type":"string","enum":["queued","ready","failed","cancelled"]},"description":"Only jobs in this status."},{"name":"client_reference","in":"query","required":false,"schema":{"description":"Only the job ordered with this client_reference.","type":"string","minLength":1,"maxLength":200},"description":"Only the job ordered with this client_reference."},{"name":"limit","in":"query","required":false,"schema":{"description":"How many to return (default 20).","type":"integer","minimum":1,"maximum":50},"description":"How many to return (default 20)."},{"name":"cursor","in":"query","required":false,"schema":{"description":"next_cursor from the previous page.","type":"string","maxLength":200},"description":"next_cursor from the previous page."}],"responses":{"200":{"description":"A page of jobs","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"type":"object","properties":{"job_id":{"type":"string"},"status":{"type":"string","enum":["queued","tracing","generating","ready","failed","cancelled"]},"address":{"type":"string"},"resolved_address":{"type":["string","null"]},"address_match":{"type":["string","null"]},"latitude":{"type":["number","null"]},"longitude":{"type":["number","null"]},"client_reference":{"type":["string","null"]},"created_at":{"type":"integer"},"finalized_at":{"type":["integer","null"]},"status_url":{"type":"string"},"estimated_ready_at":{"type":"integer"},"pdf_url":{"type":"string"},"pdf_expires_at":{"type":"integer"},"measurements":{"type":"object"},"measurements_url":{"type":"string"},"error_code":{"type":"string"},"error_message":{"type":"string"},"credit_balance":{"type":"integer"},"charged":{"type":"boolean"},"test":{"type":"boolean"}},"required":["job_id","status","address"]}},"has_more":{"type":"boolean"},"next_cursor":{"type":["string","null"]}},"required":["results","has_more"]}}}}}}},"/reports/{job_id}":{"get":{"operationId":"get_roof_report","summary":"Get a roof report","description":"Status of one report. When status is \"ready\" it includes the measurement summary (total area, squares, waste factor, predominant pitch, facet count, linear feet of eaves, rakes, ridges, hips, valleys, flashing) and pdf_url, a link that expires after 15 minutes (call again for a fresh one). \"failed\" includes error_message; a failed or cancelled job is refunded. Do not poll in a loop: reports are delivered within 3 hours.","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"The job","content":{"application/json":{"schema":{"type":"object","properties":{"job_id":{"type":"string"},"status":{"type":"string","enum":["queued","tracing","generating","ready","failed","cancelled"]},"address":{"type":"string"},"resolved_address":{"type":["string","null"]},"address_match":{"type":["string","null"]},"latitude":{"type":["number","null"]},"longitude":{"type":["number","null"]},"client_reference":{"type":["string","null"]},"created_at":{"type":"integer"},"finalized_at":{"type":["integer","null"]},"status_url":{"type":"string"},"estimated_ready_at":{"type":"integer"},"pdf_url":{"type":"string"},"pdf_expires_at":{"type":"integer"},"measurements":{"type":"object"},"measurements_url":{"type":"string"},"error_code":{"type":"string"},"error_message":{"type":"string"},"credit_balance":{"type":"integer"},"charged":{"type":"boolean"},"test":{"type":"boolean"}},"required":["job_id","status","address"]}}}},"404":{"description":"Not this account's job","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}}},"delete":{"operationId":"cancel_roof_report","summary":"Cancel a roof report","description":"Cancels a report that is still \"queued\" and refunds its credit. A report already being traced or finished cannot be cancelled. Confirm with the user first; this cannot be undone.","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Cancelled and refunded","content":{"application/json":{"schema":{"type":"object","properties":{"job_id":{"type":"string"},"status":{"type":"string","enum":["queued","tracing","generating","ready","failed","cancelled"]},"address":{"type":"string"},"resolved_address":{"type":["string","null"]},"address_match":{"type":["string","null"]},"latitude":{"type":["number","null"]},"longitude":{"type":["number","null"]},"client_reference":{"type":["string","null"]},"created_at":{"type":"integer"},"finalized_at":{"type":["integer","null"]},"status_url":{"type":"string"},"estimated_ready_at":{"type":"integer"},"pdf_url":{"type":"string"},"pdf_expires_at":{"type":"integer"},"measurements":{"type":"object"},"measurements_url":{"type":"string"},"error_code":{"type":"string"},"error_message":{"type":"string"},"credit_balance":{"type":"integer"},"charged":{"type":"boolean"},"test":{"type":"boolean"}},"required":["job_id","status","address"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Too late to cancel","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}}}},"/reports/{job_id}/measurements":{"get":{"operationId":"get_roof_measurements","summary":"Get roof measurements by section","description":"The measurement detail of a READY report, by section, with no coordinate arrays (the PDF has the diagram). sections: \"summary\" (totals, squares, pitch, waste, linear feet), \"areas\" (every area and pitch figure), \"edges\" (every eave/rake/ridge/hip/valley length), \"faces\" (each roof face with area and pitch), \"materials\" (the take-off estimate), \"waste\" (waste factor, drivers, the 5/10/15/20% options). Default: summary, areas, edges, waste. units: \"imperial\" (default) or \"metric\". Use it to fill an estimate or a CRM measurement form. Answers an error until the report is ready.","parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"sections","in":"query","required":false,"schema":{"type":"string"},"description":"Comma-separated: summary,areas,edges,faces,materials,waste (or all). Omitted = the full engine output."},{"name":"units","in":"query","required":false,"schema":{"description":"imperial (sq ft, ft — default) or metric (m², m). Squares and bundles are never converted.","type":"string","enum":["imperial","metric"]}}],"responses":{"200":{"description":"Measurements","content":{"application/json":{"schema":{"type":"object","properties":{"job_id":{"type":"string"},"address":{"type":["string","null"]},"units":{"type":"string"},"sections":{"type":"object"},"measurements":{"type":"object"},"note":{"type":"string"}}}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Not ready yet","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}}}},"/account":{"get":{"operationId":"get_account","summary":"Get account and credits","description":"The account this connection belongs to: company name, whether it is Live or Practice (mode \"live\" / \"test\"), report credits left, and job counts by status. Call it when the user asks about credits or before explaining a cost.","responses":{"200":{"description":"The account","content":{"application/json":{"schema":{"type":"object","properties":{"account_id":{"type":"string"},"company_name":{"type":["string","null"]},"mode":{"type":"string","enum":["live","test"]},"credit_balance":{"type":"integer"},"status":{"type":"string"},"webhook_url":{"type":["string","null"]},"job_stats":{"type":"object"}}}}}}}}},"/events":{"get":{"operationId":"list_recent_events","summary":"What happened on the account","description":"Things that happened on the Roof Manager account, oldest first: reports finished (report.ready), reports that could not be produced (report.failed), and more as Roof Manager adds them. Use it to answer \"what is new since …\" or to catch up after a pause: pass the last event id you saw as `after` and you get only newer ones, never a repeat. Only event types this connection may see are returned.","parameters":[{"name":"after","in":"query","required":false,"schema":{"type":"string"},"description":"Last event id you handled."},{"name":"types","in":"query","required":false,"schema":{"type":"string"},"description":"Comma-separated types or prefixes, e.g. report.ready,report.*"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":100}}],"responses":{"200":{"description":"Events, oldest first","content":{"application/json":{"schema":{"type":"object","properties":{"events":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string","enum":["report.ready","report.failed","door.pin_created","door.status_changed","door.appointment_booked","door.appointment_assigned","door.appointment_status_changed","turf.created","turf.assigned","customer.created","customer.updated","customer.stage_changed","customer.note_added","estimate.ready","estimate.failed","lead.created","lead.updated","lead.status_changed","lead.assigned","job.created","job.updated","job.scheduled","job.status_changed","job.completed","proposal.created","proposal.sent","proposal.status_changed","proposal.accepted","proposal.declined","invoice.created","invoice.sent","invoice.status_changed","invoice.paid","task.created","task.updated","task.completed","calendar.event_created","webhook.test"]},"created_at":{"type":"string","format":"date-time"},"account_id":{"type":"integer"},"entity":{"type":["object","null"]},"actor":{"type":"object"},"data":{"type":"object"}},"required":["id","type","created_at","data"]}},"next_cursor":{"type":["string","null"]},"has_more":{"type":"boolean"}}}}}}}}},"/events/catalog":{"get":{"operationId":"event_catalog","summary":"Every event type, with a sample payload","security":[],"responses":{"200":{"description":"The catalog","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/webhooks":{"get":{"operationId":"list_webhooks","summary":"Webhook subscriptions this key made","description":"Needs a key with Events & webhooks.","responses":{"200":{"description":"Subscriptions","content":{"application/json":{"schema":{"type":"object","properties":{"webhooks":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","disabled"]},"secret":{"type":"string","description":"Returned once, on create. whsec_… (Standard Webhooks)."}}}}}}}}}}},"post":{"operationId":"subscribe_webhook","summary":"Subscribe a URL to events (REST hook)","description":"Body: { url, events: [\"report.ready\"] or [\"*\"], description? }. Returns the signing secret ONCE. Events the key may not see are never sent to it.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"description":{"type":"string"}},"required":["url"]}}}},"responses":{"201":{"description":"Subscribed","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["active","disabled"]},"secret":{"type":"string","description":"Returned once, on create. whsec_… (Standard Webhooks)."}}}}}},"400":{"description":"Bad URL or event","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks Events & webhooks","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Too many endpoints","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}}}},"/webhooks/{id}":{"delete":{"operationId":"unsubscribe_webhook","summary":"Remove a subscription","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Deleted","content":{"application/json":{"schema":{"type":"object"}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}}}},"/webhooks/{id}/test":{"post":{"operationId":"test_webhook","summary":"Send a signed webhook.test event now","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Result of the attempt","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/orders":{"get":{"operationId":"list_account_reports","summary":"List every report on the account","description":"Every roof report on the account, newest first — ordered on the website, in the iPhone app, by SMS or through the API — with address, status, whether it is in review or a re-trace is pending, and roof area. Use order_id with share_roof_report, request_retrace or get_material_takeoff. (list_roof_reports shows API orders only.)","tags":["orders"],"x-scope":"orders","x-feature":"api.reports","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"parameters":[{"name":"status","in":"query","required":false,"schema":{"description":"Only orders in this status (e.g. completed)","type":"string","maxLength":30},"description":"Only orders in this status (e.g. completed)"},{"name":"limit","in":"query","required":false,"schema":{"description":"How many to return (default 50, max 200).","type":"integer","minimum":1,"maximum":200},"description":"How many to return (default 50, max 200)."}]}},"/orders/{order_id}/share":{"post":{"operationId":"share_roof_report","summary":"Get a share link for a report","description":"A link anyone can open to a finished report. variant \"customer\" = the homeowner-safe Customer Copy (aerial and diagrams, no measurements); \"full\" = the whole report. This only makes the link — nothing is emailed; send it yourself.","tags":["orders"],"x-scope":"orders","x-feature":"api.reports","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope, or the connection is Practice (code practice_read_only: Practice reads records but cannot change them)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"variant":{"type":"string","enum":["full","customer"]},"idempotency_key":{"description":"Your own unique id for THIS write (any string, e.g. a UUID). Repeating a call with the same key returns the first result instead of acting twice. Always send one on a write.","type":"string","minLength":1,"maxLength":128}},"additionalProperties":false}}}},"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}}]}},"/orders/{order_id}/retrace":{"post":{"operationId":"request_retrace","summary":"Ask for a report to be re-traced","description":"Ask Roof Manager's team to re-trace a finished report that looks wrong, saying what is wrong (at least 10 characters). Safe to repeat: an open request is returned, not duplicated. Free.","tags":["orders"],"x-scope":"orders","x-feature":"api.reports","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope, or the connection is Practice (code practice_read_only: Practice reads records but cannot change them)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","minLength":10,"maxLength":2000},"idempotency_key":{"description":"Your own unique id for THIS write (any string, e.g. a UUID). Repeating a call with the same key returns the first result instead of acting twice. Always send one on a write.","type":"string","minLength":1,"maxLength":128}},"required":["reason"],"additionalProperties":false}}}},"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}}]}},"/orders/{order_id}/takeoff":{"get":{"operationId":"get_material_takeoff","summary":"Material take-off for a report","description":"The bill of materials from a finished report: shingles, underlayment, starter, ridge cap, drip edge, flashing and more, with quantities. Prices and totals are included only when the connection may see money.","tags":["export_reports"],"x-scope":"export_reports","x-feature":"api.exports","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}}]}},"/customers":{"get":{"operationId":"search_customers","summary":"Find customers","description":"Search My Customers by name, email, phone or address (search), or list by stage (status). Newest first. Use it before creating a customer so you never add the same person twice.","tags":["crm"],"x-scope":"crm","x-feature":"api.crm","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"parameters":[{"name":"search","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["lead","contacted","quote_sent","job_approved","completed","inactive"]}},{"name":"limit","in":"query","required":false,"schema":{"description":"How many to return (default 50, max 200).","type":"integer","minimum":1,"maximum":200},"description":"How many to return (default 50, max 200)."}]},"post":{"operationId":"create_customer","summary":"Add a customer","description":"Add a customer to My Customers (it also appears on the Leads board). If someone with the same email or phone already exists, nothing is created and that customer is returned as a warning; pass allow_duplicate: true to add anyway.","tags":["crm"],"x-scope":"crm","x-feature":"api.crm","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope, or the connection is Practice (code practice_read_only: Practice reads records but cannot change them)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"Full name (or send first_name / last_name).","type":"string","minLength":1,"maxLength":120},"first_name":{"type":"string","maxLength":60},"last_name":{"type":"string","maxLength":60},"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","maxLength":40},"company":{"type":"string","maxLength":120},"address":{"type":"string","maxLength":300},"city":{"type":"string","maxLength":80},"province":{"type":"string","maxLength":40},"postal_code":{"type":"string","maxLength":20},"notes":{"type":"string","maxLength":4000},"tags":{"type":"string","maxLength":300},"source":{"type":"string","maxLength":80},"status":{"type":"string","enum":["lead","contacted","quote_sent","job_approved","completed","inactive"]},"allow_duplicate":{"type":"boolean"},"idempotency_key":{"description":"Your own unique id for THIS write (any string, e.g. a UUID). Repeating a call with the same key returns the first result instead of acting twice. Always send one on a write.","type":"string","minLength":1,"maxLength":128}},"additionalProperties":false}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}}]}},"/customers/{customer_id}":{"get":{"operationId":"get_customer","summary":"Get a customer","description":"One customer: contact details, stage, and their history — jobs, proposals, invoices and appointments — newest first.","tags":["crm"],"x-scope":"crm","x-feature":"api.crm","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}}]},"patch":{"operationId":"update_customer","summary":"Edit a customer","description":"Change some of a customer's details. Only the fields you send change; everything else is kept.","tags":["crm"],"x-scope":"crm","x-feature":"api.crm","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope, or the connection is Practice (code practice_read_only: Practice reads records but cannot change them)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"Full name (or send first_name / last_name).","type":"string","minLength":1,"maxLength":120},"first_name":{"type":"string","maxLength":60},"last_name":{"type":"string","maxLength":60},"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","maxLength":40},"company":{"type":"string","maxLength":120},"address":{"type":"string","maxLength":300},"city":{"type":"string","maxLength":80},"province":{"type":"string","maxLength":40},"postal_code":{"type":"string","maxLength":20},"notes":{"type":"string","maxLength":4000},"tags":{"type":"string","maxLength":300},"source":{"type":"string","maxLength":80},"idempotency_key":{"description":"Your own unique id for THIS write (any string, e.g. a UUID). Repeating a call with the same key returns the first result instead of acting twice. Always send one on a write.","type":"string","minLength":1,"maxLength":128}},"additionalProperties":false}}}},"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}}]}},"/customers/{customer_id}/stage":{"post":{"operationId":"set_customer_stage","summary":"Move a customer","description":"Move a customer to a stage: lead, contacted, quote_sent, job_approved, completed or inactive. The move is logged on their timeline and fires customer.stage_changed.","tags":["crm"],"x-scope":"crm","x-feature":"api.crm","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope, or the connection is Practice (code practice_read_only: Practice reads records but cannot change them)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["lead","contacted","quote_sent","job_approved","completed","inactive"]},"idempotency_key":{"description":"Your own unique id for THIS write (any string, e.g. a UUID). Repeating a call with the same key returns the first result instead of acting twice. Always send one on a write.","type":"string","minLength":1,"maxLength":128}},"required":["status"],"additionalProperties":false}}}},"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}}]}},"/customers/{customer_id}/notes":{"post":{"operationId":"log_customer_note","summary":"Log a call, text or note","description":"Add an entry to a customer's timeline: a call, text, email, meeting, site visit, note or other. This only records it; nothing is sent to anyone.","tags":["crm"],"x-scope":"crm","x-feature":"api.crm","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope, or the connection is Practice (code practice_read_only: Practice reads records but cannot change them)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["call","text","email","meeting","site_visit","note","other"]},"note":{"type":"string","minLength":1,"maxLength":4000},"occurred_at":{"description":"ISO time it happened; default now","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"},"idempotency_key":{"description":"Your own unique id for THIS write (any string, e.g. a UUID). Repeating a call with the same key returns the first result instead of acting twice. Always send one on a write.","type":"string","minLength":1,"maxLength":128}},"required":["kind","note"],"additionalProperties":false}}}},"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}}]}},"/customers/{customer_id}/timeline":{"get":{"operationId":"get_customer_timeline","summary":"Customer timeline","description":"Every touch with a customer, newest first: calls, texts, emails, meetings, site visits, notes, and the stage changes the app logged.","tags":["crm"],"x-scope":"crm","x-feature":"api.crm","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"parameters":[{"name":"customer_id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"name":"limit","in":"query","required":false,"schema":{"description":"How many to return (default 50, max 200).","type":"integer","minimum":1,"maximum":200},"description":"How many to return (default 50, max 200)."}]}},"/leads":{"get":{"operationId":"list_leads","summary":"List leads","description":"The Leads board: name, contact, source, estimated value, status, who it is assigned to. Filter by status.","tags":["leads"],"x-scope":"leads","x-feature":"api.leads","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["new","contacted","appointment","quoted","won","lost"]}},{"name":"limit","in":"query","required":false,"schema":{"description":"How many to return (default 50, max 200).","type":"integer","minimum":1,"maximum":200},"description":"How many to return (default 50, max 200)."}]},"post":{"operationId":"create_lead","summary":"Add a lead","description":"Add a lead to the Leads board (it is also added to My Customers, matched by email or phone). Assigning it (assigned_to_member_id) emails that team member only when notify is true and the connection may send.","tags":["leads"],"x-scope":"leads","x-feature":"api.leads","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope, or the connection is Practice (code practice_read_only: Practice reads records but cannot change them)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"phone":{"type":"string","maxLength":40},"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"address":{"type":"string","maxLength":300},"source":{"type":"string","maxLength":80},"est_value":{"type":"number","minimum":0,"maximum":10000000},"status":{"type":"string","enum":["new","contacted","appointment","quoted","won","lost"]},"notes":{"type":"string","maxLength":4000},"assigned_to_member_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"notify":{"description":"Send the usual email/text to the person it concerns (for example the rep a lead is assigned to). Off unless you set true AND the connection was allowed to send emails & texts.","type":"boolean"},"idempotency_key":{"description":"Your own unique id for THIS write (any string, e.g. a UUID). Repeating a call with the same key returns the first result instead of acting twice. Always send one on a write.","type":"string","minLength":1,"maxLength":128}},"required":["name"],"additionalProperties":false}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}}]}},"/leads/{lead_id}":{"patch":{"operationId":"update_lead","summary":"Update a lead","description":"Move a lead (status), add notes, edit its details or (re)assign it. Only what you send changes. An assignment emails the team member only when notify is true and the connection may send.","tags":["leads"],"x-scope":"leads","x-feature":"api.leads","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope, or the connection is Practice (code practice_read_only: Practice reads records but cannot change them)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["new","contacted","appointment","quoted","won","lost"]},"notes":{"type":"string","maxLength":4000},"name":{"type":"string","minLength":1,"maxLength":120},"phone":{"type":"string","maxLength":40},"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"address":{"type":"string","maxLength":300},"source":{"type":"string","maxLength":80},"est_value":{"type":"number","minimum":0,"maximum":10000000},"assigned_to_member_id":{"description":"A team member id, or null to unassign.","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]},"notify":{"description":"Send the usual email/text to the person it concerns (for example the rep a lead is assigned to). Off unless you set true AND the connection was allowed to send emails & texts.","type":"boolean"},"idempotency_key":{"description":"Your own unique id for THIS write (any string, e.g. a UUID). Repeating a call with the same key returns the first result instead of acting twice. Always send one on a write.","type":"string","minLength":1,"maxLength":128}},"additionalProperties":false}}}},"parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}}]}},"/inquiries":{"get":{"operationId":"list_inquiries","summary":"List inquiries","description":"The inquiries inbox: everything that came in — website widget, calls, texts, voicemail, door bookings, job messages, chat — newest first, with whether it was read or turned into a lead.","tags":["leads"],"x-scope":"leads","x-feature":"api.leads","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"parameters":[{"name":"channel","in":"query","required":false,"schema":{"type":"string","enum":["all","web_widget","voice_call","sms","voicemail","d2d_appointment","crm_job_message","rover_chat"]}},{"name":"limit","in":"query","required":false,"schema":{"description":"How many to return (default 50, max 200).","type":"integer","minimum":1,"maximum":200},"description":"How many to return (default 50, max 200)."}]}},"/inquiries/{channel}/{inquiry_id}/convert":{"post":{"operationId":"convert_inquiry","summary":"Turn an inquiry into a lead","description":"Put an inquiry on the Leads board (and in My Customers). Safe to repeat: an inquiry already converted returns its lead.","tags":["leads"],"x-scope":"leads","x-feature":"api.leads","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope, or the connection is Practice (code practice_read_only: Practice reads records but cannot change them)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"idempotency_key":{"description":"Your own unique id for THIS write (any string, e.g. a UUID). Repeating a call with the same key returns the first result instead of acting twice. Always send one on a write.","type":"string","minLength":1,"maxLength":128}},"additionalProperties":false}}}},"parameters":[{"name":"channel","in":"path","required":true,"schema":{"type":"string","enum":["web_widget","voice_call","sms","voicemail","d2d_appointment","crm_job_message","rover_chat"]}},{"name":"inquiry_id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}}]}},"/jobs":{"get":{"operationId":"list_jobs","summary":"List jobs","description":"Jobs on the schedule, soonest first: title, customer, address, status, date and time, crew size. Filter by status or month (YYYY-MM).","tags":["jobs"],"x-scope":"jobs","x-feature":"api.jobs","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["scheduled","in_progress","completed","cancelled","postponed"]}},{"name":"month","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"}},{"name":"limit","in":"query","required":false,"schema":{"description":"How many to return (default 50, max 200).","type":"integer","minimum":1,"maximum":200},"description":"How many to return (default 50, max 200)."}]},"post":{"operationId":"create_job","summary":"Create a job","description":"Put a job on the schedule for a customer (crm_customer_id from search_customers). It is added to the calendar as usual when calendar sync is on.","tags":["jobs"],"x-scope":"jobs","x-feature":"api.jobs","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope, or the connection is Practice (code practice_read_only: Practice reads records but cannot change them)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":160},"scheduled_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"YYYY-MM-DD"},"scheduled_time":{"type":"string","pattern":"^\\d{2}:\\d{2}$","description":"HH:MM, 24-hour"},"crm_customer_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"property_address":{"type":"string","maxLength":300},"job_type":{"description":"install (default), repair, inspection…","type":"string","maxLength":40},"estimated_duration":{"type":"string","maxLength":40},"crew_size":{"type":"integer","minimum":1,"maximum":50},"notes":{"type":"string","maxLength":4000},"material_delivery_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"YYYY-MM-DD"},"idempotency_key":{"description":"Your own unique id for THIS write (any string, e.g. a UUID). Repeating a call with the same key returns the first result instead of acting twice. Always send one on a write.","type":"string","minLength":1,"maxLength":128}},"required":["title","scheduled_date"],"additionalProperties":false}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}}]}},"/jobs/{job_id}":{"get":{"operationId":"get_job","summary":"Get a job","description":"One job in full: its customer, address, status, date and time, crew size, notes and checklist. Use the job_id from list_jobs.","tags":["jobs"],"x-scope":"jobs","x-feature":"api.jobs","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}}]}},"/jobs/{job_id}/status":{"post":{"operationId":"set_job_status","summary":"Move a job","description":"Move a job to scheduled, in_progress, completed, cancelled or postponed. Completing a job here does NOT email the homeowner a certificate.","tags":["jobs"],"x-scope":"jobs","x-feature":"api.jobs","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope, or the connection is Practice (code practice_read_only: Practice reads records but cannot change them)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["scheduled","in_progress","completed","cancelled","postponed"]},"idempotency_key":{"description":"Your own unique id for THIS write (any string, e.g. a UUID). Repeating a call with the same key returns the first result instead of acting twice. Always send one on a write.","type":"string","minLength":1,"maxLength":128}},"required":["status"],"additionalProperties":false}}}},"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}}]}},"/jobs/{job_id}/schedule":{"post":{"operationId":"schedule_job","summary":"Schedule a job","description":"Set a job's date and time and optionally put a crew member on it.","tags":["jobs"],"x-scope":"jobs","x-feature":"api.jobs","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope, or the connection is Practice (code practice_read_only: Practice reads records but cannot change them)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"scheduled_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"YYYY-MM-DD"},"scheduled_time":{"type":"string","pattern":"^\\d{2}:\\d{2}$","description":"HH:MM, 24-hour"},"crew_member_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"idempotency_key":{"description":"Your own unique id for THIS write (any string, e.g. a UUID). Repeating a call with the same key returns the first result instead of acting twice. Always send one on a write.","type":"string","minLength":1,"maxLength":128}},"required":["scheduled_date"],"additionalProperties":false}}}},"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}}]}},"/estimates":{"post":{"operationId":"instant_estimate","summary":"Instant roof estimate","description":"Price a roof at an address in seconds with the account's own Instant Estimator tiers: the footprint is measured from satellite imagery, the sloped area is computed at the pitch YOU send, and the price range per tier is returned with a link to the branded estimate sheet. The pitch is required — ask the person for it first and never guess it. Not a measured report — for that, order_roof_report. The Instant Estimator must be active on the account. A lead is created only when you send contact details (name, email or phone) or create_lead: true. Every run fires estimate.ready or estimate.failed.","tags":["leads"],"x-scope":"leads","x-feature":"api.leads","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope, or the connection is Practice (code practice_read_only: Practice reads records but cannot change them)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"address":{"type":"string","minLength":5,"maxLength":300,"description":"Full street address with the house number."},"pitch":{"anyOf":[{"type":"string","minLength":1,"maxLength":20},{"type":"number","minimum":0,"maximum":24}],"description":"REQUIRED — the roof pitch the person told you: \"6/12\" (or \"6:12\", \"6\", 6), or a bucket — flat, low (≤3/12), average (4–6/12), steep (7–9/12), very_steep (10/12+). Ask for it before calling; do not guess or default it. The sloped roof area and every price come from this pitch."},"latitude":{"description":"Pin the building yourself (with longitude); otherwise the address is geocoded.","type":"number","minimum":-90,"maximum":90},"longitude":{"type":"number","minimum":-180,"maximum":180},"name":{"description":"The homeowner, when this estimate is for a known person (creates a lead).","type":"string","maxLength":120},"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","maxLength":40},"create_lead":{"description":"Add a lead for this estimate even with no contact details (named after the address).","type":"boolean"},"client_reference":{"description":"Your own id for this estimate; echoed back and carried on the event.","type":"string","maxLength":128},"idempotency_key":{"description":"Your own unique id for THIS write (any string, e.g. a UUID). Repeating a call with the same key returns the first result instead of acting twice. Always send one on a write.","type":"string","minLength":1,"maxLength":128}},"required":["address","pitch"],"additionalProperties":false}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}}]}},"/d2d/turfs":{"get":{"operationId":"list_d2d_turfs","summary":"List door-to-door areas","description":"The door-to-door areas (turfs) on the account, each with its reps and door counts (knocked, yes, no, no answer, appointments, not yet knocked). Use it to find a turf_id or to report progress by area.","tags":["d2d"],"x-scope":"d2d","x-feature":"api.d2d","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}}},"post":{"operationId":"create_d2d_turf","summary":"Create a door-to-door area","description":"Draw a door-to-door area from at least 3 map points and (optionally) give it to reps. Only the account owner can manage areas, so this works for owner connections only.","tags":["d2d"],"x-scope":"d2d","x-feature":"api.d2d","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope, or the connection is Practice (code practice_read_only: Practice reads records but cannot change them)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"polygon":{"minItems":3,"maxItems":500,"type":"array","items":{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180}},"required":["lat","lng"],"additionalProperties":false},"description":"The outline, in order."},"description":{"type":"string","maxLength":500},"color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"member_ids":{"description":"Rep ids from list_d2d_reps.","maxItems":50,"type":"array","items":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"idempotency_key":{"description":"Your own unique id for THIS write (any string, e.g. a UUID). Repeating a call with the same key returns the first result instead of acting twice. Always send one on a write.","type":"string","minLength":1,"maxLength":128}},"required":["name","polygon"],"additionalProperties":false}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}}]}},"/d2d/pins":{"get":{"operationId":"list_door_pins","summary":"List doors","description":"Doors on the door-to-door map, newest activity first, with status, address, coordinates, notes, who knocked and when. Filter by turf_id, status or the rep (member_id).","tags":["d2d"],"x-scope":"d2d","x-feature":"api.d2d","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"parameters":[{"name":"turf_id","in":"query","required":false,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["not_knocked","yes","no","no_answer","appointment","come_back","new_roof","renter","do_not_knock"],"description":"not_knocked (placed, nobody knocked yet) · yes (interested) · no · no_answer · appointment · come_back · new_roof (already has one) · renter · do_not_knock"},"description":"not_knocked (placed, nobody knocked yet) · yes (interested) · no · no_answer · appointment · come_back · new_roof (already has one) · renter · do_not_knock"},{"name":"member_id","in":"query","required":false,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"name":"limit","in":"query","required":false,"schema":{"description":"How many to return (default 50, max 200).","type":"integer","minimum":1,"maximum":200},"description":"How many to return (default 50, max 200)."}]},"post":{"operationId":"drop_door_pin","summary":"Add a door","description":"Put a door on the door-to-door map at a coordinate, optionally already knocked (status) and inside an area (turf_id). A knock is credited to the account owner unless knocked_by_member_id names a rep.","tags":["d2d"],"x-scope":"d2d","x-feature":"api.d2d","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope, or the connection is Practice (code practice_read_only: Practice reads records but cannot change them)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"address":{"type":"string","maxLength":300},"turf_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"status":{"type":"string","enum":["not_knocked","yes","no","no_answer","appointment","come_back","new_roof","renter","do_not_knock"],"description":"not_knocked (placed, nobody knocked yet) · yes (interested) · no · no_answer · appointment · come_back · new_roof (already has one) · renter · do_not_knock"},"notes":{"type":"string","maxLength":2000},"knocked_by_member_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"idempotency_key":{"description":"Your own unique id for THIS write (any string, e.g. a UUID). Repeating a call with the same key returns the first result instead of acting twice. Always send one on a write.","type":"string","minLength":1,"maxLength":128}},"required":["lat","lng"],"additionalProperties":false}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}}]}},"/d2d/pins/{pin_id}":{"get":{"operationId":"get_door_pin","summary":"Get one door","description":"One door: address, coordinates, status, notes, who knocked, and the appointment booked there if any. Use the address and coordinates with check_address to order a roof report for this house.","tags":["d2d"],"x-scope":"d2d","x-feature":"api.d2d","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"parameters":[{"name":"pin_id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}}]},"patch":{"operationId":"set_door_status","summary":"Record a knock","description":"Set the result at a door (yes, no, no_answer, appointment, come_back, new_roof, renter, do_not_knock, or back to not_knocked) and optionally add notes. Fires door.status_changed.","tags":["d2d"],"x-scope":"d2d","x-feature":"api.d2d","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope, or the connection is Practice (code practice_read_only: Practice reads records but cannot change them)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["not_knocked","yes","no","no_answer","appointment","come_back","new_roof","renter","do_not_knock"],"description":"not_knocked (placed, nobody knocked yet) · yes (interested) · no · no_answer · appointment · come_back · new_roof (already has one) · renter · do_not_knock"},"notes":{"type":"string","maxLength":2000},"idempotency_key":{"description":"Your own unique id for THIS write (any string, e.g. a UUID). Repeating a call with the same key returns the first result instead of acting twice. Always send one on a write.","type":"string","minLength":1,"maxLength":128}},"additionalProperties":false}}}},"parameters":[{"name":"pin_id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}}]}},"/d2d/appointments":{"post":{"operationId":"book_door_appointment","summary":"Book an appointment from a door","description":"Book a homeowner in. Pass pin_id to book at a door (its address is used and the door is marked appointment). The appointment also becomes a lead on the Leads board and a customer in My Customers, and lands on the calendar. Refused (409) if the time is already taken. The account owner gets the usual booking email.","tags":["d2d"],"x-scope":"d2d","x-feature":"api.d2d","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope, or the connection is Practice (code practice_read_only: Practice reads records but cannot change them)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"pin_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"customer_name":{"type":"string","minLength":1,"maxLength":120},"address":{"type":"string","maxLength":300},"email":{"type":"string","maxLength":254,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","maxLength":40},"appointment_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"YYYY-MM-DD"},"appointment_time":{"type":"string","pattern":"^\\d{2}:\\d{2}$","description":"HH:MM, 24-hour"},"notes":{"type":"string","maxLength":2000},"idempotency_key":{"description":"Your own unique id for THIS write (any string, e.g. a UUID). Repeating a call with the same key returns the first result instead of acting twice. Always send one on a write.","type":"string","minLength":1,"maxLength":128}},"required":["customer_name","appointment_date","appointment_time"],"additionalProperties":false}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}}]},"get":{"operationId":"list_door_appointments","summary":"List door appointments","description":"Appointments booked at doors (the D2D lead board), newest first, with who booked and who is assigned. Filter by status.","tags":["d2d"],"x-scope":"d2d","x-feature":"api.d2d","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["new","assigned","processing","completed","lost"]}}]}},"/d2d/appointments/{appointment_id}/assign":{"post":{"operationId":"assign_door_appointment","summary":"Assign a door appointment","description":"Give a door appointment to one or more reps (ids from list_d2d_reps); an empty list unassigns it. A new appointment moves to assigned.","tags":["d2d"],"x-scope":"d2d","x-feature":"api.d2d","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope, or the connection is Practice (code practice_read_only: Practice reads records but cannot change them)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"member_ids":{"maxItems":20,"type":"array","items":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"idempotency_key":{"description":"Your own unique id for THIS write (any string, e.g. a UUID). Repeating a call with the same key returns the first result instead of acting twice. Always send one on a write.","type":"string","minLength":1,"maxLength":128}},"required":["member_ids"],"additionalProperties":false}}}},"parameters":[{"name":"appointment_id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}}]}},"/d2d/appointments/{appointment_id}/status":{"post":{"operationId":"set_door_appointment_status","summary":"Move a door appointment","description":"Move a door appointment to new, assigned, processing, completed or lost.","tags":["d2d"],"x-scope":"d2d","x-feature":"api.d2d","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope, or the connection is Practice (code practice_read_only: Practice reads records but cannot change them)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["new","assigned","processing","completed","lost"]},"idempotency_key":{"description":"Your own unique id for THIS write (any string, e.g. a UUID). Repeating a call with the same key returns the first result instead of acting twice. Always send one on a write.","type":"string","minLength":1,"maxLength":128}},"required":["status"],"additionalProperties":false}}}},"parameters":[{"name":"appointment_id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}}]}},"/d2d/reps":{"get":{"operationId":"list_d2d_reps","summary":"List door-to-door reps","description":"The reps on the door-to-door roster with their knock, yes, no, no-answer and appointment counts and last activity. Their ids are the member_ids other door tools take.","tags":["d2d"],"x-scope":"d2d","x-feature":"api.d2d","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}}}},"/d2d/stats":{"get":{"operationId":"get_d2d_stats","summary":"Door-to-door totals","description":"Totals for the door-to-door program: areas, reps, doors, knocked, yes / no / no answer, appointments, and today's knocks, yeses, appointments and bookings.","tags":["d2d"],"x-scope":"d2d","x-feature":"api.d2d","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}}}},"/documents":{"get":{"operationId":"list_documents","summary":"List proposals, estimates or invoices","description":"Proposals, estimates or invoices (type), newest first, with customer, status, totals and dates. Filter by status.","tags":["invoices"],"x-scope":"invoices","x-feature":"api.invoices","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"parameters":[{"name":"type","in":"query","required":false,"schema":{"description":"Default invoice","type":"string","enum":["proposal","estimate","invoice"]},"description":"Default invoice"},{"name":"status","in":"query","required":false,"schema":{"type":"string","maxLength":20}},{"name":"limit","in":"query","required":false,"schema":{"description":"How many to return (default 50, max 200).","type":"integer","minimum":1,"maximum":200},"description":"How many to return (default 50, max 200)."}]},"post":{"operationId":"create_document_draft","summary":"Create a proposal, estimate or invoice","description":"Save a DRAFT proposal, estimate or invoice for a customer with your own line items. Nothing is sent. Proposals need the proposals permission.","tags":["invoices"],"x-scope":"invoices","x-feature":"api.invoices","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope, or the connection is Practice (code practice_read_only: Practice reads records but cannot change them)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"document_type":{"type":"string","enum":["proposal","estimate","invoice"]},"crm_customer_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"items":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"object","properties":{"description":{"type":"string","minLength":1,"maxLength":300},"quantity":{"type":"number","exclusiveMinimum":0,"maximum":1000000},"unit":{"type":"string","maxLength":20},"unit_price":{"type":"number","minimum":0,"maximum":10000000},"category":{"type":"string","maxLength":60},"is_taxable":{"type":"boolean"}},"required":["description"],"additionalProperties":false}},"notes":{"type":"string","maxLength":4000},"property_address":{"type":"string","maxLength":300},"due_days":{"type":"integer","minimum":0,"maximum":365},"tax_rate":{"description":"Percent, e.g. 5","type":"number","minimum":0,"maximum":30},"valid_until":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"title":{"type":"string","maxLength":160},"idempotency_key":{"description":"Your own unique id for THIS write (any string, e.g. a UUID). Repeating a call with the same key returns the first result instead of acting twice. Always send one on a write.","type":"string","minLength":1,"maxLength":128}},"required":["document_type","crm_customer_id","items"],"additionalProperties":false}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}}]}},"/documents/{document_id}":{"get":{"operationId":"get_document","summary":"Get a proposal, estimate or invoice","description":"One proposal, estimate or invoice in full: customer, status, dates, totals, line items and any payment links. Use the document_id from list_documents.","tags":["invoices"],"x-scope":"invoices","x-feature":"api.invoices","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}}]}},"/proposals/from-report":{"post":{"operationId":"build_proposal_from_report","summary":"Build a proposal from a roof report","description":"Price a proposal from a finished roof report with the account's own price sheet (what the Proposal Builder does) and save it as a DRAFT for a customer. Nothing is sent. Lines with no configured price come back at 0 and are flagged.","tags":["proposals"],"x-scope":"proposals","x-feature":"api.proposals","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope, or the connection is Practice (code practice_read_only: Practice reads records but cannot change them)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"order_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The report's order id (list_account_reports)."},"crm_customer_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The customer (search_customers)."},"waste_pct":{"type":"number","minimum":0,"maximum":50},"include_labor":{"type":"boolean"},"include_tearoff":{"type":"boolean"},"include_disposal":{"type":"boolean"},"title":{"type":"string","maxLength":160},"document_type":{"type":"string","enum":["proposal","estimate"]},"idempotency_key":{"description":"Your own unique id for THIS write (any string, e.g. a UUID). Repeating a call with the same key returns the first result instead of acting twice. Always send one on a write.","type":"string","minLength":1,"maxLength":128}},"required":["order_id","crm_customer_id"],"additionalProperties":false}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}}]}},"/documents/{document_id}/status":{"post":{"operationId":"set_document_status","summary":"Change a document's status","description":"Mark a proposal, estimate or invoice draft, viewed, accepted, declined, overdue, cancelled, paid or refunded (for example a cheque or e-transfer received). Marking paid or refunded closes any open payment link. Never \"sent\" — use send_document.","tags":["invoices"],"x-scope":"invoices","x-feature":"api.invoices","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope, or the connection is Practice (code practice_read_only: Practice reads records but cannot change them)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["draft","viewed","paid","overdue","cancelled","refunded","accepted","declined"],"description":"Never \"sent\": sending is send_document. paid / refunded need the money permission."},"idempotency_key":{"description":"Your own unique id for THIS write (any string, e.g. a UUID). Repeating a call with the same key returns the first result instead of acting twice. Always send one on a write.","type":"string","minLength":1,"maxLength":128}},"required":["status"],"additionalProperties":false}}}},"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}}]}},"/documents/{document_id}/convert":{"post":{"operationId":"convert_proposal_to_invoice","summary":"Turn a proposal into an invoice","description":"Create an invoice (draft) from an accepted proposal or estimate, with the same lines. Nothing is sent.","tags":["invoices"],"x-scope":"invoices","x-feature":"api.invoices","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope, or the connection is Practice (code practice_read_only: Practice reads records but cannot change them)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"idempotency_key":{"description":"Your own unique id for THIS write (any string, e.g. a UUID). Repeating a call with the same key returns the first result instead of acting twice. Always send one on a write.","type":"string","minLength":1,"maxLength":128}},"additionalProperties":false}}}},"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}}]}},"/documents/{document_id}/payment-link":{"post":{"operationId":"get_payment_link","summary":"Get a payment link for an invoice","description":"The Square link the homeowner pays an invoice with. Returns the existing link when there is one (asking again never makes a second). Needs the account's Square connected. This only makes the link; nothing is sent.","tags":["invoices"],"x-scope":"invoices","x-feature":"api.invoices.payment_links","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope, or the connection is Practice (code practice_read_only: Practice reads records but cannot change them)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"idempotency_key":{"description":"Your own unique id for THIS write (any string, e.g. a UUID). Repeating a call with the same key returns the first result instead of acting twice. Always send one on a write.","type":"string","minLength":1,"maxLength":128}},"additionalProperties":false}}}},"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}}]}},"/documents/{document_id}/share-link":{"get":{"operationId":"get_document_share_link","summary":"Share link for a document","description":"The link the homeowner opens to view (and for a proposal, sign) a document. Nothing is sent.","tags":["invoices"],"x-scope":"invoices","x-feature":"api.invoices","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}}]}},"/documents/{document_id}/send":{"post":{"operationId":"send_document","summary":"Email a document to the homeowner","description":"EMAILS the proposal, estimate or invoice to the homeowner on file from the account (and marks it sent). Only when the user explicitly asked to send it. Needs permission to send emails & texts. Refused (429) if it was sent less than a minute ago.","tags":["invoices"],"x-scope":"invoices","x-feature":"api.send","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope, or the connection is Practice (code practice_read_only: Practice reads records but cannot change them)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"idempotency_key":{"description":"Your own unique id for THIS write (any string, e.g. a UUID). Repeating a call with the same key returns the first result instead of acting twice. Always send one on a write.","type":"string","minLength":1,"maxLength":128}},"additionalProperties":false}}}},"parameters":[{"name":"document_id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}}]}},"/tasks":{"get":{"operationId":"list_tasks","summary":"List tasks","description":"Tasks & Schedule: title, priority, status, due date, what it is linked to (lead, customer, job) and who it is assigned to. Filter by status.","tags":["tasks"],"x-scope":"tasks","x-feature":"api.tasks","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["open","in_progress","done","cancelled"]}},{"name":"limit","in":"query","required":false,"schema":{"description":"How many to return (default 50, max 200).","type":"integer","minimum":1,"maximum":200},"description":"How many to return (default 50, max 200)."}]},"post":{"operationId":"create_task","summary":"Add a task","description":"Add a task, optionally due on a date and linked to a lead, customer or job.","tags":["tasks"],"x-scope":"tasks","x-feature":"api.tasks","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope, or the connection is Practice (code practice_read_only: Practice reads records but cannot change them)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":4000},"priority":{"type":"string","enum":["low","normal","high"]},"due_date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"related_type":{"type":"string","enum":["lead","customer","job"]},"related_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"idempotency_key":{"description":"Your own unique id for THIS write (any string, e.g. a UUID). Repeating a call with the same key returns the first result instead of acting twice. Always send one on a write.","type":"string","minLength":1,"maxLength":128}},"required":["title"],"additionalProperties":false}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}}]}},"/tasks/{task_id}":{"patch":{"operationId":"update_task","summary":"Update or complete a task","description":"Move a task (status: done completes it), or change its title, description, priority or due date. Only what you send changes.","tags":["tasks"],"x-scope":"tasks","x-feature":"api.tasks","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope, or the connection is Practice (code practice_read_only: Practice reads records but cannot change them)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["open","in_progress","done","cancelled"]},"title":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":4000},"priority":{"type":"string","enum":["low","normal","high"]},"due_date":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"idempotency_key":{"description":"Your own unique id for THIS write (any string, e.g. a UUID). Repeating a call with the same key returns the first result instead of acting twice. Always send one on a write.","type":"string","minLength":1,"maxLength":128}},"additionalProperties":false}}}},"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}}]}},"/calendar/events":{"get":{"operationId":"list_calendar_events","summary":"List calendar events","description":"Events on the Roof Manager calendar for the next N days (default 30), plus how many Google Calendar events there are when it is connected.","tags":["tasks"],"x-scope":"tasks","x-feature":"api.tasks","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","minimum":1,"maximum":366}},{"name":"past_days","in":"query","required":false,"schema":{"type":"integer","minimum":0,"maximum":366}}]},"post":{"operationId":"create_calendar_event","summary":"Add a calendar event","description":"Add an event to the Roof Manager calendar (and the owner's Google Calendar when connected). Guests (attendees) are added only when notify is true and the connection may send; otherwise nobody is invited.","tags":["tasks"],"x-scope":"tasks","x-feature":"api.tasks","responses":{"200":{"description":"Done","content":{"application/json":{"schema":{"type":"object"}}}},"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Bad input","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"402":{"description":"Not in this plan (code plan_required)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"403":{"description":"Key lacks the scope, or the connection is Practice (code practice_read_only: Practice reads records but cannot change them)","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"404":{"description":"Not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}},"409":{"description":"Conflict","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":200},"start_time":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}(T\\d{2}:\\d{2}(:\\d{2})?)?$","description":"YYYY-MM-DD (all day) or YYYY-MM-DDTHH:MM local time"},"end_time":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}(T\\d{2}:\\d{2}(:\\d{2})?)?$","description":"YYYY-MM-DD (all day) or YYYY-MM-DDTHH:MM local time"},"all_day":{"type":"boolean"},"description":{"type":"string","maxLength":4000},"location":{"type":"string","maxLength":300},"linked_entity_type":{"type":"string","enum":["job","lead","customer"]},"linked_entity_id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"attendees":{"maxItems":20,"type":"array","items":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"time_zone":{"type":"string","maxLength":60},"notify":{"description":"Send the usual email/text to the person it concerns (for example the rep a lead is assigned to). Off unless you set true AND the connection was allowed to send emails & texts.","type":"boolean"},"idempotency_key":{"description":"Your own unique id for THIS write (any string, e.g. a UUID). Repeating a call with the same key returns the first result instead of acting twice. Always send one on a write.","type":"string","minLength":1,"maxLength":128}},"required":["title","start_time"],"additionalProperties":false}}}},"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":128}}]}},"/pdf/{job_id}":{"get":{"operationId":"download_pdf","summary":"Download a report PDF with a signed link","description":"Use the pdf_url a job returns (signed, 15 minutes). No key needed: the signature is the capability.","security":[],"parameters":[{"name":"job_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"exp","in":"query","required":true,"schema":{"type":"integer"}},{"name":"sig","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"application/pdf"},"403":{"description":"Bad or expired signature","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"hint":{"type":"string"},"retry_after":{"type":"integer"}},"required":["error"]}}}}}}}},"x-mcp":{"url":"https://www.roofmanager.ca/mcp","transport":"streamable-http","auth":["oauth2","bearer"],"resource_metadata":"https://www.roofmanager.ca/.well-known/oauth-protected-resource/mcp"}}