Overview
The Hitler API uses JWT (JSON Web Tokens) for authentication. There are two ways to obtain a token:- Email/Password - Traditional login
- Slack OAuth - Sign in with Slack
Email/Password Authentication
Login
Register
Registration requires a valid
organizationId. Organizations are created separately or via Slack
OAuth.Slack OAuth
Flow Overview
Get OAuth URL
Callback
The callback is handled automatically. On success, the user is redirected toreturnUrl with the token.
Using the Token
Include the token in theAuthorization header:
Token Refresh
Tokens expire after 7 days. Refresh before expiry:Get Current User
Verify a token and get user info:Token Structure
The JWT payload contains:Error Responses
Invalid Credentials
Token Expired
Email Already Registered
Security Best Practices
Store tokens securely
Store tokens securely
In browsers, use
httpOnly cookies or secure storage. Never expose tokens in URLs or logs.Refresh before expiry
Refresh before expiry
Implement proactive token refresh to avoid interruptions.
Handle token errors
Handle token errors
When you receive a 401, redirect to login or attempt refresh.
Use HTTPS
Use HTTPS
Always use HTTPS in production to protect tokens in transit.