Skip to main content
WA-Templates
API reference

Grounding knowledge API

A template can carry a grounding document — the source of truth a reply bot answers from. These calls attach it, read it, remove it, and switch it on or off without deleting it.

GET/templates/:id/knowledgetemplates:read

Read the grounding doc

Read a template's grounding doc — the source of truth a reply bot answers from.

Arguments

NameTypeInDescription
idrequiredstringpath

Request

curl -X GET "https://your-server/api/agent/templates/<id>/knowledge" \
  -H "Authorization: Bearer $WA_AGENT_KEY"

Same call, as a tool

# MCP tool name
get_knowledge

# CLI (planned)
$ wa knowledge <id> --get
PUT/templates/:id/knowledgetemplates:write

Set the grounding doc

Attach or replace the grounding doc behind a template.

Arguments

NameTypeInDescription
idrequiredstringpath
docrequiredstringbodyThe knowledge document (markdown or plain text).

Request

curl -X PUT "https://your-server/api/agent/templates/<id>/knowledge" \
  -H "Authorization: Bearer $WA_AGENT_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "doc": <string>
  }'

Same call, as a tool

# MCP tool name
set_knowledge

# CLI (planned)
$ wa knowledge <id> --set-file <doc.md>
DELETE/templates/:id/knowledgetemplates:write

Delete the grounding doc

Remove a template's grounding doc entirely.

Arguments

NameTypeInDescription
idrequiredstringpath

Request

curl -X DELETE "https://your-server/api/agent/templates/<id>/knowledge" \
  -H "Authorization: Bearer $WA_AGENT_KEY"

Same call, as a tool

# MCP tool name
delete_knowledge

# CLI (planned)
$ wa knowledge <id> --delete
POST/templates/:id/knowledge/enabletemplates:write

Turn grounding on

Switch grounding on for a template without deleting or re-uploading the doc.

Arguments

NameTypeInDescription
idrequiredstringpath

Request

curl -X POST "https://your-server/api/agent/templates/<id>/knowledge/enable" \
  -H "Authorization: Bearer $WA_AGENT_KEY"

Same call, as a tool

# MCP tool name
enable_knowledge

# CLI (planned)
$ wa knowledge <id> --enable
POST/templates/:id/knowledge/disabletemplates:write

Turn grounding off

Switch grounding off while keeping the doc in place.

Arguments

NameTypeInDescription
idrequiredstringpath

Request

curl -X POST "https://your-server/api/agent/templates/<id>/knowledge/disable" \
  -H "Authorization: Bearer $WA_AGENT_KEY"

Same call, as a tool

# MCP tool name
disable_knowledge

# CLI (planned)
$ wa knowledge <id> --disable