Portal Ops

Portal Ops
API Guide

How org admins issue API keys and how trusted assistants call Pezley Portal for morning briefs, leads, jobs, proposals, and scheduling — without signing in as a user.

Public reference · Keys are org-scoped · You choose which scope groups each key may use.

What's Inside

  1. Quick start
  2. Fast lookups: list, then call by id
  3. OpenAPI spec
  4. Getting started
  5. What is Portal Ops?
  6. Issue & rotate keys
  7. ChatGPT / MCP connection
  8. Authentication & HTTP surface
  9. Actions: brief, exec, company-state, log
  10. Morning brief shape
  11. Before you act
  12. Scope groups (full tool lists)
  13. What a key can do, area by area
  14. Manage settings & pricing
  15. AI assistants (integrator playbook)
  16. Estimates & exclusions
  17. Proposals
  18. Jobs, delays & limbo
  19. Staff Home File
  20. Owner finance scope
  21. Import from another app
  22. Job naming
  23. Blocked tools
  24. Operator responsibility

Quick start

Tool arguments go in input, never in args. Top-level orgId must match the org baked into the key.

{
  "action": "exec",
  "orgId": "YOUR_ORG_ID",
  "toolName": "list_jobs",
  "input": { "view": "index", "search": "Sam Exampel" }
}

Start with the short list or a search. To find a job, call list_jobs with "view": "index" and the name, phone or job number the owner gave (search, phone, jobNumber); for a lead, call search_leads. Don't start with the full list_jobs (no view) or action: "brief" just to find an id: both read every job and are much slower. Use the brief only when you need the whole-company morning snapshot.

Before working on an estimate, call read_estimate_handoff to check staff and prior-agent context, then call estimate_snapshot. If you do not have a job id yet, find it with the short list or a search first (above), then call estimate_snapshot or read_proposal with that input.jobId. estimate_context, update_estimate, and link_recording are live. estimate_context needs a full-access key (*). Do not invent ids. If the API returns job-not-found, the message includes the identifier that was tried — look it up with list_jobs view: "index" and search, then retry with that id.

For trials, ask your organization administrator for an approved sandbox with synthetic data and the minimum required access. Keep sandbox login details and keys in your authorized secret store, never in public documentation or chat.

restore_proposal_revision is PR #1239 (not on main yet). Batch and view: "summary" are PR #1240 (not on main yet). Send one exec per request until batch ships.

ChatGPT — one-click Connect

  1. Add a custom connector. MCP server URL https://pezleyportal.com/ops-connect. OAuth client ID is pezley-chatgpt. Leave the client secret blank.
  2. Redirect URI, exact: https://chatgpt.com/connector_platform_oauth_redirect. Portal returns iss so ChatGPT can use this stable callback. https://chatgpt.com/connector/oauth/… is a different URI and is rejected.
  3. Sign in as an org admin and approve the scopes. Owner finances and app import are never granted here. The key page shows “ChatGPT, connected by <name>”. Revoke it to disconnect immediately.
  4. Paste this into a new chat: tool arguments always go in the JSON field "input", never "args". Start by calling estimate_snapshot. For a safe trial, use the administrator-approved sandbox.

Claude — one-click Connect

Hosted Claude (claude.ai, desktop, mobile) uses the same server URL https://pezleyportal.com/ops-connect and client ID pezley-claude (no client secret). Redirect URI, exact, from Anthropic’s connector docs: https://claude.ai/api/mcp/auth_callback. Claude Code’s loopback redirect (http://localhost/callback on a changing port) is not a fixed URI, so it is not accepted. Approve scopes as an admin. Revoke “Claude, connected by <name>” on the key page to kill tokens immediately. Same starter prompt. For a safe trial, use the administrator-approved sandbox.

Generic MCP

One exec per request until PR #1240. Example tool: estimate_snapshot with "input": {} and the administrator-approved sandbox orgId for a safe trial. Same starter prompt as ChatGPT.

Fast lookups: list, then call by id

The quickest way to find and change things is three short steps. Get an id from a light list or a name lookup, read that one record, then change it by the same id. Each step reads only what it needs, not the whole company.

  1. Find the id. list_jobs with "view": "index" returns only id, name, status, customerName and jobNumber. For leads, use search_leads.
  2. Read one record. read_job with jobId, or lead_status with leadId.
  3. Change it by id. edit_job, set_job_status, rename_job, assign_to_job and set_job_colors with that jobId touch only that job.
{ "action": "exec", "orgId": "YOUR_ORG_ID", "toolName": "list_jobs",
  "input": { "view": "index", "status": "open", "limit": 200 } }

→ { "view": "index", "jobs": [ { "id": "JOB_ID_1", "name": "1042 Example Ave",
      "status": "active", "customerName": "Sam Example", "jobNumber": "1042" } ],
    "count": 1, "total": 1, "nextCursor": null }

Without a search, the index pages with limit (default 200, max 1000) and cursor (pass nextCursor back). status is open (default, everything not archived), all, or one of active, accepted, limbo, completed, archived.

Look up by name, phone or number in one call

Pass what the owner said. search takes a customer or job name, phone a phone number, and jobNumber (alias customerNumber) a job or estimate number. The portal has no separate customer number, so the job or estimate number is the number to use. list_jobs (index view), read_job, search_leads and lead_status all take these.

Names are matched on the server and spelling mistakes are fine. A name heard as “Sam Exampel” still finds “Sam Example”. You get at most 5 ranked matches with a score from 0 to 1 and what matched (matchedOn: name, phone or number), never the whole list.

{ "action": "exec", "orgId": "YOUR_ORG_ID", "toolName": "list_jobs",
  "input": { "view": "index", "search": "Sam Exampel" } }

→ { "jobs": [ { "id": "JOB_ID_1", "name": "1042 Example Ave", "status": "active",
      "customerName": "Sam Example", "jobNumber": "1042", "score": 0.92, "matchedOn": "name" } ],
    "match": { "id": "JOB_ID_1", … }, "matchConfidence": "sure",
    "hint": "One clear match. Use its id for read_job or any change." }

Changes always need the exact id. A name lookup only finds ids. No write tool picks a job or lead from a fuzzy name, so a misspelling can never change the wrong customer.

Lead status in one call

lead_status answers “where is this lead?” with the CRM stage, when it last changed, the linked job and the proposal state (to_build, draft, sent, accepted or declined, with sent, accepted and declined times). Look up by leadId (fastest), jobId, search or phone. search_leads lists leads with id, name and stage, newest first, or ranked when you search. Both are in the Leads & pipeline group (leads-crm) and return no phone numbers, emails or consent records. Full lead records stay on get_lead (opt-in Lead intake grant).

{ "action": "exec", "orgId": "YOUR_ORG_ID", "toolName": "lead_status",
  "input": { "leadId": "LEAD_ID_1" } }

→ { "leadId": "LEAD_ID_1", "name": "Sam Example", "status": "estimate_scheduled",
    "stage": "Est. scheduled", "statusChangedAt": "2026-01-15T16:00:00.000Z",
    "job": { "id": "JOB_ID_1", "name": "1042 Example Ave", "status": "active", "jobNumber": "1042" },
    "proposal": { "state": "sent", "estimateId": "ESTIMATE_ID_1",
      "sentAt": "2026-01-18T14:30:00.000Z", "acceptedAt": null, "declinedAt": null } }

Work orders and job files

Add includeFileLinks: true to read_job to get the job's work order and other documents in the same call. Each file in files has a name, contentType, sizeBytes, a workOrder flag and a downloadUrl that expires in 15 minutes (expiresAtMs). Fetch it right away; call again for a fresh link. includeFiles: true lists the files without links. Keys without the owner-finance grant see work orders only (filesShown: "work-orders"), since other files can be contracts or priced proposals. Photos stay on the photo tools. For the estimate or proposal PDF, use download_proposal_pdf with the estimateId or jobId.

A file counts as a work order only when it was stored as one, never because of its name. When you attach a work order with upload_job_file, pass kind: "work-order" (on add_job, fileKind: "work-order"). Leave it out for proposals, contracts and other files. In the app, an admin marks a file with the Work order toggle on the Photos tab. A caption that says “Work order” does not count.

{ "action": "exec", "orgId": "YOUR_ORG_ID", "toolName": "read_job",
  "input": { "jobId": "JOB_ID_1", "includeFileLinks": true } }

→ { "job": { "id": "JOB_ID_1", "name": "1042 Example Ave", ... },
    "files": [ { "name": "Work order 1042.pdf", "contentType": "application/pdf",
      "sizeBytes": 48211, "workOrder": true, "linkAvailable": true,
      "downloadUrl": "https://storage.example.invalid/...", "expiresAtMs": 1767225600000 } ],
    "fileCount": 1, "filesShown": "all" }

Older calls still work

list_jobs with no view (or summary, scope, full) returns the same full job rows as before. read_job still takes jobId or jobName. list_sales_leads, list_leads, get_lead and action: "brief" are unchanged. Use the index and by-id calls when speed matters.

Rate limits: 60 requests a minute per key, so one busy agent no longer slows other keys in the same company. Revoking, rotating or re-scoping a key takes effect within 30 seconds.

OpenAPI spec

Agents and integrators should use the generated OpenAPI 3.0 document for every exec tool name, JSON input shape, read vs write kind, and x-ops-scopes group. It is rebuilt from the Portal tool registry on each deploy.

Download YAML  ·  Download JSON  ·  https://pezleyportal.com/portal-ops-openapi.yaml

Browse below or paste the YAML URL into your agent framework. No login required.

Getting started

  1. Read the OpenAPI spec (or Redoc below) — every exec tool has a PortalOpsInput_* schema, scope tags, and write tools include x-examples.
  2. As an org admin, issue a ppops_… key under Settings → Portal Ops keys. New keys are opt-in: no scopes are checked until you pick groups (or Full access for every standard group; opt-in groups are ticked one by one). Choose the smallest set that fits — e.g. briefing-read only for a morning snapshot.
  3. Store the secret in your assistant env (e.g. PEZLEY_OPS_BRIEF_KEY). Never commit it to git or paste it into customer-visible channels.
  4. Call POST https://pezleyportal.com/.netlify/functions/portal-ops-mrz-tool with Authorization: Bearer … and a JSON body. Top-level orgId must match the org baked into the key — not inside input.
  5. Use action: "brief" for a one-shot morning snapshot, or action: "exec" with toolName + input for a single registry tool per request. Put tool arguments in input, not args.
  6. On 403 / 400, read the code field and adjust scopes or tool choice — see error codes, scope groups, and blocked tools.

What is Portal Ops?

Portal Ops is Pezley Portal's HTTP API for external AI assistants, automations, and integrations. Each request is authenticated with a long-lived ppops_… secret your org admin issues in Settings.

Typical uses: a morning operations brief, adding a lead from a phone call, booking an estimate visit, updating a proposal draft, posting a weather delay, or attaching a work-order PDF.

Signing in to the web app as an org admin still unlocks the full in-browser admin assistant catalog. Portal Ops keys are separate credentials with scopes you control.

Issue & rotate keys (org admins)

  1. Sign in at pezleyportal.com as an org admin.
  2. Open Settings → Portal Ops keys (or ?adminTab=opsbrief).
  3. Name the key (e.g. “Morning brief”, “Phone lead bot”). Scopes for new key start with none checked — enable only the groups this automation needs. High-impact groups (settings & pricing, owner $, send proposal, delete job files, crew clock, and some job-ops groups) ask for confirmation when you turn them on.
  4. For product prices, production rates, estimate pricing or contracts, enable Manage settings & pricing (settings-write). This starts unchecked and can also be changed on an existing named key.
  5. Optional: Full access grants every standard Portal Ops group after a confirmation dialog; the key stores ["*"] (includes settings-write, photo approval and job-cost writes). It leaves the opt-in groups off, such as people & access, payroll export and client email sends; tick each one you want as well, and the key then stores that full list instead of ["*"]. You cannot Generate ops key with zero scopes selected — pick at least one group or Full access.
  6. Pick Expires after: 30, 90 (default), 180 or 365 days, or No expiry. Keys made before this option, and one-click Connect keys, have no expiry until you set one.
  7. Copy the ppops_… value once into the assistant's secret store (often PEZLEY_OPS_BRIEF_KEY).
  8. Use Save scopes on existing named keys, or Rotate / Revoke per key; other keys keep working. After scope changes, reconnect ChatGPT if you use MCP.
  9. Pause key stops every call with that key, reads included, until you tap Resume key. Each key row also shows when it expires and flags a key not used in 30+ days. Rotating restarts the expiry clock.
  10. Pause all ops key writes (Org write controls) stops every key's writes at once; reads keep working.

Key guards

Legacy keys: Older single-key installs and named rows with no scopes field keep their original Portal Ops access, including owner finance, but do not gain the new settings or pricing-write permission. Orgs that still show one row with keyId: "legacy" retain that original access; scopes are not editable — issue a new named key with settings-write to allow settings and pricing changes.

POST https://pezleyportal.com/.netlify/functions/ops-brief-key
Authorization: Bearer <Firebase org-admin ID token>
{ "action": "generate-key", "orgId": "your-org-id", "label": "Production assistant",
  "scopes": ["briefing-read", "proposals-estimates"], "expiryDays": 90 }
# Full access: "scopes": ["*"]
# Missing or empty scopes[] → 400 scopes-empty
# expiryDays: 30 | 90 | 180 | 365 | null (no expiry); omitted → 90; other → 400 invalid-key-expiry

{ "action": "set-key-lifecycle", "orgId": "your-org-id", "keyId": "<keyId>", "paused": true }
{ "action": "set-key-lifecycle", "orgId": "your-org-id", "keyId": "<keyId>", "expiryDays": 180 }
# Pause/resume and expiry changes never change who made the key.
Never commit secrets
Portal stores only a hash of each key. If a key leaks, revoke it immediately and issue a new one.

