Enrich internal tools with data from endpoints
Contents
This guide walks through integrating PostHog Endpoints with Retool to build internal dashboards and tools powered by your analytics data.
Before starting, create an endpoint you want to use in your internal tool. See Create an insight-based endpoint with variables for a step-by-step example.
Step 1: Create a Retool REST API resource
In Retool, resources are reusable connections to external APIs. Create one for PostHog Endpoints:
- Go to Resources in your Retool workspace
- Click Create new and select REST API
- Configure the resource:
- Name:
PostHog Endpoints(or similar) - Base URL:
https://us.posthog.com/api/projects/{your_project_id}/endpoints(replace with your project ID) - Headers: Add an
Authorizationheader with valueBearer {your_personal_api_key}
- Name:


- Click Create resource
Step 2: Use the resource in your Retool app
Once your resource is set up, you can query your PostHog endpoints directly from Retool apps.
Using Retool AI
The fastest way to get started is using Retool's AI assistant. Simply describe what you want:
Create a simple chart that shows pageviews by OS by querying the PostHog Endpoints REST API resource, and executing the pageviews_by_os/run endpoint.
Retool AI will:
- Create a query using your PostHog Endpoints resource
- Configure the correct endpoint path (e.g.,
/pageviews_by_os/run) - Set up a chart component to visualize the results


Manual query setup
To create a query manually:
- In your Retool app, click + to add a new query
- Select your PostHog Endpoints resource
- Set the Action to
POST - Set the URL path to your endpoint name followed by
/run(e.g.,/pageviews_by_os/run) - Add a Body with any required variables:
- Run the query to fetch data
Step 3: Build your dashboard
With your query returning data, you can:
- Add charts: Bind chart components to your query results
- Create filters: Use Retool inputs to dynamically pass variables to your endpoint
- Build tables: Display raw data in table components
- Combine endpoints: Query multiple endpoints to build comprehensive dashboards
Tips for internal tools
- Use descriptive endpoint names like
daily_active_usersorsignup_funnelso they're easy to find in Retool - Enable materialization on frequently-queried endpoints for faster response times
- Pass variables dynamically by binding Retool input components to your query's body parameters
Next steps
- Generate a typed SDK for more complex integrations
- Learn about materialization to speed up your dashboards
- Monitor usage to track which endpoints power your tools