Skip to main content

Overview

The Hitler API uses JWT (JSON Web Tokens) for authentication. There are two ways to obtain a token:
  1. Email/Password - Traditional login
  2. Slack OAuth - Sign in with Slack

Email/Password Authentication

Login

Response:

Register

Registration requires a valid organizationId. Organizations are created separately or via Slack OAuth.

Slack OAuth

Flow Overview

Get OAuth URL

Response:

Callback

The callback is handled automatically. On success, the user is redirected to returnUrl with the token.

Using the Token

Include the token in the Authorization header:

Token Refresh

Tokens expire after 7 days. Refresh before expiry:
Response:

Get Current User

Verify a token and get user info:
Response:

Token Structure

The JWT payload contains:

Error Responses

Invalid Credentials

Token Expired

Email Already Registered

Security Best Practices

In browsers, use httpOnly cookies or secure storage. Never expose tokens in URLs or logs.
Implement proactive token refresh to avoid interruptions.
When you receive a 401, redirect to login or attempt refresh.
Always use HTTPS in production to protect tokens in transit.