Skip to main content
RapidDev - Software Development Agency
retool-integrationsREST API Resource

How to Integrate Retool with Amplitude

Connect Retool to Amplitude by creating a REST API Resource with Amplitude's API endpoint and API key plus secret key authentication. Pull cohort data, event segmentation, and retention metrics into interactive Retool dashboards where product managers can filter and slice analytics without needing to learn Amplitude's query interface.

What you'll learn

  • How to configure an Amplitude REST API Resource in Retool with Basic authentication
  • How to query Amplitude's event segmentation and user activity APIs
  • How to build an interactive retention and conversion dashboard in Retool
  • How to export Amplitude cohorts and cross-reference them with your database
  • How to use JavaScript transformers to reshape Amplitude's response format for Retool Charts
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Intermediate14 min read25 minutesAnalyticsLast updated April 2026RapidDev Engineering Team
TL;DR

Connect Retool to Amplitude by creating a REST API Resource with Amplitude's API endpoint and API key plus secret key authentication. Pull cohort data, event segmentation, and retention metrics into interactive Retool dashboards where product managers can filter and slice analytics without needing to learn Amplitude's query interface.

Quick facts about this guide
FactValue
ToolAmplitude
CategoryAnalytics
MethodREST API Resource
DifficultyIntermediate
Time required25 minutes
Last updatedApril 2026

Build Amplitude Analytics Dashboards with Retool for Product and Operations Teams

Amplitude is a powerful product analytics platform, but its analytics interface is built for product analysts who know the platform well. For product managers who just need to check retention numbers, or operations teams who want to filter by a specific cohort, the full Amplitude interface has a steep learning curve. Retool solves this by building a simplified, purpose-built analytics panel on top of Amplitude's API that shows exactly what each team needs.

With Retool connected to Amplitude, you can pull event segmentation data, retention curves, and funnel conversion rates and display them in configurable Charts and Tables. Product managers can filter by date range, user property, or event type using simple dropdowns rather than learning Amplitude's query language. Operations teams can cross-reference Amplitude cohort data with internal database records to identify which customer tiers are experiencing specific behaviors.

Amplitude's REST API uses HTTP Basic authentication — you combine your API key and secret key as a base64-encoded username:password string. Retool's Basic Auth resource configuration handles this automatically. The most useful Amplitude endpoints for internal tools are the Events Segmentation API (event counts by property), the User Activity API (individual user event history), and the Cohorts API (export cohort membership).

Integration method

REST API Resource

Amplitude connects to Retool through a REST API Resource using HTTP Basic authentication with your API key and secret key. Retool proxies all Amplitude API requests server-side, keeping credentials secure. You build queries against Amplitude's REST API to pull event segmentation data, cohort results, and retention metrics — which you then surface in Retool Tables and Charts for interactive operational dashboards.

Prerequisites

  • An Amplitude account with API access (Growth plan or higher)
  • Your Amplitude project's API key and secret key (Settings → Projects → select project → API Keys)
  • A Retool account with permission to create Resources
  • Basic understanding of Amplitude's event taxonomy and cohort concepts
  • Optional: a connected PostgreSQL database to join with Amplitude user IDs

Step-by-step guide

1

Create an Amplitude REST API Resource in Retool

Navigate to the Resources tab in Retool and click Add Resource. Select REST API from the list. Name it 'Amplitude Analytics API'. In the Base URL field, enter https://amplitude.com/api. This is Amplitude's REST API base — individual endpoints append their version and path to this base (e.g., /2/events/segmentation). For authentication, select Basic Auth from the Authentication dropdown. Amplitude uses HTTP Basic authentication where the username is your API key and the password is your secret key. Enter your API key in the Username field and your secret key in the Password field. For better security, store these as configuration variables first. Navigate to Settings → Configuration Variables, create AMPLITUDE_API_KEY and AMPLITUDE_SECRET_KEY, mark both as Secret, and use {{ retoolContext.configVars.AMPLITUDE_API_KEY }} and {{ retoolContext.configVars.AMPLITUDE_SECRET_KEY }} in the resource's authentication fields. Note: Amplitude has separate API endpoints for different regions. If your Amplitude organization uses the EU data center, use https://analytics.eu.amplitude.com/api instead of the standard URL. Click Save Changes.

