Overview
Resolves a platform user (Slack, Teams, WhatsApp) to an Hitler user and returns user information along with a short-lived JWT token for authenticated requests.
This endpoint is for service-to-service communication only. It requires an API key and should
never be called from client applications.
Authentication
This endpoint uses API key authentication.
Request Body
The platform identifier. One of: slack, teams, whatsapp
The user’s ID on the platform (e.g., Slack user ID like U0123456789)
The team/workspace ID on the platform (e.g., Slack workspace ID)
Response
The Hitler user ID (UUID)
The organization ID (UUID)
The user’s role: employee, manager, or admin
A short-lived JWT token (15 minutes) for making authenticated requests on behalf of the user
Example
curl -X POST https://api.hitler.io/api/users/resolve-platform \
-H "Content-Type: application/json" \
-H "X-API-Key: your-api-key" \
-d '{
"platform": "slack",
"platformUserId": "U0123456789",
"platformTeamId": "T0123456789"
}'
Success Response
{
"userId": "550e8400-e29b-41d4-a716-446655440000",
"organizationId": "660e8400-e29b-41d4-a716-446655440001",
"email": "john@company.com",
"name": "John Smith",
"role": "employee",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
User Not Found
If the platform identity is not linked to any user, the endpoint returns null with a 200 status code.
Usage Notes
Token Lifecycle
The returned token has a 15-minute expiration. Bot services should:
- Cache the token with its expiry time
- Re-resolve the user when the token expires
- Use the token for all API calls on behalf of the user
Security Considerations
- Never expose the API key to clients
- The returned token should only be used server-side
- Consider implementing additional rate limiting for this endpoint
- Monitor for unusual resolution patterns that could indicate abuse
Users must have their platform identity linked before they can be resolved. This is done through:
- OAuth flow (automatic linking during Slack/Teams login)
- Admin portal (manual linking by organization admins)
- API call to
POST /api/users/:id/identities