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

Groups_types

List Project Group Types By Id

Retrieve a list of group types within a specific project by providing the project ID. This endpoint requires authentication with a PersonalAPIKey and grants read access to group data.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_LIST_PROJECT_GROUP_TYPES_BY_ID])

Update Project Group Type Metadata

PATCH /api/projects/{project_id}/groups_types/update_metadata: Update group type metadata for a specific project using its project_id. Can modify name_singular and name_plural fields up to 400
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_UPDATE_PROJECT_GROUP_TYPE_METADATA])

Insights

Retrieve Project Insights With Pagination

The GET `/api/projects/{project_id}/insights/` endpoint retrieves a paginated list of insights for a specified project. Filter by creator, response format (CSV/JSON), and use limit/offset for
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_PROJECT_INSIGHTS_WITH_PAGINATION])

Create Project Insights With Format Option

Create project insights with optional CSV/JSON format parameter. Requires `project_id` in the path and a JSON body with project insight details. Supports personal API key authentication. Succe
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_CREATE_PROJECT_INSIGHTS_WITH_FORMAT_OPTION])

Retrieve Insight Sharing Configurations

Retrieve sharing configurations for a specific insight within a project, requiring project and insight IDs. Validates access via PersonalAPIKeyAuth. Returns data such as creation time and acce
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_INSIGHT_SHARING_CONFIGURATIONS])

Retrieve Project Insight Details

Retrieve details for a specific project insight by ID, with options to format as JSON/CSV, request refresh, and specify dashboard context. Supports PersonalAPIKeyAuth with insight read access.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_PROJECT_INSIGHT_DETAILS])

Update Project Insight Details

Endpoint "/api/projects/{project_id}/insights/{id}/" allows for updating an insight's details for a given project and insight ID, supporting JSON and CSV formats, with fields like name, query,
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_UPDATE_PROJECT_INSIGHT_DETAILS])

Partial Update Of A Project Insight

The PATCH endpoint supports partial insight updates in a project, allows format specification (CSV/JSON), and requires `PersonalAPIKeyAuth` and `insight:write` scope for access.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_PARTIAL_UPDATE_OF_A_PROJECT_INSIGHT])

Set Insight Deletion Flag

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_SET_INSIGHT_DELETION_FLAG])

Retrieve Project Insight Activity Data

Retrieve insights activity for a specific project and insight ID, offering data in JSON or CSV format. Requires project_id and insight id in the path, with optional data format query. Secure a
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_PROJECT_INSIGHT_ACTIVITY_DATA])

Mark Insight As Viewed With Configurable Format

The POST endpoint marks an insight as viewed for a specified project, requires `project_id` and `id`, supports `csv` or `json` formats, and returns fast-loading serialized data.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_MARK_INSIGHT_AS_VIEWED_WITH_CONFIGURABLE_FORMAT])

Retrieve Project Activity Insights

Retrieve activity insights for a specific project by project_id, supporting CSV or JSON formats. Requires an API key with activity_log:read permission. Limited to essential data to enhance res
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_PROJECT_ACTIVITY_INSIGHTS])

Cancel Insights For A Project

The "/api/projects/{project_id}/insights/cancel/" endpoint allows users to cancel insights for a project by providing a project ID and insight details in JSON or CSV, and confirms cancellation
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_CANCEL_INSIGHTS_FOR_A_PROJECT])

Retrieve Funnel Insights In Project

Gain insights from funnel analysis of a specific project by providing its ID and having 'insight:read' permission. Supports JSON/CSV formats and offers detailed info like creation, modificatio
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_FUNNEL_INSIGHTS_IN_PROJECT])

Retrieve Project Funnel Correlation Insights

Retrieve insights about funnel correlations for a specific project by ID, offering results in JSON or CSV. Supports querying and output formatting, with a focus on fast loading of large datase
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_PROJECT_FUNNEL_CORRELATION_INSIGHTS])

Generate Project Funnel Correlation Insight

