← Back to Index

Carmee Pathway API - Full Specification v2.0

Version: 2.0 (REVISED with Integrity → Authority → Escalation gating)
Date: 2026-02-18
Purpose: Automate 60-70% of Carmee's pathway coordination work (10-18 hrs/week savings)
Expected ROI: ~10,000x (API costs <$50/month, saves ~$3,000/month in Carmee time)


🚨 CRITICAL CHANGE FROM V1.0

OLD MODEL (v1.0 - WRONG):

Inquiry → Classify to Pathway → Verify Eligibility → Quote

NEW MODEL (v2.0 - CORRECT):

Inquiry → Gate (Integrity/Authority/Escalation) → Unlock Pathways → Route → Quote

Key differences:


Overview

What it does:

What it DOESN'T do:

Integration points:


API Endpoints (Revised)

1. POST /api/pathway/gate

Purpose: Verify Integrity → Authority → Escalation before unlocking pathways

Request:

{
  "inquiry_text": "We're a YMCA after-school program serving 200 kids...",
  "organization_name": "YMCA of Greater Los Angeles",
  "website": "https://ymcala.org",
  "email_domain": "ymcala.org",
  "contact_name": "Jane Smith",
  "contact_email": "jane@ymcala.org",
  "context": {
    "supervised_use": true,
    "educational_setting": true,
    "playmaker_present": true,
    "purchasing_authority": "site",
    "district_intro_sent": false,
    "ztag_included_in_thread": false,
    "district_reply_received": false,
    "monthly_playmaker_commitment": false
  }
}

Response:

{
  "gates": {
    "integrity_pass": true,
    "authority_level": "site",
    "escalation_verified": false
  },
  "unlocked_pathways": [1, 2, 3, 4],
  "locked_pathways": [5, 7],
  "pilot_unlock": "LOCKED",
  "pilot_unlock_requirements": [
    "Authority level must be 'district' (currently 'site')",
    "District introduction must be sent",
    "ZTAG must be included in email thread",
    "District reply must be received",
    "Monthly Playmaker commitment required"
  ],
  "next_action": {
    "action": "request_district_escalation",
    "message": "Request district introduction via email template",
    "reasoning": "Site-level authority detected. Escalate to district for Pilot eligibility."
  },
  "stop_conditions": [],
  "confidence": 0.95
}

Gating Logic:

INTEGRITY GATE (pass/fail):

If integrity fails → STOP (auto-reject, no pathways unlocked)

AUTHORITY GATE (site/district/unknown):

ESCALATION GATE (verified/not verified):

If escalation verified + authority=district + monthly commitment → Pilot unlocks


Pathway Unlock Matrix

Gates Passed Unlocked Pathways Notes
Integrity FAIL NONE (STOP) Auto-reject (drop-off/rental/unsupervised)
Integrity PASS + Authority=site 1, 2, 3, 4 Can quote EDU/Pro pricing, close deals
Integrity PASS + Authority=district 1, 2, 3, 4 Same as site (Pilot still locked)
Integrity PASS + Authority=district + Escalation VERIFIED + Monthly commitment 1, 2, 3, 4, 6 (Pilot) Pilot overlay unlocked
Operator inquiry (rental-only, exposure) 5 Quan approval required (not Carmee)
Professional inquiry (FEC, GameTruck) 7 Kristin/Quan approval (not Carmee)

Critical: Pilot (6) is NOT a parallel pathway. It's an overlay on Pathway 1 that unlocks after full gating.


2. POST /api/pathway/route

Purpose: Determine which pathway applies AFTER gating (replaces /classify)

Request:

{
  "unlocked_pathways": [1, 2, 3, 4],
  "organization_type": "nonprofit_501c3",
  "program_type": "after_school",
  "funding_source": "grant_funded",
  "location_type": "in_school"
}

Response:

{
  "recommended_pathway": 2,
  "pathway_name": "3rd-Party After-School (Nonprofit)",
  "pricing_tier": "EDU",
  "confidence": 0.9,
  "reasoning": "501(c)(3) nonprofit + supervised + in-school → EDU pricing",
  "alternate_pathways": [
    {
      "pathway": 1,
      "name": "Grant-Funded School/After-School",
      "match_score": 0.7,
      "reason": "Could apply if grant-funded directly by district"
    }
  ],
  "next_steps": [
    "Verify 501(c)(3) status (EIN required)",
    "Generate EDU pricing quote",
    "Prepare funding packet if grant-funded"
  ]
}