ChatGPT / MCP connection (org admins)

In Settings → Portal Ops keys, the ChatGPT / MCP connection card controls how long hosted ChatGPT OAuth sessions last for new connects. Default: until the Ops key is revoked or rotated (grantTtlMode: until_revoked) — not a 30-day calendar timer.

Scopes vs OAuth: current key scopes are checked on each request, alongside OAuth scope and applicable consent caps. Refresh tools updates metadata; reconnect ChatGPT through normal consent to restore or approve access. See setup, discovery and consent and Estimate Library reads.

Optional: expires_after_days caps lifetime from each new Connect (1–3650 days). Existing ChatGPT sessions keep the deadline from when they connected.

Programmatic parity (Firebase org-admin ID token, not ppops_):

POST https://pezleyportal.com/.netlify/functions/ops-brief-key
{ "action": "key-status", "orgId": "your-org-id" }
→ keys[], availableScopes[], mcpConnection { grantTtlMode, expiresAfterDays }

{ "action": "save-mcp-connection", "orgId": "your-org-id", "grantTtlMode": "until_revoked" }
→ { ok, orgId, mcpConnection }

Tool calls still use POST https://pezleyportal.com/.netlify/functions/portal-ops-mrz-tool with your ppops_ key. See PortalMcpConnectionSettings in the OpenAPI spec.

Before you act

Ask the owner in the assistant's chat and receive an explicit yes for each specific action before acting on any customer send (proposal, invoice, text or reminder), any money change (invoice, payment, job price or job costing), any delete, or any settings/library change. Show the exact recipient, content, amount and fields that will change when asking. A general instruction or an earlier unrelated yes is not approval for a new action.

Drafting, reading and internal notes need no approval. For sends, first preview, show the owner the exact recipient/content, then use the returned recipient and content digest with confirm:true after their yes. This confirmation is handled in chat; there is no separate Portal approval screen.

The Portal does not strip, blank, or refuse customer copy because it contains access words or numbers. Estimators own what they type on estimates, proposals, share pages, PDFs, work details, texts, and Home File notes. Dedicated staff Home File fields (gate code, lockbox, access notes, pets) stay on the staff record.

Never send to the same customer twice for the same thing. Respect send caps: two customer notifications per proposal or invoice in any rolling 24 hours, including unsend/resend cycles; five texts per customer per key in any rolling 24 hours. 429 send-cap means stop and explain the cap. Retrying the same operation must reuse the same Idempotency-Key header.

Every key-authenticated write requires the Idempotency-Key request header, including MCP, batch writes, previews and dry runs. Missing header returns 400 idempotency-key-required; reads are unchanged. Do not substitute a new retry key to evade a failed or uncertain send.

Keys never get bank tools, Stripe charge/refund/payout actions, payroll or employee pay-rate writes, or the ability to enable a drip. Draft tools never notify customers.

Authentication & HTTP surface

ItemValue
Environment variablePEZLEY_OPS_BRIEF_KEY (or a named secret per assistant)
Authorization headerAuthorization: Bearer <your ppops key>
Alternate headerX-Pezley-Ops-Key: <your ppops key>
HTTP endpointPOST https://pezleyportal.com/.netlify/functions/portal-ops-mrz-tool (also OPTIONS for CORS)
Legacy aliasPOST …/openclaw-mrz-tool — deprecated thin re-export; migrate to portal-ops-mrz-tool.
Key managementPOST https://pezleyportal.com/.netlify/functions/ops-brief-key — Firebase org-admin ID token only (not ppops_). Actions: key-status (includes mcpConnection, availableScopes), save-mcp-connection, generate-key (label + required non-empty scopes[] — scope ids or ["*"]), update-key-scopes, rotate-key, revoke-key. Scope catalog: OpenAPI x-portal-ops-scope-appendix.
Org in bodyorgId must match the org embedded in the key (top-level JSON field, not inside input). Mismatch → 403 org-mismatch.
Rate limitOps keys: 60 requests / minute per key (each named key has its own bucket) → 429 with retryMs. See OpenAPI x-portal-ops-http-notes.
Error shape{ error, code, hint?, toolName?, allowed? } — code enum in OpenAPI PortalOpsError.

Actions: brief, exec, company-state, log

Every request is JSON POST to the Portal Ops endpoint. The action field selects behavior. Signed-in Firebase org admins may use the same URL with an ID token for the full in-app tool catalog; ops keys are limited to registry tools allowed by their scopes.

brief

Morning operations snapshot. Requires briefing-read on ops keys. Optional sessionId, adminName for audit.

{
  "action": "brief",
  "orgId": "your-org-id"
}

exec

One registry tool per request. toolName must appear in OpenAPI x-portal-ops-tools; input must match PortalOpsInput_{toolName}.

{
  "action": "exec",
  "orgId": "your-org-id",
  "toolName": "create_lead",
  "input": { "name": "Example lead", "phone": "CUSTOMER_PHONE" }
}

company-state

Compact company memory + brief subset for multi-turn assistants (same auth as brief). Requires scopes that cover the underlying reads.

{
  "action": "company-state",
  "orgId": "your-org-id"
}

log

Append an audit line for an external assistant session (kind, message, optional tool list). Does not run Portal tools.

{
  "action": "log",
  "orgId": "your-org-id",
  "sessionId": "morning-bot",
  "kind": "assistant",
  "message": "Posted rain delay for JOB_ID"
}

Missing/invalid auth → 401 (missing-auth, invalid-ops-key). Scope or blocked tool → 403 with a named code. Malformed JSON → 400.

Office tools and private records

create_proposal_draft creates a blank draft for an existing leadId or contactId, without a job or customer notification. save_proposal_draft and its dry run report droppedAreas:[{name,reason:"needs-dimensions"}] when a new room lacks L/W/H or sqft.

add_contact_note, add_lead_note and add_visit_note append 1–2000 characters privately under the authenticated org record. Visit notes take jobId and the existing visitId (or estimate for the estimate appointment). No note is rendered on a customer page. Hosted CRM corrections now use the existing leads-crm permission and live issuer checks.

create_invoice_draft/update_invoice_draft and draft_sms never notify. send_invoice/send_sms require exact recipient/digest confirmation after approval in chat. Invoice delivery never charges Stripe; customers use the existing payment-link flow. Texts retain TCPA/STOP refusal.

For a custom subject or body, pass messageOverride to send_invoice, send_proposal, resend_proposal_email, or schedule_proposal_send. Use send_client_email with subject and body for standalone messages.

Key formula/leftover removal is also reversible: call set_home_file_formulas or set_home_file_leftovers with {jobId,restoreIds:[rowId]} to restore explicitly selected tombstoned rows. Key import undo retains restorable records; restore_deleted_record with deleteTool:"undo_app_import" uses the import grant.

request_pto, approve_pto, deny_pto and cancel_pto share the app's PTO policy. Removing or denying approved time off flags existing paid shifts for admin review and never deletes them or sends crew SMS.

hold_share_photos/unapprove_photo hide selected photos reversibly; they never delete files. add_home_file_entry/update_home_file_entry update general Home File records while staff access codes remain private. Costing writes use the separate opt-in scope, idempotency, before/after audit and dryRun.

Morning brief shape

Successful action: "brief" returns ok: true and a brief object (OpenAPI PortalOpsBriefSnapshot). Fields are filtered by what your key can read — finance blocks stay out unless owner-finance is enabled.

asOf
ISO timestamp when the snapshot was built.
today
Calendar date YYYY-MM-DD in the org timezone.
orgId
Active org id (must match request).
todayJobs / weekJobs
Scheduled production jobs (shape aligns with list_jobs / dispatch).
onClock
Crew currently clocked in.
hours
Pay-period hour rollups per crew member.
crew
Roster snapshot for stand-up.
salesLeads
Hub “To build” leads when leads-crm or briefing reads allow.
proposals
Hub proposal list when proposal reads are in scope.
pipeline
Pipeline scoring summary when allowed.
pendingCheckins
Action Feed check-ins awaiting publish when action-feed is enabled.
learningAi
Learning AI study status for the org.

Use read_job / read_proposal via exec for detail beyond the brief list rows.

Scope groups (full tool lists)

When you issue or edit a key, you enable one or more groups below. New keys are opt-in in Settings (nothing checked until you choose). Explicit Full access (["*"]) includes settings-write. Legacy keys and rows with no scopes field retain their original access, including owner finance, but keep their settings and pricing-write restrictions. Each group lists its tools; writes still follow the key restrictions. Product and rate pricing changes require Manage settings & pricing, even when the key already has estimate or production-rate access.

proposals-estimates is a deprecated alias for proposals-draft + proposals-send. Existing keys keep draft/send access; settings/library changes require settings-write. New keys show separate draft/send checkboxes. job-costing-write is off by default and included in Full access. Full access leaves the opt-in groups listed under What a key can do off until each is ticked.

Each row lists every registry tool in that group — regenerated from the ops brief scope catalog on deploy.

Scope idLabelWhat it allows
briefing-read Morning brief & reads Jobs, crew, clock scans, learning AI, recurring reminders, check-ins. Home File, including gate codes, is a separate Home File grant.

Tools: analyze_time_trends, list_crew, list_jobs, list_learning_ai, list_recurring_reminders, list_teams, list_tools, read_job, scan_shifts
action-feed Tasks & alerts medium risk Full Action Feed cleanup for this org: list/approve pending check-ins, one-off reminders — same mutate surface as Today (not read-only).

Tools: add_reminder, list_pending_checkins, publish_checkins
company-state Company memory & inventory medium risk Company profile, lore (remember/forget), tools checkout, reminders.

Tools: add_reminder, add_tool, check_in_tool, check_out_tool, create_recurring_reminder, delete_recurring_reminder, delete_tool, edit_recurring_reminder, edit_tool, forget, mark_tool_fixed, mark_tool_repair, remember, restore_deleted_record, set_tool_photo, toggle_recurring_reminder, update_company_info
leads-crm Leads & pipeline Pipeline scoring, follow-up drafts, Sales hub to-build jobs (list_sales_leads), fast lead lookups (search_leads, lead_status: id, name, status, linked job and proposal state, no phone, email or consent data), and update_lead / update_contact. create_lead, list_leads, and get_lead (full records with phones and consent docs) require the opt-in lead-intake grant (not this group).

Tools: analyze_pipeline, draft_followup, lead_status, list_sales_leads, score_lead, search_leads, update_contact, update_lead
lead-intake Lead intake medium risk Opt-in. create_lead writes a Sales → Leads CRM record (phone then name dedupe; no SMS, email, staff alert, estimate job, or appointment). list_leads and get_lead return full website CRM records and linked consent docs (including phone numbers). Not included on leads-crm, business-data, or Full access (*). Uses the 10/minute opt-in group rate limit.

Tools: create_lead, get_lead, list_leads
lead-stage CRM lead stage medium risk Opt-in. set_lead_stage moves one website CRM lead to an existing Sales lead stage (New, Contacted, Est. scheduled, Won, Lost, Spam). Requires confirm:true and the Idempotency-Key header. Writes an audit with the old stage, new stage, issuer and time. Lost and Spam also retire the unsold estimate, the same way a declined proposal does. Not included on leads-crm or legacy unscoped keys. Uses the 10/minute opt-in group rate limit.

Tools: set_lead_stage
proposals-draft Proposal drafts Proposal reads and draft edits. Sending and settings/library writes require separate grants.

Tools: add_estimate_note, analyze_rate_book, create_estimate, create_proposal_draft, discard_staged_estimate, download_proposal_pdf, estimate_context, estimate_snapshot, get_estimate_descriptor, get_estimate_product, get_staged_estimate, keep_staged_estimate, link_recording, list_estimate_descriptors, list_estimate_products, list_proposals, list_recordings, list_staged_estimates, push_staged_estimate, read_estimate_handoff, read_proposal, read_recording_transcript, reopen_estimate_draft, reopen_proposal_draft, research_estimate_product, restore_proposal_revision, save_proposal_draft, stage_estimate_draft, unlink_recording, update_estimate, update_staged_estimate
proposals-send Send proposals high risk Customer proposal sends, recipient changes and unsend. Review recipient/content and obtain the owner's explicit yes in chat.

Tools: resend_proposal_email, send_proposal, set_proposal_cc_emails, set_proposal_secondary_email, unsend_proposal_to_draft
notes Internal notes Append-only notes stored in private org record subcollections; never customer output.

Tools: add_contact_note, add_lead_note, add_visit_note
invoices-draft Invoice drafts high risk Draft ordinary, deposit, progress, final and supported time-and-material invoices, and attach an estimate to an invoice. Money changes need approval in chat.

Tools: create_invoice_draft, delete_invoice, get_invoice, link_invoice_estimate, list_invoices, update_invoice_draft
invoices-send Send invoices high risk Preview and confirm invoice delivery. Never creates a Stripe charge.

Tools: cancel_scheduled_invoice_send, schedule_invoice_send, send_invoice
sms-send Customer texts high risk SMS draft and digest-confirmed send, with TCPA/opt-out checks and a five-per-customer rolling daily key cap.

Tools: draft_sms, send_sms
pto-manage Time off Manage PTO without crew texts; retained paid shifts are flagged for admin removal.

Tools: adjust_pto_balance, approve_pto, cancel_pto, deny_pto, request_pto
photos-manage Hide shared photos Reversible removal from customer sharing; files are retained.

Tools: hold_share_photos, unapprove_photo
job-costing-write Write job costs high risk Opt-in job-costing writes with required idempotency, before/after audit and dryRun. No pay-rate writes.

Tools: dismiss_receipt, get_costing_gaps, get_job_costing, list_job_costs, move_job_cost, reassign_receipt, save_job_costing, undismiss_receipt
jobs-files Jobs & files high risk Create/edit jobs, uploads, work orders, delete files, rename, hours, assign tasks — full job file ops (use Job status & limbo scope for status-only keys). Does not include Home File gate codes, pets, formulas, or leftovers.