The /api/projects/{project_id}/insights/funnel/correlation endpoint generates a correlation insight for funnel analysis in a project, accepting JSON/CSV and needing 'project_id' and insight de
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_GENERATE_PROJECT_FUNNEL_CORRELATION_INSIGHT])

Retrieve Last Viewed Insights For User

Returns basic details about the last 5 insights viewed by this user. Most recently viewed first.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_LAST_VIEWED_INSIGHTS_FOR_USER])

Retrieve Project Insights Details

Retrieve detailed insights for a specific project using its ID. Queries can be made in CSV or JSON format. Requires 'insight:read' permission. Results include various metadata like creation, l
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_PROJECT_INSIGHTS_DETAILS])

Create Project Insights With Customizable Parameters

The POST endpoint enables creating insights for projects using a project_id and supports JSON/CSV. It offers detailed parameters for customizing insights and returns structured data with Perso
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_CREATE_PROJECT_INSIGHTS_WITH_CUSTOMIZABLE_PARAMETERS])

Retrieve Retention Insights

Retrieve retention insights for a specified project. Options to output in CSV or JSON format. Requires a project ID and supports query customization. Authenticated access with 'insight:read' p
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_RETENTION_INSIGHTS])

Create Retrieve Retention Insights For Project

Create and retrieve retention insights for a project using its ID, allowing CSV/JSON outputs. Requires an API key with `insight:read` permissions and supports query node JSON strings and old d
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_CREATE_RETRIEVE_RETENTION_INSIGHTS_FOR_PROJECT])

Create Project Timing Insights

Create timing insights for a project by POST to /api/projects/{project_id}/insights/timing, supporting CSV or JSON. It returns a 200 status with content in the chosen format.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_CREATE_PROJECT_TIMING_INSIGHTS])

Retrieve Project Trend Insights

Retrieve trend insights for a specific project, supporting CSV or JSON formats. Mandatory project_id required. Provides details on insight cache status, creator, and associated dashboards. Aut
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_PROJECT_TREND_INSIGHTS])

Funnel

Custom Project Funnel Analytics With Advanced Options

The `/api/projects/{project_id}/insights/funnel/` endpoint generates customizable funnel insights for a project in either CSV or JSON, offering filtering, exclusion, and ordering features with
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_CUSTOM_PROJECT_FUNNEL_ANALYTICS_WITH_ADVANCED_OPTIONS])

Trend

Post Project Trends In Various Formats With Optional Filters

The `/api/projects/{project_id}/insights/trend/` endpoint provides project trends in CSV/JSON, requires `project_id` and optional parameters, and needs 'PersonalAPIKeyAuth'. It outputs event d
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_POST_PROJECT_TRENDS_IN_VARIOUS_FORMATS_WITH_OPTIONAL_FILTERS])

Notebooks

List Notebooks With Filters And Pagination

The API for interacting with Notebooks. This feature is in early access and the API can have breaking changes without announcement.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_LIST_NOTEBOOKS_WITH_FILTERS_AND_PAGINATION])

Create A Notebook In A Project

The API for interacting with Notebooks. This feature is in early access and the API can have breaking changes without announcement.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_CREATE_A_NOTEBOOK_IN_A_PROJECT])

Retrieve Notebook Details

The API for interacting with Notebooks. This feature is in early access and the API can have breaking changes without announcement.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_NOTEBOOK_DETAILS])

Update Project Notebook Details

The API for interacting with Notebooks. This feature is in early access and the API can have breaking changes without announcement.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_UPDATE_PROJECT_NOTEBOOK_DETAILS])

Partial Update Of Project Notebook

The API for interacting with Notebooks. This feature is in early access and the API can have breaking changes without announcement.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_PARTIAL_UPDATE_OF_PROJECT_NOTEBOOK])

Prevent Hard Delete Notebook By Flagging

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_PREVENT_HARD_DELETE_NOTEBOOK_BY_FLAGGING])

Retrieve Notebook Activity Log

The API for interacting with Notebooks. This feature is in early access and the API can have breaking changes without announcement.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_NOTEBOOK_ACTIVITY_LOG])

Retrieve Notebook Activity For Project

