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

Plugin_configs

Partially Update Project Plugin Config

Update plugin configuration partially for a specified project using PATCH on '/api/projects/{project_id}/plugin_configs/{id}'. Requires plugin write authority. Accepts JSON, form data, and mul
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_PARTIALLY_UPDATE_PROJECT_PLUGIN_CONFIG])

Remove Project Plugin Configuration

DELETE /api/projects/{project_id}/plugin_configs/{id}/: Removes a specific plugin configuration by ID from a given project. Requires 'plugin:write' permissions and project ID. Returns 204 with
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_REMOVE_PROJECT_PLUGIN_CONFIGURATION])

Retrieve Plugin Config Activity Details

Retrieve activity details for a specific plugin configuration within a project. Requires `project_id` and unique `id` of the plugin config. Responds with plugin info, status, and activity metr
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_PLUGIN_CONFIG_ACTIVITY_DETAILS])

Retrieve Plugin Frontend Config

Retrieve the frontend configuration of a specific plugin for a given project. Requires the project ID and plugin config ID. Provides details including plugin state, order, and related info.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_PLUGIN_FRONTEND_CONFIG])

Create Plugin Job Configuration

Create a job-related configuration for a specific plugin by providing plugin and project IDs. Accepts JSON, form data, and returns config details on success. Use carefully; requires mandatory
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_CREATE_PLUGIN_JOB_CONFIGURATION])

List Project Configuration Plugin Logs

Retrieve logs for a specific plugin configuration within a project. Supports pagination with limit and offset query parameters. Requires project and plugin configuration IDs. Auth: PersonalAPI
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_LIST_PROJECT_CONFIGURATION_PLUGIN_LOGS])

Reconfigure Plugin Order And Status In Project

Patch endpoint to reconfigure the order of plugins within a project by project ID. Supports JSON, form, and multipart bodies to update plugin order and status.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RECONFIGURE_PLUGIN_ORDER_AND_STATUS_IN_PROJECT])

Property_definitions

Retrieve Filtered Project Property Definitions

Get property definitions for a project using project_id, with filters for event names, property types, exclusions, and numerical or feature flags. Also, view properties relevant to specific ev
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_FILTERED_PROJECT_PROPERTY_DEFINITIONS])

Retrieve Property Definition Details

Retrieve details of a specific property definition by UUID within a project. Requires project_id and property definition id. Security: PersonalAPIKeyAuth with read access. No response body pro
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_PROPERTY_DEFINITION_DETAILS])

Update Project Property Definition

Update a property definition in a project by its UUID. Requires a project_id and definition id, both as path parameters. Security: PersonalAPIKeyAuth with write access. No body in the response
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_UPDATE_PROJECT_PROPERTY_DEFINITION])

Partially Update Project Property Definition

PATCH /api/projects/{project_id}/property_definitions/{id}/: Partially update a specific property definition by UUID in a project. Requires property_definition:write auth. No response body.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_PARTIALLY_UPDATE_PROJECT_PROPERTY_DEFINITION])

Remove Property Definition By Uuid

Delete a property definition by providing its UUID and the associated project ID. Requires 'property_definition:write' permission. On success, no response body is returned (204).
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_REMOVE_PROPERTY_DEFINITION_BY_UUID])

Retrieve Properties And Events Association

Allows a caller to provide a list of event names and a single property name Returns a map of the event names to a boolean representing whether that property has ever been seen with that event_
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_PROPERTIES_AND_EVENTS_ASSOCIATION])

Query

Create Query In Project By Id

The `/api/projects/{project_id}/query/` POST endpoint allows users to submit queries for a specific project by providing the project ID in the URL and the query details in JSON or form data. A
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_CREATE_QUERY_IN_PROJECT_BY_ID])

Retrieve Async Query Status By Id

(Experimental)
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_ASYNC_QUERY_STATUS_BY_ID])

Remove Specific Project Query

(Experimental)
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_REMOVE_SPECIFIC_PROJECT_QUERY])

Retrieve Project Draft Sql Query

Retrieve the draft SQL query for a specific project using its project_id. Ensure to obtain the project_id by calling /api/projects/. Note: This endpoint does not return a response body.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_PROJECT_DRAFT_SQL_QUERY])

