v2.4.2

Headers

Headers are defined per Serverless HTTP event. The tables below describe the common contract; service-specific additions are documented in the owning OpenAPI operation.

Request

HeaderRequiredPurpose
X-Api-Keyprivate: true methodsAPI Gateway API key; primary auth path
Content-TypeJSON request bodiesUsually application/json
AuthorizationSigV4/IAM callers onlyAllowed by CORS, not the normal drive-apig auth path
X-Amz-Date, X-Amz-Security-Token, X-Amz-User-AgentSigV4/IAM callers onlyAWS signing artifacts
modeservice-specificUsed by selected geo and marketplace endpoints
sentry-traceoptionalSentry trace propagation on routes that allow it
traceparent, baggageoptionalOpenTelemetry propagation when clients send it

Common CORS allow-list:

Content-Type, Authorization, X-Api-Key, X-Amz-Date,
X-Amz-Security-Token, X-Amz-User-Agent

Some endpoints add headers such as mode or sentry-trace. Check services/<service>/serverless.yml before changing browser-facing requests.

Response

HeaderPurpose
Access-Control-Allow-OriginUsually * from Serverless CORS config
Access-Control-Allow-CredentialsOften true on handlers that return explicit CORS headers
Access-Control-Allow-HeadersMirrors the method CORS allow-list
Access-Control-Max-AgeLong-lived preflight cache on selected endpoints
Cache-ControlService-specific cache policy
VaryCache variation, commonly Accept-Encoding, Origin
ETagConditional requests on selected cacheable routes
ExpiresHTTP date on selected cacheable routes
x-ratelimit-limit, x-ratelimit-remaining, x-ratelimit-reset, x-ratelimit-resourceLeads in-handler token bucket failures

CORS

API Gateway generates preflight OPTIONS from each method's cors config. The OpenAPI specs intentionally do not list synthetic OPTIONS operations.

Esc