Routing Logic (only runs if gating passed):

Pathway 1: Grant-Funded School/After-School

Pathway 2: 3rd-Party After-School

Pathway 3: City/Municipal

Pathway 4: Camps

Pathway 5: Operator Partnership (requires Quan approval)

Pathway 6: Pilot Program (Kristin owns, Quan approves)

Pathway 7: Professional/Operators (requires Kristin/Quan approval)


3. POST /api/pathway/verify-eligibility

Purpose: Verify 501(c)(3) status, supervision model, website legitimacy

(Same as v1.0 - no changes needed)

Request:

{
  "organization_name": "YMCA of Greater Los Angeles",
  "ein": "95-1684064",
  "website": "https://ymcala.org",
  "program_description": "Supervised after-school program with Playmakers leading activities"
}

Response:

{
  "nonprofit_status": {
    "is_501c3": true,
    "ein": "95-1684064",
    "organization_name": "YMCA OF GREATER LOS ANGELES",
    "source": "IRS Tax Exempt Organization Search",
    "verified_at": "2026-02-18T14:30:00Z"
  },
  "supervision_check": {
    "is_supervised": true,
    "confidence": 0.9,
    "keywords_found": ["supervised", "Playmakers", "after-school program"],
    "red_flags": []
  },
  "website_check": {
    "is_legitimate": true,
    "organization_type": "nonprofit",
    "mission_statement": "To put Christian principles into practice through programs that build healthy spirit, mind, and body for all.",
    "educational_mission": true
  },
  "eligibility_verdict": "APPROVED for EDU pricing (Pathway 2: 501(c)(3) + supervised + educational mission)",
  "flags": []
}

4. POST /api/pathway/generate-quote

Purpose: Calculate pricing, apply discounts, generate quote PDF

(Same as v1.0 - no changes to pricing logic)

Request:

{
  "pathway_id": 2,
  "buyer_type": "nonprofit_501c3_supervised",
  "products": [
    {"sku": "ZTAGGER_V3", "quantity": 50},
    {"sku": "ZUES_ROUTER", "quantity": 2},
    {"sku": "EXTENDED_CARE_12MO", "quantity": 50}
  ],
  "organization_name": "YMCA of Greater Los Angeles",
  "contact_name": "Jane Smith",
  "contact_email": "jane@ymcala.org"
}

Response:

{
  "quote_id": "Q-2026-02-18-001",
  "pricing_tier": "EDU",
  "line_items": [
    {
      "sku": "ZTAGGER_V3",
      "description": "ZTAGGER v3 Wearable",
      "quantity": 50,
      "unit_price_edu": 149.00,
      "unit_price_msrp": 199.00,
      "discount_percent": 25,
      "subtotal": 7450.00
    },
    {
      "sku": "ZUES_ROUTER",
      "description": "ZUES Control System",
      "quantity": 2,
      "unit_price_edu": 899.00,
      "unit_price_msrp": 1199.00,
      "discount_percent": 25,
      "subtotal": 1798.00
    },
    {
      "sku": "EXTENDED_CARE_12MO",
      "description": "Extended Care 12-Month Subscription",
      "quantity": 50,
      "unit_price_edu": 49.00,
      "unit_price_msrp": 69.00,
      "discount_percent": 29,
      "subtotal": 2450.00
    }
  ],
  "subtotal": 11698.00,
  "total": 11698.00,
  "quote_pdf_url": "https://ztag.com/quotes/Q-2026-02-18-001.pdf",
  "valid_until": "2026-03-18"
}

5. POST /api/pathway/customize-funding-packet

Purpose: Fill in funding proposal templates (ESSER, ELOP, Title funds)

(Same as v1.0 - no changes needed)


6. POST /api/pathway/generate-vp-battle-kit

Purpose: Create pathway-specific value proposition one-pager

(Same as v1.0 - no changes needed)


Stop Conditions (Auto-Reject)

Integrity gate failures:

