Skip to content

fix: migrate registerHttpHandler to registerHttpRoute (OpenClaw 2026.3.x)#39

Merged
madtank merged 1 commit intoax-platform:mainfrom
viewsonic-max:fix/register-http-route-api-migration
Mar 27, 2026
Merged

fix: migrate registerHttpHandler to registerHttpRoute (OpenClaw 2026.3.x)#39
madtank merged 1 commit intoax-platform:mainfrom
viewsonic-max:fix/register-http-route-api-migration

Conversation

@viewsonic-max
Copy link
Copy Markdown
Contributor

Problem

api.registerHttpHandler() was removed in OpenClaw 2026.3.x, causing the plugin to fail during registration with:
TypeError: api.registerHttpHandler is not a function

Fix

Migrated to api.registerHttpRoute() with the correct params object signature.

Key details

  • auth: 'plugin' is required — omitting it silently prevents the route from mounting (no error, just 404)
  • match: 'prefix' supports both POST dispatch and GET WebSub challenge verification at the same path
  • No other files needed changes

Before

api.registerHttpHandler(dispatchHandler);

After

api.registerHttpRoute({
  path: '/ax/dispatch',
  handler: dispatchHandler,
  auth: 'plugin',
  match: 'prefix',
});

Tested

Verified on OpenClaw 2026.3.13 — dispatch endpoint responds correctly and agent receives/processes messages end to end.

api.registerHttpHandler() was removed in OpenClaw 2026.3.x.
Migrated to the new api.registerHttpRoute() with the required
params object signature, including auth: 'plugin' (required field
that silently prevented the route from mounting when omitted) and
match: 'prefix' to support both POST dispatch and GET WebSub
challenge verification.
@madtank
Copy link
Copy Markdown
Member

madtank commented Mar 27, 2026

@viewsonic-max thanks for the PR!

@madtank madtank merged commit 4baeb9d into ax-platform:main Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants