Sourcetable Integration

Export Cognito Users to CSV

Jump to


    Welcome to our comprehensive guide on exporting Cognito Users to a CSV fileā€”an invaluable process for data management and migration that offers the flexibility to store, analyze, and recreate user records across various platforms. By converting your Cognito Users into a CSV format, you can easily manipulate and visualize your user data within spreadsheet applications, enhancing your ability to make informed decisions and maintain robust data integrity. On this page, we will delve into the essentials of what Cognito Users are, provide a detailed walkthrough on how to export them to a CSV file using the ListUsers API call, explore practical use cases for such exports, introduce an alternative method for CSV exports using Sourcetable, and address common questions. Whether you're looking to migrate to a different storage or user provider service, or simply aiming to better organize your user data, this guide is your go-to resource for mastering the art of exporting Cognito Users to CSV.

    What Are Cognito Users?

    Cognito users are entities within the Amazon Cognito service that are authenticated and authorized to access web or mobile applications. They are managed by Amazon Cognito user pools, which serve as a secure user directory. As an OpenID Connect (OIDC) identity provider (IdP), Cognito users can authenticate via various methods including self-service sign-ups, administrator-driven user creation, or through third-party identity providers for single sign-on (SSO) capabilities.

    These users are integral to providing a customized and secure user experience, enabling app integration, and implementing identity federation. Cognito users can be part of a standalone user directory or act as an intermediate service provider (SP), connecting workforce and customer identities with third-party identity providers. By leveraging Amazon Cognito, developers can facilitate different sign-in and sign-up models, manage user profiles, and integrate multi-factor authentication (MFA) to enhance security.

    The flexibility of Amazon Cognito extends to its ability to authenticate users through various interfaces, including a hosted UI by Amazon Cognito or a custom UI developed by the service consumer. Additionally, Amazon Cognito supports authorization on the backend with multiple methods, including machine-to-machine authorization using OAuth 2.0 scopes. The service's robust feature set allows for the detection of malicious activity, customization of user experience during sign-up and sign-in, and the monitoring of API requests and performance metrics through integrations with AWS services such as CloudTrail and CloudWatch.

    Sourcetable Integration

    Streamline Your Workflow with Sourcetable

    Are you tired of the tedious process of exporting your Cognito Users to a CSV, only to import them again into a spreadsheet program? Sourcetable offers a seamless solution that can transform the way you manage your user data. With Sourcetable, you can directly sync your live Cognito Users data into a dynamic spreadsheet. This integration eliminates the need for manual exports and imports, streamlining your data management process.

    Utilize Sourcetable to automate your workflows and enhance your business intelligence capabilities. With the ability to pull in data from multiple sources, including Cognito, Sourcetable simplifies the aggregation and querying of your user information within a user-friendly spreadsheet interface. Embrace the ease of automation and real-time data access with Sourcetable, and make the most out of your data management practices.

    Common Use Cases

    • C
      Sourcetable Integration
      Migrate or export existing users from Amazon Cognito User Pool
    • C
      Sourcetable Integration
      Store or recreate users into another storage like a database, CSV file, or other user provider service
    • C
      Sourcetable Integration
      Backing up Cognito User Pool data
    • C
      Sourcetable Integration
      Creating a script to pull all Cognito User records for processing or analysis

    Frequently Asked Questions

    Can I directly export Cognito users to a CSV file within the AWS Console?

    Cognito does not allow for exporting users directly from a user pool through the AWS Console. However, you can use the ListUsers API call as a workaround to export users.

    How can I export Cognito users if the service does not support direct exports?

    You can use the ListUsers API call to list the users in your user pool and then store these user records in a CSV file. This process may be automated with a script, such as one written in Python using the boto3 library.

    How many users can I retrieve at once when using the ListUsers API call?

    The ListUsers API call returns 60 users per request. Pagination can be used to retrieve additional users beyond the initial response.

    Will I need to reset user passwords after exporting them to a CSV file?

    The workaround for exporting user pools to a CSV file may require users to reset their passwords, as sensitive information like passwords cannot be exported.

    Does the ListUsers API call retrieve all user attributes?

    Yes, the ListUsers API call retrieves all user attributes, including both Cognito default attributes and any custom attributes you have configured.


    In conclusion, the most efficient method to export Cognito users to a CSV file is through the utilization of the ListUsers API call, leveraging the comprehensively featured AWS SDKs, such as the Python boto3 library, to ensure seamless integration with the Amazon Cognito Service. By following best practices, including the implementation of pagination with the list_users method and handling custom attributes, you can adeptly manage user data for storage or migration. However, for a more streamlined approach, consider using Sourcetable to import your data directly into a spreadsheet, bypassing the need for manual CSV handling. Sign up for Sourcetable today to elevate your data management experience and get started with ease.

    Start working with Live Data

    Analyze data, automate reports and create live dashboards
    for all your business applications, without code. Get unlimited access free for 14 days.