FlowManner
Chat
Sign InGet Started
Flowmanner
Menu
  • Chat
  • Agents
  • Pricing
  • Docs
  • About
Products
  • Workflows
  • Templates
  • Changelog
  • Missions
Resources
  • Blog
  • API Reference
More
  • Careers
  • Contact
  • Security
  • Start
    • Quickstart
    • Your First Mission
    • Your First Eval
  • How-to
    • Connect Your Own Keys (BYOK)
    • Switch Models Per Task
    • Publish a Template
    • Run Evaluations
    • Chat with Artifacts & Previews
    • Automate via the API
    • Webhooks & Triggers
  • Concepts
    • Glossary
    • Execution Model
    • Models & Routing
    • Sandboxes & Previews
    • Memory & Privacy
    • Trust Model
  • Reference
    • Reference · API
      • Authentication
      • Missions & Runs
      • Chat & Sandboxes
      • Blueprints, Graphs & Templates
      • Evaluations & Feedback
      • Marketplace & Community
      • Files & Exports
      • Integrations & Webhooks
      • Agents & Orchestration
      • Auth, Workspaces & Billing
      • Memory & Knowledge
      • Notifications
      • Platform Services
    • Errors
    • Models
    • Limits

Authentication

Flowmanner's two auth surfaces: the browser session cookie and the backend JWT bearer token. What API integrators need to know in minute one.

Two surfaces, by design

Flowmanner intentionally separates browser traffic from API traffic:

  1. Browser surface. The web app authenticates you via a NextAuth session cookie. This cookie fronts Next.js only — the FastAPI backend does not accept it.
  2. Backend surface. Every call to /api/* (missions, chat, evals, …) must carry its own JWT access token as Authorization: Bearer <token>.

The browser obtains that JWT after login and stores it client-side (acquisition chain and caching rules live in frontend/src/lib/get-auth-token.ts). This is why a bare browser fetch with only the session cookie returns 401 against /api/*: the backend never sees or trusts the NextAuth cookie.

Getting a token

POST /api/auth/login
Content-Type: application/json

{ "username_or_email": "you@example.com", "password": "…" }

This endpoint is public (no security declaration in the OpenAPI contract; contracts/openapi.json, op summary "Login"). The response contains an access token and a refresh token.

  • Access tokens expire after 15 minutes (JWT_ACCESS_TOKEN_EXPIRES: int = 900, backend/backend/app/config.py:33; signing at backend/backend/app/services/auth_service.py:57).
  • Refresh tokens are longer-lived (backend/backend/app/services/auth_service.py:88) and are used to mint new access tokens without re-login.

Using the token

GET /api/auth/me
Authorization: Bearer <access-token>

Any endpoint whose row shows Bearer in the generated reference tables requires this header. Rows marked public either need no authentication or use a dedicated scheme — notably webhook ingest (POST /api/triggers/webhook/{webhook_path}), which is authenticated by an HMAC-SHA256 X-Signature signature over the raw body instead of a bearer token (backend/backend/app/api/v1/triggers.py:189, verification in backend/backend/app/services/trigger_service.py, verify_webhook_signature).

Common pitfalls

SymptomCauseFix
401 from /api/* despite being logged in in the browserOnly the NextAuth session cookie was sentAttach Authorization: Bearer <access-token>
GET /api/auth/session returns null while logged into the API flowThat route reflects the NextAuth session only; the JWT flow does not populate itUse POST /api/auth/login → bearer token for API work
Token worked, then stopped after ~15 minAccess-token TTL elapsedMint a fresh one via refresh or re-login

Note: raw schema surfaces (/docs, /redoc, /openapi.json) are gated at the edge and return 404 publicly. This documentation plus the curated /api/v2/openapi.json contract are the intended public references.

Last updated 2026-08-25 (git-derived)

  • Two surfaces, by design
  • Getting a token
  • Using the token
  • Common pitfalls