Use Posthog with AI Agents

Integrate PostHog to manage your analytics directly from Composio.
🔗 Connect and Use Posthog
1. 🔑 Connect your Posthog account
2. ✅ Select an action
3. 🚀 Go live with the agent
What do you want to do?
Actions
organizations
- Retrieve paginated organization list
actions
activity_log
annotations
app_metrics
batch_exports
cohorts
dashboard_templates
dashboards
early_access_feature
event_definitions
events
experiments
explicit_members
exports
feature_flags
groups
groups_types
insights
funnel
trend
notebooks
persons
pipeline_destination_configs
pipeline_frontend_apps_configs
pipeline_import_apps_configs
pipeline_transformation_configs
plugin_configs
property_definitions
query
session_recording_playlists
session_recordings
sessions
subscriptions
surveys
users

API actions for Posthog for AI assitants/agents

Language
JS
PYTHON

Event_definitions

Update Event Definition By Uuid

Update an event definition by sending a PUT request to '/api/projects/{project_id}/event_definitions/{id}/' using the UUID and project ID, provided you have 'event_definition:write' authorizat
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_UPDATE_EVENT_DEFINITION_BY_UUID])

Update Project Event Definition

Update an existing event definition for a specified project using its UUID. Requires a project ID and event definition write permissions. Responds without a body on success.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_UPDATE_PROJECT_EVENT_DEFINITION])

Remove Project Event Definition

Delete an event definition by providing its UUID and the associated project ID. Requires `event_definition:write` permission. Successful deletion returns no content (204 status).
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_REMOVE_PROJECT_EVENT_DEFINITION])

Events

List And Filter Project Events

This endpoint for listing/filtering events is deprecated and maintained only for compatibility. Users are discouraged from using it and should use the Query endpoint for ad-hoc lists/aggregati
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_LIST_AND_FILTER_PROJECT_EVENTS])

Retrieve Project Event Details By Id

Retrieve details for a specific event by ID within a project. Supports CSV or JSON format. Requires project_id in path and adheres to PersonalAPIKeyAuth for security.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_PROJECT_EVENT_DETAILS_BY_ID])

Retrieve Project Event Values

Retrieve event values for a specific project by ID. Supports querying in CSV or JSON format. Requires a project_id and personal API key with query:read permission. Responds with event details
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_PROJECT_EVENT_VALUES])

Experiments

List Project Experiments With Pagination

Get a paginated list of experiments within a project using 'limit' and 'offset' parameters. Need a valid project ID and 'experiment:read' permission. Returns details like features and metrics.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_LIST_PROJECT_EXPERIMENTS_WITH_PAGINATION])

Create New Project Experiment

Create a new experiment in a specific project using JSON, form, or multipart data. Requires project_id and experiment details, secured with PersonalAPIKeyAuth. Generates a 201 response with ex
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_CREATE_NEW_PROJECT_EXPERIMENT])

Retrieve Experiment Details By Ids

Access detailed experiment info within a project using unique `experiment ID` & `project ID`, with 'experiment:read' rights. Response includes dates, feature flag key, metrics, creator details
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_EXPERIMENT_DETAILS_BY_IDS])

Update Experiment Details

Update an experiment by sending a PUT request with `project_id` and `id`, including new details as JSON/form data. Changes to name, description, dates, etc., allowed. `experiment:write` permis
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_UPDATE_EXPERIMENT_DETAILS])

Partial Experiment Update In Project

Endpoint enables partial updates to an experiment in a project using PATCH, needing `project_id`, `experiment_id`, and various payload types. Returns updated details. Authentication is mandato
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_PARTIAL_EXPERIMENT_UPDATE_IN_PROJECT])

Remove Project Experiment By Id

Delete a specific experiment by its unique integer ID within a project. Requires a Project ID and personal API key with experiment write permission. No response body upon success.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_REMOVE_PROJECT_EXPERIMENT_BY_ID])

Create Experiment Exposure Cohort

Create a new exposure cohort for an experiment in a project by sending a POST request with experiment details and feature flag data. Requires experiment ID and project ID in the path.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_CREATE_EXPERIMENT_EXPOSURE_COHORT])

Retrieve Project Experiment Results

Retrieve experiment results within a project by project and experiment ID. Requires project_id and experiment id in the path. Returns experiment details in JSON, with authentication via Person
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_PROJECT_EXPERIMENT_RESULTS])

Fetch Project Experiment Secondary Data

