Skip to content
You are reading the docs for Wanaku next, the unreleased development version. Read the docs for the latest release.

Management API reference for tools, forwards and policies ​

The management API lets operators inspect and change Wanaku at runtime. It listens on port 8080 by default. Set WANAKU_MGMT_LISTEN to use a different address.

WASM handler lifecycle routes are documented in WASM tool handlers. These routes compile and activate component bindings without a server rebuild.

The server uses Pingora's ServeHttp trait. The A2A agent routes run first. The other core routes run next. Feature routes run after core routes. Core routes match complete path segments. For example, /api/v1/tools-export does not match the /api/v1/tools route, so a feature can own that path. If no route matches, the server returns 404.

Access and Response Format ​

Wanaku does not apply built-in authentication or rate limits to the management API. Restrict access to port 8080. In production, put the API behind an authenticated reverse proxy and apply a rate limit there.

Most JSON responses use this envelope:

json
{
  "data": {
    "name": "example"
  },
  "error": null
}

For an error, data is null and error contains a message:

json
{
  "data": null,
  "error": "Tool 'unknown-tool' not found"
}

The data value can be an object, an array, or null. This envelope keeps the API compatible with the classic Wanaku CLI.

Service and Core Routes ​

MethodPathPurpose
GET/healthGet the server health.
GET/healthzGet the server health.
GET/openapi.jsonGet the OpenAPI document.
GET/api/v1/management/infoGet the server name, the version, and the public MCP URL (mcpPublicUrl, null when WANAKU_MCP_PUBLIC_URL is not set).
GET/api/v1/management/statisticsGet registry counts.
GET/api/v1/toolsList tools.
GET/api/v1/tools/{name}Get a tool. Use the optional namespace query parameter.
DELETE/api/v1/tools/{name}Delete a tool. Use the optional namespace query parameter.
PUT/api/v1/tools/{name}/enableEnable a tool. Use the optional namespace query parameter.
PUT/api/v1/tools/{name}/disableDisable a tool. Use the optional namespace query parameter.
GET/api/v1/resourcesList resources.
GET/api/v1/resources/{name}Get a resource. Use the optional namespace query parameter.
DELETE/api/v1/resources/{name}Delete a resource. Use the optional namespace query parameter.
PUT/api/v1/resources/{name}/enableEnable a resource. Use the optional namespace query parameter.
PUT/api/v1/resources/{name}/disableDisable a resource. Use the optional namespace query parameter.
GET/api/v1/promptsList prompts.
GET/api/v1/prompts/{name}Get a prompt. Use the optional namespace query parameter.
DELETE/api/v1/prompts/{name}Delete a prompt. Use the optional namespace query parameter.
PUT/api/v1/prompts/{name}/enableEnable a prompt. Use the optional namespace query parameter.
PUT/api/v1/prompts/{name}/disableDisable a prompt. Use the optional namespace query parameter.
GET/api/v1/namespacesList namespaces.
GET/api/v1/namespaces/{name}Get a namespace.
POST/api/v1/namespacesCreate a namespace from the JSON request body.
PUT/api/v1/namespaces/{name}Replace a namespace entry with the JSON request body.
DELETE/api/v1/namespaces/{name}Delete a namespace.
GET/api/v1/forwardsList forwards.
GET/api/v1/forwards/{name}Get a forward.
POST/api/v1/forwardsCreate a forward and run upstream discovery.
DELETE/api/v1/forwards/{name}Delete a forward and its discovered entries. Use optional label.<key>=<value> query parameters to delete only when the labels match.
POST/api/v1/forwards/{name}/refreshesRun upstream discovery again.
GET/api/v1/agentsList A2A agents. Use the optional namespace query parameter to select one namespace.
GET/api/v1/agents/{namespace}/{name}Get a registered A2A agent and its proxy endpoint.
POST/api/v1/agentsRegister an A2A agent.
PUT/api/v1/agents/{namespace}/{name}Replace an A2A agent's editable configuration.
DELETE/api/v1/agents/{namespace}/{name}Delete an A2A agent and remove its proxy route. Use optional label.<key>=<value> query parameters to delete only when the labels match.
GET/api/v1/bindingsList credential bindings.
GET/api/v1/bindings/{id}Get a credential binding.
POST/api/v1/bindingsCreate a credential binding.
PUT/api/v1/bindings/{id}Replace a credential binding definition.
DELETE/api/v1/bindings/{id}Delete a credential binding.

