Intermittent 403 Errors while using klaviyo-api version 7.0.0 with AWS Lambda
I'm using klaviyo-api version 7.0.0 and calling klaviyo.Events.create_event(eventsBody) from AWS Lambda. Occasionally, I receive a 403 error. During these error occurrences, the Lambda function executes concurrently, with some requests succeeding and others failing. Is this due to exceeding the concurrency limit?
Reason: Forbidden HTTP response headers: HTTPHeaderDict({'Date': 'Mon, 07 Apr 2025 03:03:47 GMT', 'Content-Type': 'text/html; charset=UTF-8', 'Transfer-Encoding': 'chunked', 'Connection': 'close', 'accept-ch': 'Sec-CH-UA-Bitness, Sec-CH-UA-Arch, Sec-CH-UA-Full-Version, Sec-CH-UA-Mobile, Sec-CH-UA-Model, Sec-CH-UA-Platform-Version, Sec-CH-UA-Full-Version-List, Sec-CH-UA-Platform, Sec-CH-UA, UA-Bitness, UA-Arch, UA-Full-Version, UA-Mobile, UA-Model, UA-Platform-Version, UA-Platform, UA', 'cf-mitigated': 'challenge', 'critical-ch': 'Sec-CH-UA-Bitness, Sec-CH-UA-Arch, Sec-CH-UA-Full-Version, Sec-CH-UA-Mobile, Sec-CH-UA-Model, Sec-CH-UA-Platform-Version, Sec-CH-UA-Full-Version-List, Sec-CH-UA-Platform, Sec-CH-UA, UA-Bitness, UA-Arch, UA-Full-Version, UA-Mobile, UA-Model, UA-Platform-Version, UA-Platform, UA', 'cross-origin-embedder-policy': 'require-corp', 'cross-origin-opener-policy': 'same-origin', 'cross-origin-resource-policy': 'same-origin', 'origin-agent-cluster': '?1', 'permissions-policy': 'accelerometer=(),autoplay=(),browsing-topics=(),camera=(),clipboard-read=(),clipboard-write=(),geolocation=(),gyroscope=(),hid=(),interest-cohort=(),magnetometer=(),microphone=(),payment=(),publickey-credentials-get=(),screen-wake-lock=(),serial=(),sync-xhr=(),usb=()', 'referrer-policy': 'same-origin', 'server-timing': 'chlray;desc="92c64b3808e3cf74"', 'x-content-options': 'nosniff', 'x-frame-options': 'SAMEORIGIN', 'cf-chl-out': 'wGhiEovyea90vBu3JDwHHFaglxWWXM7UyCnYFRrggNFr/eNDe1bOwUVMCB84ZoSo3Zlmyhuc1FpfIANUi2DqmZ4gdrvT2P6vfTYI72gv0w2wZdmYx9r0lWM/0OgxKm0T$hklTbN3gNHcZg+AA46YDew==', 'Cache-Control': 'private, max-age=0, no-store, no-cache, must-revalidate, post-check=0, pre-check=0', 'Expires': 'Thu, 01 Jan 1970 00:00:01 GMT', 'Vary': 'Accept-Encoding', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains; preload', 'X-Content-Type-Options': 'nosniff', 'Server': 'cloudflare', 'CF-RAY': '92c64b3808e3cf74-CMH'}) HTTP response body:
Hi there - the 403 error typically indicates that the API key being used to make the requests does not have the correct scope. Since you said the requests usually work and occasionally throw this error, then this may not be the case but it is worth confirming. I'd also recommend reviewing the API Logs for your Klaviyo account (https://www.klaviyo.com/developer-tools/logs) as the logs may provide some additional insight on the errors. For help with the specific requests, I'd recommend opening a support ticket with our team so that they can investigate the details of the requests.