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.
| Field | Value |
|---|---|
| Capability | context.get |
| Grant | capability:context.get |
| Legacy scope | v1:context:read |
| Modes | dry_run, execute |
| Cost | 1 action credit when executed |
| Side effect | none |
| MCP tool | get_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:
| Field | Type | Notes |
|---|---|---|
id | string | Customer node id. |
customerId | string | Alias for id. |
customer | string | Customer id or email. |
email | string | Resolves 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
| Status | Code | Cause |
|---|---|---|
| 400 | invalid_input | Missing id, customerId, customer, and email. |
| 401 | unauthenticated | Missing or invalid key. |
| 403 | grant_denied | Key lacks capability:context.get or compatible legacy scope. |
| 403 | mode_denied | Key cannot use the requested mode. |
| 404 | not_found | Customer does not exist. |
| 429 | rate_limited | Per-key request cap. Honor Retry-After. |