After deploying, replace $API with your endpoint URL:
API=https://{api-id}.execute-api.us-east-1.amazonaws.com/apicurl $API/health
# {"status": "ok", "service": "jhcontext-api", "version": "0.2.0"}curl -X POST $API/envelopes \
-H "Content-Type: application/json" \
-d '{
"envelope": {
"context_id": "ctx-test-001",
"schema_version": "jh:0.3",
"producer": "did:hospital:test",
"scope": "healthcare_test",
"status": "active",
"compliance": {
"risk_level": "high",
"human_oversight_required": true,
"forwarding_policy": "semantic_forward"
},
"proof": {
"content_hash": "abc123"
}
}
}'
# {"context_id": "ctx-test-001", "content_hash": "abc123"}curl $API/envelopes/ctx-test-001
# Returns full envelope with @context and @type JSON-LD annotationscurl "$API/envelopes?scope=healthcare_test"
curl "$API/envelopes?risk_level=high"# Encode content
CONTENT=$(echo -n "Patient P-12345: elevated tumor markers" | base64)
curl -X POST $API/artifacts \
-H "Content-Type: application/json" \
-d "{
\"artifact_id\": \"art-sensor-test\",
\"context_id\": \"ctx-test-001\",
\"artifact_type\": \"token_sequence\",
\"content_base64\": \"$CONTENT\"
}"
# {"artifact_id": "art-sensor-test", "content_hash": "...", "storage_path": "s3://..."}curl $API/artifacts/art-sensor-test
# {"artifact_id": "art-sensor-test", "type": "token_sequence",
# "content_hash": "...", "content_base64": "..."}curl -X POST $API/provenance \
-H "Content-Type: application/json" \
-d '{
"context_id": "ctx-test-001",
"graph_turtle": "@prefix prov: <http://www.w3.org/ns/prov#> .\n@prefix jh: <https://jhcontext.com/vocab#> .\n\njh:art-sensor a prov:Entity ;\n prov:wasGeneratedBy jh:act-sensor .\njh:act-sensor a prov:Activity .\njh:agent-sensor a prov:Agent .\njh:act-sensor prov:wasAssociatedWith jh:agent-sensor .\n"
}'
# {"context_id": "ctx-test-001", "digest": "...", "path": "ctx-test-001"}# Temporal sequence — shows all activities in order
curl -X POST $API/provenance/query \
-H "Content-Type: application/json" \
-d '{
"context_id": "ctx-test-001",
"query_type": "temporal_sequence"
}'
# Causal chain — traces what generated a specific entity
curl -X POST $API/provenance/query \
-H "Content-Type: application/json" \
-d '{
"context_id": "ctx-test-001",
"query_type": "causal_chain",
"entity_id": "art-sensor"
}'curl -X POST $API/decisions \
-H "Content-Type: application/json" \
-d '{
"context_id": "ctx-test-001",
"passed_artifact_id": "art-sensor-test",
"outcome": {"recommendation": "Continue chemotherapy", "confidence": 0.87},
"agent_id": "did:hospital:decision-agent"
}'
# {"decision_id": "dec-..."}curl $API/compliance/package/ctx-test-001 -o compliance.zip
# Downloads ZIP containing: envelope.json, provenance.ttl, audit_report.json, manifest.jsonMCP=https://{mcp-id}.execute-api.us-east-1.amazonaws.com/api
curl $MCP/health
curl -X POST $MCP/mcp \
-H "Content-Type: application/json" \
-d '{
"tool_name": "get_envelope",
"arguments": {"context_id": "ctx-test-001"}
}'
curl -X POST $MCP/mcp \
-H "Content-Type: application/json" \
-d '{
"tool_name": "run_audit",
"arguments": {"context_id": "ctx-test-001", "checks": ["integrity"]}
}'