Skip to content

Authentication and security ​

Nexus uses different credential types for public publisher APIs, member APIs, and OpenRTB.

ProductCredentialTransport
Search APIScoped publisher API keyBearer header (preferred), or token query parameter
XML APIScoped publisher API keyBearer header (preferred), or token query parameter
Exchange / Demand Stats APIExplicitly scoped member API key and assigned resourceBearer header (preferred), or token query parameter
MCPScoped publisher API keyAuthorization: Bearer ...
Advertiser APIMember access JWT or same-origin sessionAuthorization header or secure cookie
OpenRTBPartner-specific configurationAgreed HTTPS bidder endpoint

Query-string compatibility

Search, XML, and Exchange/Demand Stats retain query-string authentication for compatibility. Prefer Authorization: Bearer YOUR_NEXUS_API_KEY. Query strings can appear in browser history, reverse-proxy logs, and monitoring systems. Never paste a production URL containing a real token into chat, email, or screenshots.

Supply exactly one transport. An Authorization header combined with any token parameter returns 400 / API_KEY_AMBIGUOUS, even if both values match. A malformed Authorization header never falls back to a query key. MCP continues to accept Bearer authentication only.

Reporting API key scopes ​

ScopeAccess
publisher:search:readSearch reports and Search link metadata
publisher:xml:readXML statistics for owned TIDs
rtb:exchange:readExchange statistics for IDs granted in members.extra.exchanges.
rtb:demand:readDemand statistics for DSP IDs granted in members.extra.demands.

The API also enforces member role, tenant ownership, optional source-IP restrictions, expiration, revocation, and rate limits.

RTB requires an explicit matching scope or *; missing, malformed or empty scopes return 403 / SCOPE_REQUIRED. Search/XML accept missing or empty scopes for compatibility. An explicit unrelated scope is rejected by every reporting API.

Machine-readable errors ​

Errors retain their human-readable message and add a stable code:

json
{ "status": "error", "message": "Unauthorized: API key has expired", "code": "API_KEY_EXPIRED" }
HTTPCodes
400API_KEY_AMBIGUOUS, INVALID_PARAMETERS, INVALID_JSON
401API_KEY_MISSING, API_KEY_INVALID, API_KEY_DISABLED, API_KEY_EXPIRED, API_KEY_REVOKED, API_KEY_INACTIVE
403SOURCE_IP_NOT_ALLOWED, SCOPE_REQUIRED, MEMBERS_ONLY, MEMBER_INACTIVE, RESOURCE_NOT_GRANTED
404NO_DATA
413REPORT_TOO_LARGE
429RATE_LIMIT_EXCEEDED
500INTERNAL_ERROR, CSV_GENERATION_FAILED
503AUTHENTICATION_UNAVAILABLE, SERVICE_UNAVAILABLE

Match the HTTP status and code, not message text. Authentication or permission failures must not be retried in a loop. Preserve existing HTTP handling: RTB empty JSON and CSV periods still return 404; only their messages differ.

API key activity ​

For Search, XML, Exchange/Demand Stats, and API-key-authenticated MCP requests, lastUsedAt records the last completed HTTP 2xx response. Key lookups, documentation endpoint discovery, rejected IP or scope checks, redirects, and failed responses do not update it. Usage is written asynchronously for the same active, unexpired, non-revoked key and tenant identity; a write failure does not change the API response. This timestamp does not extend the key's expiration.

Authentication errors ​

Rejected reporting keys return HTTP 401 with { "status": "error", "message": "..." }:

MessageMeaning
Unauthorized: Invalid API keyNo accepted key matches the supplied credential.
Unauthorized: API key is disabledThe matching key has status disabled.
Unauthorized: API key has expiredThe matching key has reached its expiration date.
Unauthorized: API key has been revokedThe matching key has been revoked.
Unauthorized: API key is not activeThe matching key has a missing or unrecognized status.

Revocation takes precedence over disabled status and expiration; disabled status takes precedence over expiration. XML documentation displays the authentication message instead of the generic ReDoc load error. These messages do not reactivate keys or bypass authentication.

Security audit logs include the rejected key ID and reason, without the credential or HMAC digest. Metrics use only the bounded events api_key_disabled, api_key_expired, api_key_revoked, and api_key_inactive; key IDs are never metric labels.

MCP header ​

http
Authorization: Bearer YOUR_NEXUS_API_KEY
Content-Type: application/json

The API key must never be placed in the MCP URL.

Advertiser member token ​

http
Authorization: Bearer MEMBER_ACCESS_TOKEN

Search/XML publisher keys are rejected by advertiser endpoints. The backend derives the tenant and advertiser UID from the authenticated member and does not allow the caller to select another member.

Credential handling ​

  • Store secrets in a secret manager or protected environment variable.
  • Grant only the required scopes.
  • Configure source-IP restrictions where the client has stable egress IPs.
  • Rotate and revoke credentials when a machine, user, or integration is retired.
  • Redact Authorization, cookies, query tokens, passwords, and API keys from logs.
  • Use HTTPS only.

White-label Nexus API documentation