Tools: add_job, add_task_to_job, assign_to_job, attach_job_file, attach_work_order, create_job, delete_job, delete_job_file, detach_job_file, edit_job, edit_summary, link_recording, remove_job_file, rename_job, restore_deleted_record, set_job_colors, set_job_name, unlink_recording, upload_job_file
home-file Home File high risk Home File timeline (no prices) plus staff-only gate code, lockbox, access notes and pets, exact color formulas, and the leftover paint log. This grant is separate from Jobs & files, so an existing jobs-files key does not gain gate-code access. Gate codes and pets are never included in anything customer-facing.

Tools: add_home_file_entry, read_home_file, set_home_file_access, set_home_file_formulas, set_home_file_leftovers, update_home_file_entry
customer-app Homeowner app sign-in medium risk Homeowner email-code sign-in for the Pezley Portal app: list who can sign in (masked email, contact ids, phones signed in, last sign-in), one homeowner's sign-in log (codes sent, sign-ins, sign-outs, revokes), and revoke_customer_app_sign_in (confirm:true) to sign them out on every phone. Codes, passes and full emails are never returned. Their contact and project records are not touched.

Tools: customer_app_sign_in_log, list_customer_app_sign_ins, revoke_customer_app_sign_in
scheduling Scheduling & visits medium risk Crew Schedule / admin assistant parity: read jobs/crew/shifts, edit bars & spots, assign crew, estimate/client visits, delay posts, and schedule-related job fields (hours). write_schedule_with_ai stays in-app (Pro Tips panel) — use edit_job_schedule or visit tools from automations.

Tools: add_spot_assignment, analyze_time_trends, apply_schedule_suggestion, assign_to_job, book_client_visit, book_estimate_visit, cancel_client_visit, cancel_estimate_visit, dismiss_schedule_suggestion, edit_job, edit_job_schedule, list_appointments, list_crew, list_days_off, list_jobs, list_recurring_reminders, list_schedule, list_schedule_suggestions, list_teams, offer_estimate_visit, polish_delay_reason, post_job_delay, read_job, remove_day_off, remove_spot_assignment, scan_shifts, set_day_off, undo_schedule_suggestion
job-delays Job delay posts medium risk Post rain/heat/schedule delays (customer share + crew cascade) with optional polish_delay_reason — same as check-in Delay / Action Feed.

Tools: polish_delay_reason, post_job_delay
job-status Job status & limbo medium risk Set job status (active, accepted, limbo, completed, archived), limbo staff reason, general/T&M flags — includes polish_limbo_reason (Rewrite with AI) or custom text.

Tools: list_jobs, polish_limbo_reason, read_job, set_job_status
crew-clock Crew & time clock high risk Clock in/out, shifts, crew roster edits.

Tools: add_crew_member, add_shift_manual, clock_in_user, clock_out_user, delete_shift, edit_crew_member, edit_shift, end_break, restore_deleted_record, start_break
settings-write Settings & pricing high risk Read and edit organization settings and pricing libraries. Includes contract types and invoice defaults. Does not grant owner finances, API-key management, or provider credentials.

Tools: analyze_rate_book, create_estimate_product, delete_estimate_descriptor, delete_estimate_product, delete_production_rate, get_estimate_descriptor, get_estimate_product, get_production_rate, get_settings, import_rate_book, list_estimate_descriptors, list_estimate_products, list_production_rates, research_estimate_product, restore_deleted_record, save_estimate_settings, save_settings, upsert_estimate_descriptor, upsert_estimate_product, upsert_production_rate
production-rates Production rates Rate book list/get/upsert/delete.

Tools: delete_production_rate, get_production_rate, list_production_rates, upsert_production_rate
drips-comms Email & drips Templates and drip sequence drafts/updates.

Tools: create_drip_sequence, draft_drip_sequence, draft_email_template, list_drip_sequences, list_email_templates, update_drip_sequence, update_email_template
business-data Business data (read) Portal Ops data API (read-only, paged, filter by date / customer / job): contacts, estimates, schedule, production, photos, messages, follow-ups, staff, hours, colors, reviews/referrals, settings, activity. CRM lead list/get need the opt-in lead-intake grant. Invoice and costing records use their own grants or owner-finance; payments require owner-finance.

Tools: get_contact, get_estimate, get_job_activity, get_job_production, get_settings, list_activity, list_contacts, list_estimates, list_followups, list_hours, list_job_colors, list_messages, list_photos, list_production, list_reviews_referrals, list_schedule, list_staff
photos Photos (upload & annotate) medium risk upload_photo / save_annotated_photo (new linked copy, original untouched) + list_photos. Every assistant photo is pending until staff approve it in Portal; approval requires the separate Approve selected photos grant and an active admin/office issuer.

Tools: annotate_photo, download_photo, list_pending_share_photos, list_photos, save_annotated_photo, upload_photo
photos-approve Approve selected photos high risk approve_photos requires jobId and explicit photoIds; never approves all. Separate from upload access.

Tools: approve_photos
webhooks Event webhooks medium risk list_webhooks / create_webhook / delete_webhook — HMAC-signed POSTs for lead.created, customer.replied, proposal.viewed, proposal.signed, payment.received.

Tools: create_webhook, delete_webhook, list_webhooks, restore_deleted_record
owner-finance Owner $ — Numbers & job costing high risk Owner reports, margin/burden and permitted finance reads. Job-costing writes require the separate opt-in grant. Pay-rate writes are prohibited.

Tools: advise_cfo, analyze_numbers, cfo_setup_status, confirm_receipt, draft_cfo_report, get_costing_gaps, get_invoice, get_job_costing, ingest_receipt, list_cfo_packs, list_employee_rates, list_invoices, list_job_costs, list_payments, list_receipts, pay_invoice, query_cfo_knowledge, record_collected_payment, reopen_voided_invoice, save_payment_schedule, set_job_price, suggest_burden_from_wages, void_invoice
app-import Import from another app high risk PaintScout export / spreadsheet import: preview_app_import (stages a preview, duplicates flagged), commit_app_import (idempotent per previewId), list_app_import_batches, undo_app_import. Writes contacts, jobs, estimates, invoices with customerNotifySuppressed — no email, SMS, drips, proposal sends, or reminders.

Tools: commit_app_import, list_app_import_batches, preview_app_import, restore_deleted_record, undo_app_import
books-bank Receipt voids high risk void_receipt.

Tools: void_receipt
pay-rates Pay rates high risk

Tools: list_employee_rates, save_employee_rates
numbers-settings Numbers settings high risk

Tools: advise_cfo, analyze_numbers, cfo_setup_status, draft_cfo_report, list_cfo_packs, query_cfo_knowledge, save_numbers_settings, suggest_burden_from_wages
drips-enable Enable drips high risk

Tools: draft_drip_sequence, enable_drip, list_drip_sequences, update_drip_sequence
change-orders Change orders high risk

Tools: create_change_order_draft, list_change_orders, mark_change_order_accepted, send_change_order, void_change_order
people-access People & access high risk

Tools: cancel_checkin_queue_purge, deactivate_user, list_people_setup, list_staff, merge_users, resend_invite, restore_user, save_chat_pair, send_user_invite, set_production_crew, set_user_role
payroll-export Payroll export

Tools: approve_shift_review, export_hours, find_duplicate_shifts, ignore_shift_anomaly, list_hours, merge_duplicate_shifts, move_shifts_to_tm, scan_shifts, undo_shift_merge
team-comms Team communications medium risk

Tools: decline_chat_proposal, delete_chat_message, list_messages, list_team_chat, list_team_threads, nudge_missing_hours, post_team_message, react_to_chat_message, send_push_to_crew, share_photo_in_chat
direct-messages Direct messages high risk

Tools: list_direct_messages, send_direct_message
client-comms-send Client email send high risk

Tools: answer_customer_question, cancel_scheduled_proposal_send, create_share_link, ignore_customer_question, reply_email_thread, request_review, schedule_proposal_send, send_client_email, send_share_message
email-blasts Email blasts high risk

Tools: list_email_blasts, save_email_blast, send_email_blast
hubs Hubs medium risk

Tools: list_hub_log, list_hubs
estimates-advanced Estimates advanced medium risk

Tools: decline_proposal, draft_client_email, record_in_person_accept, split_estimate
field-ops Field operations medium risk

Tools: add_crew_need, attach_checklist_to_job, check_off_crew_need, complete_checklist, create_checkin, create_checklist, create_purchase_order_draft, crew_day_steps, delete_checkin, delete_checklist, discard_checkin, edit_checkin, edit_sub_company, job_walkthrough, list_brush_requests, list_checklists, list_crew_needs, list_pending_checkins, list_purchase_orders, list_shop_duties, list_sub_access, list_sub_companies, list_sub_profiles, list_touchups, mark_crew_day_step, move_checkin, remove_pending_checkin_photos, request_brush_replacement, reset_checklist, resolve_brush_request, revoke_sub_access, save_sub_profile, save_touchup, send_sub_invite, set_shop_duty_item, set_shop_duty_supply, set_sub_homeowner_settings, set_walkthrough, tick_crew_list_item, unpublish_checkin, update_checklist, update_purchase_order
job-record Job record medium risk

Tools: add_job_product, confirm_job_product, delete_color_photo, move_portfolio_photo, publish_job_prep_sheet, read_job_record, relabel_color_photo, remove_job_product, save_job_prep_draft, save_office_handoff, set_job_paid, set_portfolio_details
contacts-leads Contacts and leads medium risk

Tools: cancel_drip_enrollment, create_contact, list_drip_enrollments, make_home_file_link, mark_home_file_sent, merge_contacts, pause_drip_enrollment, resend_lead_to_google, resend_lead_webhook
settings-advanced Settings advanced high risk

Tools: get_settings, restore_schedules_from_history, save_settings, scan_missing_profiles, scan_summary_scratchpad, send_test_email, send_test_text, set_company_logo, set_new_clock, wipe_job_summary
integrations-sync Integrations sync medium risk

Tools: companycam_link_project, trigger_google_calendar_sync, trigger_quickbooks_sync
records-archive Archive records medium risk

Tools: archive_contact, archive_estimate, archive_lead, restore_deleted_record
ops-audit Ops audit log

Tools: list_ops_receipts

What a key can do, area by area

Every action a person can do in the app, and whether a key can do it today. Regenerated with the OpenAPI files (machine copy: x-portal-ops-control-map). New features ship with their ops key tools, so rows move to Covered as tools land.

Of 175 action groups in the app, a key covers 123, does part of 33, and can't do 1 yet. 18 stay with a signed-in person on purpose. Each covered action still needs the scope group for its tools (see Scope groups).

Full access is not every group. A Full access key (["*"]) leaves these opt-in groups off. Tick each one you want on the key as well: lead-intake (Lead intake), lead-stage (CRM lead stage), books-bank (Receipt voids), pay-rates (Pay rates), numbers-settings (Numbers settings), drips-enable (Enable drips), change-orders (Change orders), people-access (People & access), payroll-export (Payroll export), team-comms (Team communications), direct-messages (Direct messages), client-comms-send (Client email send), email-blasts (Email blasts), hubs (Hubs), estimates-advanced (Estimates advanced), field-ops (Field operations), job-record (Job record), contacts-leads (Contacts and leads), settings-advanced (Settings advanced), integrations-sync (Integrations sync), records-archive (Archive records).

AreaCoveredPartlyNot yetPerson
Crew day16900
Hours and payroll3400
Jobs11501
Schedule7300
Leads and follow-ups9000
Contacts and Home File8000
Estimates and proposals15100
Invoices and payments10002
Numbers, receipts, purchasing6100
Customer messages5301
Team chat4301
Check-in review and photos7000
Admin and settings113011
Hub (shop iPad)7112
Subcontractors4000
All areas12333118

Crew day

ActionStatusTools today
Clock someone in or outCoveredclock_in_user, clock_out_user
No GPS from a key.
Start or end a break or lunchCoveredstart_break, end_break
For a crew member who is clocked in. Break time is unpaid. Nobody is notified.
Switch a shift to another jobCoverededit_shift
Clear a duplicate shiftCoveredfind_duplicate_shifts, merge_duplicate_shifts, undo_shift_merge
Create or edit a check-in or final dayCoveredcreate_checkin, edit_checkin
Add check-in photosPartlyupload_photo, remove_pending_checkin_photos
Photos wait for staff approval.
Polish a check-in or delay reasonCoveredpolish_delay_reason
Discard or move a check-inPartlydiscard_checkin, move_checkin
Unpublished ones only. Needs Field ops.
Publish check-insCoveredlist_pending_checkins, publish_checkins
Unapproved photos are held back.
Create, edit or tick a checklistCoveredcreate_checklist, update_checklist, complete_checklist, list_checklists
Tick a last-day walkthrough listCoveredcomplete_checklist, crew_day_steps
Own and customer walkthrough lists the app puts on each job.
Reset or delete a checklistCoveredreset_checklist, delete_checklist, restore_deleted_record
Needs Field ops. A delete can be undone.
Upload a PDF checklist or attach a saved onePartlyattach_checklist_to_job
Attaches a saved list or template. PDF upload is in the app.
Work order extrasPartlyassign_to_job, add_task_to_job
Tools: add, edit, delete, check out, check in, repair, fixedCoveredlist_tools, add_tool, edit_tool, delete_tool, check_out_tool, check_in_tool, mark_tool_repair, mark_tool_fixed
Add a tool photoCoveredset_tool_photo
Crew brush requestsPartlyrequest_brush_replacement
Replacement requests for office review. The quarterly allotment sign-off is the crew member's own, in the app.
Office brush reviewCoveredlist_brush_requests, resolve_brush_request
Walkthrough touch-ups: add, edit, tick fixed, removePartlylist_touchups, save_touchup
Notes only. Touch-up photos are added in the app.
Pin or tick crew needs for tomorrowPartlylist_crew_needs, add_crew_need, check_off_crew_need
Record only. Moving a tool stays with check_out_tool.
Set the walkthrough time and record how it wentCoveredjob_walkthrough, set_walkthrough
Record only. Nothing is sent to the homeowner or the crew.
Tick a crew list item or mark a crew day step (Today, shop hub)Partlycrew_day_steps, tick_crew_list_item, mark_crew_day_step
Record only. Check-ins, lunch and marking a job finished stay on the person's phone.
Time off: request, approve, deny, cancelCoveredrequest_pto, approve_pto, deny_pto, cancel_pto
Adjust a time-off balanceCoveredadjust_pto_balance
Never the key issuer's own bank. Nobody is notified.
Add or edit a crew memberPartlyadd_crew_member, edit_crew_member
No profile photo. Current admins can't be changed.