Pro tip: Find your Amplitude API key and secret key in Amplitude → Settings → Projects → click your project name → General. The API key is public (safe to display in URLs), but the secret key is private and must be treated as a password — always store it as a Secret configuration variable.

Expected result: The Amplitude REST API resource is saved. A test query to /2/taxonomy/event returns your event definitions, confirming authentication is working.

2

Query event segmentation data

Create a query to pull event segmentation data — this is Amplitude's core analytics query type, showing event counts filtered by date range and user properties. Name the query getEventSegmentation. Set Method to GET, Path to /2/events/segmentation. Amplitude's segmentation endpoint accepts URL parameters for the query definition. The key parameters are: - e: JSON-encoded event definition (event name and optional filter) - start: start date (YYYYMMDD format) - end: end date (YYYYMMDD format) - i: interval (1 for daily, 7 for weekly, 30 for monthly) - s: optional segmentation property filters Add URL parameters to your query: - e: { "event_type": "{{ dropdown_eventName.value || 'any' }}" } (URL-encoded) - start: {{ moment(dateRange.value[0]).format('YYYYMMDD') }} - end: {{ moment(dateRange.value[1]).format('YYYYMMDD') }} - i: {{ dropdown_interval.value || '1' }} Amplitude returns a data object with series (array of arrays with counts) and seriesLabels (event names), plus xValues (date labels for each data point). This format requires a transformer before it's usable in Retool Charts.

transformer.js
1// JavaScript transformer — convert Amplitude segmentation to Chart-friendly format
2const result = data?.data || {};
3const xValues = result.xValues || [];
4const series = result.series || [[]];
5const labels = result.seriesLabels || ['Event Count'];
6
7// Convert to array of {date, value} objects for Retool Chart
8const chartData = xValues.map((date, index) => {
9 const point = { date };
10 series.forEach((seriesData, seriesIndex) => {
11 const label = labels[seriesIndex] || `Series ${seriesIndex + 1}`;
12 point[label] = seriesData[index] || 0;
13 });
14 return point;
15});
16
17return {
18 chart_data: chartData,
19 total: series[0].reduce((sum, val) => sum + (val || 0), 0),
20 dates: xValues,
21 values: series[0] || []
22};

Pro tip: Amplitude's event_type for the e parameter must match exactly how the event is named in your Amplitude taxonomy. Use 'any' to count all events, or query /2/taxonomy/event to get a list of all event names for a dropdown selector.

Expected result: The segmentation query returns daily event counts for the selected event and date range. The transformer formats the data for Retool's Chart component with date labels and count values.

3

Build a user activity lookup query

Create a query to retrieve individual user event history. This is valuable for support investigations where you want to see exactly what a specific user did. Name the query getUserActivity. Set Method to GET, Path to /2/useractivity. Required URL parameters: - user: the Amplitude user ID or device ID you're looking up - limit: number of events to return (max 1000, default 100) Optional parameters: - start: start timestamp (seconds since epoch) - end: end timestamp Amplitude's user activity endpoint returns an array of events in the userData field. Each event has event_type, event_time, event_properties, user_properties, and metadata about the device and location. Add a Text Input named textInput_userId to your Retool app. Set getUserActivity to trigger on the Search button click, using {{ textInput_userId.value }} as the user parameter value. Bind the results to a Table component. The transformer should flatten the event_properties object for display — event properties are nested and vary per event type, so decide which properties are most relevant for your support use case and flatten them as columns.