Wanaku discovers tools, resources, and prompts when you create or refresh a forward. The API does not have create routes for these entries. Tools and resources are read-only. You cannot edit them through the API.

Namespaces of Tools, Resources, and Prompts ​

Virtual namespaces combine concrete inventories through /virtual-ns/{name}/mcp and /virtual-ns/{name}/a2a. Add members to a namespace create or update body to define a virtual namespace. members: [] defines an empty virtual namespace. Members must be existing concrete namespaces. targets is an alias for members. Direct registrations still require a concrete namespace. Management entry routes keep concrete ownership and identifiers. See Virtual namespaces.

Wanaku identifies each tool, resource, and prompt by its namespace and its name. The same name can exist in more than one namespace. For example, two forwards in different namespaces can point to the same upstream. Each namespace then has its own copy of the entries.

The routes that address one entry by name use the namespace query parameter. The default value is default. Thus, a request without the parameter addresses the default namespace, as in earlier versions:

bash
curl http://localhost:8080/api/v1/tools/echo
curl 'http://localhost:8080/api/v1/tools/echo?namespace=finance'
curl -X PUT 'http://localhost:8080/api/v1/tools/echo/disable?namespace=finance'

If the entry does not exist in the namespace, the server returns 404. The list routes return the entries of all namespaces. Each entry has a namespace field.

Enable and Disable Tools, Resources, and Prompts ​

Each tool, resource, and prompt has an enabled field. The default value is true.

A disabled entry stays in the management API. GET /api/v1/tools and the other list routes return it with "enabled": false. MCP clients cannot see or use a disabled entry. tools/list, resources/list, and prompts/list do not include it. tools/call, resources/read, and prompts/get reject it.

Wanaku keeps the state when it discovers the entries of a forward again. A forward refresh or a reconnect does not enable a disabled entry.

Do not delete a tool, resource, or prompt. The next discovery adds it again. Disable the entry instead. The examples use the tool name get_weather. Use a name from GET /api/v1/tools:

bash
curl -X PUT http://localhost:8080/api/v1/tools/get_weather/disable

To enable the entry again:

bash
curl -X PUT http://localhost:8080/api/v1/tools/get_weather/enable

The response contains the updated entry. If the entry does not exist, the server returns 404.

The Admin UI shows an Enable/Disable toggle for each tool, resource, and prompt. The Admin UI does not show a Delete button for these entries.

Register an A2A agent ​

Register an upstream agent with its JSON-RPC address:

bash
curl -X POST http://localhost:8080/api/v1/agents \
  -H 'Content-Type: application/json' \
  -d '{"name":"assistant","namespace":"default","description":"Team assistant","address":"http://localhost:9000/"}'

The name and namespace identify the agent. Both values must use valid identifiers. Wanaku registers a missing namespace when you create an agent. The address must be an HTTP or HTTPS URL. URL credentials and fragments are not permitted. Set cardAddress when the Agent Card uses a different discovery URL.

Agent responses contain name, namespace, description, address, optional cardAddress, optional labels, and proxyUrl. The proxy URL comes from the configured public A2A origin. It is not an editable agent field.

Creating an existing agent returns 409. Getting, updating, or deleting an unknown agent returns 404. Invalid configuration returns 400. An invalid update does not change the existing entry. An update does not change the namespace and name in the route.

An update sends the complete agent entry. The body must contain name and namespace, and both must be equal to the values in the route. A missing namespace defaults to default. If the route has a different namespace, the server returns 400. The body accepts only name, namespace, description, address, cardAddress, and labels. Unknown keys return 400. Thus, do not send a GET response without changes: remove proxyUrl first.