Hours and payroll

ActionStatusTools today
Edit, delete or add a shiftCoverededit_shift, delete_shift, add_shift_manual
Add a time-off shiftPartlyadd_shift_manual
Move hours to T&M billingPartlymove_shifts_to_tm
Whole closed shifts. Splitting a shift is in the app. Needs Payroll hours export.
Approve a shift review or ignore an anomalyPartlyapprove_shift_review, ignore_shift_anomaly, edit_shift
PTO review stays in the app. A wrong clock-out is fixed with edit_shift. Needs Payroll hours export.
Scan shifts for problemsCoveredscan_shifts, find_duplicate_shifts, analyze_time_trends
Nudge someone about their hoursCoverednudge_missing_hours
Needs Team messages.
Review and export hoursPartlylist_hours, export_hours
Locking the pay period stays with an admin in the app.

Jobs

ActionStatusTools today
Create or edit a jobCoveredcreate_job, add_job, edit_job, rename_job
Price and hours budget need owner finance.
Change status or limboCoveredset_job_status, polish_limbo_reason
Mark a job paidCoveredset_job_paid
Admin issuer only. Not for time and material jobs. Needs Job record.
Archive a jobCoveredset_job_status
Checked-out tools go back to the shop, like the app.
Delete a jobPartlydelete_job, restore_deleted_record
Test companies only, and restorable.
Pin a jobStays with a personEach person's own pins, not a company record.
Assign crewCoveredassign_to_job, add_spot_assignment
Add, remove or confirm job productsCoveredadd_job_product, remove_job_product, confirm_job_product
Needs Job record.
Look up a productPartlyresearch_estimate_product
Save or apply a color planCoveredset_job_colors, list_job_colors
Color photos: add, relabel, deletePartlyrelabel_color_photo, delete_color_photo
Adding a photo stays in the app. Needs Job record.
Attach or remove job files and work ordersCoveredupload_job_file, delete_job_file, attach_work_order
Office handoffCoveredread_estimate_handoff, add_estimate_note, save_office_handoff
Save needs Job record.
Memory notesPartlyremember, forget
Company memory, not per job.
Rewrite the job summaryCoverededit_summary
Prep sheet: draft, publishCoveredsave_job_prep_draft, publish_job_prep_sheet
Needs Job record.
Completed job wrapPartlysave_job_costing
Job costing only.

Schedule

ActionStatusTools today
Move a job on the scheduleCoverededit_job_schedule
Weather delayPartlypost_job_delay
No undo.
Spot assign crewCoveredadd_spot_assignment, remove_spot_assignment
Review a cascade of movesPartlyedit_job_schedule
One job at a time.
AI auto-schedule: apply, undo, dismissCoveredlist_schedule_suggestions, apply_schedule_suggestion, undo_schedule_suggestion, dismiss_schedule_suggestion
Undo covers applies made with a key. New suggestions are made in the app. A suggestion shows the sub the scheduling assistant picked, when there is one.
Reply to a customer about the schedulePartlydraft_client_email, send_client_email
Estimate visits: book, offer, cancelCoveredbook_estimate_visit, offer_estimate_visit, cancel_estimate_visit, list_appointments
Client visits: book, cancelCoveredbook_client_visit, cancel_client_visit
Company days offCoveredlist_days_off, set_day_off, remove_day_off
RemindersCoveredadd_reminder, list_recurring_reminders, create_recurring_reminder, edit_recurring_reminder, toggle_recurring_reminder, delete_recurring_reminder

Leads and follow-ups

ActionStatusTools today
Create or edit a leadCoveredcreate_lead, update_lead, get_lead, search_leads
Archive or restore a leadCoveredarchive_lead, restore_deleted_record
Set the pipeline stage, lost or limboCoveredset_lead_stage
Notes and callback notesCoveredadd_lead_note, add_visit_note
Draft a replyCovereddraft_followup
Resend to Google Contacts or a webhookCoveredresend_lead_to_google, resend_lead_webhook
Build or turn on a follow-up sequenceCovereddraft_drip_sequence, create_drip_sequence, update_drip_sequence, enable_drip
Pause a sequence or one enrollmentCoveredupdate_drip_sequence, list_drip_enrollments, pause_drip_enrollment, cancel_drip_enrollment
See one job's customer activity (Customer views, By job)Coveredget_job_activity

Contacts and Home File

ActionStatusTools today
Add a new contactCoveredcreate_contact
Edit a contactCoveredupdate_contact, add_contact_note
Archive a contactCoveredarchive_contact
Merge duplicate contactsCoveredmerge_contacts
Import from another appCoveredpreview_app_import, commit_app_import, undo_app_import
Link a contact to a jobCoveredcreate_job, edit_job
Home File entries, access, formulas, leftoversCoveredread_home_file, add_home_file_entry, update_home_file_entry, set_home_file_access, set_home_file_formulas, set_home_file_leftovers
Send or share a Home FileCoveredmake_home_file_link, mark_home_file_sent, send_client_email, send_sms

Estimates and proposals

ActionStatusTools today
Create and edit a draftCoveredcreate_estimate, save_proposal_draft, update_estimate, stage_estimate_draft, update_staged_estimate, push_staged_estimate
Delete a draftCoveredarchive_estimate
Split an estimateCoveredsplit_estimate
Send with CC after previewCoveredsend_proposal, set_proposal_cc_emails, resend_proposal_email
Customize the proposal email subject and bodyCoveredsend_proposal
Schedule a proposal with optional custom email wordingCoveredschedule_proposal_send
Cancel a scheduled sendCoveredcancel_scheduled_proposal_send
Needs Send client email.
Decline a proposalCovereddecline_proposal
Record an in-person acceptCoveredrecord_in_person_accept
Change orders: create, send, accept, voidCoveredcreate_change_order_draft, send_change_order, mark_change_order_accepted, void_change_order
Proposal PDF and work orderCovereddownload_proposal_pdf, attach_work_order
Estimate photos and markupPartlyupload_photo, save_annotated_photo
Approval stays with staff.
Products and descriptors libraryCoveredcreate_estimate_product, upsert_estimate_descriptor
Needs Manage settings & pricing.
Production rate book changesCoveredupsert_production_rate, delete_production_rate
Needs Manage settings & pricing.
Import a rate book from another appCoveredimport_rate_book
Needs Manage settings & pricing. PaintScout CSVs; adds or updates rows, never deletes or replaces.
Purchase order from an estimateCoveredcreate_purchase_order_draft

Invoices and payments

ActionStatusTools today
Create an invoice, T&M, phase, balance or finalCoveredcreate_invoice_draft, update_invoice_draft
Save the payment scheduleCoveredsave_payment_schedule
Admin issuer. Owner finance.
Save the sold priceCoveredset_job_price
Owner finance.
Send an invoice with optional custom email wordingCoveredsend_invoice
Schedule an invoice sendCoveredschedule_invoice_send, cancel_scheduled_invoice_send
Cancel the schedule too. Needs Send invoices.
Record a partial, offline or collected paymentCoveredpay_invoice, record_collected_payment
Void an invoiceCoveredvoid_invoice
Reopen a voided invoiceCoveredreopen_voided_invoice
Admin issuer. Comes back held, not sent.
Delete an invoiceCovereddelete_invoice, restore_deleted_record
Needs Invoice drafts. Unsent drafts with no money only; anything else is voided. A delete can be undone.
Attach the estimate fileCoveredlink_invoice_estimate
Card checkout, refunds, the Stripe accountStays with a personMoney leaves or moves.
Void or delete an invoice that has payments (refund or keep as credit)Stays with a personMoney leaves or moves.

Numbers, receipts, purchasing

ActionStatusTools today
Numbers settingsCoveredsave_numbers_settings
Job costing and expensesCoveredsave_job_costing, move_job_cost
Upload a cost filePartlyingest_receipt
CFO reportsCoveredanalyze_numbers, draft_cfo_report, advise_cfo
Numbers date range (7d to last year, custom)Coveredanalyze_numbers, query_cfo_knowledge, draft_cfo_report
Receipts: upload, match, dismiss, voidCoveredingest_receipt, confirm_receipt, dismiss_receipt, void_receipt
Purchase ordersCoveredlist_purchase_orders, update_purchase_order

Customer messages

ActionStatusTools today
New email to a customerCovereddraft_client_email, send_client_email
Reply inside an email threadCoveredreply_email_thread
Never to an address on the email opt-out list. Needs Send client email.
Text a customerCovereddraft_sms, send_sms
Suggested replyCovereddraft_followup
Answer or ignore a customer questionPartlyanswer_customer_question, ignore_customer_question
The homeowner's push notice goes only from the app; they see it on the share page. Needs Send client email.
Reply on share page messagesPartlysend_share_message
The homeowner's push notice goes only from the app; they see it on the share page. Needs Send client email.
Ask for a reviewCoveredrequest_review
Email blastsPartlylist_email_blasts, save_email_blast, send_email_blast
Consented contacts only. Up to 500 recipients and one new blast a day from keys; larger lists send from the app. Needs an admin key issuer and Email blasts.
Bulk marketing opt-inStays with a personConsent has to come from the customer.

Team chat

ActionStatusTools today
Read a team chatCoveredlist_team_chat
Private assistant chats are never read.
Post to a team channelCoveredlist_team_threads, post_team_message
Push to crewCoveredsend_push_to_crew
Start or send a direct messageCoveredlist_direct_messages, send_direct_message
As the key's creator, behind its own off-by-default switch. No push.
Send a photo in chatPartlyshare_photo_in_chat
Shares a photo already on a job. New photos go through upload_photo and approval first.
React or deletePartlyreact_to_chat_message, delete_chat_message
Deletes only posts a key made.
Pin a chatStays with a personPins are each person's own sidebar.
Confirm a proposal in chatPartlydecline_chat_proposal
Declines a card. To go ahead, use the step's own tool. Multi-step assistant actions stay in the app.

Check-in review and photos

ActionStatusTools today
Publish check-insCoveredpublish_checkins
Unpublish or delete a check-inCoveredunpublish_checkin, delete_checkin, restore_deleted_record
Needs Field ops. Unpublish needs an admin key issuer. Delete takes discarded check-ins only and can be undone.
Edit captionsCoverededit_checkin
Approve photosCoveredapprove_photos
Its own grant.
Hide or unapprove a shared photoCoveredhold_share_photos, unapprove_photo
Create a share linkCoveredcreate_share_link
Portfolio detailsCoveredset_portfolio_details, move_portfolio_photo
Needs Job record. Title, tags, map pin, featured and photo order. Approving photos is Approve photos.

Admin and settings

ActionStatusTools today
Invite or resend an inviteCoveredsend_user_invite, resend_invite
Never as an admin.
Change a rolePartlyset_user_role
Lead or crew. Making an admin stays a person's tap.
Deactivate a userPartlydeactivate_user
Not a current admin.
Delete, restore or merge usersPartlydeactivate_user, restore_user, merge_users
Deactivate pauses someone; a full Delete stays in the app. Never an admin account.
Make invite codesStays with a personPezley platform only. A code lets someone start a new company.
Chat pairs and production crewsCoveredlist_people_setup, save_chat_pair, set_production_crew
Needs an admin key issuer.
Title access for one personStays with a personLive permissions, including money and admin access.
Team setup: titles and what each person can doStays with a personGiving people access stays a person's tap. Their links go out with send_user_invite.
Company info and settingsCoveredupdate_company_info, save_settings, save_estimate_settings, update_email_template
Upload a logoCoveredset_company_logo
PNG, JPEG or WebP. Padding is not trimmed.
WebhooksCoveredlist_webhooks, create_webhook, delete_webhook
Audit logCoveredlist_ops_receipts, list_activity
QuickBooks sync nowCoveredtrigger_quickbooks_sync
Google Calendar sync, CompanyCam linkCoveredtrigger_google_calendar_sync, companycam_link_project
Calendar sync reads the key owner's own calendar into Today; counts only.
Send a test email or textCoveredsend_test_email, send_test_text
Only to the key issuer's own email or mobile.
Recovery toolsCoveredrestore_schedules_from_history, scan_summary_scratchpad, wipe_job_summary, scan_missing_profiles, restore_user
Needs Advanced settings and an admin key issuer. The summary scan and wipe are Pezley maintenance only.
New clock company switchCoveredset_new_clock
Needs Advanced settings and an admin key issuer. Off by default; turn on for a test company first.
Connect or disconnect QuickBooks, Stripe, Google and other appsStays with a personYour own sign-in to each app.
Make, rotate, pause or revoke ops keysStays with a personA key never manages keys.
Texting registration and email domainStays with a personCarrier and domain checks.
AI automation consentStays with a personYour consent.
Subscription billing, deleting the companyStays with a personOwner only.
Publish Firestore rulesStays with a personRun from main by the owner.
Face ID lock on the iPhone appStays with a personAccount security, set on each phone.
Watch or replay the What's new cardsStays with a personOn-screen help for whoever is signed in; nothing to change.

