TUMR DOCS
# Authentication & API Keys
Tumr supports two primary modes of authentication depending on whether you are building server-to-server merchant integrations or authenticating interactive client dashboards.
1. Secret API Keys (Server-to-Server) Secret API keys are designed for backend services, e-commerce plug-ins, and automated scheduling systems.
Include the API key in the standard Authorization header:
``http
Authorization: Bearer ak_live_sec_1092a48d8291f0923...
API Key Prefix Conventions
- ak_live_...: Production API keys. Real charges and live dispatching apply.
- ak_test_...: Sandbox API keys. Uses mock courier rates, sandbox wallets, and simulated rider movements.
**Keep your secret API keys private!** > Never expose your Secret API Key in client-side applications (React, iOS, Android, Vue) or public source code repositories. Always make API requests from a backend proxy or serverless function.
2. JWT Bearer Tokens (Dashboard & Mobile) Used by user-facing applications (such as the Tumr Business Dashboard and Rider mobile app).
- Authenticate using the [Login Endpoint](/en/docs/api-reference/auth/):
- ```http
- POST /api/v1/auth/login/
- Content-Type: application/json
{ "email": "[email protected]", "password": "SecurePassword123!" } ```
- Use the returned
accesstoken in subsequent requests: - ```http
- Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
`
Access tokens expire after 60 minutes. Use the refresh token with POST /api/v1/auth/refresh/ to obtain fresh credentials without prompting the user to re-authenticate.