Skip to main content
WA-Templates
API reference

The agent gateway, endpoint by endpoint

36 calls over one authenticated HTTP surface. Every route is listed with its method, path, and the scope it requires — the same catalog the MCP server and CLI are built from.

The HTTP gateway below is live; the packaged toolkit is not. Every route, scope, and argument on these pages is generated from the gateway's own tool catalog and is accurate today. The wa CLI and wa-mcp server names are planned and not on npm yet, so treat those commands as the intended shape rather than something to copy — ask us for the current package name and key prefix if you want to wire an agent up now.

Base URL and authentication

The gateway is deployed per organization, so the host is yours; every path below is relative to /api/agent. Authenticate with a scoped agent key as a bearer token. Agent keys are a separate rail from the human app — the master key is not honoured here, and an agent key cannot reach human admin routes.

export WA_AGENT_KEY=<your agent key>

curl "https://your-server/api/agent/capabilities" \
  -H "Authorization: Bearer $WA_AGENT_KEY"

Keys are minted by an org admin, shown once, stored only as a SHA-256 hash, and revocable. Revocation fails closed.

Prefer tools over HTTP? The same catalog is exposed as an MCP server and a CLI.

OpenAPI document

Every route on this page is also published as OpenAPI 3.1, generated from the gateway's own tool catalog — so paths, scopes, and request arguments are the schemas it actually validates against, not a restatement. Responses are described loosely: the catalog types inputs but not outputs yet.

All routes at a glance

MethodPathToolScope
GET/capabilitiescapabilitiesany key
GET/templatessearch_templatestemplates:read
GET/templates/:idget_templatetemplates:read
POST/templates/:id/renderrender_templatetemplates:read
POST/templatescreate_templatetemplates:write
PUT/templates/:idupdate_templatetemplates:write
POST/templates/:id/duplicateduplicate_templatetemplates:write
DELETE/templates/:iddelete_templatetemplates:write
POST/marketplace/:id/cloneclone_templatemarketplace:clone
POST/templates/:id/submitsubmit_templatetemplates:submit
POST/messages/sendsend_messagemessages:send
GET/surveyssearch_surveyssurveys:read
GET/surveys/:idget_surveysurveys:read
POST/surveys/:id/renderrender_surveysurveys:read
POST/surveyscreate_surveysurveys:write
POST/surveys/:id/cloneclone_surveymarketplace:clone
DELETE/surveys/:iddelete_surveysurveys:write
POST/surveys/:id/submitsubmit_surveysurveys:submit
POST/surveys/:id/sendsend_surveysurveys:send
PATCH/surveys/:idupdate_surveysurveys:write
GET/surveys/:id/sendslist_survey_sendssurveys:read
POST/surveys/:id/send-testsend_survey_testsurveys:send
GET/surveys/:id/resultsget_resultsresults:read
POST/media/uploadupload_mediasurveys:write
GET/templates/:id/knowledgeget_knowledgetemplates:read
PUT/templates/:id/knowledgeset_knowledgetemplates:write
DELETE/templates/:id/knowledgedelete_knowledgetemplates:write
POST/templates/:id/knowledge/enableenable_knowledgetemplates:write
POST/templates/:id/knowledge/disabledisable_knowledgetemplates:write
GET/usageget_usageusage:read
GET/audiencessearch_audiencesaudiences:read
GET/audiences/:idget_audienceaudiences:read
GET/audiences/:id/contactslist_audience_contactsaudiences:read
POST/audiencescreate_audienceaudiences:write
POST/audiences/:id/contactsimport_contactsaudiences:write
DELETE/audiences/:iddelete_audienceaudiences:write

Scopes

An agent key is a capability token: it carries exactly the scopes it was minted with and nothing more. A call outside a key's scopes is rejected before it reaches the handler.

templates:read

Search, fetch, and render templates, and read grounding docs

templates:write

Author, revise, duplicate, and delete drafts, and manage grounding

templates:submit

Submit drafts for provider approval

marketplace:clone

Clone marketplace templates and surveys into your org

messages:send

Broadcast templates to recipients

surveys:read

Search, fetch, render, and list sends for surveys

surveys:write

Author, patch, and delete surveys, and upload media

surveys:submit

Submit surveys for provider approval

surveys:send

Send survey tests and live survey runs

results:read

Read survey responses

audiences:read

List audiences and their contacts

audiences:write

Create and delete audiences, and import contacts

usage:read

Read metered usage for the org