bash
curl -X PUT http://localhost:8080/api/v1/agents/default/assistant \
  -H 'Content-Type: application/json' \
  -d '{"name":"assistant","namespace":"default","description":"Team assistant","address":"http://localhost:9000/"}'

Label an A2A agent ​

Use the optional labels object to attach string key-value pairs to an agent. POST and PUT accept labels. A PUT request replaces the complete entry. Send the current labels again to keep them. If you do not send labels, the agent has no labels. Responses do not contain labels when the agent has no labels.

bash
curl -X POST http://localhost:8080/api/v1/agents \
  -H 'Content-Type: application/json' \
  -d '{"name":"assistant","address":"http://localhost:9000/","labels":{"cic.instance":"pod-a"}}'

To delete an agent only when it has the given labels, add label.<key>=<value> query parameters. This contract is the same as the contract of conditional forward deletion:

bash
curl -X DELETE 'http://localhost:8080/api/v1/agents/default/assistant?label.cic.instance=pod-a'
CaseResponse
No label.* parameters200. Wanaku deletes the agent without a check.
The agent has all the given labels with the given values200. Wanaku deletes the agent.
A given label is absent or has a different value409 Conflict with {"data": null, "error": "agent {namespace}/{name} label precondition failed"}. Wanaku keeps the agent.
The agent does not exist404.

Wanaku checks the labels and removes the agent in one registry operation. A concurrent PUT for the same agent cannot occur between the check and the removal.

Agent changes use the configured registry persistence backend. They affect subsequent proxy requests without a restart. See A2A Proxy for the admin UI, listener configuration, policy, and supported protocol operations.

Create a Namespace ​

Use the Wanaku CLI:

bash
wanaku namespaces create finance --no-auth

The CLI sends this request to the management API:

bash
curl -X POST http://localhost:8080/api/v1/namespaces \
  -H 'Content-Type: application/json' \
  -d '{"name":"finance"}'

Namespace names can contain lowercase letters, numbers, and hyphens. They cannot start or end with a hyphen. The maximum length is 63 characters. An invalid name returns 400.

If the namespace already exists, the request returns 409 and does not change the stored entry. Use PUT /api/v1/namespaces/{name} to change an existing namespace.

Update a Namespace ​

Send the complete namespace entry to the namespace path:

bash
curl -X PUT http://localhost:8080/api/v1/namespaces/finance \
  -H 'Content-Type: application/json' \
  -d '{"name":"finance","labels":{"team":"payments"}}'

The name in the path identifies the namespace. Wanaku ignores the name value in the body. An update cannot rename a namespace. An update does not remove the tools, forwards, or A2A agents in the namespace. A malformed body, a missing body, or an invalid path name returns 400 and does not change the stored entry. The admin UI uses this operation to save namespace edits.

Create a Forward ​

Use the Wanaku CLI:

bash
wanaku forwards add --service="http://upstream-server:8080/mcp" --name upstream-mcp --namespace finance --no-auth

The CLI sends this request to the management API. Include the namespace in the request:

bash
curl -X POST http://localhost:8080/api/v1/forwards \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "upstream-mcp",
    "address": "http://upstream-server:8080/mcp",
    "namespace": "finance"
  }'

Wanaku validates the request before discovery:

  • An invalid namespace name returns 400. Wanaku does not create the forward or the namespace.
  • An address without an http or https scheme and a host returns 400.
  • A forward with the same name returns 409 and does not change the stored forward or its discovered entries. To replace the forward, add the replace=true query parameter (POST /api/v1/forwards?replace=true). To discover the capabilities of a forward again, use POST /api/v1/forwards/{name}/refreshes.

A successful request returns 200 with the forward and the discovered entry counts:

json
{
  "data": {
    "forward": {"name": "upstream-mcp", "address": "http://upstream-server:8080/mcp", "namespace": "finance", "available": true},
    "tools_discovered": 3,
    "resources_discovered": 0,
    "prompts_discovered": 1
  },
  "error": null
}

