# Amazon Cognito Integration for Email Validation

URL: https://email-validation.org/integrations/cognito/
Updated: 2026-11-29

> Documentation index: https://email-validation.org/llms.txt

An AWS Lambda function runs as your Cognito user pool’s pre sign-up trigger: just before Cognito creates a user, it checks the address with our API and refuses the sign-up when the result is one you stop. When a check cannot be made, the sign-up goes through.

[Read the full setup guide](https://email-validation.org/docs/guides/cognito/) [Get an API key](https://email-validation.org/signin/)

- Status: Setup guide
- One CommonJS file and an AWS SAM template

**Deploy** from the unpacked download

Terminal

```bash
sam deploy --guided --template-file template.json
```

## At a glance.

- **Status**: **Setup guide.** Not listed on a marketplace yet: you set it up yourself in a few steps, below and in the full guide.
- **For**: Apps that keep their users in an Amazon Cognito user pool and want sign-ups with an undeliverable or throwaway address refused, from self sign-up, administrators and federated first sign-ins.
- **You need**: An AWS account with the user pool, the right to create a Lambda function, an IAM role and a Parameter Store parameter in its Region, and an [API key](https://email-validation.org/app/api-keys/) made for it, with a [daily credit cap](https://email-validation.org/docs/authentication/#limits), stored as a SecureString parameter.
- **Costs**: 1 credit = 1 validated address, as with any API request. Free: unknown results, API errors, malformed addresses, test addresses on sandbox.email-validation.org and, in a bulk list, repeats of an address (charged once).
- **Full guide**: [Read the full setup guide](https://email-validation.org/docs/guides/cognito/)

## Typical uses.

- **Refuse before the user exists**: Cognito runs the trigger just before it creates the user. A stopped address fails the sign-up with your message, and no user is created.
- **Cover every way in**: Self sign-ups, users an administrator creates and the first sign-in of a Google, SAML or OIDC user are all checked, unless you narrow it.
- **Keep your own trigger**: A pool has one pre sign-up trigger. If yours already has a function, call the check from it instead of deploying a second one.

## Set it up. 4 steps.

The short version of the [full setup guide](https://email-validation.org/docs/guides/cognito/), which stays the reference when a step does not match what you see.

1. **Store your key**: In Parameter Store, create the SecureString parameter `/email-validation/api-key` in the pool’s Region with your API key as its value.
2. **Deploy the function**: Unpack the download from the guide and deploy it with AWS SAM, giving your user pool’s ID. The role it creates may read only that one parameter.
3. **Attach the trigger**: In the Cognito console, open your user pool, then Extensions, Lambda triggers, and add the function as the pre sign-up trigger.
4. **Test it**: Sign up with `no_mailbox@sandbox.email-validation.org`: it is refused, for free. Do not sign up with a test address that goes through, because Cognito would send its code to a domain that receives no mail.

## Good to know.

- Cognito gives the function 5 seconds; it gives up on our API well before that and lets the sign-up through.
- No key, a timeout, no credits or any other error lets the sign-up through. The function never resends a check.
- A user who later changes their email address is not checked, and user import jobs do not reach the trigger.
- The function logs no address and sends it only to our US host, or with the EU setting to our [EU host](https://email-validation.org/docs/eu-data-residency/).

## Related

- [The full Amazon Cognito setup guide](https://email-validation.org/docs/guides/cognito/)
- [What gets checked](https://email-validation.org/docs/guides/cognito/#scope)
- [Settings](https://email-validation.org/docs/guides/cognito/#settings)
- [Test addresses](https://email-validation.org/docs/test-addresses/)
- [Firebase integration](https://email-validation.org/integrations/firebase/)
- [Keycloak integration](https://email-validation.org/integrations/keycloak/)
- [Stytch integration](https://email-validation.org/integrations/stytch/)
- [Supabase integration](https://email-validation.org/integrations/supabase/)
- [All integrations](https://email-validation.org/integrations/)
