# Roofpeace agent reference > Generated from the agent route table, OpenAPI contract and MCP tool registry by `web/scripts/agent-docs.ts`. Do not edit by hand. ## Authentication Every call except coverage checks needs an owner-issued key: `Authorization: Bearer rp_live_...`. Owners create and revoke keys at https://roofpeace.com/settings/agent-access. Keys carry scopes; calls outside them return 403. An inactive workspace plan returns 402. See https://roofpeace.com/agent.md for the full guide. ## MCP tools Endpoint: `https://roofpeace.com/api/mcp` (streamable HTTP, stateless). Only tools within the key's scopes are listed. Read tools accept `detail: "concise" | "detailed"`. ### get_workspace Confirm which Roofpeace company this credential acts for, whether its plan is active, the granted scopes, and its service areas. Call first in a new conversation. Scope: any valid key. Read-only. #### Parameters None. #### Example Arguments: ```json {} ``` Result (abridged): ```json { "agent": { "id": "5a2c8e1f-6b4d-4f9a-b7e3-2d1c9a8f6e50", "name": "Dispatch agent", "kind": "workspace", "org_id": "c7e2a9d4-1f3b-4c6e-8a5d-9b2f7e4c1a36", "delegated_user_email": "owner@krroofing.example", "scopes": [ "crm:write", "workspace:read" ] }, "workspace": { "id": "c7e2a9d4-1f3b-4c6e-8a5d-9b2f7e4c1a36", "name": "KR Roofing" }, "access_active": true, "service_areas": [ { "service_area_id": "0a4d7c2e-9b1f-4e8a-a3c5-7d9e2b4f6a18", "name": "Santa Fe", "seed_status": "seeded" } ] } ``` ### list_jobs The company's jobs, most recently updated first: stage, customer, address, insurance claim, sales rep and next step. Filter by stage or search text (name, address, claim number, rep). total counts every match; for the next page, pass next_offset as offset until it is null. A job updated while you page moves to the top, so check the job_ids you collected against total. Scope: `workspace:read`. Read-only. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `search` | string (max 200 chars) | no | Matches title, number, customer, address, claim number or rep. | | `stage` | `lead`, `signed`, `claim_filed`, `adjuster_meeting`, `estimates`, `approved`, `scheduled`, `materials_ordered`, `materials_delivered`, `in_progress`, `work_complete`, `invoiced`, `paid`, `lost`, `on_hold` | no | | | `limit` | integer (min 1, max 50, default 20) | no | | | `offset` | integer (min 0, default 0) | no | How many to skip: next_offset from the previous page. | #### Example Arguments: ```json { "stage": "signed", "limit": 5 } ``` Result (abridged): ```json { "jobs": [ { "job_id": "8c4112a8-7706-485b-b84d-dfe20f62b720", "number": "1341", "title": "Lewis roof replacement", "stage": "signed", "stage_label": "Signed", "customer": "Nolan Lewis", "address": "1418 Camino Real, Santa Fe, NM", "insurance_carrier": "Allstate", "claim_number": "0838088185", "sales_rep": "Kyle", "next_step": "Order materials (due 2026-11-12T16:00:00Z)", "updated_at": "2026-11-08T15:12:00Z" } ], "total": 1, "next_offset": null } ``` ### get_job Everything on one job: details and insurance claim, people, open tasks, recent notes, every PDF on the job (labelled, e.g. carrier estimate, invoice, signed agreement, supplier bill), the planned dates and what still blocks the start, and money: sold, invoiced, paid, balance, cost and what is missing. Amounts are US dollars. Scope: `workspace:read`. Read-only. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `job_id` | string (uuid) | yes | job_id from list_jobs. | #### Example Arguments: ```json { "job_id": "8c4112a8-7706-485b-b84d-dfe20f62b720" } ``` Result (abridged): ```json { "job": { "job_id": "8c4112a8-7706-485b-b84d-dfe20f62b720", "title": "Lewis roof replacement", "stage": "signed" }, "people": [ { "contact_id": "0b9c6a52-5d0f-4c1e-9a43-7f1de2c4b801", "name": "Nolan Lewis", "role": "Customer", "phone": "(505) 555-0118", "email": null, "primary": true } ], "open_tasks": [ { "task_id": "3f0c…", "title": "Order materials", "details": null, "due_at": "2026-11-12T16:00:00Z", "assignee": "Kyle" } ], "recent_notes": [ { "kind": "Note", "body": "Adjuster approved ridge vent.", "author": "Kyle", "at": "2026-11-07T18:00:00Z" } ], "documents": [ { "label": "Carrier estimate", "note": "Allstate", "kind": "reading", "date": "2026-10-30" } ], "schedule": { "planned_start": "2026-11-17", "planned_finish": "2026-11-18", "crew": "Ortiz Roofing Crew", "started_on": null, "completed_on": null, "ready": false, "still_needed": [ "Materials delivered" ], "overdue": [] }, "money": { "invoiced": 2808.7, "paid": 0, "balance": 2808.7, "supplements_requested": 640, "supplements_approved": 0, "sold": 9450, "cost": 4210.55, "supplier_bills": 3, "missing": [] } } ``` ### list_invoices A job's invoices with status, who is billed, lines, totals, payments and balance. Amounts are US dollars. Scope: `workspace:read`. Read-only. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `job_id` | string (uuid) | yes | job_id from list_jobs. | #### Example Arguments: ```json { "job_id": "8c4112a8-7706-485b-b84d-dfe20f62b720" } ``` Result (abridged): ```json { "invoices": [ { "invoice_id": "5b1e…", "number": "1150", "status": "draft", "bill_to": "insurance", "issued_on": null, "due_on": null, "total": 2808.7, "paid": 0, "balance": 2808.7, "sent_at": null, "lines": [ { "name": "Ridge vent", "description": null, "quantity": 32, "unit": "LF", "unit_price": 12.5, "amount": 400 } ] } ] } ``` ### list_supplements Supplements requested from the insurance carrier on a job: each item with its reason and the carrier's decision, plus requested and approved totals. Amounts are US dollars. Scope: `workspace:read`. Read-only. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `job_id` | string (uuid) | yes | job_id from list_jobs. | #### Example Arguments: ```json { "job_id": "8c4112a8-7706-485b-b84d-dfe20f62b720" } ``` Result (abridged): ```json { "supplements": [ { "supplement_id": "9a2d…", "number": 1, "note": null, "requested": 640, "approved": 0, "items_awaiting_carrier": 2, "sent_at": null, "invoice_number": null, "items": [ { "name": "Drip edge", "quantity": 160, "unit": "LF", "unit_price": 4, "amount": 640, "reason": "Required by code (IRC R905.2.8.5)", "decision": null } ] } ] } ``` ### get_quote The job's current quote: draft or final, its lines, any good/better/best options with totals, which option the customer chose, and required items still missing. Amounts are US dollars. Returns quote: null when the job has none. Scope: `workspace:read`. Read-only. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `job_id` | string (uuid) | yes | job_id from list_jobs. | #### Example Arguments: ```json { "job_id": "8c4112a8-7706-485b-b84d-dfe20f62b720" } ``` Result (abridged): ```json { "quote": { "status": "issued", "revision": 2, "lines": [ { "description": "Architectural shingles", "quantity": 24, "unit": "SQ", "unit_price": 410, "option": null } ], "options": [ { "name": "Better", "total": 14820 } ], "chosen_option": "Better", "subtotal": 13900, "total": 14820, "missing_required_items": [] } } ``` ### list_tasks Open tasks on jobs and leads, soonest due first. By default the connected person's own; everyone=true shows the whole team's when they are allowed to see it. search finds tasks by their words or their job's name, number, address, customer, phone, email or claim, as the Tasks page does. Scope: `workspace:read`. Read-only. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `everyone` | boolean (default false) | no | | | `search` | string (max 200 chars) | no | Words to match, e.g. a job name, address or customer. | #### Example Arguments: ```json { "everyone": false } ``` Result (abridged): ```json { "tasks": [ { "task_id": "3f0c…", "title": "Order materials", "due_at": "2026-11-12T16:00:00Z", "job_id": "8c4112a8-7706-485b-b84d-dfe20f62b720", "subject": "Lewis roof replacement", "assignee": "Kyle" } ] } ``` ### list_team Everyone on the company's team, with their role and user id for assigning work. Scope: `workspace:read`. Read-only. #### Parameters None. #### Example Arguments: ```json {} ``` Result (abridged): ```json { "team": [ { "user_id": "u_1", "name": "Kyle", "role": "owner", "is_you": true } ] } ``` ### add_job_note Add a note to a job's activity, like a call outcome or what the adjuster said. It shows under the connected person's name. Scope: `crm:write`. Writes; retry with the same `idempotency_key`. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `job_id` | string (uuid) | yes | job_id from list_jobs. | | `body` | string (max 20000 chars) | yes | | | `idempotency_key` | string (max 100 chars) | yes | Unique per intended action. Reuse the same key when retrying after a timeout; a new key repeats the action. | #### Example Arguments: ```json { "job_id": "8c4112a8-7706-485b-b84d-dfe20f62b720", "body": "Adjuster approved ridge vent on the call.", "idempotency_key": "note-lewis-adjuster-1" } ``` Result (abridged): ```json { "replayed": false, "result": { "kind": "Note", "body": "Adjuster approved ridge vent on the call.", "author": "Kyle", "at": "2026-11-08T18:00:00Z" } } ``` ### add_job_task Add a task to a job: what is left to do, optionally with details (color, sides, how many) and a due time. The title is a short action someone can scan in a list; everything else goes in details. Scope: `crm:write`. Writes; retry with the same `idempotency_key`. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `job_id` | string (uuid) | yes | job_id from list_jobs. | | `title` | string (max 300 chars) | yes | A short action, about 8 words or fewer, e.g. Order materials or Call adjuster about ridge vent. | | `details` | string (max 2000 chars) | no | Short specifics, e.g. Clay color, front and right side, 2 downspouts, 1 kickout. | | `due_at` | string (date-time) | no | ISO 8601 with offset, e.g. 2026-11-12T09:00:00-07:00. | | `idempotency_key` | string (max 100 chars) | yes | Unique per intended action. Reuse the same key when retrying after a timeout; a new key repeats the action. | #### Example Arguments: ```json { "job_id": "8c4112a8-7706-485b-b84d-dfe20f62b720", "title": "Order materials", "due_at": "2026-11-12T09:00:00-07:00", "idempotency_key": "task-lewis-materials-1" } ``` Result (abridged): ```json { "replayed": false, "result": { "task_id": "3f0c…", "title": "Order materials", "details": null, "due_at": "2026-11-12T16:00:00Z", "assignee": null } } ``` ### set_job_stage Move a job to another stage: lead, signed, claim_filed, adjuster_meeting, estimates, approved, scheduled, materials_ordered, materials_delivered, in_progress, work_complete, invoiced, paid, lost, on_hold. lead is a quote (in Quotes); signed (shown as Sold) puts it in Jobs, and needs no verified agreement: the agreement status is separate (set_agreement_status) and a stage change never changes it. Insurance jobs then go claim_filed, adjuster_meeting, estimates, approved; every job then goes scheduled (crew lined up), materials_ordered, materials_delivered, in_progress, work_complete, invoiced, paid. A job with paperwork still out for signature can't be marked lost, and a job can't be marked paid while a check payment has no photo of the check or note saying why. Scope: `crm:write`. Writes; retry with the same `idempotency_key`. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `job_id` | string (uuid) | yes | job_id from list_jobs. | | `stage` | `lead`, `signed`, `claim_filed`, `adjuster_meeting`, `estimates`, `approved`, `scheduled`, `materials_ordered`, `materials_delivered`, `in_progress`, `work_complete`, `invoiced`, `paid`, `lost`, `on_hold` | yes | | | `idempotency_key` | string (max 100 chars) | yes | Unique per intended action. Reuse the same key when retrying after a timeout; a new key repeats the action. | #### Example Arguments: ```json { "job_id": "8c4112a8-7706-485b-b84d-dfe20f62b720", "stage": "materials_ordered", "idempotency_key": "stage-lewis-materials" } ``` Result (abridged): ```json { "replayed": false, "result": { "job_id": "8c4112a8-7706-485b-b84d-dfe20f62b720", "stage": "materials_ordered", "stage_label": "Materials ordered" } } ``` ### update_job_details Correct a job's address, or its customer's name, phone or email, as anyone can on the job page. Only the fields given change; an empty string clears one. A cleared address falls back to the job's building or inquiry. If the job has a main contact in People, their contact changes too, on every job they're on; the card says how many. New quotes, emails and paperwork use the change; anything already sent or signed keeps what it said. The inquiry itself is never changed. Scope: `crm:write`. Writes; retry with the same `idempotency_key`. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `job_id` | string (uuid) | yes | job_id from list_jobs. | | `address` | string (max 300 chars) | no | One line: street, city, state and ZIP. | | `customer_name` | string (max 200 chars) | no | | | `customer_phone` | string (max 40 chars) | no | | | `customer_email` | string (email, max 320 chars) or `` | no | | | `idempotency_key` | string (max 100 chars) | yes | Unique per intended action. Reuse the same key when retrying after a timeout; a new key repeats the action. | #### Example Arguments: ```json { "job_id": "8c4112a8-7706-485b-b84d-dfe20f62b720", "customer_phone": "505-555-0199", "idempotency_key": "lewis-phone-fix-1" } ``` Result (abridged): ```json { "replayed": false, "result": { "job_id": "8c4112a8-7706-485b-b84d-dfe20f62b720", "address": "4512 Lomas Blvd NE, Albuquerque, NM 87110", "customer": { "name": "Nolan Lewis", "phone": "505-555-0199", "email": null } } } ``` ### set_job_main_contact Make one of the job's people (get_job lists them with contact_id) its main contact: the person the job page shows and invoices go to. Their name, phone and email are copied onto the job. contact_id null leaves the job with no main contact. To put someone new on the job first, use add_person_to_job. Scope: `crm:write`. Writes; retry with the same `idempotency_key`. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `job_id` | string (uuid) | yes | job_id from list_jobs. | | `contact_id` | string (uuid) or null | yes | contact_id of someone in the job's people, or null for none. | | `idempotency_key` | string (max 100 chars) | yes | Unique per intended action. Reuse the same key when retrying after a timeout; a new key repeats the action. | #### Example Arguments: ```json { "job_id": "8c4112a8-7706-485b-b84d-dfe20f62b720", "contact_id": "0b9c6a52-5d0f-4c1e-9a43-7f1de2c4b801", "idempotency_key": "lewis-main-dana" } ``` Result (abridged): ```json { "replayed": false, "result": { "job_id": "8c4112a8-7706-485b-b84d-dfe20f62b720", "main_contact": "Dana Reyes" } } ``` ### add_person_to_job Add someone already in contacts (find_contacts or add_contact gives contact_id) to a job's people, as on the job page. make_main true also makes them the job's main contact. Scope: `crm:write`. Writes; retry with the same `idempotency_key`. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `job_id` | string (uuid) | yes | job_id from list_jobs. | | `contact_id` | string (uuid) | yes | contact_id from find_contacts or add_contact. | | `make_main` | boolean (default false) | no | | | `idempotency_key` | string (max 100 chars) | yes | Unique per intended action. Reuse the same key when retrying after a timeout; a new key repeats the action. | #### Example Arguments: ```json { "job_id": "8c4112a8-7706-485b-b84d-dfe20f62b720", "contact_id": "0b9c6a52-5d0f-4c1e-9a43-7f1de2c4b801", "make_main": true, "idempotency_key": "lewis-add-dana" } ``` Result (abridged): ```json { "replayed": false, "result": { "job_id": "8c4112a8-7706-485b-b84d-dfe20f62b720", "contact_id": "0b9c6a52-5d0f-4c1e-9a43-7f1de2c4b801", "main_contact": true } } ``` ### set_agreement_status Say whether the customer signed the agreement, as anyone can on the job page: not_verified (nobody has checked), not_signed, or signed_outside (signed on paper or another app). Signed in Roofpeace comes from Roofpeace's own signing and can't be set. It never moves the job's stage; to move a quote into Jobs, use set_job_stage with signed (shown as Sold), which needs no verified agreement. Scope: `crm:write`. Writes; retry with the same `idempotency_key`. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `job_id` | string (uuid) | yes | job_id from list_jobs. | | `status` | `not_verified`, `not_signed`, `signed_outside` | yes | | | `idempotency_key` | string (max 100 chars) | yes | Unique per intended action. Reuse the same key when retrying after a timeout; a new key repeats the action. | #### Example Arguments: ```json { "job_id": "8c4112a8-7706-485b-b84d-dfe20f62b720", "status": "signed_outside", "idempotency_key": "lewis-agreement-paper" } ``` Result (abridged): ```json { "replayed": false, "result": { "job_id": "8c4112a8-7706-485b-b84d-dfe20f62b720", "agreement": "Signed outside Roofpeace", "stage_label": "Sold" } } ``` ### search_workspace Find anything in the company by a name, address, phone, email, job number or claim number, as the search boxes on Jobs, Quotes and Contacts do: jobs, quotes (deals not sold yet, or lost), contacts, leads, buildings and teammates. Each result says where it opens. Use it when you don't know whether someone is a job, a quote or only a contact. Scope: `workspace:read`. Read-only. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `query` | string (max 100 chars) | yes | | #### Example Arguments: ```json { "query": "american legion" } ``` Result (abridged): ```json { "jobs": [ { "id": "8c4112a8-7706-485b-b84d-dfe20f62b720", "title": "American legion post 69", "subtitle": "Dave Stevens · 9000 4th St NW · #1339 · Claim filed", "href": "/jobs/8c4112a8-7706-485b-b84d-dfe20f62b720" } ], "quotes": [], "contacts": [], "leads": [], "buildings": [], "people": [] } ``` ### set_claim_decision Say what the insurance carrier decided on a job's claim, as anyone can on the job page: waiting (no decision yet), approved, partial (partly approved), or denied. It never moves the job's stage. After a denial the usual next steps are ask_for_reinspection, switching the job to retail (set_work_type), or set_job_stage lost. Scope: `crm:write`. Writes; retry with the same `idempotency_key`. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `job_id` | string (uuid) | yes | job_id from list_jobs. | | `decision` | `waiting`, `approved`, `partial`, `denied` | yes | | | `idempotency_key` | string (max 100 chars) | yes | Unique per intended action. Reuse the same key when retrying after a timeout; a new key repeats the action. | #### Example Arguments: ```json { "job_id": "8c4112a8-7706-485b-b84d-dfe20f62b720", "decision": "denied", "idempotency_key": "lewis-claim-denied" } ``` Result (abridged): ```json { "replayed": false, "result": { "job_id": "8c4112a8-7706-485b-b84d-dfe20f62b720", "claim_decision": "Claim denied", "stage_label": "Adjuster meeting" } } ``` ### ask_for_reinspection Record that the company asked the carrier to inspect the roof again, usually after a denial, owned by the person asking, with a follow-up task on follow_up_on (YYYY-MM-DD). requested_on is the day it was asked, normally today. Only one open re-inspection ask per job. Scope: `crm:write`. Writes; retry with the same `idempotency_key`. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `job_id` | string (uuid) | yes | job_id from list_jobs. | | `requested_on` | string | yes | | | `follow_up_on` | string | yes | | | `idempotency_key` | string (max 100 chars) | yes | Unique per intended action. Reuse the same key when retrying after a timeout; a new key repeats the action. | #### Example Arguments: ```json { "job_id": "8c4112a8-7706-485b-b84d-dfe20f62b720", "requested_on": "2026-11-19", "follow_up_on": "2026-11-24", "idempotency_key": "lewis-reinspection" } ``` Result (abridged): ```json { "replayed": false, "result": { "job_id": "8c4112a8-7706-485b-b84d-dfe20f62b720", "asked": true, "follow_up_on": "2026-11-24" } } ``` ### set_work_type Say whether a job is paid by an insurance claim (insurance) or by the homeowner (retail), as the job page's Insurance or retail picker does. A retail job has no claim stages, so a job switched to retail while at claim_filed, adjuster_meeting, estimates or approved goes back to signed (Sold). Switching to retail is one of the usual steps after a denied claim. Scope: `crm:write`. Writes; retry with the same `idempotency_key`. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `job_id` | string (uuid) | yes | job_id from list_jobs. | | `work_type` | `insurance`, `retail` | yes | | | `idempotency_key` | string (max 100 chars) | yes | Unique per intended action. Reuse the same key when retrying after a timeout; a new key repeats the action. | #### Example Arguments: ```json { "job_id": "8c4112a8-7706-485b-b84d-dfe20f62b720", "work_type": "retail", "idempotency_key": "lewis-retail" } ``` Result (abridged): ```json { "replayed": false, "result": { "job_id": "8c4112a8-7706-485b-b84d-dfe20f62b720", "work_type": "retail", "stage_label": "Sold" } } ``` ### find_contacts The company's contacts, not tied to any job: homeowners, adjusters, insurance agents, realtors, property managers, inspectors, subs, crew and suppliers. Search by name, company, phone or email, or filter by what they are. total counts every match; for the next page, pass next_offset as offset until it is null. Scope: `workspace:read`. Read-only. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `search` | string (max 200 chars) | no | Name, company, phone digits or email. | | `kind` | `customer`, `adjuster`, `insurance_agent`, `realtor`, `property_manager`, `inspector`, `subcontractor`, `crew`, `supplier`, `consultant`, `engineer`, `attorney`, `vendor`, `other` | no | | | `limit` | integer (min 1, max 50, default 20) | no | | | `offset` | integer (min 0, default 0) | no | How many to skip: next_offset from the previous page. | #### Example Arguments: ```json { "search": "abc supply", "limit": 5 } ``` Result (abridged): ```json { "contacts": [ { "contact_id": "0b9c6a52-5d0f-4c1e-9a43-7f1de2c4b801", "name": "Mike Ross", "kind": "Supplier", "company": "ABC Supply", "phone": "(505) 555-0142", "email": "mross@abcsupply.com", "last_touch": "2026-11-14T16:20:00Z" } ], "total": 1, "next_offset": null } ``` ### get_contact Everything with one person, found from what Roofpeace already has: their details, jobs (as customer, adjuster or on the job), buildings, money invoiced and paid on their jobs, emails sent to them, leads, notes and tasks. Amounts are US dollars. Scope: `workspace:read`. Read-only. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `contact_id` | string (uuid) | yes | contact_id from find_contacts. | #### Example Arguments: ```json { "contact_id": "0b9c6a52-5d0f-4c1e-9a43-7f1de2c4b801" } ``` Result (abridged): ```json { "contact": { "contact_id": "0b9c6a52-5d0f-4c1e-9a43-7f1de2c4b801", "name": "Dana Reyes", "kind": "Homeowner", "company": null, "phone": "(505) 555-0199", "email": "dana@example.com", "address": "4120 Montano Rd NW, Albuquerque, NM", "note": null }, "jobs": [ { "job_id": "8c4112a8-7706-485b-b84d-dfe20f62b720", "title": "Reyes roof replacement", "stage": "signed", "role": "customer", "address": "4120 Montano Rd NW" } ], "money": { "invoiced": 18240, "paid": 9000, "invoices": 1 }, "leads": [], "emails": [ { "subject": "Your roof quote", "sent_at": "2026-11-02T15:00:00Z" } ], "notes": [ { "body": "Wants it done before Thanksgiving", "author": "Kyle", "at": "2026-11-10T18:00:00Z" } ], "open_tasks": [ { "title": "Call Dana about the start date", "due_at": null } ] } ``` ### add_contact Add someone to the company's contacts, no job needed. If someone with the same phone or email (or a very close name at the same company) is already here, nothing is added and they are returned as matches: tell the person, and only add again with confirm_new true if they say it's someone different. Scope: `crm:write`. Writes; retry with the same `idempotency_key`. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `name` | string (max 300 chars) | yes | | | `kind` | `customer`, `adjuster`, `insurance_agent`, `realtor`, `property_manager`, `inspector`, `subcontractor`, `crew`, `supplier`, `other` (default "other") | no | What they are to the company; customer means a homeowner or lead. | | `company` | string (max 200 chars) | no | | | `phone` | string (max 40 chars) | no | | | `email` | string (email, max 320 chars) | no | | | `address` | string (max 400 chars) | no | One line: street, city, state and ZIP. | | `note` | string (max 1000 chars) | no | | | `confirm_new` | boolean (default false) | no | True only after the person confirmed a returned match is someone else. | | `idempotency_key` | string (max 100 chars) | yes | Unique per intended action. Reuse the same key when retrying after a timeout; a new key repeats the action. | #### Example Arguments: ```json { "name": "Mike Ross", "kind": "supplier", "company": "ABC Supply", "phone": "505-555-0142", "idempotency_key": "contact-mike-ross-1" } ``` Result (abridged): ```json { "replayed": false, "result": { "added": true, "contact_id": "0b9c6a52-5d0f-4c1e-9a43-7f1de2c4b801", "found": { "jobs": 0, "leads": 0, "invoices": 0, "emails": 0 } } } ``` ### get_money What customers and carriers still owe across every job: each sent invoice with a balance, oldest due first and overdue ones marked, plus invoices still in draft. Imported invoices are totalled separately: their payments may have been recorded in the previous system, so say they need checking rather than calling them owed. Amounts are US dollars. Scope: `workspace:read`. Read-only. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `limit` | integer (min 1, max 50, default 15) | no | | #### Example Arguments: ```json { "limit": 2 } ``` Result (abridged): ```json { "today": "2026-11-11", "owed": 12840.5, "overdue": 4210, "unpaid": [ { "invoice_id": "5b1e…", "number": "1150", "job_id": "8c4112a8-7706-485b-b84d-dfe20f62b720", "job": "Lewis roof replacement", "bill_to": "carrier", "due_on": "2026-10-30", "balance": 4210, "overdue": true } ], "drafts": [ { "invoice_id": "7c2a…", "number": "1153", "job_id": "1d9e…", "job": "Garcia reroof", "total": 6480 } ], "imported_unpaid": { "invoices": 32, "balance": 2696243.36 } } ``` ### get_schedule Jobs on the production schedule: planned dates, crew and who is responsible, whether each is ready to start and what still blocks it, and double bookings; plus sold jobs with no dates yet. Office roles only. Scope: `workspace:read`. Read-only. #### Parameters None. #### Example Arguments: ```json {} ``` Result (abridged): ```json { "today": "2026-11-11", "scheduled": [ { "job_id": "8c4112a8-7706-485b-b84d-dfe20f62b720", "title": "Lewis roof replacement", "address": "1418 Camino Real, Santa Fe, NM", "stage": "scheduled", "planned_start": "2026-11-17", "planned_finish": "2026-11-18", "crew": "Ortiz Roofing Crew", "responsible": "Kyle", "started_on": null, "ready": false, "still_needed": [ "Materials delivered" ], "overdue": [], "double_booked_with": [] } ], "unscheduled": [] } ``` ### list_paperwork Supplier invoices, credits and warranties waiting for a person to say which job they belong to, with what the document says and Roofpeace's suggested job; plus supplier statements listing invoices that never arrived. Office roles see everything; others see only what they were asked about. Amounts are US dollars. Scope: `workspace:read`. Read-only. #### Parameters None. #### Example Arguments: ```json {} ``` Result (abridged): ```json { "needs_a_job": [ { "document_id": "2f7c…", "title": "QXO invoice VK09065", "kind": "invoice", "supplier": "QXO", "number": "VK09065", "date": "2026-11-04", "total": 3482.17, "po": "Lewis", "job_reference": null, "ship_to": "1418 Camino Real", "emailed_by": "ar@qxo.example", "read_by_ai": false, "suggested_job": { "job_id": "8c4112a8-7706-485b-b84d-dfe20f62b720", "title": "Lewis roof replacement", "reason": "The PO names Lewis" }, "asked": null } ], "statements": [ { "supplier": "QXO", "account": "40112", "checked_through": "2026-10-31", "balance": 9120.4, "invoices_not_here": [ "VK08811" ] } ], "still_reading": 0 } ``` ### list_licenses The company's licenses, insurance policies and bonds, and each subcontractor's certificates, as the Licenses page lists them: most urgent first (expired, then due within 30 days, then no expiry on file), with the carrier or agency, number, expiry, how to renew, any renewal in progress and its task. Office roles only. Ask for history to also see terms that were renewed. Scope: `workspace:read`. Read-only. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `include_history` | boolean (default false) | no | Also list earlier terms that were renewed. | #### Example Arguments: ```json {} ``` Result (abridged): ```json { "needs_attention": "1 expired", "documents": [ { "document_id": "9b4dc0b5-e972-42ce-b58f-08382bc7e9ce", "kind": "general_liability", "name": "General liability", "subcontractor": null, "carrier_or_agency": "Third Coast Insurance", "number": "GL-1088125", "holder": null, "state_or_county": "Kansas", "issued_on": "2025-11-21", "expires_on": "2026-11-21", "days_left": -2, "status": "Expired Nov 21", "ends_with": null, "certificate": "Additional Insured.pdf", "papers": [], "how_to_renew": "Agent emails the renewal to sign and pay.", "notes": null, "renewal": null, "task": { "task_id": "3f0c…", "title": "Renew General liability", "assignee": "Kyle", "done": false } } ] } ``` ### start_license_renewal Mark a renewal as under way on one document from list_licenses and say where it stands, e.g. 'Signed and paid, waiting on the new certificate'. It is handled by the connected person unless you name someone in the office (user_id from list_team); the document's open task goes to them. Call again to update the note. This does not record the new term; use record_license_renewal once the new dates are known. Scope: `crm:write`. Writes; retry with the same `idempotency_key`. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `document_id` | string (uuid) | yes | document_id from list_licenses. | | `note` | string (max 1000 chars) | no | Where the renewal stands. | | `handled_by_user_id` | string | no | An office member's user_id from list_team; the connected person when left out. | | `idempotency_key` | string (max 100 chars) | yes | Unique per intended action. Reuse the same key when retrying after a timeout; a new key repeats the action. | #### Example Arguments: ```json { "document_id": "9b4dc0b5-e972-42ce-b58f-08382bc7e9ce", "note": "Signed and paid, waiting on the new certificate.", "idempotency_key": "renewal-gl-2026-1" } ``` Result (abridged): ```json { "replayed": false, "result": { "document_id": "9b4dc0b5-e972-42ce-b58f-08382bc7e9ce", "kind": "general_liability", "name": "General liability", "subcontractor": null, "carrier_or_agency": "Third Coast Insurance", "number": "GL-1088125", "holder": null, "state_or_county": "Kansas", "issued_on": "2025-11-21", "expires_on": "2026-11-21", "days_left": -2, "status": "Expired Nov 21", "ends_with": null, "certificate": "Additional Insured.pdf", "papers": [], "how_to_renew": "Agent emails the renewal to sign and pay.", "notes": null, "renewal": { "started_at": "2026-11-23T19:00:00.000Z", "handled_by": "Kyle", "note": "Signed and paid, waiting on the new certificate." }, "task": { "task_id": "3f0c…", "title": "Renew General liability", "assignee": "Kyle", "done": false } } } ``` ### record_license_renewal Record the new term of one document from list_licenses once it has been renewed: the new expiry, and the new number and issue date if they changed. The old term moves to history, its renewal task is done and reminders start over for the new date. Only use dates and numbers from the new license, policy or certificate itself. The new certificate file is added on the Licenses page. Scope: `crm:write`. Writes; retry with the same `idempotency_key`. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `document_id` | string (uuid) | yes | document_id from list_licenses. | | `expires_on` | string | yes | A date as YYYY-MM-DD. | | `number` | string (max 120 chars) | no | The new number; the old one is kept when left out. | | `issued_on` | string | no | A date as YYYY-MM-DD. | | `idempotency_key` | string (max 100 chars) | yes | Unique per intended action. Reuse the same key when retrying after a timeout; a new key repeats the action. | #### Example Arguments: ```json { "document_id": "9b4dc0b5-e972-42ce-b58f-08382bc7e9ce", "expires_on": "2027-11-21", "issued_on": "2026-11-21", "idempotency_key": "renewed-gl-2026-1" } ``` Result (abridged): ```json { "replayed": false, "result": { "document_id": "c1f0a2d4-5b6e-4f70-8a91-b2c3d4e5f607", "kind": "general_liability", "name": "General liability", "subcontractor": null, "carrier_or_agency": "Third Coast Insurance", "number": "GL-1088125", "holder": null, "state_or_county": "Kansas", "issued_on": "2026-11-21", "expires_on": "2027-11-21", "days_left": 363, "status": "Good until Nov 21, 2027", "ends_with": null, "certificate": null, "papers": [], "how_to_renew": "Agent emails the renewal to sign and pay.", "notes": null, "renewal": null, "task": null } } ``` ### get_today The person's day: open website leads to call (newest first, with when each came in and who holds it) and their follow-ups that are due. Start here for 'who should I call', 'what's next' or 'what's due'. Scope: `crm:read`. Read-only. #### Parameters None. #### Example Arguments: ```json {} ``` Result (abridged): ```json { "now": "2026-11-11T16:00:00.000Z", "leads_to_call": [ { "inquiry_id": "6f1c2a8e-3b7d-4c55-9a10-2e8f4b6d7c01", "name": "Dana Ortiz", "phone": "505-555-0187", "email": null, "address": "4120 Montano Rd NW, Albuquerque, NM", "headline": "Hail damage, leak over the garage", "received_at": "2026-11-11T14:42:00.000Z", "held_by": "nobody" } ], "follow_ups": [ { "title": "Send the Garcia estimate", "due_at": "2026-11-11T22:00:00.000Z", "for": "9 Sandia View Ct NE", "inquiry_id": null, "property_id": null } ] } ``` ### get_lead One website lead in full: contact details, what they asked for, stage, who holds it, notes and open follow-ups. Scope: `crm:read`. Read-only. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `inquiry_id` | string (uuid) | yes | inquiry_id from get_today. | #### Example Arguments: ```json { "inquiry_id": "6f1c2a8e-3b7d-4c55-9a10-2e8f4b6d7c01" } ``` Result (abridged): ```json { "inquiry_id": "6f1c2a8e-3b7d-4c55-9a10-2e8f4b6d7c01", "name": "Dana Ortiz", "phone": "505-555-0187", "email": null, "company": null, "address": "4120 Montano Rd NW, Albuquerque, NM", "details": "Hail Saturday night, water coming in over the garage.", "received_at": "2026-11-11T14:42:00.000Z", "stage": "lead", "held_by": null, "notes": [], "open_follow_ups": [ { "title": "Call Dana back", "due_at": "2026-11-12T16:00:00.000Z" } ] } ``` ### list_storm_alerts List the company's most recent storm alerts (hail or wind that hit a service area), newest first, with how many properties each affects. Use get_door_list with an alert_id to work one. Scope: `workspace:read`. Read-only. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `limit` | integer (min 1, max 20, default 5) | no | Number of alerts, newest first. | #### Example Arguments: ```json { "limit": 2 } ``` Result (abridged): ```json { "alerts": [ { "alert_id": "6f1c2d9e-4b7a-4e21-9c3f-2a8b5d7e1f04", "name": "Santa Fe", "source": "storm", "storm_started_at": "2026-09-18T21:40:00.000Z", "max_hail_inches": 1.25, "max_wind_mph": 58, "property_count": 42, "status": "ready" } ] } ``` ### get_door_list Return the properties hit by one storm alert, ranked by opportunity and ordered into a driving route that fits the time budget. Give start_lat/start_lng to route from the crew's location. Stops outside the budget are listed after the route with stop=null. Scope: `workspace:read`. Read-only. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `alert_id` | string (uuid) | yes | From list_storm_alerts. | | `start_lat` | number (min -90, max 90) | no | Crew start latitude; routes from here when given with start_lng. | | `start_lng` | number (min -180, max 180) | no | Crew start longitude. | | `time_budget_minutes` | number (min 15, max 720, default 240) | no | Driving and stop time the route must fit. | | `limit` | integer (min 1, max 100, default 25) | no | Doors to return, in route order. | | `detail` | `concise`, `detailed` (default "concise") | no | concise returns the fields needed to act; detailed adds owner, parcel and roof data. | #### Example Arguments: ```json { "alert_id": "6f1c2d9e-4b7a-4e21-9c3f-2a8b5d7e1f04", "start_lat": 35.687, "start_lng": -105.938, "time_budget_minutes": 180, "limit": 2 } ``` Result (abridged): ```json { "alert_id": "6f1c2d9e-4b7a-4e21-9c3f-2a8b5d7e1f04", "name": "Santa Fe", "route_miles": 18.4, "route_minutes": 171, "total_stops": 42, "doors": [ { "stop": 1, "rank": 3, "property_id": "b3e8a1c4-7d2f-4a9b-8e6c-1f5d3a7b9c20", "address": "100 Example Rd, Santa Fe, NM", "score": 8.8, "expected_hail_inches": 1.25, "roof_hail_inches": 1, "roof_age_years": 19, "status": "pending" }, { "stop": 2, "rank": 1, "property_id": "e1b4c7a2-3d9f-4b6e-a8c1-5f2d9e7b3a40", "address": "2210 Calle Cacique, Santa Fe, NM", "score": 9.1, "expected_hail_inches": 1, "roof_hail_inches": null, "roof_age_years": 23, "status": "pending" } ], "more": "40 more; raise limit (max 100) to see them." } ``` ### search_properties Search the company's ranked properties (doors to knock) with filters, highest opportunity first by default. Filter by address or owner text, urgency, building use, pipeline stage or whether someone holds it; assigned_to_me for the person's own. Returns a page; use offset for the next page. For a storm's affected properties use get_door_list instead. Scope: `workspace:read`. Read-only. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `service_area_id` | string (uuid) | no | From get_workspace. | | `search` | string (max 200 chars) | no | Address, owner or business text. | | `urgency_tier` | string | no | For example high_urgency. | | `roof_material` | string | no | For example asphalt_shingle, metal or tile. | | `occupancy_class` | `commercial`, `residential`, `mixed`, `unknown` | no | Building use. | | `min_score` | number | no | Minimum opportunity score, 0 to 10. | | `max_years_remaining` | integer | no | Only roofs with at most this many estimated years of life left. | | `crm_stage` | `lead`, `not_home`, `contacted`, `appointment`, `inspected`, `quoted`, `sold`, `not_interested`, `lost` | no | Only properties at this pipeline stage. | | `assignment_status` | `assigned`, `unassigned` | no | Whether a rep already owns the property. | | `assigned_to_me` | boolean | no | Only properties the person holds. | | `sort_by` | `score`, `urgency`, `value`, `address` (default "score") | no | Sort key; results are in descending order. | | `limit` | integer (min 1, max 50, default 10) | no | Page size. | | `offset` | integer (min 0, default 0) | no | Use next_offset from the previous page. | | `detail` | `concise`, `detailed` (default "concise") | no | concise returns the fields needed to act; detailed adds owner, parcel and roof data. | #### Example Arguments: ```json { "service_area_id": "0a4d7c2e-9b1f-4e8a-a3c5-7d9e2b4f6a18", "urgency_tier": "high_urgency", "assignment_status": "unassigned", "limit": 1 } ``` Result (abridged): ```json { "properties": [ { "property_id": "b3e8a1c4-7d2f-4a9b-8e6c-1f5d3a7b9c20", "address": "100 Example Rd, Santa Fe, NM", "score": 8.8, "urgency": "high_urgency", "roof_age_years": 19, "crm_stage": null } ], "offset": 0, "next_offset": 1 } ``` ### get_property One property's roof, owner and scoring detail, its storms since 2018 (largest hail, strongest wind, warnings issued over it), and its roof permits from public permit records (replacement or repair, finished or issued date, contractor). No permits listed is not proof no roof work was done. With access to the pipeline, also its stage, who holds it, notes and open follow-ups. Scope: `workspace:read`. Read-only. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `property_id` | string (uuid) | yes | From search_properties or get_door_list. | #### Example Arguments: ```json { "property_id": "b3e8a1c4-7d2f-4a9b-8e6c-1f5d3a7b9c20" } ``` Result (abridged): ```json { "property": { "property_id": "b3e8a1c4-7d2f-4a9b-8e6c-1f5d3a7b9c20", "address": "100 Example Rd, Santa Fe, NM", "score": 8.8, "urgency": "high_urgency", "roof_age_years": 19, "crm_stage": "lead", "owner_name": "Sample Owner", "owner_mailing_address": "PO Box 100, Santa Fe, NM 87504", "roof_material": "asphalt_shingle", "roof_area_sqft": 2140, "years_remaining": 1, "year_built": 2007, "assessed_value": 412000, "occupancy": "residential", "lat": 35.6571, "lng": -105.9602 }, "storms": { "storm_days": 4, "since": "2018-01-01", "recent": [ { "date": "2025-06-02", "hail_inches": 1.75, "wind_mph": 61, "warnings": [ "severe_thunderstorm" ], "nearest_report_miles": 1.8 } ] }, "roof_permits": [ { "kind": "Roof replacement · asphalt shingle", "when": "Finished Aug 2019", "finaled_on": "2019-08-06", "issued_on": "2019-07-01", "contractor": "Sample Roofing LLC", "description": "Reroof a single family house", "issued_by": "Kansas City, MO" } ], "crm": { "assignment": { "stage": "lead" }, "notes": [], "tasks": [] } } ``` ### get_roof_code The energy code's roof insulation requirement for one building, from Roofpeace's reviewed code table: the adopted code, climate zone, R-value for insulation entirely above the deck, and whether a replacement, recover or repair must meet it, with official sources. Use for any R-value, roof insulation or energy code question. Leave scope or occupancy out when you do not know them. Scope: `workspace:read`. Read-only. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `property_id` | string (uuid) | yes | | | `scope` | `replacement`, `recover`, `repair` | no | replacement: tear off to the deck; recover: new roof over the existing; repair: fixing part of the roof. | | `occupancy` | `all_other`, `group_r` | no | group_r for residential occupancies such as apartments; all_other for commercial. | #### Example Arguments: ```json { "property_id": "b3e8a1c4-7d2f-4a9b-8e6c-1f5d3a7b9c20", "scope": "replacement" } ``` Result (abridged): ```json { "covered": true, "code": "2021 IECC", "climate_zone": "4B", "r_value": "R-30ci", "section": "C402.1.3", "sources": [ "https://example.com/adoption" ] } ``` ### record_door_outcome Record what happened at a property: set its pipeline stage and optionally add a note, in one step. Use after a door knock, call or inspection. Scope: `crm:write`. Writes; retry with the same `idempotency_key`. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `property_id` | string (uuid) | yes | From get_door_list or search_properties. | | `stage` | `lead`, `not_home`, `contacted`, `appointment`, `inspected`, `quoted`, `sold`, `not_interested`, `lost` | yes | New pipeline stage. | | `note` | string (max 10000 chars) | no | What happened, for the team. | | `idempotency_key` | string (max 100 chars) | yes | Unique per intended action. Reuse the same key when retrying after a timeout; a new key repeats the action. | #### Example Arguments: ```json { "property_id": "b3e8a1c4-7d2f-4a9b-8e6c-1f5d3a7b9c20", "stage": "not_home", "note": "No answer at 4:10 pm. Hail dents on gutters, left door hanger.", "idempotency_key": "knock-1418-camino-2026-09-19" } ``` Result (abridged): ```json { "replayed": false, "result": { "property_id": "b3e8a1c4-7d2f-4a9b-8e6c-1f5d3a7b9c20", "assignment": { "stage": "not_home" }, "note": { "body": "No answer at 4:10 pm. Hail dents on gutters, left door hanger." } } } ``` ### add_follow_up_task Create an open follow-up task on a property, optionally with a due time. The task is unassigned so the team can pick it up. Scope: `crm:write`. Writes; retry with the same `idempotency_key`. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `property_id` | string (uuid) | yes | From get_door_list or search_properties. | | `title` | string (max 300 chars) | yes | Short task title. | | `details` | string (max 5000 chars) | no | Context for whoever picks it up. | | `due_at` | string (date-time) | no | ISO 8601 with offset. | | `idempotency_key` | string (max 100 chars) | yes | Unique per intended action. Reuse the same key when retrying after a timeout; a new key repeats the action. | #### Example Arguments: ```json { "property_id": "b3e8a1c4-7d2f-4a9b-8e6c-1f5d3a7b9c20", "title": "Return visit after 5 pm", "due_at": "2026-09-20T17:30:00-06:00", "idempotency_key": "followup-1418-camino-1" } ``` Result (abridged): ```json { "replayed": false, "result": { "title": "Return visit after 5 pm", "status": "open", "due_at": "2026-09-20T23:30:00.000Z", "assigned_operator_user_id": null } } ``` ### check_coverage Check whether Roofpeace has property data for a city, ZIP or street address. Storm tracking works everywhere; ranked properties exist only in covered counties. Scope: any valid key. Read-only. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `location` | string (max 200 chars) | yes | City, ZIP or street address. | #### Example Arguments: ```json { "location": "Santa Fe, NM" } ``` Result (abridged): ```json { "supported": true, "location": "Santa Fe, NM", "display_name": "Santa Fe, Santa Fe County, New Mexico, United States", "state_code": "NM", "county": "Santa Fe", "lat": 35.687, "lng": -105.938, "reason": null } ``` ### get_website_copy List the editable text on the company's website, by page: each field's id, label, character limit, live wording and any draft awaiting review. Also says whether agent edits publish immediately. Only these fields are editable; layout and code are not. Scope: `marketing:website`. Read-only. #### Parameters None. #### Example Arguments: ```json {} ``` Result (abridged): ```json [ { "id": "5d0c2f7a-3b1e-4c8d-9a6f-2e7b1c4d8f90", "name": "KR Roofing website", "origin": "https://www.buildingprotector.com", "agents_publish_copy": false, "pages": [ { "page": "/roof-leak-check", "fields": [ { "id": "8a1f3c5e-6b2d-4e9f-8c7a-1d3b5e7f9a20", "key": "hero.headline", "label": "Headline", "max_length": 80, "published_value": "Water coming in through your roof?", "draft_value": null, "draft_note": null, "draft_by_email": null, "draft_at": null, "updated_at": "2026-10-29T16:00:00.000Z" } ] } ] } ] ``` ### edit_website_copy Change the wording of one field from get_website_copy. If the company lets agents publish, Roofpeace immediately queues delivery to the site (status published; delivery may retry during an outage); otherwise it is saved as a draft for a person to review (status draft). Explain the change in note. Don't invent guarantees, prices, response times or insurance claims. Scope: `marketing:website`. Writes; retry with the same `idempotency_key`. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `field_id` | string (uuid) | yes | Field id from get_website_copy. | | `value` | string (max 5000 chars) | yes | New wording, within the field's max_length. | | `note` | string (max 1000 chars) | no | Why this change; shown to the reviewer. | | `idempotency_key` | string (max 100 chars) | yes | Unique per intended action. Reuse the same key when retrying after a timeout; a new key repeats the action. | #### Example Arguments: ```json { "field_id": "8a1f3c5e-6b2d-4e9f-8c7a-1d3b5e7f9a20", "value": "Roof leaking? Get it checked this week.", "note": "Shorter headline for the leak ad.", "idempotency_key": "copy-leak-headline-1" } ``` Result (abridged): ```json { "replayed": false, "result": { "id": "8a1f3c5e-6b2d-4e9f-8c7a-1d3b5e7f9a20", "status": "draft", "value": "Roof leaking? Get it checked this week.", "published_value": "Water coming in through your roof?" } } ``` ### submit_research Submit a sourced observation, and optionally a hypothesis, for human review in Marketing research. Separate what the source says from what you infer. Scope: `research:write`. Writes; retry with the same `idempotency_key`. #### Parameters | Name | Type | Required | Description | |---|---|---|---| | `observation` | string (max 5000 chars) | yes | What the source says or shows. | | `source` | string (max 300 chars) | yes | Interview, page or publication title. | | `received_on` | string | yes | YYYY-MM-DD | | `evidence_url` | string (uri, max 2000 chars) | yes | HTTP(S) link to the source; Roofpeace does not fetch it. | | `hypothesis` | string (max 5000 chars) | no | Your inference, kept separate from the observation. | | `proposed_change` | string (max 5000 chars) | no | Suggested change for the team to consider. | | `idempotency_key` | string (max 100 chars) | yes | Unique per intended action. Reuse the same key when retrying after a timeout; a new key repeats the action. | #### Example Arguments: ```json { "observation": "The owner said two crews quoted the same hail job and neither followed up in writing.", "source": "Door conversation, 100 Example Rd", "received_on": "2026-09-19", "evidence_url": "https://example.com/field-notes/2026-09-19", "hypothesis": "A written same-day estimate could win repeat-quote homeowners.", "idempotency_key": "research-2026-09-19-1" } ``` Result (abridged): ```json { "replayed": false, "result": { "status": "new", "outcome": "pending" } } ``` ## REST operations Base URL: `https://roofpeace.com/api/v1`. Writes require an `Idempotency-Key` header; retrying with the same key and payload replays the original response. ### POST /api/v1/coverage/check Check Agent Coverage Scope: none (public or any valid key). #### Parameters None. #### Request body | Field | Type | Required | Description | |---|---|---|---| | `location` | string (max 300 chars) | yes | City, ZIP or street address. | | `region_hint` | string (max 2 chars) or null | no | Two-letter state code that disambiguates the location. | #### Example request ```sh curl -X POST "https://roofpeace.com/api/v1/coverage/check" \ -H "Content-Type: application/json" \ -d '{"location":"location"}' ``` #### Responses - 200: Successful Response - 422: Validation Error ### GET /api/v1/me Get Agent Identity Scope: none (public or any valid key). #### Parameters None. #### Example request ```sh curl -X GET "https://roofpeace.com/api/v1/me" \ -H "Authorization: Bearer $ROOFPEACE_AGENT_KEY" ``` #### Responses - 200: Successful Response ### GET /api/v1/service-areas Get Agent Service Areas Scope: `workspace:read`. #### Parameters None. #### Example request ```sh curl -X GET "https://roofpeace.com/api/v1/service-areas" \ -H "Authorization: Bearer $ROOFPEACE_AGENT_KEY" ``` #### Responses - 200: Successful Response ### POST /api/v1/service-areas Create Agent Service Area Scope: `workspace:write`. #### Parameters | Name | In | Type | Required | Description | |---|---|---|---|---| | `Idempotency-Key` | header | string (max 100 chars) | yes | Unique mutation key. Repeating the same JSON payload replays its committed response; different data returns 409. | #### Request body | Field | Type | Required | Description | |---|---|---|---| | `name` | string (max 200 chars) | yes | Display name for the service area. | | `location` | string (max 300 chars) | yes | City, ZIP or street address. | | `radius_miles` | number (min 1, max 100, default 12) | no | Radius around the location, in miles. | | `region_hint` | string (max 2 chars) or null | no | Two-letter state code that disambiguates the location. | | `allow_unsupported` | boolean (default false) | no | Create the area where property data is not live yet; storm tracking still works there. | #### Example request ```sh curl -X POST "https://roofpeace.com/api/v1/service-areas" \ -H "Authorization: Bearer $ROOFPEACE_AGENT_KEY" \ -H "Idempotency-Key: 7f3a-example-1" \ -H "Content-Type: application/json" \ -d '{"name":"name","location":"location"}' ``` #### Responses - 201: Successful Response - 409: Conflicting payload, concurrent mutation, or legacy request requiring reconciliation. - 422: Validation Error ### GET /api/v1/buildings Get Agent Buildings Scope: `workspace:read`. #### Parameters | Name | In | Type | Required | Description | |---|---|---|---|---| | `urgency_tier` | query | string or null | no | Urgency tier, for example high_urgency. | | `roof_material` | query | string or null | no | Roof material, for example asphalt_shingle, metal or tile. | | `occupancy_class` | query | `commercial`, `residential`, `mixed`, `unknown` or null | no | Building use. | | `min_score` | query | number or null | no | Minimum opportunity score, 0 to 10. | | `max_years_remaining` | query | integer or null | no | Only roofs with at most this many estimated years of life left. | | `search` | query | string or null | no | Text matched against address, city, ZIP, county, owner and business name. | | `assignment_status` | query | `assigned`, `unassigned` or null | no | Whether a rep already owns the building: assigned or unassigned. | | `crm_stage` | query | `lead`, `not_home`, `contacted`, `appointment`, `inspected`, `quoted`, `sold`, `not_interested`, `lost` or null | no | Only buildings at this pipeline stage. | | `service_area_id` | query | string (uuid) or null | no | Service area id from GET /service-areas. | | `sort_by` | query | `score`, `urgency`, `value`, `address` (default "score") | no | Sort key. | | `sort_dir` | query | `asc`, `desc` (default "desc") | no | Sort direction. | | `limit` | query | integer (min 1, max 200, default 50) | no | Maximum number of records to return. | | `offset` | query | integer (min 0, default 0) | no | Records to skip, for paging. | #### Example request ```sh curl -X GET "https://roofpeace.com/api/v1/buildings" \ -H "Authorization: Bearer $ROOFPEACE_AGENT_KEY" ``` #### Responses - 200: Successful Response - 422: Validation Error ### GET /api/v1/buildings/{building_id} Get Agent Building Scope: `workspace:read`. #### Parameters | Name | In | Type | Required | Description | |---|---|---|---|---| | `building_id` | path | string (uuid) | yes | Building id from GET /buildings or GET /strikes/{strike_id}. | #### Example request ```sh curl -X GET "https://roofpeace.com/api/v1/buildings/b3e8a1c4-7d2f-4a9b-8e6c-1f5d3a7b9c20" \ -H "Authorization: Bearer $ROOFPEACE_AGENT_KEY" ``` #### Responses - 200: Successful Response - 422: Validation Error ### GET /api/v1/strikes Get Agent Strikes Scope: `workspace:read`. #### Parameters | Name | In | Type | Required | Description | |---|---|---|---|---| | `limit` | query | integer (min 1, max 100, default 20) | no | Maximum number of records to return. | #### Example request ```sh curl -X GET "https://roofpeace.com/api/v1/strikes" \ -H "Authorization: Bearer $ROOFPEACE_AGENT_KEY" ``` #### Responses - 200: Successful Response - 422: Validation Error ### GET /api/v1/strikes/{strike_id} Get Agent Strike Scope: `workspace:read`. #### Parameters | Name | In | Type | Required | Description | |---|---|---|---|---| | `strike_id` | path | string (uuid) | yes | Storm alert id from GET /strikes. | | `start_lat` | query | number (min -90, max 90) or null | no | Route start latitude; the route starts here when start_lng is also given. | | `start_lng` | query | number (min -180, max 180) or null | no | Route start longitude. | | `time_budget_minutes` | query | number (min 15, max 720) or null | no | Driving and stop time the route must fit. | #### Example request ```sh curl -X GET "https://roofpeace.com/api/v1/strikes/b3e8a1c4-7d2f-4a9b-8e6c-1f5d3a7b9c20" \ -H "Authorization: Bearer $ROOFPEACE_AGENT_KEY" ``` #### Responses - 200: Successful Response - 422: Validation Error ### GET /api/v1/crm/pipeline Get Agent Pipeline Scope: `crm:read`. #### Parameters None. #### Example request ```sh curl -X GET "https://roofpeace.com/api/v1/crm/pipeline" \ -H "Authorization: Bearer $ROOFPEACE_AGENT_KEY" ``` #### Responses - 200: Successful Response ### GET /api/v1/crm/buildings/{building_id}/summary Get Agent Crm Summary Scope: `crm:read`. #### Parameters | Name | In | Type | Required | Description | |---|---|---|---|---| | `building_id` | path | string (uuid) | yes | Building id from GET /buildings or GET /strikes/{strike_id}. | #### Example request ```sh curl -X GET "https://roofpeace.com/api/v1/crm/buildings/b3e8a1c4-7d2f-4a9b-8e6c-1f5d3a7b9c20/summary" \ -H "Authorization: Bearer $ROOFPEACE_AGENT_KEY" ``` #### Responses - 200: Successful Response - 422: Validation Error ### POST /api/v1/crm/buildings/{building_id}/notes Create Agent Crm Note Scope: `crm:write`. #### Parameters | Name | In | Type | Required | Description | |---|---|---|---|---| | `building_id` | path | string (uuid) | yes | Building id from GET /buildings or GET /strikes/{strike_id}. | | `Idempotency-Key` | header | string (max 100 chars) | yes | Unique mutation key. Repeating the same JSON payload replays its committed response; different data returns 409. | #### Request body | Field | Type | Required | Description | |---|---|---|---| | `body` | string (max 10000 chars) | yes | Note text for the team. | | `client_mutation_id` | string (max 100 chars) or null | no | Client id that makes a retried note return the original; agent requests default it to the Idempotency-Key. | #### Example request ```sh curl -X POST "https://roofpeace.com/api/v1/crm/buildings/b3e8a1c4-7d2f-4a9b-8e6c-1f5d3a7b9c20/notes" \ -H "Authorization: Bearer $ROOFPEACE_AGENT_KEY" \ -H "Idempotency-Key: 7f3a-example-1" \ -H "Content-Type: application/json" \ -d '{"body":"body"}' ``` #### Responses - 201: Successful Response - 409: Conflicting payload, concurrent mutation, or legacy request requiring reconciliation. - 422: Validation Error ### PATCH /api/v1/crm/buildings/{building_id}/stage Update Agent Crm Stage Scope: `crm:write`. #### Parameters | Name | In | Type | Required | Description | |---|---|---|---|---| | `building_id` | path | string (uuid) | yes | Building id from GET /buildings or GET /strikes/{strike_id}. | | `Idempotency-Key` | header | string (max 100 chars) | yes | Unique mutation key. Repeating the same JSON payload replays its committed response; different data returns 409. | #### Request body | Field | Type | Required | Description | |---|---|---|---| | `stage` | `lead`, `not_home`, `contacted`, `appointment`, `inspected`, `quoted`, `sold`, `not_interested`, `lost` | yes | New pipeline stage. | #### Example request ```sh curl -X PATCH "https://roofpeace.com/api/v1/crm/buildings/b3e8a1c4-7d2f-4a9b-8e6c-1f5d3a7b9c20/stage" \ -H "Authorization: Bearer $ROOFPEACE_AGENT_KEY" \ -H "Idempotency-Key: 7f3a-example-1" \ -H "Content-Type: application/json" \ -d '{"stage":"lead"}' ``` #### Responses - 200: Successful Response - 409: Conflicting payload, concurrent mutation, or legacy request requiring reconciliation. - 422: Validation Error ### GET /api/v1/marketing/ads List provider ads and copy proposals Scope: `marketing:read`. #### Parameters None. #### Example request ```sh curl -X GET "https://roofpeace.com/api/v1/marketing/ads" \ -H "Authorization: Bearer $ROOFPEACE_AGENT_KEY" ``` #### Responses - 200: Successful Response ### POST /api/v1/marketing/ads/{ad_id}/revisions Propose ad copy for human review Scope: `marketing:draft`. #### Parameters | Name | In | Type | Required | Description | |---|---|---|---|---| | `ad_id` | path | string (uuid) | yes | Provider ad id from GET /marketing/ads. | | `Idempotency-Key` | header | string (max 100 chars) | yes | Unique mutation key. Repeating the same JSON payload replays its committed response; different data returns 409. | #### Request body | Field | Type | Required | Description | |---|---|---|---| | `title` | string (max 50 chars) | yes | Proposed ad headline, up to 50 characters. | | `body` | string (max 100 chars) | yes | Proposed ad body copy, up to 100 characters. | | `target_url` | string (max 2000 chars) | yes | Landing page URL for the ad. | | `note` | string (max 2000 chars) or null | no | Why this change, for the human reviewer. | #### Example request ```sh curl -X POST "https://roofpeace.com/api/v1/marketing/ads/b3e8a1c4-7d2f-4a9b-8e6c-1f5d3a7b9c20/revisions" \ -H "Authorization: Bearer $ROOFPEACE_AGENT_KEY" \ -H "Idempotency-Key: 7f3a-example-1" \ -H "Content-Type: application/json" \ -d '{"title":"title","body":"body","target_url":"target url"}' ``` #### Responses - 201: Successful Response - 409: Conflicting payload, concurrent mutation, or legacy request requiring reconciliation. - 422: Validation Error ### PATCH /api/v1/marketing/ad-revisions/{revision_id} Update an agent-owned ad proposal Scope: `marketing:draft`. #### Parameters | Name | In | Type | Required | Description | |---|---|---|---|---| | `revision_id` | path | string (uuid) | yes | Ad revision id from GET /marketing/ads. | | `Idempotency-Key` | header | string (max 100 chars) | yes | Unique mutation key. Repeating the same JSON payload replays its committed response; different data returns 409. | #### Request body | Field | Type | Required | Description | |---|---|---|---| | `title` | string (max 50 chars) | yes | Proposed ad headline, up to 50 characters. | | `body` | string (max 100 chars) | yes | Proposed ad body copy, up to 100 characters. | | `target_url` | string (max 2000 chars) | yes | Landing page URL for the ad. | | `note` | string (max 2000 chars) or null | no | Why this change, for the human reviewer. | #### Example request ```sh curl -X PATCH "https://roofpeace.com/api/v1/marketing/ad-revisions/b3e8a1c4-7d2f-4a9b-8e6c-1f5d3a7b9c20" \ -H "Authorization: Bearer $ROOFPEACE_AGENT_KEY" \ -H "Idempotency-Key: 7f3a-example-1" \ -H "Content-Type: application/json" \ -d '{"title":"title","body":"body","target_url":"target url"}' ``` #### Responses - 200: Successful Response - 409: Conflicting payload, concurrent mutation, or legacy request requiring reconciliation. - 422: Validation Error ### POST /api/v1/marketing/ad-revisions/{revision_id}/comments Comment on an ad proposal Scope: `marketing:draft`. #### Parameters | Name | In | Type | Required | Description | |---|---|---|---|---| | `revision_id` | path | string (uuid) | yes | Ad revision id from GET /marketing/ads. | | `Idempotency-Key` | header | string (max 100 chars) | yes | Unique mutation key. Repeating the same JSON payload replays its committed response; different data returns 409. | #### Request body | Field | Type | Required | Description | |---|---|---|---| | `body` | string (max 2000 chars) | yes | Comment text. | #### Example request ```sh curl -X POST "https://roofpeace.com/api/v1/marketing/ad-revisions/b3e8a1c4-7d2f-4a9b-8e6c-1f5d3a7b9c20/comments" \ -H "Authorization: Bearer $ROOFPEACE_AGENT_KEY" \ -H "Idempotency-Key: 7f3a-example-1" \ -H "Content-Type: application/json" \ -d '{"body":"body"}' ``` #### Responses - 201: Successful Response - 409: Conflicting payload, concurrent mutation, or legacy request requiring reconciliation. - 422: Validation Error ### GET /api/v1/crm/inquiries/{inquiry_id}/summary Get Agent Inquiry Summary Scope: `crm:read`. #### Parameters | Name | In | Type | Required | Description | |---|---|---|---|---| | `inquiry_id` | path | string (uuid) | yes | Inquiry id from GET /crm/pipeline or GET /marketing/leads. | #### Example request ```sh curl -X GET "https://roofpeace.com/api/v1/crm/inquiries/b3e8a1c4-7d2f-4a9b-8e6c-1f5d3a7b9c20/summary" \ -H "Authorization: Bearer $ROOFPEACE_AGENT_KEY" ``` #### Responses - 200: Successful Response - 422: Validation Error ### POST /api/v1/crm/inquiries/{inquiry_id}/notes Create Agent Inquiry Note Scope: `crm:write`. #### Parameters | Name | In | Type | Required | Description | |---|---|---|---|---| | `inquiry_id` | path | string (uuid) | yes | Inquiry id from GET /crm/pipeline or GET /marketing/leads. | | `Idempotency-Key` | header | string (max 100 chars) | yes | Unique mutation key. Repeating the same JSON payload replays its committed response; different data returns 409. | #### Request body | Field | Type | Required | Description | |---|---|---|---| | `body` | string (max 10000 chars) | yes | Note text for the team. | | `client_mutation_id` | string (max 100 chars) or null | no | Client id that makes a retried note return the original; agent requests default it to the Idempotency-Key. | #### Example request ```sh curl -X POST "https://roofpeace.com/api/v1/crm/inquiries/b3e8a1c4-7d2f-4a9b-8e6c-1f5d3a7b9c20/notes" \ -H "Authorization: Bearer $ROOFPEACE_AGENT_KEY" \ -H "Idempotency-Key: 7f3a-example-1" \ -H "Content-Type: application/json" \ -d '{"body":"body"}' ``` #### Responses - 201: Successful Response - 409: Conflicting payload, concurrent mutation, or legacy request requiring reconciliation. - 422: Validation Error ### GET /api/v1/marketing/leads Read workspace leads Scope: `marketing:read`. #### Parameters None. #### Example request ```sh curl -X GET "https://roofpeace.com/api/v1/marketing/leads" \ -H "Authorization: Bearer $ROOFPEACE_AGENT_KEY" ``` #### Responses - 200: Workspace-scoped evidence ### GET /api/v1/marketing/learning Read workspace learning Scope: `marketing:read`. #### Parameters | Name | In | Type | Required | Description | |---|---|---|---|---| | `days` | query | integer (min 1, max 365, default 30) | no | Lookback window in days. | #### Example request ```sh curl -X GET "https://roofpeace.com/api/v1/marketing/learning" \ -H "Authorization: Bearer $ROOFPEACE_AGENT_KEY" ``` #### Responses - 200: Workspace-scoped evidence ### GET /api/v1/marketing/feedback Read workspace feedback Scope: `marketing:read`. #### Parameters None. #### Example request ```sh curl -X GET "https://roofpeace.com/api/v1/marketing/feedback" \ -H "Authorization: Bearer $ROOFPEACE_AGENT_KEY" ``` #### Responses - 200: Workspace-scoped evidence ### GET /api/v1/marketing/feedback/{id} Read workspace feedback/{id} Scope: `marketing:read`. #### Parameters | Name | In | Type | Required | Description | |---|---|---|---|---| | `id` | path | string (uuid) | yes | Research record id from GET /marketing/feedback. | #### Example request ```sh curl -X GET "https://roofpeace.com/api/v1/marketing/feedback/b3e8a1c4-7d2f-4a9b-8e6c-1f5d3a7b9c20" \ -H "Authorization: Bearer $ROOFPEACE_AGENT_KEY" ``` #### Responses - 200: Workspace-scoped evidence ### POST /api/v1/crm/buildings/{building_id}/tasks Create internal follow-up. Creates internal work only. Omitted assignee leaves the task unassigned. Supply a verified workspace member ID to assign it. No customer message is sent. Scope: `crm:write`. #### Parameters | Name | In | Type | Required | Description | |---|---|---|---|---| | `building_id` | path | string (uuid) | yes | Building id from GET /buildings or GET /strikes/{strike_id}. | | `Idempotency-Key` | header | string (max 100 chars) | yes | Unique mutation key. Repeating the same JSON payload replays its committed response; different data returns 409. | #### Request body | Field | Type | Required | Description | |---|---|---|---| | `title` | string (max 300 chars) | yes | Short title. | | `details` | string (max 10000 chars) | no | Context for whoever picks up the task. | | `due_at` | string (date-time) | no | Due time, ISO 8601 with offset. | | `assigned_operator_user_id` | string (max 200 chars) | no | Workspace member to assign; omit or null to leave unassigned. Agents cannot be assignees. | | `assigned_operator_email` | string (max 320 chars) | no | Email of the assigned workspace member. | #### Example request ```sh curl -X POST "https://roofpeace.com/api/v1/crm/buildings/b3e8a1c4-7d2f-4a9b-8e6c-1f5d3a7b9c20/tasks" \ -H "Authorization: Bearer $ROOFPEACE_AGENT_KEY" \ -H "Idempotency-Key: 7f3a-example-1" \ -H "Content-Type: application/json" \ -d '{"title":"title"}' ``` #### Responses - 201: Successful Response - 409: Conflicting payload, concurrent mutation, or legacy request requiring reconciliation. - 422: Validation Error ### POST /api/v1/crm/inquiries/{inquiry_id}/tasks Create internal follow-up. Creates internal work only. Omitted assignee leaves the task unassigned. Supply a verified workspace member ID to assign it. No customer message is sent. Scope: `crm:write`. #### Parameters | Name | In | Type | Required | Description | |---|---|---|---|---| | `inquiry_id` | path | string (uuid) | yes | Inquiry id from GET /crm/pipeline or GET /marketing/leads. | | `Idempotency-Key` | header | string (max 100 chars) | yes | Unique mutation key. Repeating the same JSON payload replays its committed response; different data returns 409. | #### Request body | Field | Type | Required | Description | |---|---|---|---| | `title` | string (max 300 chars) | yes | Short title. | | `details` | string (max 10000 chars) | no | Context for whoever picks up the task. | | `due_at` | string (date-time) | no | Due time, ISO 8601 with offset. | | `assigned_operator_user_id` | string (max 200 chars) | no | Workspace member to assign; omit or null to leave unassigned. Agents cannot be assignees. | | `assigned_operator_email` | string (max 320 chars) | no | Email of the assigned workspace member. | #### Example request ```sh curl -X POST "https://roofpeace.com/api/v1/crm/inquiries/b3e8a1c4-7d2f-4a9b-8e6c-1f5d3a7b9c20/tasks" \ -H "Authorization: Bearer $ROOFPEACE_AGENT_KEY" \ -H "Idempotency-Key: 7f3a-example-1" \ -H "Content-Type: application/json" \ -d '{"title":"title"}' ``` #### Responses - 201: Successful Response - 409: Conflicting payload, concurrent mutation, or legacy request requiring reconciliation. - 422: Validation Error ### POST /api/v1/research Submit research for human review. Requires research:write. Owner-issued bearer key; workspace access must be active. Scope: `research:write`. #### Parameters | Name | In | Type | Required | Description | |---|---|---|---|---| | `Idempotency-Key` | header | string (max 100 chars) | yes | Unique mutation key. Repeating the same JSON payload replays its committed response; different data returns 409. | #### Request body | Field | Type | Required | Description | |---|---|---|---| | `observation` | string (max 5000 chars) | yes | What the source says or shows. | | `source` | string (max 300 chars) | yes | Interview, page or publication title. | | `received_on` | string (date) | yes | Date the source was received, YYYY-MM-DD. | | `evidence_url` | string (uri, max 2000 chars) | yes | HTTP(S) link to the source; Roofpeace does not fetch it. | | `hypothesis` | string (max 5000 chars) | no | Your inference, kept separate from the observation. | | `proposed_change` | string (max 5000 chars) | no | Suggested change for the team to consider. | #### Example request ```sh curl -X POST "https://roofpeace.com/api/v1/research" \ -H "Authorization: Bearer $ROOFPEACE_AGENT_KEY" \ -H "Idempotency-Key: 7f3a-example-1" \ -H "Content-Type: application/json" \ -d '{"observation":"observation","source":"source","received_on":"2026-09-19","evidence_url":"https://example.com/source"}' ``` #### Responses - 201: Success - 401: Invalid, expired or revoked key - 402: Workspace billing inactive; owner action required - 403: Scope or delegation denied - 404: Unavailable record - 409: Conflicting idempotency payload or transition - 422: Invalid input ### GET /api/v1/jobs List jobs. Requires jobs:read. Owner-issued bearer key; workspace access must be active. Scope: `jobs:read`. #### Parameters None. #### Example request ```sh curl -X GET "https://roofpeace.com/api/v1/jobs" \ -H "Authorization: Bearer $ROOFPEACE_AGENT_KEY" ``` #### Responses - 200: Success - 401: Invalid, expired or revoked key - 402: Workspace billing inactive; owner action required - 403: Scope or delegation denied - 404: Unavailable record - 409: Conflicting idempotency payload or transition - 422: Invalid input ### POST /api/v1/jobs Create job. Requires jobs:write. Owner-issued bearer key; workspace access must be active. Scope: `jobs:write`. #### Parameters | Name | In | Type | Required | Description | |---|---|---|---|---| | `Idempotency-Key` | header | string (max 100 chars) | yes | Unique mutation key. Repeating the same JSON payload replays its committed response; different data returns 409. | #### Request body | Field | Type | Required | Description | |---|---|---|---| | `title` | string (max 300 chars) | yes | Short title. | | `source` | `property`, `inquiry` | yes | Interview, page or publication title. | | `building_id` | string (uuid) | no | Property id; required when source is property. | | `inquiry_id` | string (uuid) | no | Inquiry id; required when source is inquiry. | | `assigned_operator_user_id` | string or null (max 200 chars) | no | Workspace member to assign; omit or null to leave unassigned. Agents cannot be assignees. | | `assigned_operator_email` | string or null (max 320 chars) | no | Email of the assigned workspace member. | | `state` | `draft`, `active`, `completed`, `cancelled` (default "draft") | no | Target job state; allowed transitions are enforced. | #### Example request ```sh curl -X POST "https://roofpeace.com/api/v1/jobs" \ -H "Authorization: Bearer $ROOFPEACE_AGENT_KEY" \ -H "Idempotency-Key: 7f3a-example-1" \ -H "Content-Type: application/json" \ -d '{}' ``` #### Responses - 201: Success - 401: Invalid, expired or revoked key - 402: Workspace billing inactive; owner action required - 403: Scope or delegation denied - 404: Unavailable record - 409: Conflicting idempotency payload or transition - 422: Invalid input ### GET /api/v1/jobs/{job_id} Read job. Requires jobs:read. Owner-issued bearer key; workspace access must be active. Scope: `jobs:read`. #### Parameters | Name | In | Type | Required | Description | |---|---|---|---|---| | `job_id` | path | string (uuid) | yes | Job id from GET /jobs. | #### Example request ```sh curl -X GET "https://roofpeace.com/api/v1/jobs/b3e8a1c4-7d2f-4a9b-8e6c-1f5d3a7b9c20" \ -H "Authorization: Bearer $ROOFPEACE_AGENT_KEY" ``` #### Responses - 200: Success - 401: Invalid, expired or revoked key - 402: Workspace billing inactive; owner action required - 403: Scope or delegation denied - 404: Unavailable record - 409: Conflicting idempotency payload or transition - 422: Invalid input ### PATCH /api/v1/jobs/{job_id} Update job title and assignment. Requires jobs:write. Owner-issued bearer key; workspace access must be active. Scope: `jobs:write`. #### Parameters | Name | In | Type | Required | Description | |---|---|---|---|---| | `Idempotency-Key` | header | string (max 100 chars) | yes | Unique mutation key. Repeating the same JSON payload replays its committed response; different data returns 409. | | `job_id` | path | string (uuid) | yes | Job id from GET /jobs. | #### Request body | Field | Type | Required | Description | |---|---|---|---| | `title` | string (max 300 chars) | no | Short title. | | `assigned_operator_user_id` | string or null (max 200 chars) | no | Workspace member to assign; omit or null to leave unassigned. Agents cannot be assignees. | | `assigned_operator_email` | string or null (max 320 chars) | no | Email of the assigned workspace member. | #### Example request ```sh curl -X PATCH "https://roofpeace.com/api/v1/jobs/b3e8a1c4-7d2f-4a9b-8e6c-1f5d3a7b9c20" \ -H "Authorization: Bearer $ROOFPEACE_AGENT_KEY" \ -H "Idempotency-Key: 7f3a-example-1" \ -H "Content-Type: application/json" \ -d '{}' ``` #### Responses - 200: Success - 401: Invalid, expired or revoked key - 402: Workspace billing inactive; owner action required - 403: Scope or delegation denied - 404: Unavailable record - 409: Conflicting idempotency payload or transition - 422: Invalid input ### PATCH /api/v1/jobs/{job_id}/state Change job state. Requires jobs:write. Owner-issued bearer key; workspace access must be active. Scope: `jobs:write`. #### Parameters | Name | In | Type | Required | Description | |---|---|---|---|---| | `Idempotency-Key` | header | string (max 100 chars) | yes | Unique mutation key. Repeating the same JSON payload replays its committed response; different data returns 409. | | `job_id` | path | string (uuid) | yes | Job id from GET /jobs. | #### Request body | Field | Type | Required | Description | |---|---|---|---| | `state` | `draft`, `active`, `completed`, `cancelled` (default "draft") | yes | Target job state; allowed transitions are enforced. | #### Example request ```sh curl -X PATCH "https://roofpeace.com/api/v1/jobs/b3e8a1c4-7d2f-4a9b-8e6c-1f5d3a7b9c20/state" \ -H "Authorization: Bearer $ROOFPEACE_AGENT_KEY" \ -H "Idempotency-Key: 7f3a-example-1" \ -H "Content-Type: application/json" \ -d '{"state":"draft"}' ``` #### Responses - 200: Success - 401: Invalid, expired or revoked key - 402: Workspace billing inactive; owner action required - 403: Scope or delegation denied - 404: Unavailable record - 409: Conflicting idempotency payload or transition - 422: Invalid input