The forward object also contains other forward fields. Wanaku stores a new forward even if discovery fails. In that case, the response is also 200. The counts are zero, forward.available is false, and forward.statusMessage contains the error. Thus, curl --fail does not detect a discovery failure. Check forward.available:

bash
curl -sS -X POST http://localhost:8080/api/v1/forwards \
  -H 'Content-Type: application/json' \
  -d '{"name":"upstream-mcp","address":"http://upstream-server:8080/mcp","namespace":"finance"}' \
  | jq -e '.data.forward.available' >/dev/null || echo "discovery failed"

A replacement (replace=true) is all or nothing. When the discovery of a replacement fails, Wanaku does not change the registry. The previous forward keeps its address, labels, availability, and entries. The response is 502 with the error in error. A conditional delete with the labels of the failed replacement returns 409. Thus, a runtime that cannot complete its replacement does not remove the forward of the instance that it replaces.

POST /api/v1/forwards/{name}/refreshes returns a different shape: refreshed (the forward name) and the three counts. It does not return the forward. After a refresh, use GET /api/v1/forwards/{name} to check available and statusMessage.

Discovery Failure Behavior ​

Forward create, forward refresh, startup, and the background reconnect loop use the same discovery path. Wanaku captures the forward registration and the identity of each referenced credential binding before discovery. It releases the registry lock before it contacts the upstream. It then checks the captured state and publishes the status and capabilities under one write lock.

If a writer changes, deletes, or recreates the forward before publication, Wanaku discards the discovery result. The same check applies to changes to a referenced credential binding. A manual create or refresh returns 409 when this check fails. Retry the operation to run discovery again.

Embedders can call RuntimeRegistry::begin_forward_registration or RuntimeRegistry::begin_forward_refresh to capture an update request. Pass the request to wanaku_server::management::prepare_forward_update to run discovery. Pass its result to wanaku_server::management::apply_forward_update to publish it conditionally.

Discovery lists tools, resources, resource templates, and prompts. Each listing has one of these results:

Listing resultExampleWanaku behavior
CompleteThe upstream returns the last page.Wanaku uses the entries. A listing stops at 500 entries.
Not supportedThe upstream returns the JSON-RPC error -32601 (method not found) on the first page.Wanaku records no entries of that type. Discovery continues.
IncompleteA transport error, a timeout, a JSON-RPC error on any page, or more than 100 pages.The full discovery fails.

When discovery succeeds, Wanaku replaces the entries of the forward with the new entries. The forward is available, and statusMessage is empty. A disabled entry stays disabled.

When discovery fails or is incomplete, Wanaku does not publish a partial list:

  • Wanaku keeps the previous entries of the forward in the registry. A new forward has no entries.
  • Wanaku sets available to false and writes the cause to statusMessage.
  • The response counts are zero.
  • The tools/call, resources/read, and prompts/get requests that resolve an entry of an unavailable forward return a JSON-RPC error. Wanaku does not call the upstream for these requests.
  • The background reconnect loop runs discovery again. When discovery succeeds, the forward becomes available again.

Wanaku identifies the entries of a forward by forwardId, not by address. When two forwards use the same address, the discovery of one forward does not change the entries of the other forward.

Name Conflicts in a Namespace ​

A name is unique in one namespace. When a forward discovers an entry, and a different owner already has an entry with the same type and name in the same namespace, Wanaku does not replace the existing entry:

  • Wanaku keeps the existing entry and skips the discovered entry. The first owner keeps the name.
  • Wanaku writes a warning to the log.
  • The forward stays available. Its statusMessage names each skipped entry, for example skipped 1 discovered entries because other owners already use the names in namespace default: tool echo.
  • The response counts do not include the skipped entries.

Entries in different namespaces do not conflict. When you delete a forward, Wanaku removes only the entries that the forward owns. The entries of other forwards stay. After the owner of a name is deleted, refresh the other forward to publish its entry with that name.

