Authentication Guide
How to obtain and use JWT tokens to authenticate with EventZR APIs.
1. Sign Up (Create Account)
Create a new account using the auth-svc signup endpoint:
bash
curl -X POST https://api.eventzr.com/auth/v1/signup/email \
-H "Content-Type: application/json" \
-H "x-tenant-id: 00000000-0000-4000-a000-000000000001" \
-d '{
"email": "dev@example.com",
"password": "SecurePass123!",
"firstName": "Developer",
"lastName": "Test"
}'Returns 201 Created with user details and tokens.
2. Login (Get Tokens)
Login with email/password to get JWT access and refresh tokens:
bash
curl -X POST https://api.eventzr.com/auth/v1/login/email \
-H "Content-Type: application/json" \
-H "x-tenant-id: 00000000-0000-4000-a000-000000000001" \
-d '{
"email": "dev@example.com",
"password": "SecurePass123!"
}'Response:
json
{
"accessToken": "eyJhbGciOiJIUzI1NiIs...",
"refreshToken": "eyJhbGciOiJIUzI1NiIs...",
"expiresIn": 3600,
"tokenType": "Bearer"
}3. Use the Token
Add the access token to all authenticated requests:
bash
curl https://api.eventzr.com/auth/v1/me \
-H "Authorization: Bearer <accessToken>" \
-H "x-tenant-id: 00000000-0000-4000-a000-000000000001"4. Required Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes* | Bearer JWT token (except public endpoints) |
| x-tenant-id | Yes | Tenant UUID for multi-tenancy isolation |
| Content-Type | Yes | application/json (for POST/PUT/PATCH) |
| x-request-id | No | Request correlation ID (auto-generated if omitted) |
| Idempotency-Key | No | Idempotency key for write operations (24h TTL) |
5. Refresh Tokens
When the access token expires, use the refresh token to get a new pair:
bash
curl -X POST https://api.eventzr.com/auth/v1/refresh \
-H "Content-Type: application/json" \
-H "x-tenant-id: 00000000-0000-4000-a000-000000000001" \
-d '{
"refreshToken": "<refreshToken>"
}'6. Staging Environment
| Setting | Value |
|---|---|
| Default Tenant ID | 00000000-0000-4000-a000-000000000001 |
| Auth Gateway | https://api.eventzr.com |
| Services Gateway | https://api.eventzr.com |
| Token Algorithm | HS256 |
| Token Expiry | 1 hour (access), 7 days (refresh) |
7. Sample Requests Per Service
Auth Service
bash
# Get current user profile
curl https://api.eventzr.com/auth/v1/me \
-H "Authorization: Bearer $TOKEN" \
-H "x-tenant-id: 00000000-0000-4000-a000-000000000001"
# List active sessions
curl https://api.eventzr.com/auth/v1/sessions \
-H "Authorization: Bearer $TOKEN" \
-H "x-tenant-id: 00000000-0000-4000-a000-000000000001"
# Check MFA status
curl https://api.eventzr.com/auth/v1/mfa/status \
-H "Authorization: Bearer $TOKEN" \
-H "x-tenant-id: 00000000-0000-4000-a000-000000000001"User Service
bash
# Get user profile
curl https://api.eventzr.com/users/v1/me \
-H "Authorization: Bearer $TOKEN" \
-H "x-tenant-id: 00000000-0000-4000-a000-000000000001"
# List user connections
curl https://api.eventzr.com/users/v1/connections/followers \
-H "Authorization: Bearer $TOKEN" \
-H "x-tenant-id: 00000000-0000-4000-a000-000000000001"Wallet Service
bash
# Get wallet balance
curl https://api.eventzr.com/wallet/v1/wallets \
-H "Authorization: Bearer $TOKEN" \
-H "x-tenant-id: 00000000-0000-4000-a000-000000000001"
# List transactions
curl https://api.eventzr.com/wallet/v1/transactions \
-H "Authorization: Bearer $TOKEN" \
-H "x-tenant-id: 00000000-0000-4000-a000-000000000001"Subscriptions Service
bash
# List available plans
curl https://api.eventzr.com/subscriptions/v1/plans \
-H "Authorization: Bearer $TOKEN" \
-H "x-tenant-id: 00000000-0000-4000-a000-000000000001"
# Get current subscription
curl https://api.eventzr.com/subscriptions/v1/subscriptions \
-H "Authorization: Bearer $TOKEN" \
-H "x-tenant-id: 00000000-0000-4000-a000-000000000001"Integration Hub Service
bash
# List available providers
curl https://api.eventzr.com/integrationhub/v1/providers \
-H "Authorization: Bearer $TOKEN" \
-H "x-tenant-id: 00000000-0000-4000-a000-000000000001"
# Browse marketplace integrations
curl https://api.eventzr.com/integrationhub/v1/marketplace/integrations \
-H "Authorization: Bearer $TOKEN" \
-H "x-tenant-id: 00000000-0000-4000-a000-000000000001"Next step: Go to the Swagger Explorer to try these endpoints interactively with the built-in "Try it out" feature.