Authentication
How to authenticate with the Search Service API using JWT tokens.
Overview
All endpoints (except Health) require a Bearer JWT token and an x-tenant-id header. The tenantId from the JWT must match the header value or the request will be rejected with ERR_SEARCH_FORBIDDEN.
Obtaining a JWT Token
Login via auth-svcbash
curl -X POST https://535ubezkse.execute-api.us-east-1.amazonaws.com/auth/v1/login \
-H "Content-Type: application/json" \
-d '{
"email": "dev@eventzr.com",
"password": "Password123!"
}'
# Response:
# {
# "data": {
# "accessToken": "eyJhbGciOiJSUzI1NiIs...",
# "refreshToken": "eyJhbGciOiJSUzI1NiIs...",
# "expiresIn": 3600
# }
# }Use the tokenbash
export TOKEN="<access-token-from-response>"
export TENANT_ID="a0000001-0000-0000-0000-000000000001"
curl -X POST https://535ubezkse.execute-api.us-east-1.amazonaws.com/search/v1/search \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-H "x-tenant-id: $TENANT_ID" \
-d '{"query": "music festival", "use_semantic": false}'Refresh an expired tokenbash
curl -X POST https://535ubezkse.execute-api.us-east-1.amazonaws.com/auth/v1/refresh \
-H "Content-Type: application/json" \
-d '{ "refreshToken": "eyJhbGciOiJSUzI1NiIs..." }'Test Credentials
Staging Environment Credentials
Use these credentials to test the API in the Scalar playground above.
| Role | Password | Tenant ID | |
|---|---|---|---|
| Developer | dev@eventzr.com | Password123! | a0000001-0000-0000-0000-000000000001 |
| Admin | admin@eventzr.com | Password123! | a0000001-0000-0000-0000-000000000001 |
JWT Claims Structure
Decoded JWT payloadjson
{
"sub": "user-uuid",
"tenantId": "tenant-uuid",
"email": "user@example.com",
"roles": ["user", "organizer", "admin"],
"planTier": "professional",
"iat": 1740000000,
"exp": 1740003600
}Standard Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer JWT token |
x-tenant-id | Yes | Tenant UUID (must match JWT tenantId claim) |
Content-Type | POST/PUT/PATCH | application/json |
x-request-id | No | Request trace ID (UUID), auto-generated if absent |
Idempotency-Key | No | Idempotency key for write operations (24h TTL) |
Response Envelope
Standard response formatjson
{
"data": { ... },
"error": null,
"page": {
"next_cursor": "eyJwYWdlIjoyLCJsaW1pdCI6MjB9",
"has_more": true,
"limit": 20
},
"meta": {
"request_id": "550e8400-e29b-41d4-a716-446655440000",
"tenant_id": "tenant-uuid",
"service": "search-svc"
}
}