Session_recording_playlists

List Of Project S Session Recording Playlists

Retrieve a list of session recording playlists for a specific project. Filter by creator, paginate with limit and offset, and identify playlists with project ID and optional short ID. Requires
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_LIST_OF_PROJECT_S_SESSION_RECORDING_PLAYLISTS])

Create Session Recording Playlists

Create playlists of session recordings for a specified project. Requires 'project_id' path parameter and personal API key with write access. Supports JSON, form-encoded, or multipart data. Ret
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_CREATE_SESSION_RECORDING_PLAYLISTS])

Fetch Session Recording Playlist Details

Retrieve session recording playlist details for a specific project by project_id and playlist short_id. Requires PersonalAPIKeyAuth with read access. Returns playlist metadata including creati
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_FETCH_SESSION_RECORDING_PLAYLIST_DETAILS])

Update Project Session Recording Playlist

Update an existing session recording playlist for a project with the specified project_id and playlist short_id. Requires JSON or form data input to modify the playlist's properties like name,
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_UPDATE_PROJECT_SESSION_RECORDING_PLAYLIST])

Update Session Recording Playlist Partially

Update session recording playlists using PATCH on the endpoint with `project_id` and `short_id`. Accepts JSON and forms data for detail amendments. Partial updates allowed. `PersonalAPIKeyAuth
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_UPDATE_SESSION_RECORDING_PLAYLIST_PARTIALLY])

Mark Session Recording Playlist Deleted

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

Retrieve Session Recording Playlist Details

Retrieve session recording playlists for a specified project and playlist short ID. Returns details like name, creator info, and recordings. Access by making a GET request to `/api/projects/{p
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_SESSION_RECORDING_PLAYLIST_DETAILS])

Create Session Recording In Playlist

The POST endpoint generates a project's session recording, needing 'project_id', 'short_id', and 'session_recording_id' in the URL, and accepts various content formats for recording details.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_CREATE_SESSION_RECORDING_IN_PLAYLIST])

Remove Session Recording From Playlist

Delete a session recording from a playlist using its ID within a specified project. Requires project_id, short_id, and session_recording_id in the path. Returns no content on success (204).
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_REMOVE_SESSION_RECORDING_FROM_PLAYLIST])

Session_recordings

List Project Session Recordings

Retrieve a paginated list of session recordings for a specific project, including viewing times and user interactions. Specify `project_id`, and use optional `limit` and `offset` query paramet
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_LIST_PROJECT_SESSION_RECORDINGS])

Retrieve Session Recording Details

Retrieve detailed information about a specific session recording by providing the session's UUID and associated project ID. The response includes metrics such as duration, activity, timestamps
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_SESSION_RECORDING_DETAILS])

Delete Session Recording By Uuid

Delete a session recording by providing the session's UUID and the associated project ID. Requires `session_recording:write` permission. Returns no content on successful deletion.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_DELETE_SESSION_RECORDING_BY_UUID])

Persist Session Recording Data By Uuid

POST `/api/projects/{project_id}/session_recordings/{id}/persist`: Endpoint for persisting session recording data identified by UUID. Requires `project_id` and accepts JSON containing various
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_PERSIST_SESSION_RECORDING_DATA_BY_UUID])

Retrieve Similar Session Recordings

Retrieve similar session recordings for a given session by UUID within a project. Details include session activity data, user info, and timestamps. Requires `project_id` and session `id`.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_SIMILAR_SESSION_RECORDINGS])

Retrieve Session Recording Snapshots

Snapshots for a session can be loaded from S3 (if old) or Redis (if recent). Clients call the API without a source to get supported sources, then per source for snapshots. API v1 is deprecated
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_SESSION_RECORDING_SNAPSHOTS])

Create Session Recording Summary

Summarize a session recording by providing the project_id and the recording's UUID. Get details like duration, activities, and user info.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_CREATE_SESSION_RECORDING_SUMMARY])

List Session Recording Sharing Configs

Retrieve a list of sharing configurations for a specific session recording in a project, including creation timestamps and access tokens. Requires project and recording IDs.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_LIST_SESSION_RECORDING_SHARING_CONFIGS])

Retrieve Session Recording Error Clusters

