SITEMAP / DOCS / AGENTS

Customer Context

context.get returns a compressed customer context bundle for an external agent: identity, lifecycle state, intent signals, open loops, blockers, recent touchpoints, and recent agent memory.

FieldValue
Capabilitycontext.get
Grantcapability:context.get
Legacy scopev1:context:read
Modesdry_run, execute
Cost1 action credit when executed
Side effectnone
MCP toolget_customer_context

01Request

POST /api/v1/capabilities/context.get/invoke
Authorization: Bearer wp_live_...
Content-Type: application/json

{
  "mode": "execute",
  "source": "api",
  "input": {
    "email": "jane@acme.com"
  }
}

Input accepts any one of:

FieldTypeNotes
idstringCustomer node id.
customerIdstringAlias for id.
customerstringCustomer id or email.
emailstringResolves through the identity graph.

02Examples

CLI

wp context get jane@acme.com
wp invoke context.get --mode execute --input '{"email":"jane@acme.com"}'

curl

curl https://api.waypath.app/api/v1/capabilities/context.get/invoke \
  -H "Authorization: Bearer wp_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "execute",
    "source": "api",
    "input": { "email": "jane@acme.com" }
  }'

node-fetch

const res = await fetch(
  'https://api.waypath.app/api/v1/capabilities/context.get/invoke',
  {
    method: 'POST',
    headers: {
      Authorization: `Bearer ${process.env.WAYPATH_API_KEY!}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      mode: 'execute',
      source: 'api',
      input: { email: 'jane@acme.com' },
    }),
  },
)

const envelope = await res.json()

Python

import os, requests

envelope = requests.post(
    'https://api.waypath.app/api/v1/capabilities/context.get/invoke',
    headers={
        'Authorization': f"Bearer {os.environ['WAYPATH_API_KEY']}",
        'Content-Type': 'application/json',
    },
    json={
        'mode': 'execute',
        'source': 'api',
        'input': {'email': 'jane@acme.com'},
    },
).json()

MCP

const ctx = await mcp.tools.get_customer_context({
  email: 'jane@acme.com',
  _mode: 'execute',
})

03Response

All capability calls return the standard envelope:

{
  "status": "committed",
  "result": {
    "customer": "Jane Doe",
    "customer_id": "cus_8af2",
    "lifecycle_stage": "opportunity",
    "intent_signals": ["viewed_pricing_3x"],
    "open_loops": ["awaiting_security_review"],
    "blockers": ["procurement_review_q2"],
    "recent_decisions": []
  },
  "action_credit_cost": 1,
  "request_id": "req_123",
  "quota": {
    "plan": "starter",
    "limit": 500,
    "used": 41,
    "remaining": 459
  },
  "receipt_url": "/api/v1/capabilities/actions/req_123"
}

The result shape may grow over time. Existing stable fields are not removed without a major contract version.

04Errors

StatusCodeCause
400invalid_inputMissing id, customerId, customer, and email.
401unauthenticatedMissing or invalid key.
403grant_deniedKey lacks capability:context.get or compatible legacy scope.
403mode_deniedKey cannot use the requested mode.
404not_foundCustomer does not exist.
429rate_limitedPer-key request cap. Honor Retry-After.

05See also