Wanaku publishes the forward record, tools, resources, and prompts together. A list request sees the complete previous inventory or the complete new inventory of each forward. A call uses the forward record from the same publication as its selected entry. During discovery, calls can continue to use the previous publication.

The snapshot queued for persistence uses the same publication. The snapshot stores dynamic forward records and disabled overrides. Startup discovery restores the full inventory.

For resource reads and prompt retrievals, Wanaku checks admission after credential resolution and before handing the request to the upstream transport. A request admitted before deletion can finish independently.

The request body can also contain credentialBindings, a map from purpose (discovery, invocation) to binding id. Create the definitions through the binding API or declare them in wanaku.yaml. See Credential Brokerage.

Static Forwards ​

A forward from wanaku.yaml has "static": true. Wanaku does not persist a static forward. Wanaku registers it again at each startup. A forward that you create through this API has "static": false. The API ignores a static value in the request body. A forward that replaces a static forward (replace=true) stays static.

You can delete or replace a static forward through this API. The change stays until the next startup. To remove a static forward permanently, remove it from wanaku.yaml. See Registry data at startup.

Delete a Forward Conditionally ​

A successful delete closes admission for tool calls to that registration. Calls that have not reached dispatch fail, including calls waiting for credentials or MCP session setup. Registering the same name again does not let those calls use the new registration.

Wanaku admits a tool call for dispatch when it submits the upstream HTTP POST for execution. This happens after the MCP client takes the call from its queue. A call admitted before deletion can complete independently. The delete response does not wait for those calls. The upstream server can receive or execute an admitted call after the delete response. Wanaku does not cancel or automatically replay admitted calls on deletion.

A runtime that registers its own forward can mark the forward with a label, such as cic.instance. A replacement instance can register the same forward name with replace=true before the old instance stops. To prevent the old instance from deleting the new forward, send the label as a precondition:

bash
curl -X DELETE 'http://localhost:8080/api/v1/forwards/upstream-mcp?label.cic.instance=pod-a'

Each label.<key>=<value> query parameter adds one precondition. You can send more than one. Wanaku ignores query parameters that do not start with label.. Encode keys and values as URL query components.

CaseResponse
No label.* parameters200. Wanaku deletes the forward without a check.
The forward has all the given labels with the given values200. Wanaku deletes the forward.
A given label is absent or has a different value409 Conflict with {"data": null, "error": "forward {name} label precondition failed"}. Wanaku keeps the forward.
The forward does not exist404.

Wanaku checks the labels and removes the forward in one registry operation. A concurrent POST /api/v1/forwards for the same name cannot occur between the check and the removal. When Wanaku deletes a forward, it also removes the cached credentials and the discovered tools, resources, and prompts of the forward. A 409 response does not change these entries.

Manage Credential Bindings ​

Binding responses contain metadata. Each secretRefs entry contains an opaque reference such as env:API_TOKEN. Wanaku resolves the reference when it uses the binding.

Treat access to the management API as operator access. Put the management listener on a trusted network. If clients connect from outside that network, use an authenticated reverse proxy that authorizes binding writes for operators. Block direct access to the listener. See Authentication.

RequestSuccessErrors
GET /api/v1/bindings200 with the array of bindings in data.
GET /api/v1/bindings/{id}200 with the binding in data.404 if the ID is absent.
POST /api/v1/bindings201 with the stored binding in data.400 for an invalid definition. 409 if the ID exists.
PUT /api/v1/bindings/{id}200 with the stored binding in data.400 for an invalid definition or a body ID that differs from the path ID. 404 if the ID is absent. 409 if the owner changes or the revision is exhausted.
DELETE /api/v1/bindings/{id}200 with {"data":null,"error":null}.404 if the ID is absent.

Write requests with bodies larger than 1 MiB return 413. For POST and PUT, use the complete binding definition. For new IDs, use ASCII letters, digits, hyphens, underscores, periods, or tildes. The IDs . and .. are invalid. Give the owning forward's name in forwardId and at least one purpose in allowedPurposes. The owner can be a forward that you plan to register. If you omit restrictions or cache, Wanaku uses their defaults. Wanaku normalizes origin to the scheme, host, and explicit port.