Fetch secondary experiment data in a project by its unique ID, using project and experiment IDs as path parameters. Authenticated by PersonalAPIKeyAuth, it returns a JSON with experiment info,
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_FETCH_PROJECT_EXPERIMENT_SECONDARY_DATA])

Retrieve Experiments Requiring Flag Implementation

Retrieve details for experiments that require feature flag implementation in a specific project. Requires a valid 'project_id' and user must have 'experiment:read' permission. Returns informat
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_EXPERIMENTS_REQUIRING_FLAG_IMPLEMENTATION])

Explicit_members

List Project Membership Details

Retrieve a list of project membership details for a specified project by ID. Members and their roles, such as member or admin, are included along with their join and update timestamps.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_LIST_PROJECT_MEMBERSHIP_DETAILS])

Add Project Specific Member Roles

Add members with specific roles to a project by providing their user_uuid and level (member or admin). Requires project_id in the URL. Supports JSON, form-data, and form-urlencoded input. Retu
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_ADD_PROJECT_SPECIFIC_MEMBER_ROLES])

Retrieve Project Member Details By Uuid

Retrieve detailed information about a specific user's membership level and status within a project by their UUID. Access project members' data, roles, and timestamps. (GET /api/projects/{proje
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_PROJECT_MEMBER_DETAILS_BY_UUID])

Update Project Member S Role By Uuid

Update explicit project membership using UUIDs. This PUT endpoint modifies a project member's role, where '1' stands for member and '8' for administrator. Requires `project_id` and `parent_mem
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_UPDATE_PROJECT_MEMBER_S_ROLE_BY_UUID])

Update Project Member Role By Uuid

Update a project member's role using their UUID in a specific project. Accepts partial data to modify membership details such as role level, provided the member's UUID and project ID.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_UPDATE_PROJECT_MEMBER_ROLE_BY_UUID])

Remove Explicit Project Member By Uuid

Delete a specific user (by UUID) from the explicit members of a given project. Requires 'project_id' and member's 'parent_membership__user__uuid'. Returns 204 on success with no response body.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_REMOVE_EXPLICIT_PROJECT_MEMBER_BY_UUID])

Exports

List Project Export Items With Pagination

Retrieve a paginated list of export items for a specific project by ID with optional 'limit' and 'offset' query parameters. Requires PersonalAPIKeyAuth for export:read permission. Supports mul
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_LIST_PROJECT_EXPORT_ITEMS_WITH_PAGINATION])

Trigger Project Export With Format Option

The `/api/projects/{project_id}/exports/` endpoint triggers a project export, requiring `project_id` and `export_format`. It accepts JSON, form-encoded, and multipart data, responding with a 2
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_TRIGGER_PROJECT_EXPORT_WITH_FORMAT_OPTION])

Retrieve Project Export Details

Retrieve detailed info on a specific export of a project using its unique ID. Requires project ID and supports various export formats like PNG, PDF, CSV, and XLSX. Auth: PersonalAPIKeyAuth wit
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_PROJECT_EXPORT_DETAILS])

Retrieve Specific Exported Asset Content

Retrieve the content of a specific exported asset by ID within a project. Requires 'export:read' permission. Supports fetching details like creation time, format (PNG, PDF, CSV, Excel), etc.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_SPECIFIC_EXPORTED_ASSET_CONTENT])

Feature_flags

List And Manage Project Feature Flags

Manage feature flags with creation, reading, updating, and deletion capabilities. Utilize JavaScript Library or an endpoint for application integration. More details in the docs.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_LIST_AND_MANAGE_PROJECT_FEATURE_FLAGS])

Create Feature Flags For Project

Manage feature flags by creating, reading, updating, and deleting them using PostHog's JavaScript Library or API endpoint. Details in the provided documentation.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_CREATE_FEATURE_FLAGS_FOR_PROJECT])

List Feature Flag Role Access Details

This GET endpoint returns role access details for a feature flag in a project, needs 'project_id' & 'feature_flag_id', and offers optional 'limit' & 'offset' for pagination.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_LIST_FEATURE_FLAG_ROLE_ACCESS_DETAILS])

Assign Feature Flag Role Based Access

Set up role-based access for a feature flag using `project_id` and `feature_flag_id`. Submit access info in JSON or form format, with `feature_flag:write` rights. Success returns new details w
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_ASSIGN_FEATURE_FLAG_ROLE_BASED_ACCESS])

Retrieve Feature Flag Role Access Details

Retrieve details for a specific role's access to a feature flag within a project. Requires 'feature_flag_id', 'id' for role access, and 'project_id'. Returns a JSON object with access details.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_FEATURE_FLAG_ROLE_ACCESS_DETAILS])