Hub (shop iPad)

ActionStatusTools today
Punch a crew member in or outCoveredclock_in_user, clock_out_user
Hub iPad punches land as the same shifts; list_hub_log shows them.
Shop duties and low suppliesCoveredlist_shop_duties, set_shop_duty_item, set_shop_duty_supply
The hub iPad saves duty taps as the hub; list_hub_log shows them.
Pin or tick crew needs on the hub iPadPartlylist_crew_needs, add_crew_need, check_off_crew_need
Record only, like the iPad: a tick there saves as the hub or the person who tapped their name and never moves a tool.
Tick a job prep itemCoveredcomplete_checklist
Tick a crew list or mark a day step on the hub iPadCoveredcrew_day_steps, tick_crew_list_item, mark_crew_day_step
The iPad saves each tap as the person who tapped their name; list_hub_log shows it.
Record the homeowner walkthrough on the hub iPadCoveredjob_walkthrough, set_walkthrough
Record only. The iPad saves it as the person who tapped their name; list_hub_log shows it.
Download a work orderCovereddownload_proposal_pdf
See hubs and what each hub didCoveredlist_hubs, list_hub_log
Needs Hubs. The activity log needs an admin key issuer.
Set up a hub with a one-time code, rename or switch it offStays with a personA setup code is a way into the company, so it stays with a signed-in office or admin person, like invite codes.
Enter a hub code on the iPadStays with a personDone on the wall iPad itself; a key can't stand in for the device.
Smart home devicesNot yetIn the app for now.

Subcontractors

ActionStatusTools today
Invite a subCoveredsend_sub_invite
Edit a sub's profile for the scheduling assistantCoveredlist_sub_profiles, save_sub_profile
Needs Field ops.
Set who OKs dates first and what homeowners see about subsCoveredset_sub_homeowner_settings
Needs Field ops.
Edit, revoke or remove a subCoveredlist_sub_companies, edit_sub_company, list_sub_access, revoke_sub_access
Needs an admin key issuer. Crews and workers stay in the app.

Manage settings & pricing

In Settings → Portal Ops keys, open Scopes for new key and enable Manage settings & pricing (settings-write) before generating the key. For an existing named key, enable the same group and choose Save scopes. This high-impact permission starts unchecked. Explicit Full access includes it; legacy unscoped keys keep their original restrictions.

This permission allows changes to organization settings, product prices, production rates, estimate pricing, contract types, deposits and payment schedules. It applies only to the key's organization. The server checks the permission before writing; no Firestore or Storage rules update is needed to enable it.

ChangeTool or section
Company profile, branding, teams and contract copysave_settings, section main
Contract types, deposit percentages, payment phases, invoice automation and due dayssave_settings, section invoice
Billable hourly rate, tax, waste and default production ratessave_estimate_settings, or save_settings with section estimate
Product library prices and coveragelist_estimate_products / get_estimate_product, then upsert_estimate_product or delete_estimate_product
Production-rate librarylist_production_rates / get_production_rate, then upsert_production_rate or delete_production_rate
Descriptor library, including flat add-on pricesupsert_estimate_descriptor / delete_estimate_descriptor; use the library input schema
Other supported settingssave_settings sections companyContact, jobPrepTemplates, mrzProposals, washRoute, scheduleCrewFit, estimateAiPlaybook, clientAiPlaybook

Read, then patch

First call get_settings with a section to read its complete current configuration. Reading a complete section requires this permission too. Then call save_settings with that section and a nonempty patch containing only changed fields. Unrelated settings are preserved. Arguments go in input; top-level orgId must match the key.

{
  "action": "exec",
  "orgId": "YOUR_ORG_ID",
  "toolName": "get_settings",
  "input": { "section": "invoice" }
}
{
  "action": "exec",
  "orgId": "YOUR_ORG_ID",
  "toolName": "save_settings",
  "input": { "section": "invoice", "patch": { "dueDays": 14 } }
}

Arrays replace the stored array. To edit a contract type, read section invoice and its returned settings.contractTypes, update the intended entry and its paymentScheduleTemplate, and send the complete contractTypes array in the patch, preserving the other entries and their ids. Deposit percentages and contract defaults use the same validation as the Settings screen. For product and production-rate changes, use ids returned by list/get and the existing library tools:

{
  "action": "exec",
  "orgId": "YOUR_ORG_ID",
  "toolName": "upsert_estimate_product",
  "input": { "id": "PRODUCT_ID_FROM_LIST", "pricePerUnit": 72 }
}

When the toggle is off: save_settings returns ops-brief-scope-denied; production-rate writes return money-write-blocked; pricing fields on estimate-library/config writes return money-field-blocked. Other scopes do not grant these pricing changes.

Existing ChatGPT / Claude connections: enable the permission on the connection's key in Settings. If the connection returns ops-mcp-consent-stale, disconnect and reconnect through the normal Connect flow to approve the newly enabled tools. Refreshing tool metadata alone does not expand the original consent.

Provider credentials, verified email sender changes, API-key management, owner Numbers settings, accounting books and job contract amounts retain their separate controls. This permission does not send proposals, charge customers or approve photos.

AI assistants (integrator playbook)

For ChatGPT, MCP, Grok, Cursor automations, and custom bots. Field-level JSON lives in OpenAPI — this section is behavior, scope, and safe sequences (including estimate recovery patterns).

Authentication & tenant rules

RuleDetail
Secretppops_… in Authorization: Bearer or X-Pezley-Ops-Key (env: PEZLEY_OPS_BRIEF_KEY).
EndpointPOST …/portal-ops-mrz-tool — one action per request (brief, exec, company-state, log).
orgIdTop-level JSON only; must match the org embedded in the key. Mismatch → org-mismatch. Never pass orgId inside input (stripped server-side).
Tool inputtoolName + input for exec; schema PortalOpsInput_{toolName} in OpenAPI.
Rate limit60 req/min per key → 429 rate-limited with retryMs.

ChatGPT / MCP — setup, refresh & consent

  1. Create or open the Pezley Portal developer connection in ChatGPT. For the existing Ops-key flow, use https://pezleyportal.com/mcp with OAuth. Complete the normal Portal consent screen using an administrator-issued key. Never paste a key into chat or a server URL.
  2. For an existing plugin, use Refresh tools (or Refresh in its developer connection settings), then start a new conversation with that connection enabled. Check the actual available tool names and input schemas; the catalog changes, so there is no permanent tool count.
  3. Refresh updates tool metadata. New OAuth consent is a separate step: invoke the requested action, then let the user complete the normal authentication challenge if additional access is required. Reconnect can retain the previous scope; refresh alone grants no permissions.
  4. Verify with the smallest relevant read. For Estimate Library questions, use the structured calls below; a successful morning brief does not verify library access.
RouteDiscovery and authorization
/mcpHosted MCP. Root discovery: /.well-known/oauth-protected-resource and /.well-known/oauth-authorization-server. The issuer is https://pezleyportal.com; the resource is https://pezleyportal.com/mcp. Supports estimates:read, mrz, portal:control, and portal:ops:v1.
/ops-connectAlso routes MCP requests to the hosted MCP handler. Its separate discovery URLs end in /ops-connect: /.well-known/oauth-protected-resource/ops-connect and /.well-known/oauth-authorization-server/ops-connect. Both issuer and resource are https://pezleyportal.com/ops-connect. This one-click Connect flow uses Portal sign-in and selected Ops scope groups, issues a hidden named key, and excludes owner finance and app import. Follow its supplied Connect flow; do not mix its OAuth discovery with the root flow.

Anonymous initialize / tools/list expose discovery metadata, not organization data or authorization. Both routes share the current MCP handler; its tool authentication challenges point at the root resource metadata. Do not assume the alias has separate tools or rewrite authorization URLs to force a scope.

Two permission layers: every call intersects the current Ops key tools with the original OAuth allowed-tool list, for scoped and full-access keys alike. OAuth scope and the original tool list stay unchanged through refresh. For portal:ops:v1, a missing allowed-tool list fails closed. Narrowing a key takes effect immediately. Widening a key or adding tools such as Home File does not expand an existing grant; complete fresh consent to add access. Rotation or revocation invalidates grants derived from that key. The connection lifetime setting applies to new root-flow connections; existing deadlines remain unchanged.

Authentication and denial apply to the connection
If ChatGPT reports that the app needs reauthorization, pause dependent Portal calls and have the user complete the normal connection flow. This can block unrelated tools in the same app. Do not switch to batch, another wrapper, raw HTTP, another key, or manually altered OAuth URLs to get around an authentication or permission denial. If consent is declined, stop that operation and report the exact error. Resume only after access is restored through the supported flow.

Read the organization's Estimate Library explicitly

read_proposal reads one proposal and its estimate snapshot; the morning brief summarizes operations. Neither embeds the organization's full Estimate Library. A missing product or rate in either response does not mean the library is empty.

Use mrz_exec with structured toolName and input. These read calls work with mrz or portal:control OAuth access when the underlying key permits them. Product reads and analyze_rate_book require the proposals-estimates or settings-write key scope; production-rate reads require production-rates or settings-write (or full key access). Pricing changes require settings-write.

mrz_exec({"toolName":"list_estimate_products","input":{}})
mrz_exec({"toolName":"get_estimate_product","input":{"id":"PRODUCT_ID_FROM_LIST"}})
mrz_exec({"toolName":"list_production_rates","input":{}})
mrz_exec({"toolName":"get_production_rate","input":{"id":"RATE_ID_FROM_LIST"}})
mrz_exec({"toolName":"analyze_rate_book","input":{}})

Optional input.query filters list results. Lists return products or rates plus count; get calls return product or rate. Copy IDs from list results. Product documents can contain saved price, coverage and PDS fields; rate documents contain the saved production assumptions. analyze_rate_book returns counts, estimate settings and gap flags, not every library row. Do not invent missing prices, coverage, rates or IDs.

Batch has different consent checks: for these library reads, portal_ops_batch requires portal:ops:v1 through per-operation authorization, even though its outer metadata advertises mrz / portal:control. Likewise, the corresponding ops_ tools require Ops parity consent. A batch authorization error is not evidence of missing library data. Choose ordinary mrz_exec for this workflow from the start; after a denial, resolve consent rather than retrying through another path.

Copyable assistant prompt

Use my connected Pezley Portal to read the organization's Estimate Library. Inspect the available tool schemas first. Use mrz_exec with structured toolName/input: list_estimate_products, list_production_rates, and analyze_rate_book; use get_estimate_product/get_production_rate with IDs returned by the lists when details are needed. The library is not embedded in read_proposal or the morning brief. Report saved values and missing fields without guessing. Do not modify records. If the app requires reauthorization or denies access, stop dependent calls, show the exact error, and use the normal user consent flow; do not bypass it.

Portal jobId vs PO / estimate number

Firestore ids (e.g. JOB_ID_FROM_LIST) are not the customer-facing PO/quote printed on the PDF. Resolve jobs with list_jobs view: "index" plus search or jobNumber, search_leads, or read_job — match on job name (PO/quote, e.g. QUOTE_NUMBER) and put the person in customerName (job naming).

The HTTP proposal schema supports estimateId or a linked jobId. The direct MCP save_proposal_draft shortcut deliberately requires estimateId. Read the proposal first and use the returned ID; this intentional schema difference alone is not evidence of a stale connector. Inspect the schema of the exact tool you are calling.

CRM leads — create_lead / list_leads / get_lead

Scope lead-intake (opt-in; not included in leads-crm, business-data, or Full access *). create_lead writes a Sales → Leads CRM row. It dedupes on normalized phone, then name, returns leadId + portalUrl + created/existing, and never texts, emails, or notifies anyone — and never creates an estimate job or appointment. list_leads and get_lead return full website CRM records and linked consent docs (including phone numbers). All three tools share the 10/minute opt-in group rate limit. Ops-key writes still need the Idempotency-Key header.

POST /.netlify/functions/portal-ops-mrz-tool
Authorization: Bearer ppops_…
Idempotency-Key: lead-create-CUSTOMER_PHONE
{
  "action": "exec",
  "toolName": "create_lead",
  "input": {
    "name": "Example lead",
    "phone": "CUSTOMER_PHONE",
    "email": "CUSTOMER_EMAIL",
    "address": "CUSTOMER_ADDRESS",
    "notes": "Exterior trim — call back after 3pm",
    "type": "callback",
    "callbackAt": "2026-11-10T15:00:00.000Z"
  }
}

Look up afterward with list_leads / get_lead. Booking a visit or drafting a proposal is a separate later step with its own scopes — this tool does not create those.

Move one CRM lead — set_lead_stage

Scope lead-stage (opt-in; not included in Full access *). A leads-crm key can edit contact fields with update_lead and cannot change the stage. Legacy unscoped keys do not get this tool. set_job_status changes a job, not the CRM lead.

Send one leadId, a stage that already exists (new, contacted, estimate_scheduled, won, lost, spam, or the same labels such as Lost), and confirm: true. The Idempotency-Key header is required. One lead per request — not a list, and not action: "batch". The call uses the 10/minute opt-in group rate limit. Lost and Spam also retire the unsold estimate, the same path a declined proposal uses. Nothing is emailed or texted.

POST /.netlify/functions/portal-ops-mrz-tool
Authorization: Bearer ppops_…
Idempotency-Key: lead-lost-SYNTHETIC_LEAD_ID
{
  "action": "exec",
  "toolName": "set_lead_stage",
  "input": { "leadId": "SYNTHETIC_LEAD_ID", "stage": "lost", "confirm": true }
}

Fast paths (1–2 calls for bots)

Proposal sends cannot be included in atomic:true batches (atomic-send-not-supported). Send separately after approval; an email cannot be rolled back.

Use action: "batch" with up to 20 ordered ops[] — counts as one weighted rate-limit request. Typical estimate edit:

