Skip to content

Request Headers

This is the canonical reference for every request header the Wenex Platform gateway recognizes. Headers are read into the per-request Metadata object by MetadataInterceptor (and a few feature interceptors) and propagated to services over gRPC. Anything not listed here is ignored.

Tenant, client, and user context come entirely from the JWT, not from headers. There is no x-domain or x-client-id header — see Authentication and Coworkers Space.

Authentication

HeaderValueRequiredDescription
AuthorizationBearer <jwt|apt>Yes*Bearer JWT (eyJ…) or APT (APT-…). May also be supplied as the ?token= query param or an authorization cookie. *Omitted only on @IsPublic() routes.
x-api-keybase64 AES-encrypted ApiTokenConditionalRequired when the token was issued with strict: true. Validated by AuthShield; see Authentication → the strict flag.

Query shaping

HeaderValueRequiredDescription
x-zonecomma list of own, share, group, clientNoABAC ownership zones applied to reads. Default own,share. Also settable via ?zone=. See Access Control.
x-exclude-soft-delete-querytruthyNoInclude soft-deleted documents (those with a non-null deleted_at) in read results.
x-naming-conventionsnake_case (default), camelCase, …NoNaming convention applied to request and response body fields (via naming-conventions-modeler).
x-no-api-responsetruthyNoSkip the standard response envelope and return the handler payload as-is.
x-ignore-change-projectiontruthyNoSuppress the x-change-projection-value response header the projection interceptor otherwise sets.

Tracing & locale

HeaderValueRequiredDescription
x-request-iduuidNoCorrelation / trace id. Auto-generated if absent.
x-langlanguage code (en, fa, …)NoLocale for response localization.
x-user-agentstringNoClient user agent; recorded in audit metadata.
x-user-ipipNoReal client IP. Honored only when a valid x-api-key is present (a trusted backend forwarding the end-user IP); otherwise the socket IP is used.
x-atISO datetimeNoOperation "as-of" timestamp. Defaults to the server's current time.

ABAC introspection — POST /auth/can

HeaderValueRequiredDescription
x-can-with-policiestruthyNoInclude the matching policy list in the can response.
x-can-with-id-policiestruthyNoInclude id-level policies in the can response.

Distributed transactions — essential sagas

HeaderValueRequiredDescription
x-saga-sessionsaga idNoEnlist the operation in an existing saga / transaction session.
x-saga-ttlsecondsNoTTL for a newly created saga session.

Domain-specific

HeaderValueRequiredDescription
x-payment-amountnumberNoPayment amount consumed by financial invoice / payment actions.
x-file-dataJSON FileDataNoUpload metadata for special/files uploads.
x-stat-typeStatType enumNoStat type to record against special/stats.
x-stat-learning-ratenumberNoLearning rate for the stat model.
x-stat-delay-datetimedatetimeNoDelay / anchor datetime for the stat.
x-stat-additional-propsJSON { obj?, flag? }NoExtra stat props — obj must be a MongoId, flag must match the key pattern.

Notes

  • Derived, not accepted from clients. The platform computes x-by, x-in, x-token, x-scope, x-policy, x-api-token, and x-nested-keys from the validated token and route metadata. Sending them has no effect.
  • Response headers. The gateway echoes some context back on the response — e.g. x-zone, x-at, x-change-projection-value, and x-no-api-response.