Token-authenticated access to the Sales Funnel on the BPG Team Portal. Every request needs an
Authorization: Bearer <token> header. Tokens are issued by Max.
| GET /api/v1/health | Liveness check. No token needed. |
| GET /api/v1/meta | Board columns, estimators, lead sources, file categories and the valid values for each status field. |
| GET /api/v1/leads | Search and list. ?q= ?group= ?open=true ?estimator= ?status= ?since= ?limit= ?offset= — and ?fields=id,name,leadStatus to keep the response small (fields=all for everything). |
| GET /api/v1/leads/{id} | One lead in full — details, notes, files, trade quotes, history. |
| POST /api/v1/leads | Create. Requires name. De-duplicates on email and street address unless "dedupe": false. |
| PATCH /api/v1/leads/{id} | Change any of name, email, leadDetails, group, estimator, source, leadStatus, quoteStatus, followUpStatus. |
| POST /api/v1/leads/{id}/updates | Post a note to the lead's update thread. |
| POST /api/v1/leads/{id}/files | Attach a file — JSON {"url":…}, multipart, or a raw body with ?filename=. 25 MB cap. |
| POST /mcp | Stateless streamable-HTTP MCP server. Tools: get_funnel_meta, list_leads, get_lead, create_lead, update_lead, add_lead_note, attach_file_to_lead. |
Writes go straight into the same SharePoint file the Sales Funnel board reads, guarded by an
If-Match precondition — a save from someone working on the board can never be overwritten, and a
clash is retried automatically. Every write is recorded in the board's own autoLog and in the
lead's history, so an API change looks like any other. Full reference: API.md.