Concept

Authentication

How Breeze Buddy authenticates API requests — JWT access tokens for users, server-to-server tokens for backends.

Every Breeze Buddy API call carries a Bearer token. The platform recognises two distinct token types — short-lived JWT access tokens for human users, and long-lived server-to-server (S2S) tokens for backend integrations. Picking the right one depends on who is making the call and how long the credential needs to live.

Two token types

Access token (JWT)S2S token
Issued byPOST /login with email + passwordPOST /s2s-token with role and scope
LifetimeShort — minutes to hoursLong — until manually revoked
Caller identityA specific user accountA named integration
Use caseDashboard session, CLI for a personBackend services pushing leads, CRON jobs, CI
RotationRe-issued on every loginRotate manually on a schedule
Where it livesBrowser memory or keychainSecrets manager, env var

Both tokens are sent the same way:

Authorization: Bearer <token>

The server treats them identically at the transport layer. The difference shows up in how they’re minted and the permissions they encode.

Scope and permissions

Every token carries a role (admin, reseller, merchant, user) and the IDs it is scoped to. The role determines what the token can read and write; the IDs determine whose data. See RBAC for the permission model.

A merchant-scoped S2S token, for example, can push leads and read analytics for that merchant — and nothing else. An admin access token can do everything, but only until it expires.

When to use which

  • Building a dashboard or CLI that users sign into? Use login + access token. The short lifetime limits blast radius if the token leaks.
  • Running a backend cron or an integration in your own infrastructure? Use an S2S token. Scope it to the narrowest role and reseller/merchant combination that works.
  • Testing in a terminal? Either works. S2S is less friction because you don’t re-authenticate every hour.

Security model

  • Tokens are signed JWTs. Tampering invalidates them.
  • There is no token-refresh endpoint — re-issue by calling /login again.
  • S2S tokens persist until revoked. Rotate them on a schedule and watch your audit log.
  • Never commit tokens to source control. Use environment variables or a secrets manager.
  • Authentication API — endpoint reference for /login and /s2s-token.
  • RBAC — the role hierarchy and what each role can do.
  • Architecture — how auth fits into the request lifecycle.
Was this helpful?