Changed from v1.0: For-profit inquiries now route to Pathway 5 (Operator Partnership) or Pathway 7 (Professional), not auto-rejected. This is "exposure, not workaround" per governance.


Pilot Unlock Logic (Critical)

Pilot (Pathway 6) is NOT a parallel pathway.

It's a permissioned overlay on Pathway 1 that unlocks after:

  1. Integrity gate passes (supervised + educational + Playmaker)
  2. Authority = district (not site-level)
  3. Escalation verified:
    • District introduction sent
    • ZTAG included in email thread
    • District replied (engaged, not ghosted)
  4. Monthly Playmaker commitment (not one-time rental)

If ANY requirement missing → Pilot stays LOCKED

Pricing: Pilot pricing is NOT "custom" or "typically MSRP". It's negotiated after unlock, requires Kristin/Quan involvement.

Workflow:

  1. Inquiry comes in (site-level authority)
  2. Gates: Integrity PASS, Authority=site, Escalation=NOT VERIFIED
  3. Pathways unlocked: 1, 2, 3, 4
  4. Carmee quotes EDU pricing (Pathway 1 or 2)
  5. If district wants Pilot: Request district intro email
  6. District replies, ZTAG included in thread
  7. Escalation now VERIFIED, Authority=district
  8. Monthly Playmaker commitment confirmed
  9. Pilot overlay unlocks (Pathway 6 now available)
  10. Kristin/Quan handle Pilot pricing/terms

System Integration

Zoho CRM Integration

(Same as v1.0 - no changes)

Read from Zoho:

Write to Zoho:

Custom field needed: pathway_gates_status (JSON field storing integrity/authority/escalation results)


Implementation Plan (3 Phases - REVISED)

Phase 1: Gating + Routing (Week 1-2)

Build:

  1. POST /api/pathway/gate (Integrity → Authority → Escalation logic)
  2. POST /api/pathway/route (pathway selection AFTER gating)
  3. POST /api/pathway/generate-quote (pricing + PDF generation)
  4. Simple web UI for Carmee (paste inquiry → get gating results + quote)

Test:

Deploy:

Success metrics:


Phase 2: Eligibility Verification + Funding Packets (Week 3-4)

Build:

  1. POST /api/pathway/verify-eligibility (IRS API + web scraping)
  2. POST /api/pathway/customize-funding-packet (template fill-in)
  3. Zoho CRM read integration (pull deal data)

(Same as v1.0 - no changes)


Phase 3: VP Battle Kits + Full Zoho Write (Week 5-6)

Build:

  1. POST /api/pathway/generate-vp-battle-kit
  2. Zoho CRM write integration (log activity, attach docs)
  3. Email draft generation

(Same as v1.0 - no changes)


Success Metrics (90 Days)

Efficiency:

Business impact:

Governance compliance:


Technical Stack

(Same as v1.0 - no changes)

Backend:


Security & Privacy

(Same as v1.0 - no changes)


Open Questions

Gating logic:

Pricing:

Workflow:


Critical Changes from v1.0

Removed:

Added:

Mental Model Shift:

OLD: "What pathway does this inquiry belong to?"
NEW: "Has this inquiry earned the right to proceed?"

Next Steps

For Quan (Dev work today):

  1. Review this spec - Does gating logic match your governance model?
  2. Clarify open questions (authority detection, commitment tracking)
  3. Build Phase 1: Gating + Routing + Quote generation
  4. Test with real inquiries (10 from past 30 days)

For Carmee (after Phase 1 ready):

  1. Test gating logic with 10 real inquiries
  2. Validate pathway unlock matrix
  3. Confirm Pilot stays locked without full gates
  4. Provide feedback on UI/UX

For Minnie:

  1. Track gating accuracy (log false positives/negatives)
  2. Monitor API costs
  3. Document edge cases (authority ambiguous, commitment unclear)

Status: Ready for review. Spec revised with Integrity → Authority → Escalation gating.

Estimated build time:

First priority: Phase 1 (gating + routing + quotes) → Immediate compliance with governance + 3-6 hrs/week savings


File: plans/carmee-pathway-api-spec-v2.md
Created: 2026-02-18
Based on: Integrity → Authority → Escalation gating model + Feb 16 pathways governance