{
  "action": "batch",
  "orgId": "your-org",
  "atomic": true,
  "ops": [
    { "toolName": "read_proposal", "input": { "estimateId": "…", "view": "scope" } },
    { "toolName": "save_proposal_draft", "input": { "estimateId": "…", "ifVersion": 2, "customerSummary": "…" } }
  ]
}
  • Reads: default view: summary (includes writeVersion). Use scope before patching rooms; full only when needed.
  • Writes: save_proposal_draft returns updatedState (default returnView: scope) — skip a verification read_proposal when the write succeeds.
  • PDF: download_proposal_pdf returns a short-lived signed URL by default; includeBase64: true only when required. Cache warms in the background after save/send.
  • MCP: portal_ops_batch mirrors HTTP batch; tool hints mark reads vs destructive writes.

Proposal write safety (save_proposal_draft / restore_proposal_revision)

Every successful write returns writeVersion, changeSummary, and recomputed totals. HTTP responses include X-Request-Id, X-RateLimit-Remaining, and Retry-After on rate limits. Send one stable Idempotency-Key request header for every intentional write, including hosted MCP. Reuse it for retries; a body field alone does not satisfy the required header. Retry retention depends on the tool; durable receipts may outlive 24 hours.

ControlField / headerBehavior
Optimistic lockifVersion ← read_proposal → estimate.writeVersionOptional. Mismatch → HTTP 409, code: version-conflict, plus currentVersion. Omit for legacy callers.
IdempotencyIdempotency-Key request headerRequired for every key write. Reuse the header for retries; changed intent with the same key conflicts. Body-only keys return 400 idempotency-key-required.
Dry rundryRun: trueValidates patch, returns changeSummary + totals without Firestore write.
Revisionsrestore_proposal_revisionEach persist snapshots the prior draft under estimates/{id}/revisions (server-only). Restore with revisionId from that history.
Strict shapetop-level keys onlyUnknown fields → 400 unknown-field with unknownFields. Do not round-trip the full estimate object from read_proposal.

Estimate Builder (in-app) sends ifVersion on save so owner edits and ops bots cannot clobber each other; on conflict the owner sees a reload banner.

Estimates & proposals — recommended tool sequence

Scope proposals-draft (or deprecated proposals-estimates) or *. Canonical loop: read_proposal → save_proposal_draft → read_proposal. Patch only fields you intend to change; confirm estimate.totals, room substrates, and line items on the second read.

○list_proposals optional → 1read_proposal { jobId } → 2create_estimate if no draft → 3save_proposal_draft delta only → 4read_proposal verify → 5Staff review & send in Portal

SENT estimate: reopen_proposal_draft → edit → read_proposal → send_proposal. See Proposals.

Pending primary sends: request a fresh preview and confirmation, including on same-key retries and old claims. confirm:true alone is refused. The reviewed subject/body/SMS, branding, frozen proposal and recipient are bound through delivery; changed copy needs new approval.

Save a second recipient: read_proposal returns customer.secondaryRecipientEmail. Use set_proposal_secondary_email with one email and the current expectedEmail (empty if absent). An empty email removes it. Saving never sends and preserves the primary customer email.

Send to that second recipient: resend_proposal_email with a matching email and useSecondaryEmail:true. Ops HTTP first returns a read-only preview. Show recipient/content; only after approval repeat with confirm:true, confirmedRecipient and confirmationDigest, using the same send key for retries. The second email is never included automatically. Hosted sends require the selected send scope and fresh connection consent.

SENT estimate, second person: resend_proposal_email with estimateId + one email — emails the same link; nothing on the proposal changes.

SENT estimate: reopen_proposal_draft → edit → read_proposal → preview and confirm the send. Ops keys with Proposals & estimates can preview and explicitly confirm a proposal send; hosted sends require fresh consent and the selected proposals-send grant. See Proposals.

Scope-loss failures can come from wiping scope with empty arrays or round-tripping compact read_proposal JSON — use targeted patches and verification reads instead.

Staging drafts — build a mock-up first, push once (v2434)

Use a staging draft when you are building or reworking an estimate over several calls and the estimator should approve it before it becomes real. The draft is saved on the server from the first call, so nothing is lost if your session ends or you forget a final save. The real estimate is not touched until push_staged_estimate. Scope proposals-draft. Writes take an Idempotency-Key header like every other write.

1stage_estimate_draft returns draftId → 2update_staged_estimate as often as needed → 3Estimator OKs the mock-up → 4push_staged_estimate
StepWhat happens
stage_estimate_draftBase it on estimateId (a draft), on jobId (its draft, or a blank one), or on nothing. Takes the same fields as save_proposal_draft and reprices with today's rates and products. If a draft is already open for that estimate it is returned (reused:true); pass startNew:true for a second one. estimatorUid picks who gets reminders.
update_staged_estimateEdit by draftId; same merge rules as save_proposal_draft. Optional ifDraftVersion lock. Every edit resets the reminder clock.
get_staged_estimate / list_staged_estimatesRead one draft (totals, rooms, lines) or list open drafts. Each row carries idleDays and nextReminderAt.
push_staged_estimateThe server recomputes every total and rechecks the rates, products and estimate settings the draft used. If any changed it stops with 409 rates-changed and a rateChanges list: show it to the estimator, then push again with acceptRateChanges:true. It updates the estimate the draft came from (version-gated, with an undo revision) or creates the job's estimate. A retry, with any key, never makes a second estimate (alreadyPushed:true). Never sends to the customer.
keep_staged_estimate"Keep working": renews the draft so its reminder starts over.
discard_staged_estimateOnly when the estimator says so. Needs confirm:true. The draft is marked discarded and kept on file; nothing is deleted.

