Auggyv0.5.0
PreviewDocs / Advanced Preview

Add HTTP routes

Advanced preview: expose focused HTTP behavior for frontends, webhooks, and server integrations without running a model turn.

Optional app integration

This surface is not part of the default agent path and does not make Auggy a general application backend. Its API may change before 1.0; pin exact versions and validate authorization and operational boundaries.

When to add a route

Optional advanced preview

A normal Auggy project does not need HTTP routes. Add one only when software already knows the exact operation it needs; use a tool when the model should mediate the operation during a turn.

  • A browser, mobile app, server job, webhook, or outside service needs to call the capability directly.
  • The behavior should be typed, repeatable, auditable, fast, or state-changing.
  • A generated client should call the capability without hand-writing paths and auth headers.
  • A chat-first flow needs a route-backed UI component to complete a structured action.

Current route surface

  • GET and POST routes.
  • Exact paths and full-segment path params such as /orders/:id.
  • Route groups, path params, query parsing, JSON body parsing, and response helpers.
  • Zod schemas for params, query, body, and successful JSON responses.
  • auth: none, bearer, creator, visitor.optional, visitor.required, or agent.required.
  • Per-route body caps, timeouts, and rate limits.
  • Route manifests, --json, --openapi, and generated TypeScript clients through auggy routes.
  • Webhook signature policy metadata, with runtime Stripe and Svix verification.

Route example

Typed routeTypeScript
import { defineRoute, json } from "auggy";
import { z } from "zod";

const SearchQuery = z.object({
  q: z.string().min(1),
});

export const routes = [
  defineRoute.get("/services/search", {
    auth: "none",
    query: SearchQuery,
    response: z.object({
      services: z.array(z.object({ id: z.string(), name: z.string() })),
    }),
    handler: async ({ query }) => {
      const services = await searchServices(query.q);
      return json({ services });
    },
  }),
];

Route classes

Route classExamplesTypical auth
Public discoveryGET /catalog/search, GET /servicesnone or visitor.optional
Lead and intakePOST /leads/create, POST /support/intakenone or visitor.optional
Draft statePOST /orders/draft, POST /appointments/holdvisitor.optional or visitor.required
Final handoffPOST /checkout/create, POST /bookings/:id/confirmvisitor.required
Account lookupGET /orders/:id, GET /tickets/:id/statusvisitor.required
WebhooksPOST /webhooks/stripe or /webhooks/agentmailStripe/Svix signature policy or handler-verified provider auth
Operator actionsPOST /admin/reindex, POST /catalog/syncbearer or creator

Related