transformer.js
1// JavaScript transformer — flatten Amplitude user events for table display
2const events = (data?.userData?.events || []);
3return events.map(event => {
4 const props = event.event_properties || {};
5 return {
6 timestamp: event.event_time
7 ? new Date(event.event_time).toLocaleString()
8 : 'N/A',
9 event_type: event.event_type || 'Unknown',
10 // Common properties — adjust to your event taxonomy
11 page: props.page || props.url || props.screen_name || 'N/A',
12 action: props.action || props.button_name || props.feature || 'N/A',
13 value: props.value || props.amount || props.duration || '',
14 device: event.device_type || 'Unknown',
15 platform: event.platform || 'Unknown',
16 country: event.country || 'Unknown',
17 session_id: event.session_id || 'N/A'
18 };
19}).sort((a, b) => new Date(b.timestamp) - new Date(a.timestamp));

Pro tip: Amplitude's user ID in its API context is the Amplitude-generated user ID (a string like 'abc123'), not necessarily your application's user ID. Use Amplitude's /2/usersearch endpoint to find the Amplitude user ID by your internal user ID if you've identified users with a custom user ID.

Expected result: Entering a user ID and clicking Search returns the user's event history in a Table, sorted by most recent event, with event properties flattened into readable columns.

4

Export Amplitude cohorts for cross-referencing

Amplitude cohorts define groups of users who meet specific behavioral criteria (e.g., 'Users who completed checkout in the last 30 days'). You can export cohort membership from the Amplitude API and join it with your internal user database in Retool. First, create a query to list available cohorts: getCohorts (GET, /3/cohorts). This returns all cohorts defined in your Amplitude project with their IDs, names, and last-computed sizes. Next, create a query to export cohort members: getCohortMembers. To export a cohort, use the two-step async export process: 1. POST to /3/cohorts/request/{cohort_id} to initiate the export — Amplitude returns a request_id 2. GET /3/cohorts/request/{request_id}/file to download the cohort data once ready Since this is an async process, for smaller cohorts you can use a simpler approach: POST to /3/cohorts/request and poll for completion, or use Amplitude's synchronous export if available for your plan. Once you have the cohort member list (an array of Amplitude user IDs), create a database query that looks them up in your customers table: The combined view shows which of your customers are in the cohort, along with their account tier, revenue, and CSM ownership — giving your team actionable business context around behavioral segments.

cohort_lookup.sql
1// SQL query — look up cohort members in your customer database
2-- amplitudeCohortIds is an array of Amplitude user IDs from the cohort export
3-- Assumes you store amplitude_user_id in your customers table
4SELECT
5 c.id,
6 c.email,
7 c.company_name,
8 c.plan_tier,
9 c.mrr,
10 c.csm_owner,
11 c.created_at,
12 c.amplitude_user_id
13FROM customers c
14WHERE c.amplitude_user_id = ANY(ARRAY[{{ getCohortMembers.data.user_ids.map(id => `'${id}'`).join(',') }}])
15ORDER BY c.mrr DESC;

Pro tip: Store the Amplitude user ID alongside your internal user ID in your customers database during the sign-up or identify flow. This makes cross-referencing Amplitude cohorts with internal data much faster — a single SQL WHERE clause instead of fuzzy matching on email.

Expected result: The cohort members query retrieves user IDs from an Amplitude cohort. The database lookup query returns matching customer records with account metadata, showing which customers belong to the selected behavioral cohort.

5

Assemble the product analytics dashboard

Combine the event segmentation, user activity, and cohort queries into a complete analytics dashboard tailored for your product and operations teams. Top section — Event Trends Panel: A Date Range Picker component (default: last 30 days), a Dropdown for event name (options loaded from /2/taxonomy/event), and an Interval selector (Daily/Weekly/Monthly). A Chart component (bar chart) showing event counts over time from the segmentation transformer. A Stat component showing the total event count for the period. Middle section — User Activity Panel: A Text Input for Amplitude user ID or email, a Search button, and a Table showing the user's event timeline from getUserActivity. Add a JSON component showing full event properties for the selected event row. Bottom section — Cohort Analysis Panel: A Dropdown of available cohorts (from getCohorts), a 'Load Cohort' button, and a Table showing cohort members joined with your database. Add summary stats showing average MRR, most common plan tier, and cohort size. For complex analytics dashboards that connect Amplitude behavioral data with your CRM, billing, and support systems in a single Retool app, RapidDev's team can help design the multi-source data architecture. Set the event segmentation chart and stat queries to run on page load so the dashboard shows data immediately when opened.

