Authentication

How to authenticate with the CPaaS Orchestrator Service API using JWT tokens and internal API keys.

Overview

The CPaaS Orchestrator Service uses two authentication methods:

  • Bearer JWT Token — For all tenant-facing endpoints. The tenantId is extracted from JWT claims via the @CurrentTenant() decorator.
  • Internal API Key — For /_internal/* endpoints and scheduled jobs. Passed via x-internal-api-key header.

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 token with CPaaS endpointsbash
export TOKEN="<access-token-from-response>"

curl -X GET https://535ubezkse.execute-api.us-east-1.amazonaws.com/cpaas/v1/providers \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json"
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.

RoleEmailPasswordTenant ID
Developerdev@eventzr.comPassword123!00000000-...-000001
Adminadmin@eventzr.comPassword123!00000000-...-000001

Internal API Key

Internal endpoints (health checks, outbox processing, template sync, scheduled jobs) require the x-internal-api-key header instead of JWT.

Call an internal endpointbash
# Health check (no auth required)
curl https://535ubezkse.execute-api.us-east-1.amazonaws.com/cpaas/v1/_internal/healthz

# Process outbox (requires internal API key)
curl -X POST https://535ubezkse.execute-api.us-east-1.amazonaws.com/cpaas/v1/_internal/process-outbox \
  -H "x-internal-api-key: eventzr-staging-internal-api-key-cpaas-2026"

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

HeaderRequiredDescription
AuthorizationYesBearer JWT token
Content-TypePOST/PUT/PATCHapplication/json
x-request-idNoRequest trace ID (UUID), auto-generated if absent
x-tenant-idRecommendedTenant UUID for explicit tenant filtering
Idempotency-KeyRecommendedIdempotency key for write operations (24h TTL)
x-internal-api-keyInternal onlyAPI key for /_internal/* and /jobs/* endpoints

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",
    "trace_id": "abc123",
    "tenant_id": "tenant-uuid"
  }
}