Context API

Context nodes, bundles, manifests, links, annotations, and feedback.

Context nodes are the knowledge that makes playbooks useful — brand guidelines, process docs, personas, examples. They can be linked together and to playbooks to form a connected knowledge graph that agents retrieve at runtime.

Endpoints

All paths are relative to /api/v1/workspaces/{workspaceId}

List context nodes

GET /context-nodes

Query parameters

ParameterTypeDescription
nodeTypestringbrand, process, reference, domain-knowledge, example, index
statusstringlive (default, excludes archived), archived (archived only), or all (both)
archivedstringDeprecated, use status. true maps to status=archived, false maps to status=live. Passing both archived and status is a 400.
sortstringSort field
orderstringasc or desc
curl "https://patina.so/api/v1/workspaces/WORKSPACE_ID/context-nodes?nodeType=brand" \
  -H "Authorization: Bearer pk_YOUR_API_KEY"

Create a context node

POST /context-nodes

Requires editor role. Content supports markdown and [[wikilinks]] — any [[slug]] references in the content are automatically parsed into node links.

Request body

FieldTypeRequiredDescription
titlestringYesNode title
descriptionstringYesBrief summary of what this node contains
contentstringNoFull content (markdown)
nodeTypestringNoOne of: brand, process, reference, domain-knowledge, example, index
agentSummarystringNoConcise summary optimized for AI consumption
importancenumberNo0–100 ranking for retrieval priority
readFirstbooleanNoMark as essential context that should always be included
edgeCaseOnlybooleanNoOnly include when specifically relevant
curl -X POST https://patina.so/api/v1/workspaces/WORKSPACE_ID/context-nodes \
  -H "Authorization: Bearer pk_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Brand Voice Guidelines",
    "description": "Tone, vocabulary, and style rules for all customer-facing content",
    "content": "## Tone\nWarm but professional. Never corporate-speak...",
    "nodeType": "brand",
    "importance": 90,
    "readFirst": true
  }'

Get a context node

GET /context-nodes/:nodeId

Returns the full node including its incoming and outgoing links.

curl https://patina.so/api/v1/workspaces/WORKSPACE_ID/context-nodes/NODE_ID \
  -H "Authorization: Bearer pk_YOUR_API_KEY"

Update a context node

PATCH /context-nodes/:nodeId

Updates any combination of node fields. Requires editor role.

curl -X PATCH https://patina.so/api/v1/workspaces/WORKSPACE_ID/context-nodes/NODE_ID \
  -H "Authorization: Bearer pk_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "## Tone\nUpdated voice guidelines for Q2...",
    "agentSummary": "Brand voice: warm, professional, never use jargon"
  }'

POST /context-nodes/:nodeId/links

Creates an explicit link between two nodes (or between a playbook and a node).

Link types

TypeMeaning
requiresSource depends on target — target is always included
referencesSource mentions target — target is included when relevant
relates-toLoosely related — included at lower priority
supersedesSource replaces target — target is deprioritized
index-entrySource is an index node that catalogs target
curl -X POST https://patina.so/api/v1/workspaces/WORKSPACE_ID/context-nodes/NODE_ID/links \
  -H "Authorization: Bearer pk_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "targetId": "TARGET_NODE_ID",
    "linkType": "references"
  }'

Get a context bundle

GET /context/bundle

Returns a playbook together with all its linked context nodes — the complete knowledge base an agent needs to execute the playbook. This is the primary retrieval endpoint for agents.

This endpoint counts as a retrieval and is metered against your plan's monthly limit.

Query parameters

ParameterTypeRequiredDescription
playbookIdstringYesPlaybook to retrieve context for
modestringNostandard (default) — controls content depth
maxNodesnumberNoMaximum number of context nodes to return
includeAnnotationsbooleanNoInclude annotations (default: true)
changedSincestringNoISO timestamp — only return nodes updated after this time
curl "https://patina.so/api/v1/workspaces/WORKSPACE_ID/context/bundle?playbookId=PLAYBOOK_ID&mode=standard&maxNodes=15" \
  -H "Authorization: Bearer pk_YOUR_API_KEY"
{
  "playbook": {
    "id": "pb_abc...",
    "title": "Blog Post Workflow",
    "latestVersion": { ... }
  },
  "nodes": [
    {
      "id": "cn_xyz...",
      "title": "Brand Voice Guidelines",
      "content": "## Tone\nWarm but professional...",
      "nodeType": "brand",
      "importance": 90
    }
  ],
  "annotations": [ ... ]
}

Get a context manifest

GET /context/manifest

Like the bundle, but returns only summaries instead of full content. Use this for progressive disclosure — get the manifest first, then fetch full nodes as needed.

This endpoint counts as a retrieval and is metered against your plan's monthly limit.

Query parameters

ParameterTypeRequiredDescription
playbookIdstringYesPlaybook to retrieve manifest for
maxNodesnumberNoMaximum nodes to include
changedSincestringNoISO timestamp for incremental sync
curl "https://patina.so/api/v1/workspaces/WORKSPACE_ID/context/manifest?playbookId=PLAYBOOK_ID&maxNodes=10" \
  -H "Authorization: Bearer pk_YOUR_API_KEY"

Follow context links

GET /context/nodes/:nodeId/follow

Returns ranked linked nodes from a starting node. Useful for traversing the knowledge graph.

ParameterTypeDescription
linkTypestringFilter by link type (can be repeated)
maxNodesnumberMaximum nodes to return
curl "https://patina.so/api/v1/workspaces/WORKSPACE_ID/context/nodes/NODE_ID/follow?maxNodes=5" \
  -H "Authorization: Bearer pk_YOUR_API_KEY"

Get recent updates

GET /context/updates

Returns context nodes that have been updated since a given timestamp. Use for incremental sync so your agent can stay up to date without re-fetching everything.

ParameterTypeDescription
sincestringISO timestamp — return nodes updated after this time
curl "https://patina.so/api/v1/workspaces/WORKSPACE_ID/context/updates?since=2025-03-01T00:00:00Z" \
  -H "Authorization: Bearer pk_YOUR_API_KEY"

Create an annotation

POST /context/annotations

Annotations let agents (or humans) attach notes to playbooks, versions, or context nodes. Agents typically use agent_local scope so their notes don't pollute the shared workspace view.

Request body

FieldTypeRequiredDescription
targetTypestringYesplaybook, playbook_version, or context_node
targetIdstringYesID of the target resource
scopeTypestringYesworkspace_overlay (visible to all) or agent_local (private to agent)
titlestringYesAnnotation title
contentstringYesAnnotation content
sourcestringNoagent or human
curl -X POST https://patina.so/api/v1/workspaces/WORKSPACE_ID/context/annotations \
  -H "Authorization: Bearer pk_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "targetType": "context_node",
    "targetId": "NODE_ID",
    "scopeType": "agent_local",
    "title": "Outdated section",
    "content": "The pricing section references the old plan names",
    "source": "agent"
  }'

Submit feedback

POST /context/feedback

Agents can flag content quality issues. Feedback is reviewed by workspace members and helps keep context accurate over time.

Feedback types

TypeMeaning
incorrectContent contains factual errors
outdatedContent is stale or references deprecated things
missing-contextImportant context is absent
helpfulPositive signal — this content was useful
low-signalContent exists but isn't adding value
curl -X POST https://patina.so/api/v1/workspaces/WORKSPACE_ID/context/feedback \
  -H "Authorization: Bearer pk_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "targetType": "playbook",
    "targetId": "PLAYBOOK_ID",
    "feedbackType": "outdated",
    "summary": "References deprecated API endpoints"
  }'