Remove Feature Flag Role Access By Id

DELETE /api/projects/{project_id}/feature_flags/{feature_flag_id}/role_access/{id}: Remove role access from a feature flag in a project by ID, requiring authorization. Expect no response body
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_REMOVE_FEATURE_FLAG_ROLE_ACCESS_BY_ID])

Retrieve Feature Flag Details

This guide details how to manage (create, read, update, delete) feature flags in applications using PostHog's JavaScript library or endpoint. For more info, visit the provided documentation.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_FEATURE_FLAG_DETAILS])

Update Feature Flag Configuration

Manage feature flags for your app with creation, reading, updating, and deletion options. Utilize PostHog's JS library or endpoint for flag status. More info in docs.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_UPDATE_FEATURE_FLAG_CONFIGURATION])

Partial Update Of A Project S Feature Flag

Learn to manage feature flags (create, read, update, delete) using PostHog's docs, with options for JavaScript Library use or dedicated endpoints for user flag status.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_PARTIAL_UPDATE_OF_A_PROJECT_S_FEATURE_FLAG])

Soft Delete Feature Flag By Setting Status

Hard delete of this model is not allowed. Use a patch API call to set "deleted" to true
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_SOFT_DELETE_FEATURE_FLAG_BY_SETTING_STATUS])

Retrieve Feature Flag Activity Details

Manage feature flags (creation, reading, updating, and deleting) using PostHog's guides or via JavaScript Library/endpoint for user-specific flag status. [Details](https://posthog.com/docs/use
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_FEATURE_FLAG_ACTIVITY_DETAILS])

Create Static Cohort For Feature Flag

Manage feature flags for apps with create, read, update, and delete operations using PostHog's JavaScript Library or dedicated endpoint. More info in the docs.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_CREATE_STATIC_COHORT_FOR_FEATURE_FLAG])

Create Feature Flag Dashboard

Manage feature flags by creating, reading, updating, and deleting them. Utilize JavaScript library or endpoint for user-specific flag status. Refer to documentation for details.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_CREATE_FEATURE_FLAG_DASHBOARD])

Manage Feature Flag Enrichment For Usage Dashboard

Learn to manage feature flags (creation, access, modification, removal) using PostHog's docs, with options to use a JavaScript Library or a dedicated endpoint for user-specific flag status.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_MANAGE_FEATURE_FLAG_ENRICHMENT_FOR_USAGE_DASHBOARD])

Retrieve Feature Flags Activity Log

Learn to manage feature flags by creating, reading, updating, and deleting them. Use PostHog's JavaScript Library or endpoint for application integration. Details in the [docs](https://posthog
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_FEATURE_FLAGS_ACTIVITY_LOG])

Retrieve Feature Flags Evaluation Reasons

Manage feature flags—create, read, update, delete—using the PostHog JavaScript Library or endpoint for user-specific flag status. (More in docs).
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_FEATURE_FLAGS_EVALUATION_REASONS])

Manage Project Feature Flags For Local Evaluation

Utilize feature flags to manage application features with creation, reading, updating, and deletion. Consult PostHog's docs or use their JS library or endpoint for user-specific flag checks.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_MANAGE_PROJECT_FEATURE_FLAGS_FOR_LOCAL_EVALUATION])

Manage Project Feature Flags

Learn to manage feature flags: create, read, update, delete, and check their status using the JavaScript Library or an endpoint. Consult the linked docs for details.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_MANAGE_PROJECT_FEATURE_FLAGS])

Manage User Feature Flags

Manage feature flags in your app with create, read, update, and delete options. Use PostHog's JavaScript Library or endpoint to verify user access. See documentation for details.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_MANAGE_USER_FEATURE_FLAGS])

Groups

List Specific Type Groups With Pagination

List all groups of a specific group type. You must pass ?group_type_index= in the URL. To get a list of valid group types, call /api/:project_id/groups_types/
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_LIST_SPECIFIC_TYPE_GROUPS_WITH_PAGINATION])

Retrieve Project Group Details By Key And Type

Retrieves specified group details within a project by group key and type index. Requires 'group_key', 'group_type_index', and 'project_id'. Responds with group details, including creation time
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_PROJECT_GROUP_DETAILS_BY_KEY_AND_TYPE])

Retrieve Group Property Definitions By Project Id

Retrieve property definitions for a group within a project by providing the project ID. This endpoint returns details like group type index, key, and creation time in JSON format.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_GROUP_PROPERTY_DEFINITIONS_BY_PROJECT_ID])