The API for interacting with Notebooks. This feature is in early access and the API can have breaking changes without announcement.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_NOTEBOOK_ACTIVITY_FOR_PROJECT])

Persons

List Or Delete Persons With Optional Filters

This endpoint is for reading/deleting persons. For creating/updating, use the capture API, set/unset properties, or SDKs.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_LIST_OR_DELETE_PERSONS_WITH_OPTIONAL_FILTERS])

Retrieve Person Details By Id

This endpoint is used to read and delete persons. For creating or updating, use the capture API, `$set` and `$unset` properties, or SDKs.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_PERSON_DETAILS_BY_ID])

Update Person Properties

Request data's "properties" will be updated on a person using "$set" event, affecting only listed properties without deletion or other changes. For property removal, use 'delete_property' endp
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_UPDATE_PERSON_PROPERTIES])

Person Partial Update Via Project Id

This endpoint allows reading and deleting individuals. For creation or updates, use the capture API, `$set`/`$unset` properties, or SDKs.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_PERSON_PARTIAL_UPDATE_VIA_PROJECT_ID])

Delete Person And Optionally Associated Events

This endpoint is used to read and delete user data. Use the capture API, `$set`/`$unset` commands, or SDKs for creating/updating persons.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_DELETE_PERSON_AND_OPTIONALLY_ASSOCIATED_EVENTS])

Retrieve Person S Activity And Delete Options

This endpoint is for reading and deleting persons; for creating/updating, use the capture API, `$set`/`$unset` properties, or SDKs.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_PERSON_S_ACTIVITY_AND_DELETE_OPTIONS])

Person Property Deletion Endpoint

This endpoint is for reading and deleting user data. Use the capture API, `$set`/`$unset`, or SDKs for creating/updating users.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_PERSON_PROPERTY_DELETION_ENDPOINT])

Retrieve Person Properties Timeline

This endpoint allows reading and deleting individuals. Use the capture API, `$set` and `$unset` properties, or SDKs for creating or updating persons.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_PERSON_PROPERTIES_TIMELINE])

Split Person Entities In Project

This endpoint allows reading and deleting persons; for creation or updates, use the capture API, `$set`/`$unset` properties, or SDKs.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_SPLIT_PERSON_ENTITIES_IN_PROJECT])

Update Person Property Endpoint

This endpoint allows for reading and deleting individuals. Use the capture API, `$set` and `$unset` properties, or SDKs for creating or updating persons.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_UPDATE_PERSON_PROPERTY_ENDPOINT])

Retrieve Project Person Activity

This endpoint allows reading and deleting individuals. For creating or updating, use the capture API, `$set`/`$unset` properties, or SDKs.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_PROJECT_PERSON_ACTIVITY])

Retrieve Project Person Cohorts

This endpoint allows reading and deletion of persons; for creation or updates, use the capture API, `$set`/`$unset` properties, or SDKs.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_PROJECT_PERSON_COHORTS])

Retrieve Or Delete Project Persons Funnel Data

This API endpoint is for reading and deleting user data. Use the capture API, `$set` and `$unset` properties, or SDKs for creating/updating users.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_OR_DELETE_PROJECT_PERSONS_FUNNEL_DATA])

Create Funnel Analysis For Project Persons

This endpoint handles reading and deleting persons. For creation or updates, use the capture API, `$set` or `$unset` properties, or SDKs.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_CREATE_FUNNEL_ANALYSIS_FOR_PROJECT_PERSONS])

Retrieve Persons Funnel Correlation Data

This endpoint is for reading and deleting persons. Use the capture API, `$set` and `$unset` properties, or SDKs for creating or updating persons.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_PERSONS_FUNNEL_CORRELATION_DATA])

Create Person Funnel Correlation

This endpoint is for reading and deleting persons. Use the capture API, `$set`/`$unset` properties, or SDKs to create or update them.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_CREATE_PERSON_FUNNEL_CORRELATION])

Retrieve Person Lifecycle Details

This endpoint is for reading and deleting persons. Use the capture API, property methods, or SDKs for creating or updating persons.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_PERSON_LIFECYCLE_DETAILS])

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🧪