Platform APIs
Authentication, user management, webhooks, and rate limiting for the Huntrecht Platform.
Authentication
OAuth2 Client Credentials flow, user registration, and social logins.
- OAuth2 token exchange
- User registration
- Google/Shopify OAuth
- JWT token management
Users & Profiles
Manage user profiles, company accounts, and RBAC permissions.
- User CRUD operations
- Company management
- Role-based access control
- Team invitations
Authentication Methods
| Method | Use Case | Flow |
|---|---|---|
| Client Credentials | Server-to-server API calls | OAuth2 |
| User Login | Web/mobile app users | Email/Password, OAuth |
| Google OAuth | Consumer authentication | OAuth2 |
| Shopify OAuth | Existing Shopify merchants | OAuth2 |
User Roles
Super Admin
└── Admin
├── Manager
│ ├── Buyer
│ ├── Accountant
│ └── Viewer
└── API Client
Token Flow
sequenceDiagram
participant App
participant Auth
participant API
App->>Auth: POST /auth/token (credentials)
Auth-->>App: Access + Refresh Token
loop Every 30 minutes
App->>Auth: POST /auth/token (refresh)
Auth-->>App: New Access Token
end
App->>API: API Request (Bearer token)
API-->>App: Response
Rate Limits by Plan
| Plan | Requests/Day | Concurrent |
|---|---|---|
| Starter | 100 | 5 |
| Basic | 1,000 | 10 |
| Standard | 10,000 | 25 |
| Pro | 50,000 | 100 |
| Enterprise | Unlimited | Unlimited |
Webhook Events
Authentication Events
user.registered- New user createduser.login- User logged inuser.logout- User logged outuser.invited- Team invitation sent
Core Events
order.created- New orderorder.updated- Order status changedpayment.completed- Payment successfulsubscription.created- New subscriptioncredit.updated- Credit score updated