Retrieve Group Property Values By Index And Key

Retrieve property values by 'group_type_index' and 'key' within a 'project_id'. Parameters must be provided. Output is a JSON with property details and creation timestamp.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_GROUP_PROPERTY_VALUES_BY_INDEX_AND_KEY])

Frequently asked questions

What is Composio.dev?

Composio.dev is a platform for building AI applications, designed to make the process of developing AI solutions super easy and fun! It provides a comprehensive set of tools and libraries that simplify the process of developing AI solutions, allowing you to focus on the creative aspects of your project without getting bogged down by the technical details.

How does Composio.dev support Posthog?

Composio.dev seamlessly integrates with Posthog, allowing you to leverage its capabilities within the Composio.dev platform. You can utilize Posthog to call functions across various platforms, including Google, GitHub, and others, making it a breeze to incorporate different services into your AI applications. Additionally, it supports user authentication via OAuth2 and can work in conjunction with other popular frameworks like LangChain and CrewAI, giving you the flexibility to build truly innovative AI solutions.

What models can I use with Posthog?

With Posthog, you have access to a wide range of state-of-the-art language models, including GPT-4o (OpenAI), GPT-3.5 (OpenAI), GPT-4 (OpenAI), Claude (Anthropic), PaLM (Google), LLaMA and LLaMA 2 (Meta), Gemini, and many others. This flexibility allows you to choose the model that best suits your specific use case, whether you're building a chatbot, a content creation tool, or any other AI-powered application. You can experiment with different models and find the one that delivers the best performance for your project.

How can I integrate Posthog into my project?

Composio.dev provides a seamless integration for Posthog, making it super easy to incorporate this powerful framework into your projects. You can leverage the Composio.dev API to call functions from Posthog, allowing you to tap into its capabilities with just a few lines of code. The SDK is available in Python, JavaScript, and TypeScript, so you can work with your preferred programming language and integrate Posthog into your projects seamlessly.

What is the pricing for Posthog?

Posthog is completely free to use, with a generous free tier that allows up to 1000 requests per month. This makes it accessible for developers and organizations of all sizes to explore and experiment with this powerful tool without any upfront costs. Whether you're a student working on a personal project or a startup building the next big thing, you can get started with Posthog without worrying about breaking the bank.

What kind of authentication is supported for Posthog?

Posthog supports OAuth2 authentication, ensuring secure and authorized access to its functionalities. You can leverage the Composio.dev API to handle authentication and call functions from Posthog seamlessly. The SDK is available in Python, JavaScript, and TypeScript for your convenience, making it easy to integrate authentication into your projects and keep your users' data safe and secure.

Can I add Posthog to my project?

Absolutely! You can easily incorporate Posthog into your project by utilizing the Composio.dev API. This API allows you to call functions from Posthog, enabling you to leverage its capabilities within your application. The SDK is available in Python, JavaScript, and TypeScript to facilitate integration, so you can work with the language you're most comfortable with and add Posthog to your project with ease.

What is the accuracy of Posthog?

Posthog is designed to provide highly accurate and reliable results, ensuring that your AI applications perform at their best. The integration with Composio.dev ensures precise function calls, enabling you to build robust and powerful AI applications with confidence. Posthog's comprehensive framework and the ability to leverage state-of-the-art models ensure reliable and accurate outcomes for your AI development needs, whether you're working on a chatbot, a content creation tool, or any other AI-powered project.

What are some common use cases for Posthog?

Posthog can be used for a wide range of AI applications, making it a versatile tool for developers and creators alike. Some common use cases include natural language processing, text generation, question answering, sentiment analysis, and more. It's particularly useful for building chatbots, virtual assistants, content creation tools, and other AI-powered applications that can help you automate tasks, engage with users, and create compelling content. Whether you're working on a personal project or building a product for your startup, Posthog can help you bring your ideas to life.

How does Posthog handle data privacy and security?

Data privacy and security are crucial considerations when working with AI systems, and Posthog takes these issues seriously. It follows industry best practices and adheres to strict data protection regulations, ensuring that your data is kept safe and secure. Posthog provides robust security measures, such as encryption and access controls, to ensure the confidentiality and integrity of your data. You can rest assured that your sensitive information is protected when using Posthog for your AI development needs.
+ Integrate seamlessly with your agentic frameworks
Composio Works with All Shapes and SizesComposio Works with All Shapes and SizesComposio Works with All Shapes and SizesComposio Works with All Shapes and SizesComposio Works with All Shapes and Sizes
Building for AI across continents🧪