Never deleted automatically. After one day untouched, the estimator (or the company's admins when no estimator is set) gets a "Still working on this estimate?" push notification and email, then again at 3 and 7 days, then weekly, during company hours. The Proposals page lists open drafts with Keep working, Push and Discard.

Other push stops (nothing written): base-changed — someone edited the real estimate after staging; read both, then overwriteBaseChanges:true if the estimator agrees. job-required — a draft staged with no job; pass jobId (use create_job first if needed). job-has-draft-estimate — the job gained its own draft meanwhile; pushIntoExisting:true overwrites it.

Example (made-up data): stage for job job_demo_123 with one room, "Sample Den", 12 × 10 × 8 ft, walls two coats; update with notes:"Patch nail pops"; the estimator approves; push. If the wall rate changed in between, the push stops and lists { "kind": "production-rate", "id": "rate_demo_walls", "change": "changed" }.

{ "toolName": "stage_estimate_draft", "input": { "jobId": "job_demo_123", "title": "Sample Den repaint",
  "areas": [{ "id": "room_demo_1", "name": "Sample Den", "length": 12, "width": 10, "height": 8,
    "substrates": [{ "id": "sub_demo_walls", "productionRateId": "rate_demo_walls", "productId": "prod_demo_eggshell", "coats": 2 }] }] } }
{ "toolName": "push_staged_estimate", "input": { "draftId": "stg_demo_abc" } }

Voice estimating (hosted MCP)

For live phone takeoff with ChatGPT + Portal Ops MCP + Plaud/Granola connectors. Goal: one tool call per spoken instruction — no long silent chains.

  1. Check context first: call read_estimate_handoff with estimateId, jobId, or jobRef. Review prior decisions, unfinished work, linked recordings, and attached note summaries. This works with the proposals-estimates scope.
  2. Call estimate_context once at the start of every conversation (jobRef, today, or YYYY-MM-DD) and keep the result. Scope: full-access key (*); narrower estimate keys use read_estimate_handoff and estimate_snapshot.
  3. Find the matching recording from recordingSearch (window = visit start minus 15 minutes through visit end plus 60 minutes, in America/Chicago and ISO) and keywords (customer last name, street, PO). Use list_recordings to browse the org’s connected Plaud/Granola account and read_recording_transcript to read the speech (follow nextOffset until null). A summary is separate from a transcript; transcriptAvailable:false means speech is unavailable. Then link_recording with estimateId or jobId/jobRef (proposals-estimates or jobs-files). Personal recording accounts are not browsed by these tools.
  4. Make one update_estimate call per spoken instruction (preferred over read_proposal → save_proposal_draft → read_proposal). Example: “add a 12 by 14 bedroom, walls and ceiling, two coats.”
  5. Do not re-read the full proposal after writes — update_estimate returns compact rooms/lines/colors and recomputed totals.
  6. Give a short spoken acknowledgement before slow calls.
  7. Read back only totals and changed rows.
  8. Ask the owner only when truly ambiguous: two visits in the same window, or no recording found.
  9. Leave context after work: call add_estimate_note with what changed, key decisions/assumptions, open questions, and next steps. Keep each note under 1,000 characters. Reuse the same Idempotency-Key header only when retrying that note. The shared Office handoff allows 4,000 characters total and preserves existing notes; if full, ask staff to condense it.

Internal only: handoff notes appear to the estimator in Office handoff. They are stored separately from estimates and never included in client proposals, PDFs, share pages, or customer AI. Never paste internal context into customer-facing estimate notes. These tools require proposals-draft (or the deprecated proposals-estimates alias or full access). Existing MCP connections must complete fresh consent to gain newly added tools.

For the note write, send the request header Idempotency-Key: bedroom-handoff-1.

{"action":"exec","orgId":"YOUR_ORG_ID","toolName":"read_estimate_handoff","input":{"jobId":"job-123"}}
{"action":"exec","orgId":"YOUR_ORG_ID","toolName":"add_estimate_note","input":{"jobId":"job-123","note":"Updated bedroom walls and ceiling. Confirm trim sheen before sending."}}

update_estimate resolves natural jobRef server-side (PO, customer, address, jobId). Ambiguous refs return a short candidate list — never guess. Merge-only: empty arrays are no-ops; explicit removeAreaIds / removeDescriptorIds / removeColorIds only. estimate_snapshot is the lean read-back tool when needed.

create_estimate vs save_proposal_draft

ToolRoleMerge semantics
create_estimate Mint a blank draft on an existing job (jobId required). Does not create jobs, rooms, or send email. If the job already has a draft estimate, returns that draft (reused: true). Non-draft linked estimate → estimate-already-linked. Stale job.estimateId pointing at a missing doc is relinked instead of minting a second blank when the handler can recover.
save_proposal_draft Patch an existing draft (needs estimateId or resolvable jobId). Firestore set(..., { merge: true }) with guarded payloads: partial top-level fields; areas[] merged by room id; lineItems / colors merged by row id unless replaceLineItems / replaceColors. Server ignores client totals and recalculates from scope. OpenAPI: PortalOpsInput_save_proposal_draft.

What to include on save_proposal_draft

IntentFields (include only what changes)
CopycustomerSummary, notes, crewNote, exclusions (exclusions shape)
Structured paint colorscolors merge by id; removeColorIds, replaceColors, clearColors — see estimate colors
Line items / optionslineItems merge by id; replaceLineItems:true. Flat amount: see the pricing rule
Remove line itemsremoveLineItemIds (line id or descriptorId) — draft only, idempotent; returns removedLineItemIds / lineItemIdsNotFound
Change one room or linepatchArea / patchLineItem: { id, ...fields to change }. An unknown room or line id is an error and saves nothing. A substrate id that is missing or not already on that room is substrate-not-found and saves nothing — add a new surface through areas
PricinghourlyRate, taxRate, discount, wastePercent
Base descriptorsdescriptorIds / selectedDescriptors / descriptors (merge-add catalog rows)
Detach descriptorsremoveDescriptorIds / detachDescriptorIds (catalog descriptorId or line id) — draft only; returns removedDescriptorIds / descriptorIdsNotFound
RoomsOne areas[] object per room with stable id + changed fields (L×W×H when adding rooms)
Remove roomsremoveAreaIds — not areas: []

Estimate pricing rule

PRICING RULE: price painting and staining through areas[] (substrates with productId, productionRateId, coats) so the crew work order gets hours and materials. Use a flat-priced lineItem only for an add-on such as lift or equipment rental (set flatAddOn:true). Never add a separate paint/stain materials line; materials come from the products on area substrates.

GOOD: areas:[{name:"Living room",length:18,width:15,height:9,substrates:[{name:"Walls",productionRateId,productId,coats:2}]}] plus lineItems:[{name:"Boom lift rental",amount:1200,flatAddOn:true}]. BAD: {name:"Exterior painting",amount:4800} (painting as a flat price, so no crew hours); {name:"Paint and materials",amount:650} or {name:"Duration (5 gal)",amount:450} (separate materials line).

Guidance only: the server does not reject lines for their price.

CodeMeaning
descriptor-scope-requiredupsert_estimate_descriptor was called with an estimate, proposal, job or customer key, or with hours, dimensions, substrates, or rate/product ids. Nothing is written. It edits the shared library only: resend without those keys (scope:"library" does not override them), or use save_proposal_draft for one estimate. price and flatAddOn may be stored for an add-on such as a lift rental.
substrate-not-foundpatchArea named a substrate id that is missing or not on that room. Nothing is saved. Add the surface through areas.
unknown-fieldResponse includes allowedFields — the keys the tool accepts.

edit_job with hoursEstimate updates the job stamp only — not Estimate Builder takeoff hours. Use save_proposal_draft for builder scope.

Anti-patterns (wiped hours / lines)

Do notWhy
areas: [] or lineItems: []Probe payloads; server strips dangerous empties — agents must not send them.
Room patch with substrates: []Clears all scope lines on that room unless you intentionally clear with clearSubstrates: true; empty substrates are ignored when existing lines remain.
replaceDescriptors: true with no idsUsed to wipe descriptors; treated as no-op when it would delete everything.
Save full read_proposal JSON backCompact read rows omit builder fields — patch deltas only.
create_estimate when job already has scopeReuses draft when linked; do not use as a “reset”. Prefer read_proposal + targeted patches.
totals-only save_proposal_draftDoes not rebuild missing scope; fix rooms/descriptors first, then verify totals on re-read.
Partial draft without colorsSafe — omit colors to leave existing rows untouched.
colors: [] aloneNo-op (probe payloads stripped). Use clearColors:true or removeColorIds to delete rows.
Trimmed colors without replaceColorsSafe — merges by id; rows you omit are kept. Use replaceColors:true only when rewriting the whole section.
Client-sent totalsIgnored — totals are always recomputed from scope after save.
Inventing colors not in estimate textBuilder “Suggest from scope” only extracts mentions (SW/BM codes, known names). Ops/API rows should set source: "ops" when adding manually.

Structured estimate colors (estimate.colors[])

Same field on the Firestore estimate as Estimate Builder → Colors (optional, collapsible). Not the customer share job.colorPlan picker — that stays on set_job_colors after deposit.

ReadWhere
read_proposalestimate.colors — rows with areaId, areaName, optional scope, brand, code, name, display, notes, source, optional citation
read_jobjob.estimateColors — same shape when job.estimateId is set

Write: save_proposal_draft with colors rows (each has a stable id from read_proposal or derived from area+scope+code). Default is merge by id — upsert the rows you send, keep the rest. Remove with removeColorIds; full replace with replaceColors:true; clear all with clearColors:true. colors: [] alone is a no-op. Omit colors on unrelated patches.

source: manual (estimator in builder), ai-extract (text scan — include citation when present), ops (API/automation). Estimate Builder saves the full in-app list with ids — same merge rules apply when rows include stable ids.

Example: { "estimateId": "…", "colors": [{ "areaId": "living-room", "scope": "Walls", "code": "SW 7029", "name": "Agreeable Gray", "display": "Agreeable Gray (SW 7029)", "source": "ops" }] }

High-risk scope groups

Settings asks for extra confirmation when enabling these on a new key. Issue separate keys per automation when possible.

ScopeRiskExamples
owner-financeOwner $ — margin, burden, CFO, bank, job costinganalyze_numbers, save_job_costing
proposals-estimatesCustomer-facing proposals & sendsend_proposal, save_proposal_draft
jobs-filesJob CRUD, uploads, delete filesdelete_job_file, upload_job_file
settings-writeOrganization settings, pricing and contract defaultssave_settings, upsert_estimate_product, upsert_production_rate
crew-clockPayroll-affecting clock & shiftsclock_in_user, edit_shift
app-importBulk contacts, jobs, estimates, invoices — Import from another appcommit_app_import, undo_app_import

Medium-risk groups (action-feed, job-delays, job-status, scheduling, company-state) still mutate production data — scope narrowly.

Answer customers (scope client-comms-send)

Find the conversation with list_messages: email threads carry a threadId, share page questions and messages carry an id and jobId. Every tool that reaches a customer previews first; repeat with confirm:true only after the owner says yes in chat.

Invoice send times use scope invoices-send: schedule_invoice_send (preview, then confirm:true; 30 seconds to 90 days ahead) and cancel_scheduled_invoice_send. Neither charges a card.

Job record (scope job-record)

An opt-in group: Full access leaves it off. Start with read_job_record for the job's Paid mark, products, color plan rooms and color photos, prep sheet and office handoff notes (with their revision). It shows no prices and no photo links. None of these tools reaches a customer by itself.

Archiving a job with set_job_status returns its checked-out tools to the shop, like the app, and the result says how many.

Contacts and leads (scope contacts-leads)

An opt-in group: Full access leaves it off. These tools add and merge contacts, make Home File links, pause or stop one customer's follow-ups and resend a website lead. None of them emails or texts a customer by itself.

Linking a contact to a job is edit_job with contactId. A merged or deleted contact cannot be linked.

Decline a proposal (scope estimates-advanced)

decline_proposal is Decline estimate in the Estimate Builder, for a sent estimate whose job still has its customer share link on. Without confirm:true it previews the customer, the email address and whether the job will be archived. Confirmed, it marks the estimate declined, archives the job unless it is already in production, moves a linked website lead to Lost, alerts the office and emails the customer the app's "what could we have done better" note. The optional reason is a note for your team and is not in the email. A key can't undo a decline, and it runs once per Idempotency-Key.

Payment schedule, reopen and attach an estimate (scopes owner-finance, invoices-draft)

Three invoice actions from the app. Each previews without confirm:true, runs once per Idempotency-Key, and never emails, texts or charges the customer.

Deleting an invoice is not a key action yet; the app only deletes invoices with their job.

Schedule suggestions (scope scheduling)

The app's schedule suggestions are the cards on the Schedule queue: suggested dates, hours, crew lead and crew for a job. A key works the same cards; making new suggestions stays in the app. None of these tools notifies the crew or the customer.

Each write needs an Idempotency-Key and confirm:true after the preview. To move a job by hand, use edit_job_schedule.

Team chat (scopes team-comms and direct-messages)

A key speaks in team chat as its owner: the person who created the key, never whoever last changed its settings. Its messages show the owner's name and are marked as a key post, and the owner must still be an active admin or office member. Chats are Company (company), a team (team:<teamId>), a job chat (job-chat:<jobId>) and the owner's own direct messages. Private assistant chats are never read or written. None of these tools sends a push, text or email.

Direct messages have their own switch, direct-messages. It is off by default, Full access does not include it, and only the key's owner can turn it on. If anyone else rotates the key, the switch turns off (the rotate response says directMessagesTurnedOff: true) and the owner turns it back on. Without it, list_direct_messages, send_direct_message and any dm: chat return direct-messages-scope-required. A key made before owners were recorded returns key-owner-unknown for direct messages; issue a new key.

Messages the app's chat safety filter would block are refused. Each write except post_team_message previews first and needs an Idempotency-Key and confirm:true. Pinning a chat stays in the app, because pins are each person's own.

People setup, logo and test sends (scopes people-access and settings-advanced)

Both groups are opt-in, and every tool here needs the key's issuer to be an admin, like Admin in the app. A key never pairs, restores or merges an admin account. Each write previews first and needs an Idempotency-Key and confirm:true. Nobody is notified.

Stays with a person: a person's own Title access (their live permissions, including money and admin access), making anyone an admin, a full Delete of a person, and invite codes.

Email blasts (scope email-blasts)

Opt-in, and every tool here needs the key's issuer to be an admin, like Email blasts in the app. A blast goes only to contacts who gave marketing consent and have not unsubscribed. Every email carries the company's postal address and an Unsubscribe link, and nobody gets the same blast twice.

Limits: a key sends to at most 500 contacts (send larger lists from the app), and keys start at most one new blast per company in 24 hours. Finishing a blast that already started does not count. A blast cannot be unsent. Admins get a notice when a key sends one.

Stays with a person: marketing opt-in. Consent has to come from the customer, so no tool marks anyone as opted in.

Hubs (scope hubs)

Opt-in and read only. A hub is a wall iPad set up with a one-time code from Settings → Hubs (admins) or Profile → Hubs (office). Nobody signs in on a hub, and it can only do hub things.

Stays with a person: making a setup code, renaming a hub and switching one off. A code is a way into the company, like an invite code.

Common error code values

HTTP layer returns { error, code, message?, hint?, toolName?, allowed? }. message says what happened. hint is one sentence the assistant can act on. Full enum: OpenAPI PortalOpsError. Tool-level failures may be 400 with domain codes (e.g. estimate-not-found).

CodeTypical causeFix
ops-brief-scope-deniedTool not in any enabled scope groupEnable the group in Settings or pick a different tool; check allowed in the response.
briefing-scope-requiredbrief / company-state without briefing-readAdd briefing-read to the key.
finance-scope-requiredNumbers / CFO tool without owner-financeAdd owner finance scope or use a non-finance tool.
numbers-cap-requiredFinance read/write when the signed-in user lacks Numbers cap (in-app admin chat path; rare on pure ppops_ flows)Org admin with Numbers access, or adjust automation to non-finance tools.
send-blockedshare_proposal / publish_proposal aliasesSave the draft; staff send from Portal.
proposal-confirmation-staleRecipient or proposal changed after previewRead again, show the new recipient/content, and request fresh confirmation.
money-write-blockedProduction-rate writes without settings-write, or save_job_costing, save_numbers_settings and bank match / reconcile on an ops keyEnable settings-write for production-rate changes. Accounting-book writes remain staff actions.
money-field-blockedContract amount, price, cost, rate, deposit %, tax on add_job / pricing-config writesEnable settings-write for product, descriptor and estimate-settings pricing. Job money fields remain restricted; remove the fields listed in unknownFields.
customer-confirmation-requiredbook_estimate_visit / book_client_visit without customerConfirmed: trueConfirm the time with the customer first, then retry.
drip-enable-blockedupdate_drip_sequence with enabled: trueEdit the sequence; staff turn it on.
bad-cursorData API cursor from another tool or filter setRestart paging without cursor.
create-estimate-blockedpersist_takeoff / save_takeoffcreate_estimate + save_proposal_draft.
ops-mcp-consent-staleScoped or full-access key allows an action outside this Ops grant's original consent snapshotObtain new portal:ops:v1 consent through normal Connect. Refresh tools alone cannot repair consent.
insufficient_scopeOAuth grant lacks the requested action scopeFollow the normal mcp/www_authenticate challenge. Library reads inside batch request portal:ops:v1. Do not bypass the denial.
invalid_token / Reconnect Pezley Portal to continue.Missing or invalid connection token, or changed session identityPause dependent calls and reauthorize the app normally.
invalid_grantOAuth exchange/refresh grant is invalid, expired, revoked or replayedStart a fresh supported Connect flow; a tool-metadata refresh is separate.
New Ops consent is required. / ops-consent-requiredOps grant lacks its allowed-tool listComplete new explicit Ops consent; never manufacture a grant.
estimateId or jobId requiredPDF/reopen call has no targetResolve the proposal ID first. For a direct draft shortcut schema error, supply its required estimateId.
ops-key-pausedAn admin paused this key (HTTP 403)Stop and tell the owner. An admin resumes it in Settings → Portal Ops keys.
ops-key-expiredThe key passed its expiry date (HTTP 401)Stop and tell the owner. An admin rotates it or sets a new expiry.
active-admin-or-office-requiredThe person who made or last re-scoped the key is no longer an active adminAn admin rotates the key in Settings → Portal Ops keys. Do not retry.
direct-messages-scope-requiredA direct message tool or dm: chat on a key without the direct-messages switchThe key's owner turns on direct messages in Settings → Portal Ops keys, or skip direct messages.
key-owner-unknown / key-owner-not-activeDirect messages on a key made before owners were recorded, or the key's creator is no longer an active admin or office memberIssue a new key from the person the key should speak as. Do not retry.
ops-key-no-longer-authorizedThe key was rotated, revoked or re-scoped after it was checkedUse the current key; re-read scopes with describe.
ops-writes-pausedAn admin paused every key's writes for the org (HTTP 503)Reads still work. Wait for an admin to resume writes.
admin-promotion-needs-person / admin-invite-needs-personTried to make someone an admin or invite them as adminA person does it in the app: Settings → Team.
cannot-change-admin-role / cannot-deactivate-admin / cannot-edit-adminTried to change, rename or deactivate a current adminA person does it in the app: Settings → Team.
org-mismatchBody orgId ≠ key orgPass the correct top-level orgId.
rate-limited> 60 req/min on this keyBackoff using retryMs.
scopes-emptygenerate-key with no scopesPass explicit scope ids or ["*"].
unknown-fieldBody used args or another undocumented top-level keyMove tool arguments to input. Remove the unknown field named in message.
job-not-foundNo job for the id that was triedmessage includes the identifier. Call list_jobs with view: "index" and search (or jobNumber), then retry with that jobId.

Blocked uploads: vendor-invoice-key-required — see blocked tools. Import codes (import-file-too-large, preview-expired, …): Import from another app.

Scheduling (scope scheduling)

Keys with Scheduling & visits get the same server tools the in-app schedule assistant uses for bars, spots, crew assignment, visits, delays, and shift reads — not a read-only subset. Issue scheduling alone for a schedule bot; add production-rates if the assistant needs rate-book capacity hints.

Estimates & exclusions

Estimate drafts use create_estimate (blank draft on an existing job) and save_proposal_draft (rooms, descriptors, pricing, exclusions). Scope proposals-estimates or *. Use the job's Portal jobId, not the printed estimate number. Automations: see AI assistants before editing drafts.

Exclusions shape (required pattern)

Exclusions are what is NOT included — never stuff them into descriptor description or room notes. OpenAPI documents exclusions as:

{
  "action": "exec",
  "orgId": "your-org-id",
  "toolName": "save_proposal_draft",
  "input": {
    "estimateId": "ESTIMATE_ID",
    "exclusions": [
      "Soffits and fascia are excluded.",
      { "text": "Moisture repairs behind siding are excluded." }
    ],
    "customerSummary": "Prep and paint main body per scope."
  }
}

Rooms need length, width, and height (or sqft) to persist. Per-room notes: "" clears; omit to keep. Patch rules: AI assistants.

Proposals

Typical Hub flow (scope proposals-estimates or *). New blank draft: create_estimate first; existing job: start at read_proposal. See AI assistants.

1read_proposal → 2save_proposal_draft → 3read_proposal verify → 4Staff send in Portal

Jobs, delays & limbo

Jobs & files (jobs-files): create_job / add_job, edit_job, uploads, work orders, rename, hours, tasks. Use PO/quote as name — see job naming.

Delays (job-delays): post_job_delay with customer-visible copy; optional polish_delay_reason to tighten wording. Same semantics as crew check-in Delay.

Status & limbo (job-status): set_job_status for active, accepted, limbo, completed, archived; polish_limbo_reason for staff-facing limbo notes; flags for general / T&M jobs per OpenAPI schema.

{
  "action": "exec",
  "orgId": "your-org-id",
  "toolName": "post_job_delay",
  "input": {
    "jobId": "JOB_ID",
    "delayKind": "rain",
    "reason": "Storms — crew rescheduled to Thursday."
  }
}

Staff Home File

The home-file scope (or Full access) grants read_home_file, set_home_file_access, set_home_file_formulas and set_home_file_leftovers. Jobs & files and morning brief scopes do not grant these tools. Gate codes, lockbox details, access notes and pets remain staff-only; these tools do not send or publish a customer Home File.

For formulas or leftovers, pass jobId and the matching row list. A matching row id replaces that row; a new row appends. removeIds removes selected rows, and replace: true replaces the whole list. Rows and parent metadata commit together. Concurrent edits to separate rows survive, and a failed transaction commits nothing. Each job save keeps the existing cap of 60 formulas or 40 leftovers; the response reports dropped overflow rows.

Use items[] for up to 20 jobs. Each job is a separate transaction: a later failure does not undo a job already saved. Prices are stripped from the timeline and row text. Use the supported consent flow if the requested tool is denied; changing a key or refreshing metadata does not upgrade an OAuth scope.

Owner finance scope

Margin, burden and CFO reads require owner-finance. Job-costing writes require the explicit opt-in job-costing-write grant; invoice drafts and sends have separate invoice grants. Bank tools remain prohibited for every Ops key. Without it, finance tools return 403 with finance-scope-required.

Tools include analyze_numbers, advise_cfo, query_cfo_knowledge, list_cfo_packs, draft_cfo_report, related owner-finance reads — full list under owner-finance in the scope table above and in OpenAPI x-portal-ops-scope-appendix.

High risk
Issue finance scope only to automations you trust with owner-level dollars. Crew-facing keys should omit owner-finance.

Import from another app

The same importer as Settings → Import from another app, on the Portal Ops key. It reads a PaintScout export (the .tar.gz, or its loose files) or the spreadsheet template CSV, matches it against this org's jobs, contacts, estimates, and invoices, and imports the result as one batch you can undo. DripJobs is coming soon.

Who can call it: keys with the app-import scope (high risk) or Full access, and org-admin ID tokens. One-click Connect (ChatGPT / Claude) cannot grant app-import — issue a manual key. Every write lands in the key's own org; orgId inside input is ignored and a top-level orgId for another org returns org-mismatch.

How to call it: the normal exec (one tool) or batch (ops[]) on portal-ops-mrz-tool. On hosted MCP use mrz_exec with toolName (or portal_ops_batch). There is no separate import endpoint and no ops_ shortcut for these four tools.

ToolKindWhat it does
preview_app_importwriteStages a preview (a write). Does not write contacts, jobs, estimates, or invoices. Input source (paintscout | generic), mode (unresolved-jobs default | sales-history), and one upload: tarGzBase64, files ({ path: text }), or csv. Optional quoteNumbers, recordIds, query, status, maxRows. Returns previewId, complete counts, duplicates, and sample rows / actions. The staged preview lasts 24 hours. Committing it keeps edits made to a matched job after the preview, including customerName.
commit_app_importwriteInput previewId. Writes the staged preview and returns importBatchId with written / created / updated.
list_app_import_batchesreadRecent batches (Settings and Portal Ops): importBatchId, status (committed | partial | undone), source, mode, counts, via. Optional limit (default 20, max 50).
undo_app_importwriteInput importBatchId. Deletes records the batch created. On records it updated, puts back only the fields the import changed, re-read inside a transaction so a payment or punch in that gap is not overwritten. Hours logged after the import (hoursLogged, actualHours) and any other edit made after the import stay. A job with logged hours is left in place (not deleted) and is not set back to estimate (conflicts, reason: "has-hours"). A created invoice whose paidCents, payments, or paidAt differs from what the import wrote is left in place, and so are its job, contact, and estimate (reason: "has-payment"). An updated invoice in that state is left unchanged, including amountCents and contractTotalCents. That job's status stays too, including when the import had moved it off estimate. Changing only the invoice status does not keep the billed amount or the job status, and it is not reported as collected. The undo snapshot stores the invoice paidAt the commit wrote. A money field missing from that snapshot is not treated as a new payment, so a paidAt that was already on the invoice does not keep the billed amount or the previous payment. An invoice this import updated onto a created job is part of the batch, so undo does not call it an extra invoice. With no later payment, that job, its estimate, and its created invoices are removed and the updated invoice is restored. A later payment on that invoice keeps them, and the conflict op is restore. A refund that lowers the amount paid is described as a refund. An extra invoice on a created job says it was added, or that it was paid, matching that invoice. A job whose paidAt differs from the import is left in place too. Contact deletes are sized so the contact read, the jobs query, and the delete commit together. If that step stops after the jobs are already gone, undo resumes and finishes the contacts. Before those deletes, the same transaction reads the job and its shifts again. A punch that lands after the first hours check leaves that job, contact, estimate, and invoice in place (reason: "has-hours"). restored counts records undo actually wrote. A contact shared by several jobs is deleted only after every one of those jobs has been checked, so a payment on a later job keeps the contact. A new invoice on the job, including a deposit, keeps the job and its invoices. A contact that another job outside this batch still uses is left in place. Changing only a payment row does not roll paidCents or status back. Safe to repeat (alreadyUndone). The appImportPreviews rules deny is deploy-later and is not published from this branch.
{ "action": "batch", "orgId": "your-org-id", "ops": [
  { "toolName": "preview_app_import", "input": { "source": "generic", "csv": "quoteNumber,firstName,…" } }
] }
// review counts + duplicates, then:
{ "action": "exec", "orgId": "your-org-id", "toolName": "commit_app_import", "input": { "previewId": "aip_…" } }

Duplicates: jobs match on the quote number only — never an invoice number, because the two sequences collide. Contacts match on PaintScout contact id, email, or 10-digit phone; estimates and invoices on their PaintScout ids. Each match is listed in duplicates with reason: "already-in-portal" and is updated, not created. Imported ids are stable, so importing the same quote again updates the same records.

Idempotent commit: previewId comes from the org, source, mode, file bytes, and selection. Calling commit_app_import again returns the same importBatchId with alreadyCommitted: true and writes nothing. A commit that stopped partway resumes the same batch: fields edited after the rows it already wrote stay, including a payment's method, check number, and client payment id. The saved undo snapshot is not replaced. Each contact, estimate, job, and invoice is written in its own transaction, so an edit made after the prepare read is not overwritten. A payment or refund that lands after that invoice was read stays, and so do the imported amount, status, and label. The undo snapshot stores what the import meant to write, not that live payment or refund. A job paidAt set in that gap stays on the job and is not stored as the import's paid date. Those payment conflicts are stored on the batch and show up from list_app_import_batches. The commit renews its claim while it reads and writes. It marks the preview committed only while that preview still says committing. If undo wins first, the commit stops and does not set committed. Previewing the same file and selection after a commit returns status: "committed". To import it again, undo that batch first, then preview again.

Limits: upload 4 MB (decoded tar.gz, or UTF-8 bytes of csv / files); a tar.gz may unpack to 32 MB; at most 200 files. A hosted MCP request is capped at 5.5 MB, and base64 adds a third, so send uploads near 4 MB over HTTP exec. preview_app_import, commit_app_import, and undo_app_import each add 5 to the rate-limit weight, on exec or inside batch, so one of them is not weight 1.

Customers are never contacted
Every imported contact, job, estimate, and invoice carries customerNotifySuppressed, the plan's sideEffects is always empty, and contacts get marketingConsent: false. Import sends no email or text, starts no drip or seasonal nurture, sends no proposal, and schedules no reminder or follow-up. Upload contents are not written to the Portal Ops activity log.
CodeMeaning
import-file-too-large (413)Upload over 4 MB.
import-unpacked-too-large (413)tar.gz unpacks past 32 MB.
import-input-required / import-too-many-files / import-unreadableMissing, oversized file list, or unreadable upload.
bad-source (400)source must be paintscout or generic.
bad-mode (400)mode must be unresolved-jobs or sales-history.
coming-soon (400)source: "dripjobs" is recognized and not available yet.
bad-plan (400)The file was read but a plan could not be built.
bad-payload (400)A staged record failed validation. Run preview_app_import again.
preview-not-found / preview-expired / preview-not-ready / preview-incompleteRun preview_app_import again.
commit-in-progress (409)Another commit for this preview is running. Retry in a few minutes. Undo returns this too until that commit finishes, from Portal Ops or Settings.
batch-undone (409) / batch-not-found (404)The batch was undone, or is not in this org. A commit that notices undo mid-run returns batch-undone and writes nothing further.
commit-lost (409)The preview is no longer committing, so the commit stopped.

Job naming tip

PO / quote number = job title

Use the PaintScout PO or quote number as the job name (e.g. QUOTE_NUMBER). Put the person's name in customerName and address, phone, and email in contact fields — not as the job title. This keeps dispatch, crew, and integrations aligned.

Business data, photos & webhooks (v2127)

Read-only, org-scoped data tools for assistants. Every call goes through exec / batch on the same endpoint and the same rate limit (60 requests / minute per key). Scope business-data covers most non-money records; CRM list_leads / get_lead need opt-in lead-intake; invoice reads need invoices-draft or owner-finance; costing reads need job-costing-write or owner-finance; payment reads need owner-finance.

ResourceTools
Leads (full record, attribution, form answers, status history)list_leads, get_lead (scope lead-intake)
Customers + historylist_contacts, get_contact
Proposals / estimates (drafts, line items, prices, viewed / signed events)list_estimates, get_estimate
Invoices & payments (Stripe + offline) — owner-financelist_invoices, get_invoice, list_payments
Estimator calendars, open slots, booked visitslist_schedule
Jobs / production, crew, dates, check-inslist_production, get_job_production
One job's customer activity (views, time on page, sent, accepted, paid, scheduling, share visits)get_job_activity
Photos with who / when / room / caption / approvallist_photos
Every customer email + text with delivery statuslist_messages
Follow-ups: drip enrollments, queued sends, texting consentlist_followups
Staff roster, roles, titles, permissionslist_staff
Shifts, clock-ins, PTOlist_hours
Job costing: supplier invoices, materials — owner-financelist_job_costs
Colors & products per joblist_job_colors
Reviews & referralslist_reviews_referrals
Settings reads: contract types, deposit %, rates, catalogget_settings; settings-write adds complete-section reads and settings edits
Activity / audit loglist_activity

Paging & filters (all list tools): limit (max 200), cursor (pass back nextCursor), sinceMs / untilMs (or ISO since / until), jobId, contactId, customer (name / email / phone text), and status where it applies. Secrets (key hashes, API keys, push tokens) are never returned. Pay rates, margin and burden are removed unless the key has owner-finance.

{
  "action": "exec",
  "orgId": "your-org-id",
  "toolName": "list_messages",
  "input": { "contactId": "CONTACT_ID", "sinceMs": 1760000000000, "limit": 50 }
}

Photos (scope photos)

upload_photo attaches a base64 image (JPEG, PNG, WebP, GIF, HEIC; 12 MB max) to a job or estimate (areaId / substrateId place it on the proposal once approved). save_annotated_photo saves an AI markup as a new linked photo (parentPhotoId / parentStoragePath); the original is never changed. Every assistant photo starts approval.status: "pending" and is hidden from the customer share page, proposal, PDF, portfolio and share Ask until that photo is approved in Portal or explicitly selected through the separately granted approve_photos action. Approval uses the existing admin, estimator or office photo permission; only an active admin can remove approval. Private bytes stay token-free; approval creates a fresh immutable public copy for that job. Link an unattached estimate to a job before approval. download_photo returns a short-lived staff URL and optional base64. list_pending_share_photos lists pending records. annotate_photo uses the same new-linked-photo writer as save_annotated_photo. Existing MCP grants need fresh consent to gain the new tools.

Webhooks (scope webhooks)

create_webhook with a public https URL and events from lead.created, customer.replied, proposal.viewed, proposal.signed, payment.received. The signing secret is returned once. Each POST carries X-Pezley-Event, X-Pezley-Delivery and X-Pezley-Signature: t=<unix>,v1=<hex> where v1 = HMAC-SHA256(secret, t + "." + rawBody). Bodies carry record ids only (leadId, jobId, contactId, estimateId, invoiceId, …) — read details with the data tools. Failed deliveries retry with backoff (up to 6 attempts). list_webhooks / delete_webhook manage subscriptions (max 10 per org).

What keys cannot do

Create an estimate-catalog product

create_estimate_product (hosted MCP: ops_create_estimate_product) adds one product to the authenticated org library. Requires the existing Settings & pricing grant or explicit Full access and a currently active admin issuer. No id, tenant selector, update or delete. Existing MCP connections must have consented to this tool.

Supply the authorized name, pricePerUnit ($/gal, nonnegative cents) and coveragePerUnit (positive sqft/gal). Never invent price or coverage. Optional catalog fields and exact validation bounds are in the tool schema and OpenAPI. Unit is gal.

Use one stable Idempotency-Key request header per intentional addition, including hosted MCP. An optional input.idempotencyKey must match the header and never replaces it. Identical retries return the original product/id. Different fields with the same key conflict. A new key intentionally adds a separate row, including a same-name product; list first to avoid an unintended duplicate. The tool never overwrites an existing row. See docs/OPS_BRIEF_API.md for audit and release details.

Operator responsibility

Your organization controls who receives a Portal Ops key and which scopes each key has. Anyone holding the secret can perform every action allowed by those scopes for your org.

Pezley is not responsible for how external assistants, automations, or third parties use a key, or for data they read or write through it. Issuing a key means you accept that risk for your organization.

Audit trail: Settings → Audit Log labels Portal Ops traffic as Portal Ops call.

Need help in the app?

Org admins manage keys under Settings → Portal Ops keys at pezleyportal.com.

Pezley Portal · Portal Ops guide · v2239 · Updated December 5, 2026