event_options.js
1// JavaScript query — build event name dropdown options from Amplitude taxonomy
2const events = data?.data || [];
3const options = [
4 { label: 'All Events', value: 'any' },
5 ...events
6 .filter(e => !e.deleted)
7 .map(e => ({
8 label: e.event_type,
9 value: e.event_type
10 }))
11 .sort((a, b) => a.label.localeCompare(b.label))
12];
13return options;

Pro tip: Cache the event taxonomy options by running the getTaxonomy query on page load and storing the result. Event types don't change often — refreshing them weekly is sufficient and avoids an extra API call every time the dashboard loads.

Expected result: The complete product analytics dashboard shows event trends in a chart, supports user activity lookups, and displays cohort analysis with database enrichment. All sections respond to date range and filter changes interactively.

Common use cases

Build a product metrics dashboard with interactive filters

Create a Retool app that shows key Amplitude metrics — DAU, WAU, retention rate, and top events — with date range pickers and event name dropdowns for filtering. Product managers can quickly check numbers without opening Amplitude and navigating through the dashboard builder.

Retool Prompt

Build a product metrics panel with a date range picker and event name dropdown that queries Amplitude's event segmentation API to show daily active user counts and top events by volume as a bar chart and data table — give product managers a single-page view of their key metrics.

Copy this prompt to try it in Retool

Customer cohort enrichment tool