Percent-encode the ID as one path component for GET, PUT, and DELETE. Use the original ID in the PUT body.

Wanaku assigns the revision and ignores the revision in the request. A definition change increments the stored revision. An identical PUT keeps the revision. A recreated binding starts at revision 1 and receives a new cache identity. Wanaku serializes binding mutations. If two creates race for an absent ID, one succeeds and the other returns 409. Updates and deletes operate on the definition present when each operation takes effect. Among successful concurrent updates, the last one to take effect wins.

Mutation routes return 503 if Wanaku cannot prepare the mutation or queue it for persistence. Wanaku keeps the previous binding state in this case. With persistence enabled, a successful response means Wanaku queued the snapshot for an asynchronous write. See registry persistence.

A binding change does not rewrite forward references or trigger discovery. A discovery or invocation that uses a missing binding, an incorrect owner or origin, or a disallowed purpose or scope fails closed before sending a request upstream. A mutation can take effect after a request has already selected the previous definition. Wanaku discards a discovery result if a referenced binding changes before publication.

Register an Authenticated Forward ​

Provision API_TOKEN in the Wanaku process environment before startup. The binding API manages definitions. The resolver provider manages credentials.

bash
curl --fail-with-body -X POST http://localhost:8080/api/v1/bindings \
  -H 'Content-Type: application/json' \
  -d '{
    "id": "upstream-auth",
    "forwardId": "upstream-mcp",
    "origin": "https://api.example.com:443",
    "mechanism": {"type": "bearer"},
    "secretRefs": ["env:API_TOKEN"],
    "allowedPurposes": ["discovery", "invocation"]
  }'

curl --fail-with-body -X POST http://localhost:8080/api/v1/forwards \
  -H 'Content-Type: application/json' \
  -d '{
    "name": "upstream-mcp",
    "address": "https://api.example.com/mcp",
    "credentialBindings": {
      "discovery": "upstream-auth",
      "invocation": "upstream-auth"
    }
  }' | jq -e '.data.forward.available'

Replace the example host with your upstream host in both requests. See Credential Brokerage for restrictions, cache rules, and startup precedence.

Feature Routes ​

Audit ​

MethodPathPurpose
GET/api/v1/audit/eventsList audit events with pagination and filters.
GET/api/v1/audit/events/{id}Get one audit event.
GET/api/v1/audit/schemaGet the audit schema version.
GET/api/v1/audit/healthGet audit-store health and the dropped-event count.
POST/api/v1/audit/semanticAccept one semantic audit event from an external producer, such as WSR.

GET /api/v1/audit/events returns 400 when category, decision, offset, or limit has an invalid value.

POST /api/v1/audit/semantic returns 404 unless WANAKU_AUDIT_INGESTION_ENABLED=true. See Ingest Camel semantic audit records.

Metrics ​

MethodPathPurpose
GET/api/v1/metricsGet filter, evaluator, LLM, WASM, and pipeline metrics.

Evaluators ​

MethodPathPurpose
GET/api/v1/evaluatorsList evaluator definitions.
GET/api/v1/evaluators/statusGet runtime readiness, revision, safe reason code, and effective posture. The optional namespace query parameter defaults to default.
PUT/api/v1/evaluatorsReplace evaluator definitions. The body uses the evaluators configuration schema.
GET/api/v1/evaluators/llm-connectionsList configured LLM connection names only, never the model, URL, or credential. Connections are config-only. Set them in wanaku.yaml, not through this API.
GET/api/v1/evaluators/revisionsList evaluator revision metadata.
GET/api/v1/evaluators/revisions/activeGet the active evaluator revision.
GET/api/v1/evaluators/revisions/{id}Get one evaluator revision.
POST/api/v1/evaluators/revisions/{id}/activateActivate a prior evaluator configuration as a new revision.

The PUT /api/v1/evaluators body is {"evaluators": [...], "expected_revision": N}. expected_revision is optional. Unknown keys return 400. A revision mismatch returns 409. A configuration that does not validate or compile returns 422, and the active revision does not change. See Update Evaluators for an example.

