How a plugin registers HTTP endpoints on the Gateway, and the auth, scope, replacement, and admission rules those routes follow. Part of the Plugin architecture internals guide.

Gateway HTTP routes

Plugins can expose HTTP endpoints with api.registerHttpRoute(...).

api.registerHttpRoute({
  path: "/acme/webhook",
  auth: "plugin",
  match: "exact",
  handler: async (_req, res) => {
    res.statusCode = 200;
    res.end("ok");
    return true;
  },
});

Route fields:

Notes: