Authorization: Bearer <credential>Guide to credential types, API keys, scopes, and security best practices in the OFFER-HUB Orchestrator.
The OFFER-HUB Orchestrator secures all API endpoints using Bearer token authentication. Requests must include an Authorization header with a valid credential.
There are three types of credentials you can use to authenticate with the API, each suited for different security and lifecycle requirements.
OFFERHUB_MASTER_KEY)* (all) scope.ohk_{env}_{id}_{random})ohk_live_ or ohk_test_.read, write).ohk_tok_*)ohk_tok_.Every endpoint in the Orchestrator enforces permission checks based on the scopes attached to your API key or token, verified via @Scopes decorators in the codebase.
Unscoped Endpoints: Some specific endpoints in the Orchestrator deliberately declare no guards and no scopes (e.g., they lack the @Scopes() decorator).
apps/api/src/modules/orders/orders.controller.tsapps/api/src/modules/resolution/resolution.controller.tsManaging your API keys and tokens involves four primary operations.
Generate a long-lived API key. Requires the support scope (usually performed using the OFFERHUB_MASTER_KEY).
POST /api/v1/auth/api-keys
Retrieve a list of all active API keys. Requires the support scope.
GET /api/v1/auth/api-keys
Create a 1-hour ohk_tok_* token. Requires the write scope.
POST /api/v1/auth/token
Check the identity and granted scopes of the currently authenticated credential.
GET /api/v1/auth/me
To ensure the security of your integration, adhere to the following best practices:
ohk_live_ API keys or the OFFERHUB_MASTER_KEY in frontend code, mobile apps, or public repositories. All requests to the Orchestrator should originate from your secure backend servers.POST /auth/api-keys, update your application configurations to use the new key, and delete the compromised key immediately.read or write access instead.