The activate body is optional. To prevent a lost update, send {"expected_revision": N}. A mismatch returns 409.

See Evaluator Engine for the evaluator configuration schema.

The OpenAPI document contains all evaluator request and response schemas. Run yarn run generate-api in ui/admin after you change an evaluator route or schema.

Action Policies ​

MethodPathPurpose
GET/api/v1/action-policiesGet the effective policy.
PUT/api/v1/action-policiesValidate and activate a policy.
GET/api/v1/action-policies/revisionsList policy revision metadata.
GET/api/v1/action-policies/revisions/activeGet the active policy revision.
GET/api/v1/action-policies/revisions/{id}Get one policy revision.
POST/api/v1/action-policies/revisions/{id}/activateActivate a prior policy as a new revision.

The update and activation requests accept an optional expected_revision. Wanaku returns 409 Conflict if the value does not equal the active revision. See Action Policies for request examples and validation behavior.

The OpenAPI document contains all action-policy request and response schemas. Run yarn run generate-api in ui/admin after you change an action-policy route or schema.

Policy Simulation ​

MethodPathPurpose
POST/api/v1/policy-simulations/validateValidate a transient candidate.
POST/api/v1/policy-simulations/simulateEvaluate one synthetic MCP action.
POST/api/v1/policy-simulations/replaysStart a bounded asynchronous comparison job.
GET/api/v1/policy-simulations/replays/{id}Get job status and its impact report.
POST/api/v1/policy-simulations/replays/{id}/cancelRequest job cancellation.
DELETE/api/v1/policy-simulations/replays/{id}Delete a retained job.

These routes do not activate candidates. They do not forward actions or resolve credentials. External evaluator execution is not supported. Reports contain decision metadata instead of request payloads. See Policy Simulation for candidate selection, replay limits, audit input, and CI examples.

Inference Proxy (not part of this API) ​

Chat completions do not go through the management API. Wanaku exposes a separate, raw reverse-proxy listener on port 8083 that forwards requests as-is to whatever OpenAI-compatible backend WANAKU_INFERENCE_UPSTREAM points at — including the caller's own Authorization header. The LLM Chat page in the Wanaku Debugger plugin calls this port directly with a key you supply in the browser. Install the plugin from the Admin UI Plugin Catalog. Open Debugger from the Developer navigation section. Select the LLM Chat tab:

bash
curl -X POST http://localhost:8083/v1/chat/completions \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <your-key>" \
  -d '{
    "model": "llama3.1:8b",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

See Configuration for how to set the upstream.

OAuth Metadata ​

The MCP metadata feature always exposes OAuth Protected Resource Metadata:

text
GET /.well-known/oauth-protected-resource/{namespace}/mcp

The MCP listener (port 8081) serves this route, not the management API. For example:

bash
curl http://localhost:8081/.well-known/oauth-protected-resource/default/mcp

The resource field always contains the namespace, for example http://localhost:8081/default/mcp. Behind a TLS-terminating proxy, the base URL comes from WANAKU_MCP_PUBLIC_URL or the X-Forwarded-Proto and X-Forwarded-Host headers. When WANAKU_AUTH_ISSUER is set, authorization_servers contains the WANAKU_AUTH_ISSUER value. When it is not set, the list is empty. MCP clients use this document to find the authorization server. An external authentication proxy enforces access to the MCP endpoint. See Authentication.

Web UI Plugins ​

Open Plugin Catalog in the admin UI to browse available plugins. Select Info to view the metadata and required services. Select Install to download and install the archive. Set the service URLs in the configuration dialog when the plugin requires backend services. Reload the admin UI after installation to load the plugin. The server adds the plugin to the list without a restart. The UI shows Not specified or None when the source has no value for a field.

GET /api/v1/plugins/catalog returns available plugins in the standard data response field. Each entry contains id, name, version, description, publisher, license, dependencies, requires, metadata, and url. The url field identifies the installation archive. The requires.services field lists the backend services that the plugin needs.

