LambdaFunctionUrlEvent: {
    body?: string;
    cookies?: string[];
    headers: Record<string, string>;
    isBase64Encoded: boolean;
    pathParameters?: null | Record<string, string>;
    queryStringParameters?: Record<string, string>;
    rawPath: string;
    rawQueryString: string;
    requestContext: {
        accountId: string;
        apiId: string;
        authentication?:
            | null
            | {
                clientCert?: {
                    clientCertPem: string;
                    issuerDN: string;
                    serialNumber: string;
                    subjectDN: string;
                    validity: { notAfter: string; notBefore: string };
                };
            };
        authorizer?: {
            iam?: {
                accessKey?: string;
                accountId?: string;
                callerId?: string;
                cognitoIdentity?: | null
                | { amr: string[]; identityId: string; identityPoolId: string };
                principalOrgId?: null | string;
                userArn?: string;
                userId?: string;
            };
            jwt?: { claims: Record<string, any>; scopes: null | string[] };
            lambda?: null | Record<string, any>;
        };
        domainName: string;
        domainPrefix: string;
        http: {
            method: | "GET"
            | "POST"
            | "PUT"
            | "PATCH"
            | "DELETE"
            | "HEAD"
            | "OPTIONS";
            path: string;
            protocol: string;
            sourceIp: string;
            userAgent: string;
        };
        requestId: string;
        routeKey: string;
        stage: string;
        time: string;
        timeEpoch: number;
    };
    routeKey: string;
    stageVariables?: null
    | Record<string, string>;
    version: string;
}

Zod schema for Lambda Function URL follows the API Gateway HTTP APIs Payload Format Version 2.0.

Keys related to API Gateway features not available in Function URL use a sentinel value (e.g.routeKey, stage).

Type declaration

  • Optionalbody?: string
  • Optionalcookies?: string[]
  • headers: Record<string, string>
  • isBase64Encoded: boolean
  • OptionalpathParameters?: null | Record<string, string>
  • OptionalqueryStringParameters?: Record<string, string>
  • rawPath: string
  • rawQueryString: string
  • requestContext: {
        accountId: string;
        apiId: string;
        authentication?:
            | null
            | {
                clientCert?: {
                    clientCertPem: string;
                    issuerDN: string;
                    serialNumber: string;
                    subjectDN: string;
                    validity: { notAfter: string; notBefore: string };
                };
            };
        authorizer?: {
            iam?: {
                accessKey?: string;
                accountId?: string;
                callerId?: string;
                cognitoIdentity?: | null
                | { amr: string[]; identityId: string; identityPoolId: string };
                principalOrgId?: null | string;
                userArn?: string;
                userId?: string;
            };
            jwt?: { claims: Record<string, any>; scopes: null | string[] };
            lambda?: null | Record<string, any>;
        };
        domainName: string;
        domainPrefix: string;
        http: {
            method: | "GET"
            | "POST"
            | "PUT"
            | "PATCH"
            | "DELETE"
            | "HEAD"
            | "OPTIONS";
            path: string;
            protocol: string;
            sourceIp: string;
            userAgent: string;
        };
        requestId: string;
        routeKey: string;
        stage: string;
        time: string;
        timeEpoch: number;
    }
  • routeKey: string
  • OptionalstageVariables?: null | Record<string, string>
  • version: string
{
"version": "2.0",
"routeKey": "$default",
"rawPath": "/",
"rawQueryString": "",
"headers": {
"sec-fetch-mode": "navigate",
"x-amzn-tls-version": "TLSv1.2",
"sec-fetch-site": "cross-site",
"accept-language": "pt-BR,pt;q=0.9",
"x-forwarded-proto": "https",
"x-forwarded-port": "443",
"x-forwarded-for": "123.123.123.123",
"sec-fetch-user": "?1",
"accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng;q=0.8,application/signed-exchange;v=b3;q=0.9",
"x-amzn-tls-cipher-suite": "ECDHE-RSA-AES128-GCM-SHA256",
"sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"102\", \"Google Chrome\";v=\"102\"",
"sec-ch-ua-mobile": "?0",
"x-amzn-trace-id": "Root=1-62ecd163-5f302e550dcde3b12402207d",
"sec-ch-ua-platform": "\"Linux\"",
"host": "<url-id>.lambda-url.us-east-1.on.aws",
"upgrade-insecure-requests": "1",
"cache-control": "max-age=0",
"accept-encoding": "gzip, deflate, br",
"sec-fetch-dest": "document",
"user-agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36"
},
"requestContext": {
"accountId": "anonymous",
"apiId": "<url-id>",
"domainName": "<url-id>.lambda-url.us-east-1.on.aws",
"domainPrefix": "<url-id>",
"http": {
"method": "GET",
"path": "/",
"protocol": "HTTP/1.1",
"sourceIp": "123.123.123.123",
"userAgent": "agent"
},
"requestId": "id",
"routeKey": "$default",
"stage": "$default",
"time": "05/Aug/2022:08:14:39 +0000",
"timeEpoch": 1659687279885
},
"isBase64Encoded": false
}