featherbit UI
    Preparing search index...

    Variable apiConst

    api: {
        clearTraces: () => Promise<unknown>;
        createRoute: (route: Route) => Promise<unknown>;
        createStore: (store: StoreConfig) => Promise<unknown>;
        debugConfig: () => Promise<DebugConfig>;
        deletePluginConfig: (name: string) => Promise<unknown>;
        deletePolicy: (name: string) => Promise<unknown>;
        deleteRoute: (name: string) => Promise<unknown>;
        deleteSession: (store: string, id: string) => Promise<unknown>;
        deleteSessionsBySubject: (
            store: string,
            subject: string,
        ) => Promise<{ revoked: number }>;
        deleteStore: (name: string) => Promise<unknown>;
        deleteSupernode: (name: string) => Promise<unknown>;
        exportConfig: () => Promise<string>;
        getPluginConfig: (name: string) => Promise<PluginConfigDef>;
        getPolicy: (name: string) => Promise<Policy>;
        getRoute: (name: string) => Promise<Route>;
        getSupernode: (name: string) => Promise<Supernode>;
        getTrace: (id: string) => Promise<TraceDetail>;
        listAcmeCerts: () => Promise<AcmeCertsResponse>;
        listEnvVars: () => Promise<string[]>;
        listPluginConfigs: () => Promise<PluginConfigDef[]>;
        listPlugins: () => Promise<PluginType[]>;
        listPolicies: () => Promise<Policy[]>;
        listPrompts: () => Promise<PromptDef[]>;
        listRoutes: () => Promise<Route[]>;
        listScripts: () => Promise<ScriptFile[]>;
        listSessions: (
            filter: {
                cursor?: string;
                limit?: number;
                plugin?: string;
                store: string;
                subject?: string;
            },
        ) => Promise<SessionPage>;
        listStores: () => Promise<StoreConfig[]>;
        listSupernodes: () => Promise<Supernode[]>;
        listTraces: (
            filter?: { limit?: number; policy?: string; source?: string },
        ) => Promise<TraceSummary[]>;
        listTracesWithRetention: (
            filter?: { limit?: number; policy?: string; source?: string },
        ) => Promise<{ retention: TraceRetention; traces: TraceSummary[] }>;
        listVars: () => Promise<VarEntry[]>;
        mcpStatus: () => Promise<McpStatus>;
        pingStore: (name: string) => Promise<StorePing>;
        reload: () => Promise<unknown>;
        renderPrompt: (
            name: string,
            args: Record<string, string>,
        ) => Promise<RenderedPrompt>;
        renewAcmeCert: (id: string, force: boolean) => Promise<AcmeRenewResponse>;
        runSandbox: (body: unknown) => Promise<SandboxResult>;
        status: () => Promise<GatewayStatus>;
        updatePluginConfig: (
            name: string,
            def: PluginConfigDef,
        ) => Promise<unknown>;
        updatePolicy: (name: string, policy: Policy) => Promise<unknown>;
        updateRoute: (name: string, route: Route) => Promise<unknown>;
        updateStore: (name: string, store: StoreConfig) => Promise<unknown>;
        updateSupernode: (name: string, sn: Supernode) => Promise<unknown>;
    } = ...

    The gateway Admin API surface used by the editor.

    All methods return promises and throw on non-2xx responses; mutating calls trigger route/policy revalidation on the gateway side.

    Type Declaration

    • clearTraces: () => Promise<unknown>

      DELETE /api/debug/traces — empties the trace buffer.

    • createRoute: (route: Route) => Promise<unknown>

      POST /api/routes — creates a new route; returns the API's JSON acknowledgement.

    • createStore: (store: StoreConfig) => Promise<unknown>

      POST /api/stores — creates a store; 409 when the name exists.

    • debugConfig: () => Promise<DebugConfig>

      GET /api/debug/config — effective debug settings; answers even when debug is disabled.

    • deletePluginConfig: (name: string) => Promise<unknown>

      DELETE /api/plugin-configs/{name} — removes the shared config; 400 while referenced.

    • deletePolicy: (name: string) => Promise<unknown>

      DELETE /api/policies/{name} — removes the named policy; returns the API's JSON acknowledgement.

    • deleteRoute: (name: string) => Promise<unknown>

      DELETE /api/routes/{name} — removes the named route; returns the API's JSON acknowledgement.

    • deleteSession: (store: string, id: string) => Promise<unknown>

      DELETE /api/sessions/{store}/{id} — revokes one session.

    • deleteSessionsBySubject: (store: string, subject: string) => Promise<{ revoked: number }>

      DELETE /api/sessions?store=…&subject=… — revokes every session for a subject.

    • deleteStore: (name: string) => Promise<unknown>

      DELETE /api/stores/{name} — removes the store; 409 in_use with referrers while referenced.

    • deleteSupernode: (name: string) => Promise<unknown>

      DELETE /api/supernodes/{name} — removes the definition; 400 while referenced.

    • exportConfig: () => Promise<string>

      GET /api/config/export — returns the live in-memory config (routes + policies) as a YAML string.

    • getPluginConfig: (name: string) => Promise<PluginConfigDef>

      GET /api/plugin-configs/{name} — returns the named shared config.

    • getPolicy: (name: string) => Promise<Policy>

      GET /api/policies/{name} — returns the named policy.

    • getRoute: (name: string) => Promise<Route>

      GET /api/routes/{name} — returns the named route.

    • getSupernode: (name: string) => Promise<Supernode>

      GET /api/supernodes/{name} — returns the named definition.

    • getTrace: (id: string) => Promise<TraceDetail>

      GET /api/debug/traces/{id} — one trace with per-step computed changes.

    • listAcmeCerts: () => Promise<AcmeCertsResponse>

      GET /api/acme/certs — managed certificate states; enabled: false when acme is not configured.

    • listEnvVars: () => Promise<string[]>

      GET /api/env-vars — process environment variable names (no values), unwrapped from { names: [...] }.

    • listPluginConfigs: () => Promise<PluginConfigDef[]>

      GET /api/plugin-configs — returns all shared plugin configs.

    • listPlugins: () => Promise<PluginType[]>

      GET /api/plugins — returns the catalog of available plugin types, unwrapped from { plugins: [...] }.

    • listPolicies: () => Promise<Policy[]>

      GET /api/policies — returns all configured policies.

    • listPrompts: () => Promise<PromptDef[]>

      GET /api/mcp/prompts — the precompiled agent prompts.

    • listRoutes: () => Promise<Route[]>

      GET /api/routes — returns all configured routes.

    • listScripts: () => Promise<ScriptFile[]>

      GET /api/scripts — returns scripted-plugin files found on the gateway host, unwrapped from { scripts: [...] }.

    • listSessions: (
          filter: {
              cursor?: string;
              limit?: number;
              plugin?: string;
              store: string;
              subject?: string;
          },
      ) => Promise<SessionPage>

      GET /api/sessions?store=… — one page of session metadata; 501 on headless builds.

    • listStores: () => Promise<StoreConfig[]>

      GET /api/stores — returns all named stores (raw ${ENV} placeholders, never resolved).

    • listSupernodes: () => Promise<Supernode[]>

      GET /api/supernodes — returns all supernode definitions.

    • listTraces: (
          filter?: { limit?: number; policy?: string; source?: string },
      ) => Promise<TraceSummary[]>

      GET /api/debug/traces — recorded traces, newest first, unwrapped from { traces: [...] }. Optional filter.policy / filter.limit / filter.source are sent as query params (source maps to the server-side TraceFilter.source, e.g. "request" | "sandbox" — see src/admin/debug.rs); called with no args, behavior is unchanged from before (all traces, default server-side limit).

    • listTracesWithRetention: (
          filter?: { limit?: number; policy?: string; source?: string },
      ) => Promise<{ retention: TraceRetention; traces: TraceSummary[] }>

      The same endpoint, keeping the retention block the list response carries. Separate from listTraces so the callers that only want rows (var suggestions) stay unchanged; the Debug panel needs the window to explain an empty result.

    • listVars: () => Promise<VarEntry[]>

      GET /api/vars — the context-variable catalog, unwrapped from { vars: [...] }.

    • mcpStatus: () => Promise<McpStatus>

      GET /api/mcp/status — MCP availability; answers even when MCP is off.

    • pingStore: (name: string) => Promise<StorePing>

      POST /api/stores/{name}/ping — connectivity check; 502/504 unreachable, 501 headless build.

    • reload: () => Promise<unknown>

      POST /api/config/reload — makes the gateway re-read gateway.yaml from disk; returns the API's JSON acknowledgement.

    • renderPrompt: (name: string, args: Record<string, string>) => Promise<RenderedPrompt>

      GET /api/mcp/prompts/{name}?… — a prompt rendered with live data.

    • renewAcmeCert: (id: string, force: boolean) => Promise<AcmeRenewResponse>

      POST /api/acme/certs/{id}/renew[?force=true] — 202 scheduled, 200 not_due, 409 in_progress, 404 unknown.

    • runSandbox: (body: unknown) => Promise<SandboxResult>

      POST /api/debug/sandbox — runs ad-hoc nodes or a named policy against a synthetic context.

    • status: () => Promise<GatewayStatus>

      GET /api/status — returns gateway version plus route and policy counts.

    • updatePluginConfig: (name: string, def: PluginConfigDef) => Promise<unknown>

      PUT /api/plugin-configs/{name} — upserts the named shared config (also used to create).

    • updatePolicy: (name: string, policy: Policy) => Promise<unknown>

      PUT /api/policies/{name} — upserts the named policy (also used to create new policies); returns the API's JSON acknowledgement.

    • updateRoute: (name: string, route: Route) => Promise<unknown>

      PUT /api/routes/{name} — replaces the named route; returns the API's JSON acknowledgement.

    • updateStore: (name: string, store: StoreConfig) => Promise<unknown>

      PUT /api/stores/{name} — upserts the named store.

    • updateSupernode: (name: string, sn: Supernode) => Promise<unknown>

      PUT /api/supernodes/{name} — upserts the named definition (also used to create).

    Handlers live in src/admin/routes.rs (routes), src/admin/policies.rs (policies, plugins, scripts), and src/admin/status.rs (status, reload).