The default source is the embedded features/plugins/plugin-catalog.json file. The server uses the plugin description and publisher from each catalog entry. It does not read GitHub release notes or plugin archives during catalog requests.

WANAKU_PLUGIN_CATALOG_PATH selects a local JSON file. WANAKU_PLUGIN_CATALOG_URL selects a remote JSON file. A local path takes precedence. A custom source replaces the complete default catalog. See Plugin Catalog for the source format and publication instructions.

The endpoint returns HTTP 502 if the selected source is unavailable or invalid. It does not use a fallback source. A request has a 30-second limit. A remote download has a 15-second limit. Catalog JSON has a 1 MiB size limit.

MethodPathPurpose
GET/api/v1/pluginsList discovered UI plugin manifests.
GET/api/v1/plugins/catalogList the plugins in the selected catalog.
POST/api/v1/plugins/installDownload a ZIP archive and install a plugin. The body is {"id": "...", "version": "...", "url": "..."}.
PUT/api/v1/plugins/{pluginId}/configReplace the backend service mappings of a plugin. The body is {"services": {"<serviceId>": {"target": "<url>"}}}.
GET/plugins/{pluginId}/{path}Get a static plugin file.
Any HTTP method/api/plugins/{pluginId}/{serviceId}/{path}Send a request through a configured plugin service mapping.

The plugin proxy accepts only plugin and service IDs that Wanaku loaded from configuration. It forwards the request method, body, query, and selected headers to the configured service. See Backend configuration.

Persistence ​

Wanaku enables file persistence by default. It stores registry snapshots in $HOME/.wanaku/server. After each registry change, Wanaku queues a snapshot and writes it in the background. On an orderly shutdown, Wanaku waits up to 10 seconds for the last write to finish.

Set WANAKU_PERSIST_BACKEND=none to disable persistence. Set WANAKU_PERSIST_PATH to use a different directory.

File persistence supports one writer. Do not run multiple replicas against the same persistence directory.

The snapshot stores tools, resources, and prompts as lists. Each entry has its namespace field. Wanaku loads snapshots from earlier versions without changes. An entry without a namespace goes to the default namespace.

Status Codes ​

The API uses these status codes:

  • 200 OK: The request succeeded. Core delete routes return a JSON confirmation in the standard envelope.
  • 202 Accepted: The server started an asynchronous job, for example a policy simulation replay.
  • 400 Bad Request: The request body is missing or invalid.
  • 404 Not Found: The route or requested entry does not exist.
  • 408 Request Timeout: A policy simulation exceeded its time limit.
  • 409 Conflict: An expected_revision does not match the active revision, an entry already exists, or a label precondition failed.
  • 413 Payload Too Large: The request body is larger than 1 MiB, or a simulation exceeded a size limit.
  • 422 Unprocessable Entity: The configuration or candidate is well-formed but does not validate, or a plugin archive is not valid.
  • 429 Too Many Requests: All simulation permits are in use, or the external audit capacity is full.
  • 500 Internal Server Error: The server could not complete the request.
  • 502 Bad Gateway: A plugin catalog, a plugin archive download, or a plugin service request failed.
  • 503 Service Unavailable: The audit store or the simulation store is not available.

Plugin file and proxy routes can return other status codes from file handling or the upstream service.

CORS ​

The management API sets Access-Control-Allow-Origin from WANAKU_CORS_ORIGIN. The default value is *.

Set a specific origin in production:

bash
export WANAKU_CORS_ORIGIN=https://app.example.com

The management API sets only the Access-Control-Allow-Origin header. It does not answer OPTIONS preflight requests. Thus, a browser on another origin can send simple GET requests, but a cross-origin JSON POST or PUT request fails the preflight. Serve browser clients from the same origin as the management API, or put a reverse proxy in front of it that handles preflight requests.

The MCP endpoint (port 8081) and the inference proxy (port 8083) each use their own pipeline CORS filter, set from the same WANAKU_CORS_ORIGIN value.

Next steps ​