BPG Portal API

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.

REST

GET /api/v1/healthLiveness check. No token needed.
GET /api/v1/metaBoard columns, estimators, lead sources, file categories and the valid values for each status field.
GET /api/v1/leadsSearch 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/leadsCreate. 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}/updatesPost a note to the lead's update thread.
POST /api/v1/leads/{id}/filesAttach a file — JSON {"url":…}, multipart, or a raw body with ?filename=. 25 MB cap.

MCP

POST /mcpStateless streamable-HTTP MCP server. Tools: get_funnel_meta, list_leads, get_lead, create_lead, update_lead, add_lead_note, attach_file_to_lead.

Notes

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.