Build a Retool dashboard that exports a specific Amplitude cohort (e.g., 'Users who completed onboarding but haven't converted') and cross-references those user IDs with your PostgreSQL customer table to show account tier, signup date, and assigned CSM for each user in the cohort.

Retool Prompt

Create a cohort analysis tool that fetches users from an Amplitude cohort by cohort ID, joins those user IDs with the customers table in PostgreSQL to get account tier and CSM owner, and shows a combined table that helps the success team prioritize outreach to at-risk users.

Copy this prompt to try it in Retool

User activity investigation panel

Build a support tool where agents can enter a user ID and see their complete event history from Amplitude — every tracked event with timestamps, event properties, and device information. Combine this with internal account data to give a full picture of user behavior leading up to a support ticket.

Retool Prompt

Build a user investigation panel where entering an Amplitude user ID triggers a query to /2/useractivity and shows the event timeline with event names, timestamps, and event properties in a Retool Table sorted by most recent, helping support teams understand what a user did before contacting support.

Copy this prompt to try it in Retool

Troubleshooting

Authentication fails with 'Invalid credentials' or 403 Forbidden

Cause: The API key and secret key are from different Amplitude projects, or the secret key is being used where the API key is expected. In Amplitude's Basic Auth, the username must be the API key (not the secret key).

Solution: In Retool's Basic Auth configuration, confirm that Username = API Key (the shorter public key) and Password = Secret Key (the longer private key). Both are visible in Amplitude → Settings → Projects → your project → General. If you're using the EU data center, ensure the base URL is https://analytics.eu.amplitude.com/api.

Segmentation query returns no data for events that clearly exist in Amplitude

Cause: The event_type parameter in the e URL parameter must exactly match the event name in Amplitude, including case. Spaces in event names must be handled carefully in URL encoding. The date format must be YYYYMMDD (no dashes).

Solution: Test with event_type: 'any' first to confirm the query works and returns data. Then add a specific event name. Use /2/taxonomy/event to get the exact event names. Ensure dates are formatted as YYYYMMDD — not YYYY-MM-DD. URL-encode the JSON e parameter if it contains special characters.

typescript
1// Correct URL parameter format for e parameter
2// Key: e
3// Value: {"event_type":"{{ dropdown_eventName.value }}"}
4// Retool handles URL encoding automatically for URL params

User activity query returns 'User not found' for a user who exists in Amplitude

Cause: The user ID format being searched doesn't match the ID type. Amplitude distinguishes between Amplitude User ID, Device ID, and the custom User ID set via amplitude.setUserId(). Each requires a different query parameter.

Solution: Use the /2/usersearch endpoint to find the correct Amplitude user ID by passing your internal user ID. The usersearch endpoint accepts user_id (your custom ID) and returns the Amplitude-assigned IDs. Use the returned Amplitude user ID in the useractivity query.

typescript
1// GET /2/usersearch to find Amplitude user by your internal ID
2// URL parameter:
3// user_id: {{ textInput_userId.value }}

Chart component shows wrong data — all values are 0 or undefined

Cause: The Amplitude segmentation response's series array is nested differently than expected, or the transformer is referencing the wrong data path. Amplitude's response structure is data.data.series (three levels deep).

Solution: Add a raw data display: bind a JSON or Text component to {{ getEventSegmentation.rawData }} to inspect the actual response structure. Verify the transformer is accessing data?.data?.series rather than data?.series or just data. The xValues for dates is at data?.data?.xValues.

typescript
1// Correct data path in transformer
2const result = data?.data || {}; // Note: data.data (two levels)
3const xValues = result.xValues || [];
4const series = result.series || [[]];

Best practices

  • Store Amplitude API key and secret key as Secret configuration variables — never hardcode them in query URL parameters or JavaScript query code.
  • Use the EU data center URL (analytics.eu.amplitude.com) if your organization's Amplitude account is based in Europe for data residency compliance.
  • Always test event segmentation queries with event_type='any' first to verify authentication and connectivity before filtering to specific event types.
  • Store Amplitude user IDs in your customer database during user identification so you can join Amplitude cohort data with internal records without complex matching logic.
  • Use Amplitude's /2/taxonomy/event endpoint to load event names dynamically into dropdown selectors rather than hardcoding event names, so the dashboard auto-updates when new events are added.
  • Add JavaScript transformers to normalize Amplitude's nested response format (data.data.series) before binding to Charts — this step is essential since Amplitude's API format isn't Table-ready by default.
  • For dashboards used by non-technical stakeholders, pre-build the common query configurations (date ranges, key events) as buttons rather than requiring manual parameter entry.
  • Cache Amplitude cohort exports in a Retool Database table for faster repeated access — cohort data doesn't change in real-time, so refreshing daily is usually sufficient.

Alternatives

Frequently asked questions

Does Amplitude have a native connector in Retool?

Amplitude does not have a native Retool connector as of 2026. You connect it via a REST API Resource with Basic Auth using your API key and secret key. Amplitude's REST API covers most analytics use cases — event segmentation, user activity, cohorts, and taxonomy — and is well-documented on amplitude.com/docs/apis/analytics.

What Amplitude plan do I need to use the REST API?

Amplitude's REST API is available on Growth plans and above. Some endpoints (particularly cohort exports and certain behavioral queries) may require higher-tier plans. The Starter plan has limited API access. Check Amplitude's pricing page for the latest plan-specific API access details, as they update their plans regularly.

Can I send events to Amplitude from Retool?

Yes, Amplitude has an HTTP API for sending events: POST to https://api2.amplitude.com/2/httpapi with your API key and event data. This lets Retool operations teams log internal actions (e.g., 'admin processed refund') as Amplitude events for analytics. Use a Retool Workflow trigger on button clicks to send events without blocking the main app queries.

How do I handle Amplitude's asynchronous cohort export in Retool?

Amplitude's cohort export is two-step: POST to request the export (returns a request_id), then GET with the request_id to check status and download the file. In Retool, you can handle this with two separate queries and a polling mechanism — trigger the request query, then use a JavaScript query with a setTimeout loop to poll the status endpoint every 5 seconds until the export is ready, then trigger the download query.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Integrations are where projects stall

We wire Retool integrations like this one every week — auth, webhooks, edge cases included. Fixed-price builds from $13K, delivered in 6–10 weeks.

Talk to an integration engineer

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.