Retrieve error clusters from session recordings for a specified project. This endpoint provides details on user interactions, console logs, and activity times in JSON format, requiring the pro
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_SESSION_RECORDING_ERROR_CLUSTERS])

Retrieve Matching Events For Session Recording

Retrieves event IDs matching a filter with one session ID and at least one event/action criterion. Intended for internal use and may have sudden changes.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_MATCHING_EVENTS_FOR_SESSION_RECORDING])

Retrieve Session Recording Properties By Project Id

Retrieve properties of session recordings for a given project by ID, including activity metrics, timestamps, and participant details. Requires project_id in the path. Returns JSON data with re
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_SESSION_RECORDING_PROPERTIES_BY_PROJECT_ID])

Sessions

Retrieve Session Property Definitions

Retrieve property definitions for a specific project by providing the project's ID. Access this GET endpoint at `/api/projects/{project_id}/sessions/property_definitions/`. Project ID is manda
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_SESSION_PROPERTY_DEFINITIONS])

Retrieve Project Session Values

Retrieve session values for a specified project. Pass the project_id in the URL path to obtain the information. Only the project's ID is required as a parameter. No response body for the 200 O
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_PROJECT_SESSION_VALUES])

Subscriptions

List Project Subscriptions With Pagination

Retrieve a paginated list of subscriptions for a given project by its ID. Optional query params include 'limit' for results per page and 'offset' for results starting index. Authentication is
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_LIST_PROJECT_SUBSCRIPTIONS_WITH_PAGINATION])

Create Project Subscription With Delivery Options

Create a subscription for a given project by providing required details such as delivery method, frequency, and starting date. Requires a project ID and supports various content types. Returns
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_CREATE_PROJECT_SUBSCRIPTION_WITH_DELIVERY_OPTIONS])

Retrieve Project Subscription Details

Retrieve a specific subscription for a project, identified by 'project_id' and 'id'. Requires valid API key with read access. Supports GET method, returns subscription details including freque
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_PROJECT_SUBSCRIPTION_DETAILS])

Update Project Subscription Details

Update a subscription for a specific project. Provide project_id and subscription id in the path and use MIME types like application/json with fields like frequency, target_type, etc. Requires
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_UPDATE_PROJECT_SUBSCRIPTION_DETAILS])

Update Partial Subscription Details

PATCH /api/projects/{project_id}/subscriptions/{id}/: Update partial details of a specific project subscription by ID. Modify target, frequency, and more. Requires subscription:write permissio
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_UPDATE_PARTIAL_SUBSCRIPTION_DETAILS])

Mark Subscription As Deleted By Id

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

Surveys

List Paginated Surveys For A Project

Get paginated surveys for a project with its ID, using 'limit' and 'offset'. Needs PersonalAPIKeyAuth ('survey:read'). JSON output includes survey info, links, and metadata.
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_LIST_PAGINATED_SURVEYS_FOR_A_PROJECT])

Create Project Surveys With Questions And Targets

Create surveys in a project by providing a project ID and details like type, questions, and targets in JSON, form-data, or urlencoded format. Use PersonalAPIKeyAuth for security. Get a survey
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_CREATE_PROJECT_SURVEYS_WITH_QUESTIONS_AND_TARGETS])

Retrieve Survey Details With Uuid And Project Id

Retrieve survey details using survey UUID and associated project ID. Supports secure access with 'PersonalAPIKeyAuth'. Returns survey name, type, linking, targeting flags, creator info, and qu
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_RETRIEVE_SURVEY_DETAILS_WITH_UUID_AND_PROJECT_ID])

Update Project Survey Details

The `/api/projects/{project_id}/surveys/{id}/` PUT endpoint updates survey details in a project using survey UUID and project ID, accepts JSON/form/multipart data, needs `survey:write` permiss
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_UPDATE_PROJECT_SURVEY_DETAILS])

Update Partial Survey Details

Update partial survey details by PATCH to /api/projects/{project_id}/surveys/{id}/ with UUID. Edit attributes like name, type, questions, targeting, and flags. Needs PersonalAPIKeyAuth for wri
from composio_langchain import ComposioToolSet, Action tool_set = ComposioToolSet() tools = tool_set.get_tools(actions=[Action.POSTHOG_UPDATE_PARTIAL_SURVEY_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🧪