:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(data-warehouse): add canonical descriptions to warehouse sources (#65636)
Tom Owers8184fe673a81
diff --git a/posthog/temporal/data_imports/sources/adroll/canonical_descriptions.py b/posthog/temporal/data_imports/sources/adroll/canonical_descriptions.pynew file mode 100644index 000000000000..5293c62a80e0--- /dev/null+++ b/posthog/temporal/data_imports/sources/adroll/canonical_descriptions.py@@ -0,0 +1,59 @@+"""Canonical, documentation-sourced descriptions for AdRoll (NextRoll) endpoints and columns.++Sourced from the official NextRoll/AdRoll API reference (https://developers.nextroll.com/).+Keyed by the endpoint names in `settings.py` `ADROLL_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced AdRoll table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "advertisables": {+ "description": "An advertisable entity (a brand or product) under your AdRoll organization that campaigns run against.",+ "docs_url": "https://developers.nextroll.com/api-reference/index.html",+ "columns": {+ "eid": "Unique encoded identifier (EID) for the advertisable.",+ "name": "Display name of the advertisable.",+ "advertiser_id": "Identifier of the advertiser the advertisable belongs to.",+ "organization": "EID of the organization that owns the advertisable.",+ "status": "Current status of the advertisable (e.g. live, paused).",+ "created_date": "Time at which the advertisable was created.",+ "currency": "Three-letter ISO currency code used for the advertisable's spend.",+ "time_zone": "Time zone configured for the advertisable.",+ },+ },+ "campaigns": {+ "description": "An advertising campaign belonging to an advertisable, grouping ads toward a goal and budget.",+ "docs_url": "https://developers.nextroll.com/api-reference/index.html",+ "columns": {+ "eid": "Unique encoded identifier (EID) for the campaign.",+ "_advertisable_eid": "EID of the parent advertisable the campaign belongs to (added during sync).",+ "name": "Display name of the campaign.",+ "advertisable": "EID of the advertisable the campaign belongs to.",+ "status": "Current status of the campaign (e.g. live, paused, archived).",+ "budget": "Budget allocated to the campaign.",+ "start_date": "Date the campaign starts running.",+ "end_date": "Date the campaign stops running.",+ "created_date": "Time at which the campaign was created.",+ "channel": "Advertising channel the campaign runs on (e.g. web, social).",+ "type": "Type of the campaign (e.g. retargeting, prospecting).",+ },+ },+ "ads": {+ "description": "An individual ad creative belonging to an advertisable, served within campaigns.",+ "docs_url": "https://developers.nextroll.com/api-reference/index.html",+ "columns": {+ "eid": "Unique encoded identifier (EID) for the ad.",+ "_advertisable_eid": "EID of the parent advertisable the ad belongs to (added during sync).",+ "name": "Display name of the ad.",+ "advertisable": "EID of the advertisable the ad belongs to.",+ "status": "Current status of the ad (e.g. live, paused, rejected).",+ "ad_format_id": "Identifier of the ad format/size.",+ "width": "Width of the ad creative in pixels.",+ "height": "Height of the ad creative in pixels.",+ "created_date": "Time at which the ad was created.",+ "type": "Type of the ad creative (e.g. image, html5, native).",+ "clickthrough_url": "Destination URL the ad links to when clicked.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/adroll/source.py b/posthog/temporal/data_imports/sources/adroll/source.pyindex 2187f40a37aa..56bfae9e4976 100644--- a/posthog/temporal/data_imports/sources/adroll/source.py+++ b/posthog/temporal/data_imports/sources/adroll/source.py@@ -16,6 +16,7 @@ from posthog.temporal.data_imports.sources.adroll.adroll import ()from posthog.temporal.data_imports.sources.adroll.settings import ENDPOINTSfrom posthog.temporal.data_imports.sources.common.base import FieldType, SimpleSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.schema import SourceSchemafrom posthog.temporal.data_imports.sources.generated_configs import AdRollSourceConfig@@ -71,6 +72,11 @@ Create a personal access token and an app in the [NextRoll developer console](ht),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.adroll.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: AdRollSourceConfig,diff --git a/posthog/temporal/data_imports/sources/aircall/canonical_descriptions.py b/posthog/temporal/data_imports/sources/aircall/canonical_descriptions.pynew file mode 100644index 000000000000..57181e157feb--- /dev/null+++ b/posthog/temporal/data_imports/sources/aircall/canonical_descriptions.py@@ -0,0 +1,100 @@+"""Canonical, documentation-sourced descriptions for Aircall endpoints and columns.++Sourced from the official Aircall Public API reference (https://developer.aircall.io/api-references/).+Keyed by the endpoint names in `settings.py` `AIRCALL_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Aircall table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "calls": {+ "description": "A phone call handled through Aircall, inbound or outbound, with its participants and outcome.",+ "docs_url": "https://developer.aircall.io/api-references/#call",+ "columns": {+ "id": "Unique identifier for the call.",+ "direction": "Direction of the call: inbound or outbound.",+ "status": "Current status of the call (e.g. initial, answered, done).",+ "started_at": "Time the call started, as a UNIX timestamp.",+ "answered_at": "Time the call was answered, as a UNIX timestamp, if answered.",+ "ended_at": "Time the call ended, as a UNIX timestamp.",+ "duration": "Total duration of the call in seconds.",+ "raw_digits": "Phone number of the external party in raw international format.",+ "missed_call_reason": "Reason the call was missed, if it was not answered.",+ "user": "The Aircall user who handled the call.",+ "number": "The Aircall number the call came through.",+ "contact": "The contact associated with the external party, if matched.",+ "assigned_to": "The user the call was assigned to.",+ "recording": "URL of the call recording, if available.",+ "voicemail": "URL of the voicemail recording, if the call went to voicemail.",+ "cost": "Cost of the call.",+ },+ },+ "contacts": {+ "description": "A contact in the Aircall address book, with phone numbers and emails.",+ "docs_url": "https://developer.aircall.io/api-references/#contact",+ "columns": {+ "id": "Unique identifier for the contact.",+ "first_name": "Contact's first name.",+ "last_name": "Contact's last name.",+ "company_name": "Company the contact is associated with.",+ "information": "Free-form notes attached to the contact.",+ "is_shared": "Whether the contact is shared across the company.",+ "created_at": "Time the contact was created, as a UNIX timestamp.",+ "updated_at": "Time the contact was last updated, as a UNIX timestamp.",+ "phone_numbers": "List of phone numbers associated with the contact.",+ "emails": "List of email addresses associated with the contact.",+ },+ },+ "users": {+ "description": "An Aircall user (agent) who can make and receive calls in the account.",+ "docs_url": "https://developer.aircall.io/api-references/#user",+ "columns": {+ "id": "Unique identifier for the user.",+ "name": "Full name of the user.",+ "email": "Email address of the user.",+ "available": "Whether the user is currently available to take calls.",+ "availability_status": "Detailed availability status of the user.",+ "created_at": "Time the user was created, as a UNIX timestamp.",+ "time_zone": "Time zone configured for the user.",+ "language": "Language configured for the user.",+ "state": "Account state of the user (e.g. active, deleted).",+ },+ },+ "teams": {+ "description": "A team of Aircall users that calls and numbers can be routed to.",+ "docs_url": "https://developer.aircall.io/api-references/#team",+ "columns": {+ "id": "Unique identifier for the team.",+ "name": "Name of the team.",+ "created_at": "Time the team was created, as a UNIX timestamp.",+ "users": "List of users that belong to the team.",+ },+ },+ "numbers": {+ "description": "An Aircall phone number that receives and places calls, with its routing settings.",+ "docs_url": "https://developer.aircall.io/api-references/#number",+ "columns": {+ "id": "Unique identifier for the number.",+ "name": "Display name of the number.",+ "digits": "The phone number in international format.",+ "country": "Two-letter ISO country code of the number.",+ "time_zone": "Time zone configured for the number.",+ "open": "Whether the number is currently open (within business hours).",+ "availability_status": "Current availability status of the number.",+ "is_ivr": "Whether the number uses an interactive voice response menu.",+ "created_at": "Time the number was created, as a UNIX timestamp.",+ "users": "List of users assigned to the number.",+ },+ },+ "tags": {+ "description": "A label that can be applied to calls in Aircall to categorize them.",+ "docs_url": "https://developer.aircall.io/api-references/#tag",+ "columns": {+ "id": "Unique identifier for the tag.",+ "name": "Name of the tag.",+ "color": "Color of the tag, as a hex value.",+ "description": "Description of what the tag is used for.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/aircall/source.py b/posthog/temporal/data_imports/sources/aircall/source.pyindex ca0f66f1b57d..820806c14241 100644--- a/posthog/temporal/data_imports/sources/aircall/source.py+++ b/posthog/temporal/data_imports/sources/aircall/source.py@@ -17,6 +17,7 @@ from posthog.temporal.data_imports.sources.aircall.aircall import ()from posthog.temporal.data_imports.sources.aircall.settings import ENDPOINTS, INCREMENTAL_FIELDSfrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -72,6 +73,11 @@ You can create an API key (API ID + API token) in your [Aircall dashboard](https),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.aircall.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: AircallSourceConfig,diff --git a/posthog/temporal/data_imports/sources/amazon_ads/canonical_descriptions.py b/posthog/temporal/data_imports/sources/amazon_ads/canonical_descriptions.pynew file mode 100644index 000000000000..fa4abffea05d--- /dev/null+++ b/posthog/temporal/data_imports/sources/amazon_ads/canonical_descriptions.py@@ -0,0 +1,50 @@+"""Canonical, documentation-sourced descriptions for Amazon Ads endpoints and columns.++Sourced from the official Amazon Ads API reference (https://advertising.amazon.com/API/docs/en-us/).+Keyed by the endpoint names in `settings.py` `AMAZON_ADS_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Amazon Ads table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "profiles": {+ "description": "An advertising profile representing an account in a specific marketplace/region.",+ "docs_url": "https://advertising.amazon.com/API/docs/en-us/reference/2/profiles",+ "columns": {+ "profileId": "Unique identifier for the advertising profile.",+ "countryCode": "Two-letter ISO country code of the marketplace the profile belongs to.",+ "currencyCode": "Three-letter ISO currency code used for the profile's spend.",+ "timezone": "Time zone configured for the profile.",+ "marketplaceStringId": "Identifier of the Amazon marketplace the profile is registered in.",+ "dailyBudget": "Default daily budget for the profile, if set.",+ "accountInfo": "Account metadata, including the account type (seller, vendor, agency) and name.",+ },+ },+ "sp_campaigns": {+ "description": "A Sponsored Products campaign that groups ad groups under a budget and targeting strategy.",+ "docs_url": "https://advertising.amazon.com/API/docs/en-us/sponsored-products/3-0/openapi/prod#tag/Campaigns",+ "columns": {+ "campaignId": "Unique identifier for the campaign.",+ "name": "Name of the campaign.",+ "state": "Current state of the campaign: enabled, paused, or archived.",+ "budget": "Budget configuration for the campaign, including amount and budget type.",+ "targetingType": "Targeting strategy of the campaign: manual or auto.",+ "startDate": "Date the campaign starts running.",+ "endDate": "Date the campaign stops running, if set.",+ "dynamicBidding": "Dynamic bidding strategy and placement bid adjustments for the campaign.",+ "portfolioId": "Identifier of the portfolio the campaign belongs to, if any.",+ },+ },+ "sp_ad_groups": {+ "description": "A Sponsored Products ad group within a campaign, grouping ads and keywords under a default bid.",+ "docs_url": "https://advertising.amazon.com/API/docs/en-us/sponsored-products/3-0/openapi/prod#tag/Ad-groups",+ "columns": {+ "adGroupId": "Unique identifier for the ad group.",+ "campaignId": "Identifier of the campaign the ad group belongs to.",+ "name": "Name of the ad group.",+ "state": "Current state of the ad group: enabled, paused, or archived.",+ "defaultBid": "Default bid applied to targets in the ad group, in the profile's currency.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/amazon_ads/source.py b/posthog/temporal/data_imports/sources/amazon_ads/source.pyindex f1eb5eaf237a..cc29fccb00df 100644--- a/posthog/temporal/data_imports/sources/amazon_ads/source.py+++ b/posthog/temporal/data_imports/sources/amazon_ads/source.py@@ -18,6 +18,7 @@ from posthog.temporal.data_imports.sources.amazon_ads.amazon_ads import ()from posthog.temporal.data_imports.sources.amazon_ads.settings import ENDPOINTSfrom posthog.temporal.data_imports.sources.common.base import FieldType, SimpleSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.schema import SourceSchemafrom posthog.temporal.data_imports.sources.generated_configs import AmazonAdsSourceConfig@@ -92,6 +93,11 @@ You need a Login with Amazon (LWA) application with Advertising API access: ente),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.amazon_ads.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: AmazonAdsSourceConfig,diff --git a/posthog/temporal/data_imports/sources/amplitude/canonical_descriptions.py b/posthog/temporal/data_imports/sources/amplitude/canonical_descriptions.pynew file mode 100644index 000000000000..36722dbdeec1--- /dev/null+++ b/posthog/temporal/data_imports/sources/amplitude/canonical_descriptions.py@@ -0,0 +1,64 @@+"""Canonical, documentation-sourced descriptions for Amplitude endpoints and columns.++Sourced from the official Amplitude HTTP API reference (https://amplitude.com/docs/apis), covering the+Export API (events) and the Dashboard REST APIs (cohorts, annotations). Keyed by the endpoint names in+`settings.py` `AMPLITUDE_ENDPOINTS`, which match the `ExternalDataSchema.name` of a synced Amplitude+table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "events": {+ "description": "A single raw event tracked in Amplitude, exported with its user, device, and event properties.",+ "docs_url": "https://amplitude.com/docs/apis/analytics/export",+ "columns": {+ "uuid": "Unique identifier for the event record.",+ "event_type": "Name of the event (e.g. 'Sign Up', 'Purchase').",+ "event_time": "Time the event occurred on the client, in the project's timezone.",+ "server_upload_time": "Time Amplitude's servers received the event — the cursor used for incremental sync.",+ "client_event_time": "Time the event occurred according to the client's device clock.",+ "user_id": "Your application's identifier for the user, if set.",+ "device_id": "Device-level identifier Amplitude uses to track anonymous users.",+ "amplitude_id": "Amplitude's internal unique identifier for the user.",+ "session_id": "Identifier of the session the event belongs to.",+ "event_id": "Counter that increments for each event the user has sent.",+ "event_properties": "Key-value properties attached to the specific event.",+ "user_properties": "Key-value properties describing the user at event time.",+ "platform": "Platform the event came from (e.g. Web, iOS, Android).",+ "os_name": "Operating system name of the device.",+ "device_type": "Type/model of the device that sent the event.",+ "country": "Country the event was sent from, derived from IP.",+ "city": "City the event was sent from, derived from IP.",+ "app_version": "Version of your application that sent the event.",+ "language": "Language set on the device.",+ },+ },+ "cohorts": {+ "description": "A saved group of users in Amplitude defined by behavioral or property criteria.",+ "docs_url": "https://amplitude.com/docs/apis/analytics/behavioral-cohorts",+ "columns": {+ "id": "Unique identifier for the cohort.",+ "name": "Name of the cohort.",+ "description": "Description of the cohort's definition.",+ "size": "Number of users currently in the cohort.",+ "owners": "Users who own the cohort.",+ "published": "Whether the cohort is published and shared.",+ "archived": "Whether the cohort has been archived.",+ "createdAt": "Time the cohort was created.",+ "lastComputed": "Time the cohort's membership was last computed.",+ "lastMod": "Time the cohort was last modified.",+ "type": "Type of cohort (e.g. dynamic or static).",+ },+ },+ "annotations": {+ "description": "A chart annotation in Amplitude marking a notable date with a label.",+ "docs_url": "https://amplitude.com/docs/apis/analytics/chart-annotations",+ "columns": {+ "id": "Unique identifier for the annotation.",+ "date": "Date the annotation is placed on.",+ "label": "Short label shown for the annotation.",+ "details": "Longer description of the annotation.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/amplitude/source.py b/posthog/temporal/data_imports/sources/amplitude/source.pyindex 76e0b963f233..1932b1f2086a 100644--- a/posthog/temporal/data_imports/sources/amplitude/source.py+++ b/posthog/temporal/data_imports/sources/amplitude/source.py@@ -19,6 +19,7 @@ from posthog.temporal.data_imports.sources.amplitude.amplitude import ()from posthog.temporal.data_imports.sources.amplitude.settings import AMPLITUDE_ENDPOINTS, EVENTS_ENDPOINTfrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -44,6 +45,11 @@ class AmplitudeSource(ResumableSource[AmplitudeSourceConfig, AmplitudeResumeConf"Invalid API Key": message,}+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.amplitude.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: AmplitudeSourceConfig,diff --git a/posthog/temporal/data_imports/sources/apollo/canonical_descriptions.py b/posthog/temporal/data_imports/sources/apollo/canonical_descriptions.pynew file mode 100644index 000000000000..be0685bd0677--- /dev/null+++ b/posthog/temporal/data_imports/sources/apollo/canonical_descriptions.py@@ -0,0 +1,71 @@+"""Canonical, documentation-sourced descriptions for Apollo.io endpoints and columns.++Sourced from the official Apollo.io API reference (https://docs.apollo.io/reference). Keyed by the+endpoint names in `settings.py` `APOLLO_ENDPOINTS`, which match the `ExternalDataSchema.name` of a+synced Apollo table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "contacts": {+ "description": "A person saved in your Apollo account — a lead or prospect with contact details and enrichment data.",+ "docs_url": "https://docs.apollo.io/reference/search-for-contacts",+ "columns": {+ "id": "Unique identifier for the contact.",+ "first_name": "Contact's first name.",+ "last_name": "Contact's last name.",+ "name": "Contact's full name.",+ "title": "Contact's job title.",+ "email": "Contact's email address.",+ "email_status": "Verification status of the contact's email.",+ "organization_id": "Identifier of the organization the contact belongs to.",+ "organization_name": "Name of the organization the contact belongs to.",+ "account_id": "Identifier of the account the contact is linked to in Apollo.",+ "linkedin_url": "URL of the contact's LinkedIn profile.",+ "phone_numbers": "List of phone numbers associated with the contact.",+ "city": "City the contact is located in.",+ "state": "State or region the contact is located in.",+ "country": "Country the contact is located in.",+ "created_at": "Time the contact was created in Apollo.",+ "updated_at": "Time the contact was last updated — the cursor used for incremental sync.",+ },+ },+ "accounts": {+ "description": "A company saved in your Apollo account, with firmographic and enrichment data.",+ "docs_url": "https://docs.apollo.io/reference/organization-search",+ "columns": {+ "id": "Unique identifier for the account.",+ "name": "Name of the company.",+ "domain": "Primary web domain of the company.",+ "website_url": "Company's website URL.",+ "phone": "Primary phone number of the company.",+ "industry": "Industry the company operates in.",+ "estimated_num_employees": "Estimated number of employees at the company.",+ "linkedin_url": "URL of the company's LinkedIn page.",+ "city": "City the company's headquarters is located in.",+ "state": "State or region the company's headquarters is located in.",+ "country": "Country the company's headquarters is located in.",+ "owner_id": "Identifier of the Apollo user who owns the account.",+ "created_at": "Time the account was created in Apollo.",+ "updated_at": "Time the account was last updated — the cursor used for incremental sync.",+ },+ },+ "opportunities": {+ "description": "A sales deal tracked in Apollo's CRM, with its stage, value, and associated account.",+ "docs_url": "https://docs.apollo.io/reference/search-for-deals",+ "columns": {+ "id": "Unique identifier for the opportunity.",+ "name": "Name of the opportunity (deal).",+ "amount": "Monetary value of the opportunity.",+ "opportunity_stage_id": "Identifier of the deal stage the opportunity is in.",+ "owner_id": "Identifier of the Apollo user who owns the opportunity.",+ "account_id": "Identifier of the account the opportunity is associated with.",+ "is_closed": "Whether the opportunity has been closed.",+ "is_won": "Whether the opportunity was won.",+ "closed_date": "Date the opportunity was or is expected to be closed.",+ "created_at": "Time the opportunity was created in Apollo.",+ "updated_at": "Time the opportunity was last updated.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/apollo/source.py b/posthog/temporal/data_imports/sources/apollo/source.pyindex a076450ec328..cc98064a1762 100644--- a/posthog/temporal/data_imports/sources/apollo/source.py+++ b/posthog/temporal/data_imports/sources/apollo/source.py@@ -17,6 +17,7 @@ from posthog.temporal.data_imports.sources.apollo.apollo import ()from posthog.temporal.data_imports.sources.apollo.settings import ENDPOINTS, INCREMENTAL_FIELDSfrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -64,6 +65,11 @@ You can create an API key in Apollo under Settings > Integrations > API. API acc),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.apollo.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: ApolloSourceConfig,diff --git a/posthog/temporal/data_imports/sources/appsflyer/canonical_descriptions.py b/posthog/temporal/data_imports/sources/appsflyer/canonical_descriptions.pynew file mode 100644index 000000000000..23ab45f0cc4f--- /dev/null+++ b/posthog/temporal/data_imports/sources/appsflyer/canonical_descriptions.py@@ -0,0 +1,56 @@+"""Canonical, documentation-sourced descriptions for AppsFlyer aggregate Pull API reports and columns.++Sourced from the official AppsFlyer Pull API / aggregate report reference+(https://support.appsflyer.com/hc/en-us/articles/207034366-Pull-APIs-aggregate-and-raw-data).+Keyed by the report names in `settings.py` `APPSFLYER_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced AppsFlyer table. Column names are the CSV headers normalized to+snake_case (see `_normalize_header`); columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Columns shared across the aggregate-by-date reports (CSV headers normalized to snake_case).+_COMMON_COLUMNS = {+ "date": "Date the aggregated metrics are reported for.",+ "agency_pmd_af_prt": "Agency or PMD partner attributed to the activity (af_prt).",+ "media_source_pid": "Media source the traffic is attributed to (pid).",+ "campaign_c": "Campaign name the activity is attributed to (c).",+ "impressions": "Number of ad impressions in the period.",+ "clicks": "Number of ad clicks in the period.",+ "ctr": "Click-through rate (clicks divided by impressions).",+ "installs": "Number of attributed app installs in the period.",+ "conversion_rate": "Install conversion rate (installs divided by clicks).",+ "cost": "Total ad spend in the period.",+ "revenue": "Total revenue attributed in the period.",+ "roi": "Return on investment (revenue relative to cost).",+ "average_ecpi": "Average effective cost per install.",+ "loyal_users": "Number of users classified as loyal in the period.",+ "loyal_users_installs": "Ratio of loyal users to installs.",+ "total_revenue": "Total revenue attributed across all events in the period.",+ "total_cost": "Total cost attributed across the period.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "daily_report": {+ "description": "Daily aggregate performance per media source and campaign — installs, clicks, cost, and revenue by date.",+ "docs_url": "https://support.appsflyer.com/hc/en-us/articles/207034366-Pull-APIs-aggregate-and-raw-data",+ "columns": _columns(),+ },+ "geo_report": {+ "description": "Daily aggregate performance broken down by country, in addition to media source and campaign.",+ "docs_url": "https://support.appsflyer.com/hc/en-us/articles/207034366-Pull-APIs-aggregate-and-raw-data",+ "columns": _columns(+ country="Country the aggregated metrics are reported for.",+ ),+ },+ "partners_report": {+ "description": "Daily aggregate performance broken down by attribution partner (media source).",+ "docs_url": "https://support.appsflyer.com/hc/en-us/articles/207034366-Pull-APIs-aggregate-and-raw-data",+ "columns": _columns(),+ },+}diff --git a/posthog/temporal/data_imports/sources/appsflyer/source.py b/posthog/temporal/data_imports/sources/appsflyer/source.pyindex 54fd0c629edc..dc6395543daf 100644--- a/posthog/temporal/data_imports/sources/appsflyer/source.py+++ b/posthog/temporal/data_imports/sources/appsflyer/source.py@@ -20,6 +20,7 @@ from posthog.temporal.data_imports.sources.appsflyer.appsflyer import ()from posthog.temporal.data_imports.sources.appsflyer.settings import ENDPOINTS, INCREMENTAL_FIELDSfrom posthog.temporal.data_imports.sources.common.base import FieldType, SimpleSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.schema import SourceSchemafrom posthog.temporal.data_imports.sources.generated_configs import AppsFlyerSourceConfig@@ -81,6 +82,11 @@ You can find your API token (V2) in AppsFlyer under your account menu > Security),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.appsflyer.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: AppsFlyerSourceConfig,diff --git a/posthog/temporal/data_imports/sources/asana/canonical_descriptions.py b/posthog/temporal/data_imports/sources/asana/canonical_descriptions.pynew file mode 100644index 000000000000..d9271b38ae5a--- /dev/null+++ b/posthog/temporal/data_imports/sources/asana/canonical_descriptions.py@@ -0,0 +1,133 @@+"""Canonical, documentation-sourced descriptions for Asana endpoints and columns.++Sourced from the official Asana API reference (https://developers.asana.com/reference/rest-api-reference).+Keyed by the endpoint names in `settings.py` `ASANA_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Asana table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by most Asana objects; merged into each entry so we don't repeat them.+_COMMON_COLUMNS = {+ "gid": "Globally unique identifier for the resource.",+ "resource_type": "The base type of the resource (e.g. 'task', 'project', 'user').",+ "name": "Name of the resource.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "workspaces": {+ "description": "A workspace or organization — the highest-level container for all Asana data.",+ "docs_url": "https://developers.asana.com/reference/workspaces",+ "columns": _columns(+ email_domains="Email domains that are associated with this workspace.",+ is_organization="Whether the workspace is an organization (as opposed to a plain workspace).",+ ),+ },+ "users": {+ "description": "A member of an Asana workspace or organization.",+ "docs_url": "https://developers.asana.com/reference/users",+ "columns": _columns(+ email="The user's email address.",+ photo="A map of the user's profile photo in various sizes.",+ workspaces="Workspaces and organizations the user is a member of.",+ ),+ },+ "projects": {+ "description": "A collection of tasks with a shared purpose, owner, and timeline.",+ "docs_url": "https://developers.asana.com/reference/projects",+ "columns": _columns(+ created_at="Time at which the project was created.",+ modified_at="Time at which the project was last modified.",+ archived="Whether the project is archived.",+ color="Color of the project in the Asana UI.",+ current_status="The most recently posted status update for the project.",+ default_view="The default layout used when viewing the project (list, board, calendar, timeline).",+ due_date="Date on which the project is due (deprecated in favor of due_on).",+ due_on="Date on which the project is due.",+ start_on="Date on which the project starts.",+ notes="Free-form textual notes describing the project.",+ public="Whether the project is public to its team.",+ owner="The user who owns the project.",+ team="The team that the project is shared with.",+ workspace="The workspace or organization the project is associated with.",+ completed="Whether the project is marked complete.",+ completed_at="Time at which the project was completed.",+ members="Users who are members of the project.",+ followers="Users following the project, who receive notifications about it.",+ permalink_url="URL linking to the project in the Asana UI.",+ ),+ },+ "tasks": {+ "description": "A unit of work in Asana — the basic object around which tasks are tracked.",+ "docs_url": "https://developers.asana.com/reference/tasks",+ "columns": _columns(+ created_at="Time at which the task was created.",+ modified_at="Time at which the task was last modified.",+ completed="Whether the task is currently marked complete.",+ completed_at="Time at which the task was completed.",+ due_on="Date on which the task is due.",+ due_at="Date and time on which the task is due, if a specific time was set.",+ start_on="Date on which the task starts.",+ assignee="The user to whom the task is assigned.",+ assignee_status="Scheduling status of the task for the assignee (today, upcoming, later).",+ notes="Free-form textual notes describing the task.",+ parent="The parent task, if this task is a subtask.",+ projects="Projects the task is associated with.",+ tags="Tags applied to the task.",+ workspace="The workspace or organization the task is associated with.",+ resource_subtype="The subtype of the task (e.g. 'default_task', 'milestone').",+ num_hearts="Number of users who have hearted the task.",+ num_likes="Number of users who have liked the task.",+ permalink_url="URL linking to the task in the Asana UI.",+ custom_fields="Values of custom fields applied to the task.",+ ),+ },+ "tags": {+ "description": "A label that can be applied to tasks to group and categorize them.",+ "docs_url": "https://developers.asana.com/reference/tags",+ "columns": _columns(+ created_at="Time at which the tag was created.",+ color="Color of the tag in the Asana UI.",+ notes="Free-form textual notes describing the tag.",+ workspace="The workspace or organization the tag is associated with.",+ permalink_url="URL linking to the tag in the Asana UI.",+ ),+ },+ "sections": {+ "description": "A grouping within a project that organizes its tasks.",+ "docs_url": "https://developers.asana.com/reference/sections",+ "columns": _columns(+ created_at="Time at which the section was created.",+ project="The project the section belongs to.",+ ),+ },+ "teams": {+ "description": "A group of users within an organization that share projects and conversations.",+ "docs_url": "https://developers.asana.com/reference/teams",+ "columns": _columns(+ description="Description of the team.",+ organization="The organization the team belongs to.",+ permalink_url="URL linking to the team in the Asana UI.",+ visibility="Visibility of the team (secret, request_to_join, or public).",+ ),+ },+ "custom_fields": {+ "description": "A custom field definition used to add structured metadata to tasks and projects.",+ "docs_url": "https://developers.asana.com/reference/custom-fields",+ "columns": _columns(+ description="Description of the custom field.",+ type="Type of the custom field (text, number, enum, multi_enum, date, people).",+ resource_subtype="The subtype of the custom field, matching its type.",+ enabled="Whether the custom field is enabled.",+ format="Format applied to the field's value (currency, percentage, duration, etc.).",+ precision="Number of decimal places shown for numeric fields.",+ is_global_to_workspace="Whether the custom field is available across the whole workspace.",+ created_by="The user who created the custom field.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/asana/source.py b/posthog/temporal/data_imports/sources/asana/source.pyindex e98226422195..e63d3a32160c 100644--- a/posthog/temporal/data_imports/sources/asana/source.py+++ b/posthog/temporal/data_imports/sources/asana/source.py@@ -17,6 +17,7 @@ from posthog.temporal.data_imports.sources.asana.asana import ()from posthog.temporal.data_imports.sources.asana.settings import ENDPOINTS, INCREMENTAL_FIELDSfrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -68,6 +69,11 @@ Grant these read scopes so every table can sync:),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.asana.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized for url: https://app.asana.com": "Your Asana token is invalid or expired. Please generate a new personal access token and reconnect.",diff --git a/posthog/temporal/data_imports/sources/ashby/canonical_descriptions.py b/posthog/temporal/data_imports/sources/ashby/canonical_descriptions.pynew file mode 100644index 000000000000..f69910aadc36--- /dev/null+++ b/posthog/temporal/data_imports/sources/ashby/canonical_descriptions.py@@ -0,0 +1,191 @@+"""Canonical, documentation-sourced descriptions for Ashby endpoints and columns.++Sourced from the official Ashby API reference (https://developers.ashbyhq.com). Keyed by the+table names in `settings.py` `ASHBY_ENDPOINTS`, which match the `ExternalDataSchema.name` of a+synced Ashby table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by most Ashby objects; merged into each entry so we don't repeat them.+_COMMON_COLUMNS = {+ "id": "Unique identifier for the object.",+ "createdAt": "Time at which the object was created.",+ "updatedAt": "Time at which the object was last updated.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "candidates": {+ "description": "A person who has applied to or been sourced for a role in Ashby.",+ "docs_url": "https://developers.ashbyhq.com/reference/candidatelist",+ "columns": _columns(+ name="The candidate's full name.",+ primaryEmailAddress="The candidate's primary email address.",+ emailAddresses="All email addresses associated with the candidate.",+ phoneNumbers="Phone numbers associated with the candidate.",+ socialLinks="Social and professional profile links for the candidate.",+ tags="Tags applied to the candidate.",+ position="The candidate's current job title.",+ company="The candidate's current company.",+ applicationIds="IDs of the applications associated with the candidate.",+ source="The source through which the candidate was added.",+ ),+ },+ "applications": {+ "description": "A candidate's application to a specific job in Ashby.",+ "docs_url": "https://developers.ashbyhq.com/reference/applicationlist",+ "columns": _columns(+ candidateId="ID of the candidate who applied.",+ jobId="ID of the job applied to.",+ status="Status of the application (Active, Hired, Archived, Lead).",+ currentInterviewStage="The interview stage the application is currently in.",+ source="The source through which the application originated.",+ archiveReason="Reason the application was archived, if applicable.",+ creditedToUser="The user credited with the application.",+ ),+ },+ "jobs": {+ "description": "A job (requisition) being recruited for in Ashby.",+ "docs_url": "https://developers.ashbyhq.com/reference/joblist",+ "columns": _columns(+ title="The job's title.",+ status="Status of the job (Draft, Open, Closed, Archived).",+ employmentType="Employment type for the job (FullTime, PartTime, Intern, Contract, Temporary).",+ locationId="ID of the location the job is based in.",+ departmentId="ID of the department the job belongs to.",+ jobPostingIds="IDs of the job postings published for this job.",+ ),+ },+ "job_postings": {+ "description": "A published, externally visible posting for a job in Ashby.",+ "docs_url": "https://developers.ashbyhq.com/reference/jobpostinglist",+ "columns": _columns(+ title="The job posting's title.",+ jobId="ID of the job this posting belongs to.",+ locationName="Name of the location shown on the posting.",+ departmentName="Name of the department shown on the posting.",+ employmentType="Employment type shown on the posting.",+ isListed="Whether the posting is publicly listed.",+ externalLink="Public URL of the job posting.",+ ),+ },+ "offers": {+ "description": "An offer extended to a candidate for a job in Ashby.",+ "docs_url": "https://developers.ashbyhq.com/reference/offerlist",+ "columns": _columns(+ applicationId="ID of the application the offer is associated with.",+ offerStatus="Status of the offer (e.g. Draft, WaitingOnApprovals, Approved, Accepted, Declined).",+ latestVersion="The most recent version of the offer's details.",+ ),+ },+ "interviews": {+ "description": "An interview type or definition configured in Ashby.",+ "docs_url": "https://developers.ashbyhq.com/reference/interviewlist",+ "columns": _columns(+ title="Title of the interview.",+ isArchived="Whether the interview is archived.",+ isDebrief="Whether the interview is a debrief session.",+ ),+ },+ "interview_schedules": {+ "description": "A scheduled set of interviews for a candidate's application in Ashby.",+ "docs_url": "https://developers.ashbyhq.com/reference/interviewschedulelist",+ "columns": _columns(+ applicationId="ID of the application the schedule is for.",+ interviewStageId="ID of the interview stage the schedule is associated with.",+ status="Status of the interview schedule.",+ interviewEvents="The individual interview events that make up the schedule.",+ ),+ },+ "users": {+ "description": "A user (recruiter, hiring manager, or admin) in the Ashby workspace.",+ "docs_url": "https://developers.ashbyhq.com/reference/userlist",+ "columns": _columns(+ firstName="The user's first name.",+ lastName="The user's last name.",+ email="The user's email address.",+ globalRole="The user's global role in the workspace.",+ isEnabled="Whether the user account is enabled.",+ ),+ },+ "departments": {+ "description": "A department that jobs and teams are organized under in Ashby.",+ "docs_url": "https://developers.ashbyhq.com/reference/departmentlist",+ "columns": _columns(+ name="Name of the department.",+ isArchived="Whether the department is archived.",+ parentId="ID of the parent department, if nested.",+ ),+ },+ "locations": {+ "description": "A location that jobs can be based in within Ashby.",+ "docs_url": "https://developers.ashbyhq.com/reference/locationlist",+ "columns": _columns(+ name="Name of the location.",+ isArchived="Whether the location is archived.",+ isRemote="Whether the location is remote.",+ address="Address details of the location.",+ ),+ },+ "sources": {+ "description": "A source channel through which candidates are added in Ashby.",+ "docs_url": "https://developers.ashbyhq.com/reference/sourcelist",+ "columns": _columns(+ title="Title of the source.",+ isArchived="Whether the source is archived.",+ sourceType="The category of the source.",+ ),+ },+ "archive_reasons": {+ "description": "A reason an application can be archived in Ashby.",+ "docs_url": "https://developers.ashbyhq.com/reference/archivereasonlist",+ "columns": _columns(+ text="The text of the archive reason.",+ isArchived="Whether the archive reason itself is archived.",+ reasonType="The category of the archive reason.",+ ),+ },+ "candidate_tags": {+ "description": "A tag that can be applied to candidates in Ashby.",+ "docs_url": "https://developers.ashbyhq.com/reference/candidatetaglist",+ "columns": _columns(+ title="The text of the candidate tag.",+ isArchived="Whether the tag is archived.",+ ),+ },+ "custom_fields": {+ "description": "A custom field definition used to capture additional data on Ashby objects.",+ "docs_url": "https://developers.ashbyhq.com/reference/customfieldlist",+ "columns": _columns(+ title="Title of the custom field.",+ objectType="The type of object the custom field applies to.",+ fieldType="The data type of the custom field.",+ isArchived="Whether the custom field is archived.",+ isExposable="Whether the field's value can be exposed externally.",+ ),+ },+ "openings": {+ "description": "An opening (headcount slot) tied to one or more jobs in Ashby.",+ "docs_url": "https://developers.ashbyhq.com/reference/openinglist",+ "columns": _columns(+ identifier="Human-readable identifier for the opening.",+ jobIds="IDs of the jobs associated with the opening.",+ openingState="State of the opening (e.g. Draft, Approved, Open, Closed).",+ isArchived="Whether the opening is archived.",+ ),+ },+ "projects": {+ "description": "A project used to organize sourcing and recruiting work in Ashby.",+ "docs_url": "https://developers.ashbyhq.com/reference/projectlist",+ "columns": _columns(+ title="Title of the project.",+ isArchived="Whether the project is archived.",+ authorId="ID of the user who created the project.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/ashby/source.py b/posthog/temporal/data_imports/sources/ashby/source.pyindex ec5055c3bf06..6922e6352a06 100644--- a/posthog/temporal/data_imports/sources/ashby/source.py+++ b/posthog/temporal/data_imports/sources/ashby/source.py@@ -19,6 +19,7 @@ from posthog.temporal.data_imports.sources.ashby.ashby import ()from posthog.temporal.data_imports.sources.ashby.settings import ASHBY_ENDPOINTS, ENDPOINTSfrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -62,6 +63,11 @@ You can create an API key under **Admin → API Keys** in Ashby. Grant read perm),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.ashby.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: AshbySourceConfig,diff --git a/posthog/temporal/data_imports/sources/attentive/canonical_descriptions.py b/posthog/temporal/data_imports/sources/attentive/canonical_descriptions.pynew file mode 100644index 000000000000..bfabfd8e9b68--- /dev/null+++ b/posthog/temporal/data_imports/sources/attentive/canonical_descriptions.py@@ -0,0 +1,92 @@+"""Canonical, documentation-sourced descriptions for Attentive webhook event tables and columns.++Sourced from the official Attentive webhooks reference (https://docs.attentive.com/pages/program-setup/webhooks/).+Attentive has no bulk read API, so every table is populated from webhook events; keys match the+webhook-backed schema names in `constants.py` `RESOURCE_TO_ATTENTIVE_EVENT_TYPE`, which match the+`ExternalDataSchema.name` of a synced Attentive table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields present on every stored Attentive webhook row. `event_id` and `created_at` are synthesized+# by PostHog during ingestion; `type` and `timestamp` come from the Attentive webhook payload.+_COMMON_COLUMNS = {+ "event_id": "Stable hash of the webhook payload, synthesized by PostHog to dedupe retried deliveries.",+ "type": "The Attentive webhook event type (e.g. 'sms.subscribed', 'email.opened').",+ "timestamp": "Time at which the event occurred, as a Unix timestamp in milliseconds.",+ "created_at": "Event time in Unix seconds, derived from `timestamp` for datetime partitioning.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "sms_subscribed": {+ "description": "A subscriber opting in to receive SMS messages from Attentive.",+ "docs_url": "https://docs.attentive.com/pages/program-setup/webhooks/",+ "columns": _columns(+ user="The subscriber the event is about, including phone and external identifiers.",+ signUpSourceId="ID of the sign-up unit or source the subscriber opted in through.",+ ),+ },+ "sms_sent": {+ "description": "An SMS message sent to a subscriber by Attentive.",+ "docs_url": "https://docs.attentive.com/pages/program-setup/webhooks/",+ "columns": _columns(+ user="The subscriber the message was sent to, including phone and external identifiers.",+ message="The message that was sent, including its body and metadata.",+ messageId="Identifier of the sent message.",+ ),+ },+ "sms_message_link_click": {+ "description": "A subscriber clicking a link in an SMS message sent by Attentive.",+ "docs_url": "https://docs.attentive.com/pages/program-setup/webhooks/",+ "columns": _columns(+ user="The subscriber who clicked the link, including phone and external identifiers.",+ message="The message containing the clicked link.",+ link="The link that was clicked.",+ ),+ },+ "email_subscribed": {+ "description": "A subscriber opting in to receive email from Attentive.",+ "docs_url": "https://docs.attentive.com/pages/program-setup/webhooks/",+ "columns": _columns(+ user="The subscriber the event is about, including email and external identifiers.",+ signUpSourceId="ID of the sign-up unit or source the subscriber opted in through.",+ ),+ },+ "email_unsubscribed": {+ "description": "A subscriber opting out of receiving email from Attentive.",+ "docs_url": "https://docs.attentive.com/pages/program-setup/webhooks/",+ "columns": _columns(+ user="The subscriber the event is about, including email and external identifiers.",+ ),+ },+ "email_opened": {+ "description": "A subscriber opening an email sent by Attentive.",+ "docs_url": "https://docs.attentive.com/pages/program-setup/webhooks/",+ "columns": _columns(+ user="The subscriber who opened the email, including email and external identifiers.",+ message="The email message that was opened.",+ ),+ },+ "email_message_link_click": {+ "description": "A subscriber clicking a link in an email sent by Attentive.",+ "docs_url": "https://docs.attentive.com/pages/program-setup/webhooks/",+ "columns": _columns(+ user="The subscriber who clicked the link, including email and external identifiers.",+ message="The email message containing the clicked link.",+ link="The link that was clicked.",+ ),+ },+ "custom_attribute_set": {+ "description": "A custom attribute being set on an Attentive subscriber.",+ "docs_url": "https://docs.attentive.com/pages/program-setup/webhooks/",+ "columns": _columns(+ user="The subscriber the attribute was set on, including external identifiers.",+ properties="The custom attribute key-value pairs that were set.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/attentive/source.py b/posthog/temporal/data_imports/sources/attentive/source.pyindex 42b7355d3185..1710293b9dd5 100644--- a/posthog/temporal/data_imports/sources/attentive/source.py+++ b/posthog/temporal/data_imports/sources/attentive/source.py@@ -31,6 +31,7 @@ from posthog.temporal.data_imports.sources.common.base import (WebhookSource,WebhookSyncResult,)+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.schema import SourceSchemafrom posthog.temporal.data_imports.sources.common.webhook_s3 import WebhookSourceManager@@ -140,6 +141,11 @@ class AttentiveSource() -> tuple[bool, str | None]:return api_client.validate_credentials(config.api_key)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.attentive.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized": (diff --git a/posthog/temporal/data_imports/sources/attio/canonical_descriptions.py b/posthog/temporal/data_imports/sources/attio/canonical_descriptions.pynew file mode 100644index 000000000000..2ca00569d31e--- /dev/null+++ b/posthog/temporal/data_imports/sources/attio/canonical_descriptions.py@@ -0,0 +1,105 @@+"""Canonical, documentation-sourced descriptions for Attio endpoints and columns.++Sourced from the official Attio API reference (https://developers.attio.com/reference). Keyed by+the endpoint names in `settings.py` `ATTIO_ENDPOINTS`, which match the `ExternalDataSchema.name`+of a synced Attio table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by Attio object records (companies, people, deals, etc.); merged into those entries.+_RECORD_COLUMNS = {+ "id": "Composite identifier for the record (workspace, object, and record id).",+ "record_id": "Unique identifier for the record within its object.",+ "created_at": "Time at which the record was created.",+ "values": "The attribute values stored on the record, keyed by attribute slug.",+ "web_url": "URL linking to the record in the Attio UI.",+}+++def _record_columns(**overrides: str) -> dict[str, str]:+ return {**_RECORD_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "companies": {+ "description": "A company record in the Attio CRM.",+ "docs_url": "https://developers.attio.com/reference/post_v2-objects-object-records-query",+ "columns": _record_columns(),+ },+ "people": {+ "description": "A person record in the Attio CRM.",+ "docs_url": "https://developers.attio.com/reference/post_v2-objects-object-records-query",+ "columns": _record_columns(),+ },+ "deals": {+ "description": "A deal record in the Attio CRM, tracking a sales opportunity.",+ "docs_url": "https://developers.attio.com/reference/post_v2-objects-object-records-query",+ "columns": _record_columns(),+ },+ "users": {+ "description": "A user record in the Attio CRM, representing a product user.",+ "docs_url": "https://developers.attio.com/reference/post_v2-objects-object-records-query",+ "columns": _record_columns(),+ },+ "workspaces": {+ "description": "A workspace record in the Attio CRM, representing a customer account or workspace.",+ "docs_url": "https://developers.attio.com/reference/post_v2-objects-object-records-query",+ "columns": _record_columns(),+ },+ "lists": {+ "description": "A list in Attio, used to track records through a pipeline or collection.",+ "docs_url": "https://developers.attio.com/reference/get_v2-lists",+ "columns": {+ "id": "Composite identifier for the list (workspace and list id).",+ "list_id": "Unique identifier for the list.",+ "name": "Display name of the list.",+ "api_slug": "URL-safe slug used to reference the list in the API.",+ "parent_object": "The object type whose records this list tracks.",+ "workspace_access": "The default access level members have to the list.",+ "created_at": "Time at which the list was created.",+ },+ },+ "notes": {+ "description": "A note attached to a record in Attio.",+ "docs_url": "https://developers.attio.com/reference/get_v2-notes",+ "columns": {+ "id": "Composite identifier for the note (workspace and note id).",+ "note_id": "Unique identifier for the note.",+ "parent_object": "The object type the note is attached to.",+ "parent_record_id": "ID of the record the note is attached to.",+ "title": "Title of the note.",+ "content_plaintext": "Plain-text content of the note.",+ "created_by_actor": "The actor (user or system) that created the note.",+ "created_at": "Time at which the note was created.",+ },+ },+ "tasks": {+ "description": "A task in Attio, optionally linked to records and assignees.",+ "docs_url": "https://developers.attio.com/reference/get_v2-tasks",+ "columns": {+ "id": "Composite identifier for the task (workspace and task id).",+ "task_id": "Unique identifier for the task.",+ "content_plaintext": "Plain-text content of the task.",+ "is_completed": "Whether the task has been completed.",+ "deadline_at": "Time by which the task is due.",+ "linked_records": "Records the task is linked to.",+ "assignees": "The actors the task is assigned to.",+ "created_by_actor": "The actor that created the task.",+ "created_at": "Time at which the task was created.",+ },+ },+ "workspace_members": {+ "description": "A member of the Attio workspace.",+ "docs_url": "https://developers.attio.com/reference/get_v2-workspace-members",+ "columns": {+ "id": "Composite identifier for the workspace member (workspace and member id).",+ "workspace_member_id": "Unique identifier for the workspace member.",+ "first_name": "The member's first name.",+ "last_name": "The member's last name.",+ "email_address": "The member's email address.",+ "access_level": "The member's access level in the workspace (admin, member, suspended).",+ "created_at": "Time at which the member was added to the workspace.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/attio/source.py b/posthog/temporal/data_imports/sources/attio/source.pyindex ef9f813a9c32..cd8ed0e3cf5d 100644--- a/posthog/temporal/data_imports/sources/attio/source.py+++ b/posthog/temporal/data_imports/sources/attio/source.py@@ -15,6 +15,7 @@ from posthog.temporal.data_imports.sources.attio.attio import ()from posthog.temporal.data_imports.sources.attio.settings import ATTIO_ENDPOINTSfrom posthog.temporal.data_imports.sources.common.base import FieldType, SimpleSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.schema import SourceSchemafrom posthog.temporal.data_imports.sources.generated_configs import AttioSourceConfig@@ -28,6 +29,11 @@ class AttioSource(SimpleSource[AttioSourceConfig]):def source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.ATTIO+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.attio.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized for url: https://api.attio.com": "Your Attio API key is invalid or expired. Please generate a new key and reconnect.",diff --git a/posthog/temporal/data_imports/sources/azure_devops/canonical_descriptions.py b/posthog/temporal/data_imports/sources/azure_devops/canonical_descriptions.pynew file mode 100644index 000000000000..6dc307b89433--- /dev/null+++ b/posthog/temporal/data_imports/sources/azure_devops/canonical_descriptions.py@@ -0,0 +1,89 @@+"""Canonical, documentation-sourced descriptions for Azure DevOps endpoints and columns.++Sourced from the official Azure DevOps REST API reference (https://learn.microsoft.com/en-us/rest/api/azure/devops).+Keyed by the endpoint names in `settings.py` `AZURE_DEVOPS_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Azure DevOps table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "projects": {+ "description": "A team project in the Azure DevOps organization — a container for repos, builds, and work items.",+ "docs_url": "https://learn.microsoft.com/en-us/rest/api/azure/devops/core/projects/list",+ "columns": {+ "id": "Unique identifier for the project.",+ "name": "Name of the project.",+ "description": "Description of the project.",+ "url": "API URL of the project.",+ "state": "State of the project (e.g. wellFormed, createPending, deleting).",+ "revision": "Revision number of the project, incremented on each change.",+ "visibility": "Visibility of the project (private or public).",+ "lastUpdateTime": "Time at which the project was last updated.",+ },+ },+ "repositories": {+ "description": "A Git repository within an Azure DevOps project.",+ "docs_url": "https://learn.microsoft.com/en-us/rest/api/azure/devops/git/repositories/list",+ "columns": {+ "id": "Unique identifier for the repository.",+ "name": "Name of the repository.",+ "url": "API URL of the repository.",+ "project": "The project the repository belongs to.",+ "defaultBranch": "The repository's default branch (e.g. refs/heads/main).",+ "size": "Size of the repository in bytes.",+ "remoteUrl": "HTTPS clone URL of the repository.",+ "sshUrl": "SSH clone URL of the repository.",+ "webUrl": "URL of the repository in the Azure DevOps web UI.",+ "isDisabled": "Whether the repository is disabled.",+ },+ },+ "builds": {+ "description": "A build run produced by a build pipeline in Azure DevOps.",+ "docs_url": "https://learn.microsoft.com/en-us/rest/api/azure/devops/build/builds/list",+ "columns": {+ "id": "Unique identifier for the build.",+ "buildNumber": "Human-readable build number.",+ "status": "Status of the build (e.g. inProgress, completed, cancelling, notStarted).",+ "result": "Result of a completed build (e.g. succeeded, failed, canceled, partiallySucceeded).",+ "queueTime": "Time at which the build was queued.",+ "startTime": "Time at which the build started running.",+ "finishTime": "Time at which the build finished.",+ "sourceBranch": "The branch the build was run against.",+ "sourceVersion": "The commit the build was run against.",+ "definition": "The build pipeline definition that produced the build.",+ "project": "The project the build belongs to.",+ "requestedFor": "The identity the build was requested for.",+ "reason": "Reason the build was triggered (e.g. manual, individualCI, schedule).",+ },+ },+ "pull_requests": {+ "description": "A Git pull request in Azure DevOps.",+ "docs_url": "https://learn.microsoft.com/en-us/rest/api/azure/devops/git/pull-requests/get-pull-requests-by-project",+ "columns": {+ "pullRequestId": "Unique identifier for the pull request.",+ "title": "Title of the pull request.",+ "description": "Description of the pull request.",+ "status": "Status of the pull request (active, abandoned, or completed).",+ "createdBy": "The identity that created the pull request.",+ "creationDate": "Time at which the pull request was created.",+ "closedDate": "Time at which the pull request was closed.",+ "sourceRefName": "The source branch of the pull request.",+ "targetRefName": "The target branch of the pull request.",+ "mergeStatus": "Status of the merge of the source into the target branch.",+ "isDraft": "Whether the pull request is a draft.",+ "repository": "The repository the pull request belongs to.",+ },+ },+ "work_item_revisions": {+ "description": "A historical revision of a work item, from the reporting (append-only) feed.",+ "docs_url": "https://learn.microsoft.com/en-us/rest/api/azure/devops/wit/reporting-work-item-revisions/read-reporting-revisions-get",+ "columns": {+ "id": "Identifier of the work item this revision belongs to.",+ "rev": "Revision number of the work item.",+ "fields": "The work item field values at this revision (title, state, assigned to, etc.).",+ "changed_date": "Time at which this revision was made.",+ "url": "API URL of the work item revision.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/azure_devops/source.py b/posthog/temporal/data_imports/sources/azure_devops/source.pyindex fcaab38e1d86..8a06bcf54196 100644--- a/posthog/temporal/data_imports/sources/azure_devops/source.py+++ b/posthog/temporal/data_imports/sources/azure_devops/source.py@@ -17,6 +17,7 @@ from posthog.temporal.data_imports.sources.azure_devops.azure_devops import ()from posthog.temporal.data_imports.sources.azure_devops.settings import ENDPOINTS, INCREMENTAL_FIELDSfrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -37,6 +38,11 @@ class AzureDevOpsSource(ResumableSource[AzureDevOpsSourceConfig, AzureDevOpsResu# organization must force re-entry of the token.return ["organization"]+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.azure_devops.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"the personal access token is invalid or expired": "Azure DevOps authentication failed. Please check your personal access token (it may have expired).",diff --git a/posthog/temporal/data_imports/sources/bamboohr/canonical_descriptions.py b/posthog/temporal/data_imports/sources/bamboohr/canonical_descriptions.pynew file mode 100644index 000000000000..10fc02e2ad5f--- /dev/null+++ b/posthog/temporal/data_imports/sources/bamboohr/canonical_descriptions.py@@ -0,0 +1,91 @@+"""Canonical, documentation-sourced descriptions for BambooHR endpoints and columns.++Sourced from the official BambooHR API reference (https://documentation.bamboohr.com/reference).+Keyed by the endpoint names in `settings.py` `BAMBOOHR_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced BambooHR table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "employees": {+ "description": "An employee in the company directory.",+ "docs_url": "https://documentation.bamboohr.com/reference/get-employees-directory-1",+ "columns": {+ "id": "Unique identifier for the employee.",+ "displayName": "The employee's display name.",+ "firstName": "The employee's first name.",+ "lastName": "The employee's last name.",+ "preferredName": "The employee's preferred name, if set.",+ "jobTitle": "The employee's job title.",+ "workEmail": "The employee's work email address.",+ "department": "The department the employee belongs to.",+ "division": "The division the employee belongs to.",+ "location": "The employee's work location.",+ "supervisor": "The employee's supervisor.",+ "workPhone": "The employee's work phone number.",+ "mobilePhone": "The employee's mobile phone number.",+ "photoUrl": "URL of the employee's profile photo.",+ },+ },+ "time_off_requests": {+ "description": "A time-off request submitted by an employee.",+ "docs_url": "https://documentation.bamboohr.com/reference/time-off-1",+ "columns": {+ "id": "Unique identifier for the time-off request.",+ "employeeId": "ID of the employee who made the request.",+ "name": "Name of the employee who made the request.",+ "status": "Status of the request, including approval state.",+ "start": "Start date of the requested time off.",+ "end": "End date of the requested time off.",+ "created": "Date the request was created.",+ "type": "The type of time off requested (e.g. vacation, sick).",+ "amount": "The amount of time off requested, with its unit.",+ "notes": "Notes attached to the request.",+ },+ },+ "time_off_types": {+ "description": "A category of time off configured for the company (e.g. vacation, sick).",+ "docs_url": "https://documentation.bamboohr.com/reference/get-time-off-types",+ "columns": {+ "id": "Unique identifier for the time-off type.",+ "name": "Name of the time-off type.",+ "units": "The unit the time-off type is measured in (hours or days).",+ "color": "Display color of the time-off type.",+ "icon": "Icon associated with the time-off type.",+ },+ },+ "meta_fields": {+ "description": "A field definition available in the company's BambooHR account.",+ "docs_url": "https://documentation.bamboohr.com/reference/metadata-get-a-list-of-fields",+ "columns": {+ "id": "Unique identifier for the field.",+ "name": "Display name of the field.",+ "type": "Data type of the field.",+ "alias": "API alias used to reference the field.",+ },+ },+ "meta_lists": {+ "description": "A list field and its available option values configured in BambooHR.",+ "docs_url": "https://documentation.bamboohr.com/reference/metadata-get-details-for-list-fields",+ "columns": {+ "fieldId": "ID of the field this list of options applies to.",+ "name": "Name of the list field.",+ "alias": "API alias used to reference the field.",+ "options": "The available option values for the list field.",+ },+ },+ "meta_users": {+ "description": "A user account with access to the company's BambooHR.",+ "docs_url": "https://documentation.bamboohr.com/reference/get-a-list-of-users",+ "columns": {+ "id": "Unique identifier for the user.",+ "employeeId": "ID of the employee the user is linked to, if any.",+ "firstName": "The user's first name.",+ "lastName": "The user's last name.",+ "email": "The user's email address.",+ "status": "Status of the user account (enabled or disabled).",+ "lastLogin": "Time at which the user last logged in.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/bamboohr/source.py b/posthog/temporal/data_imports/sources/bamboohr/source.pyindex 81ccdd561be4..24397a774995 100644--- a/posthog/temporal/data_imports/sources/bamboohr/source.py+++ b/posthog/temporal/data_imports/sources/bamboohr/source.py@@ -17,6 +17,7 @@ from posthog.temporal.data_imports.sources.bamboohr.bamboohr import ()from posthog.temporal.data_imports.sources.bamboohr.settings import ENDPOINTS, INCREMENTAL_FIELDSfrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -68,6 +69,11 @@ Make sure your API key has access to the data you want to sync (employee, time o),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.bamboohr.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: BambooHRSourceConfig,diff --git a/posthog/temporal/data_imports/sources/bing_ads/canonical_descriptions.py b/posthog/temporal/data_imports/sources/bing_ads/canonical_descriptions.pynew file mode 100644index 000000000000..2b1559ac5026--- /dev/null+++ b/posthog/temporal/data_imports/sources/bing_ads/canonical_descriptions.py@@ -0,0 +1,95 @@+"""Canonical, documentation-sourced descriptions for Bing Ads (Microsoft Advertising) endpoints and columns.++Sourced from the official Microsoft Advertising API reference+(https://learn.microsoft.com/en-us/advertising/guides/). Keyed by the resource names in `schemas.py`+`RESOURCE_SCHEMAS`, which match the `ExternalDataSchema.name` of a synced Bing Ads table. Columns+absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Performance-report metrics shared by the campaign/ad-group/ad reports.+_REPORT_METRICS = {+ "AccountName": "Name of the Microsoft Advertising account.",+ "CampaignId": "Identifier of the campaign the row belongs to.",+ "CampaignName": "Name of the campaign the row belongs to.",+ "TimePeriod": "Date the aggregated metrics apply to.",+ "CurrencyCode": "Three-letter ISO currency code for the monetary metrics.",+ "Impressions": "Number of times the ad was shown.",+ "Clicks": "Number of clicks the ad received.",+ "Ctr": "Click-through rate — clicks divided by impressions.",+ "Spend": "Total amount spent over the period.",+ "AverageCpc": "Average cost per click.",+ "AverageCpm": "Average cost per thousand impressions.",+ "Conversions": "Number of conversions attributed over the period.",+ "ConversionRate": "Conversions divided by clicks.",+ "CostPerConversion": "Average cost per conversion.",+ "Revenue": "Revenue attributed to the ads over the period.",+ "ReturnOnAdSpend": "Return on ad spend — revenue divided by spend.",+ "Assists": "Number of conversions the ad assisted but did not directly drive.",+}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "campaigns": {+ "description": "A Microsoft Advertising campaign — a container for ad groups, budget, and targeting settings.",+ "docs_url": "https://learn.microsoft.com/en-us/advertising/campaign-management-service/campaign",+ "columns": {+ "Id": "Unique identifier of the campaign.",+ "Name": "Name of the campaign.",+ "Status": "Campaign status (e.g. Active, Paused, BudgetPaused).",+ "CampaignType": "Type of campaign (e.g. Search, Shopping, DynamicSearchAds, Audience).",+ "BudgetType": "How the budget is applied (e.g. DailyBudgetStandard, DailyBudgetAccelerated).",+ "DailyBudget": "Daily spending limit for the campaign.",+ "TimeZone": "Time zone the campaign's schedule and reporting use.",+ "Languages": "Languages the campaign targets.",+ "AudienceAdsBidAdjustment": "Percentage bid adjustment applied to audience ads.",+ },+ },+ "campaign_performance_report": {+ "description": "Daily performance metrics for campaigns — impressions, clicks, spend, and conversions.",+ "docs_url": "https://learn.microsoft.com/en-us/advertising/reporting-service/campaignperformancereportrequest",+ "columns": {+ **_REPORT_METRICS,+ "AbsoluteTopImpressionSharePercent": "Percentage of impressions shown in the very top position.",+ "TopImpressionSharePercent": "Percentage of impressions shown in a top position above search results.",+ "ImpressionSharePercent": "Share of impressions received out of those the ad was eligible for.",+ "ImpressionLostToBudgetPercent": "Share of impressions lost because of insufficient budget.",+ "ImpressionLostToRankAggPercent": "Share of impressions lost because of ad rank.",+ "QualityScore": "Microsoft's measure of how competitive the campaign's ads are.",+ "ExpectedCtr": "Expected click-through rate component of quality score.",+ "AdRelevance": "Ad relevance component of quality score.",+ "LandingPageExperience": "Landing page experience component of quality score.",+ },+ },+ "ad_group_performance_report": {+ "description": "Daily performance metrics broken down by ad group.",+ "docs_url": "https://learn.microsoft.com/en-us/advertising/reporting-service/adgroupperformancereportrequest",+ "columns": {+ **_REPORT_METRICS,+ "AdGroupId": "Identifier of the ad group the row belongs to.",+ "AdGroupName": "Name of the ad group the row belongs to.",+ "AbsoluteTopImpressionSharePercent": "Percentage of impressions shown in the very top position.",+ "TopImpressionSharePercent": "Percentage of impressions shown in a top position above search results.",+ "ImpressionSharePercent": "Share of impressions received out of those the ad group was eligible for.",+ "ImpressionLostToBudgetPercent": "Share of impressions lost because of insufficient budget.",+ "ImpressionLostToRankAggPercent": "Share of impressions lost because of ad rank.",+ "QualityScore": "Microsoft's measure of how competitive the ad group's ads are.",+ "ExpectedCtr": "Expected click-through rate component of quality score.",+ "AdRelevance": "Ad relevance component of quality score.",+ "LandingPageExperience": "Landing page experience component of quality score.",+ },+ },+ "ad_performance_report": {+ "description": "Daily performance metrics broken down by individual ad.",+ "docs_url": "https://learn.microsoft.com/en-us/advertising/reporting-service/adperformancereportrequest",+ "columns": {+ **_REPORT_METRICS,+ "AdGroupId": "Identifier of the ad group the ad belongs to.",+ "AdGroupName": "Name of the ad group the ad belongs to.",+ "AdId": "Identifier of the ad the row belongs to.",+ "AdTitle": "Title text of the ad.",+ "AdType": "Type of the ad (e.g. TextAd, ResponsiveSearchAd, ProductAd).",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/bing_ads/source.py b/posthog/temporal/data_imports/sources/bing_ads/source.pyindex 24dcfb294a8a..5a232a3887fc 100644--- a/posthog/temporal/data_imports/sources/bing_ads/source.py+++ b/posthog/temporal/data_imports/sources/bing_ads/source.py@@ -17,6 +17,7 @@ from posthog.temporal.data_imports.sources.common.base import (FieldType,ResumableSource,)+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.mixins import OAuthMixinfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManager@@ -35,6 +36,11 @@ class BingAdsSource(ResumableSource[BingAdsSourceConfig, BingAdsResumeConfig], Odef source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.BINGADS+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.bing_ads.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:# Match only on auth/permission failures that retrying cannot recover from.# Transient SDK errors (network, Bing outage, rate limits) propagate as theirdiff --git a/posthog/temporal/data_imports/sources/braintree/canonical_descriptions.py b/posthog/temporal/data_imports/sources/braintree/canonical_descriptions.pynew file mode 100644index 000000000000..3734a3c46e2a--- /dev/null+++ b/posthog/temporal/data_imports/sources/braintree/canonical_descriptions.py@@ -0,0 +1,52 @@+"""Canonical, documentation-sourced descriptions for Braintree endpoints and columns.++Sourced from the official Braintree GraphQL API reference (https://graphql.braintreepayments.com/).+Keyed by the endpoint names in `settings.py` `BRAINTREE_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Braintree table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "transactions": {+ "description": "A single attempt to move money — a sale or credit processed through Braintree.",+ "docs_url": "https://graphql.braintreepayments.com/reference/#object--Transaction",+ "columns": {+ "id": "Globally unique GraphQL identifier of the transaction.",+ "legacyId": "Legacy numeric/string transaction id from the classic Braintree API.",+ "createdAt": "Time at which the transaction was created.",+ "status": "Current status of the transaction (e.g. SETTLED, AUTHORIZED, SUBMITTED_FOR_SETTLEMENT, VOIDED).",+ "amount": "Monetary amount of the transaction, with value and currency code.",+ "orderId": "Merchant-supplied order identifier associated with the transaction.",+ "merchantAccountId": "Identifier of the merchant account the transaction was processed under.",+ "paymentMethodSnapshot": "Snapshot of the payment method used at the time of the transaction.",+ },+ },+ "refunds": {+ "description": "A refund returning funds from a settled transaction back to the customer.",+ "docs_url": "https://graphql.braintreepayments.com/reference/#object--Refund",+ "columns": {+ "id": "Globally unique GraphQL identifier of the refund.",+ "legacyId": "Legacy numeric/string refund id from the classic Braintree API.",+ "createdAt": "Time at which the refund was created.",+ "status": "Current status of the refund.",+ "amount": "Monetary amount refunded, with value and currency code.",+ "refundedTransaction": "The original transaction that was refunded.",+ "orderId": "Merchant-supplied order identifier associated with the refund.",+ },+ },+ "disputes": {+ "description": "A customer's challenge of a transaction with their bank (a chargeback) and its status.",+ "docs_url": "https://graphql.braintreepayments.com/reference/#object--Dispute",+ "columns": {+ "id": "Globally unique GraphQL identifier of the dispute.",+ "legacyId": "Legacy numeric/string dispute id from the classic Braintree API.",+ "createdAt": "Time at which the dispute was created in Braintree.",+ "receivedDate": "Date the dispute was received from the processor.",+ "status": "Current status of the dispute (e.g. OPEN, WON, LOST, ACCEPTED).",+ "type": "Type of dispute (e.g. CHARGEBACK, PRE_ARBITRATION, RETRIEVAL).",+ "caseNumber": "Case number assigned to the dispute by the processor.",+ "amountDisputed": "Monetary amount being disputed, with value and currency code.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/braintree/source.py b/posthog/temporal/data_imports/sources/braintree/source.pyindex 9e68db9ed46b..a315f83ed0c8 100644--- a/posthog/temporal/data_imports/sources/braintree/source.py+++ b/posthog/temporal/data_imports/sources/braintree/source.py@@ -19,6 +19,7 @@ from posthog.temporal.data_imports.sources.braintree.braintree import ()from posthog.temporal.data_imports.sources.braintree.settings import ENDPOINTS, INCREMENTAL_FIELDSfrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -33,6 +34,11 @@ class BraintreeSource(ResumableSource[BraintreeSourceConfig, BraintreeResumeConfdef source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.BRAINTREE+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.braintree.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized for url: https://payments.braintree-api.com": "Braintree authentication failed. Please check your public and private keys.",diff --git a/posthog/temporal/data_imports/sources/braze/canonical_descriptions.py b/posthog/temporal/data_imports/sources/braze/canonical_descriptions.pynew file mode 100644index 000000000000..cadb83fe7bee--- /dev/null+++ b/posthog/temporal/data_imports/sources/braze/canonical_descriptions.py@@ -0,0 +1,72 @@+"""Canonical, documentation-sourced descriptions for Braze endpoints and columns.++Sourced from the official Braze REST API reference (https://www.braze.com/docs/api/endpoints/).+Keyed by the endpoint names in `settings.py` `BRAZE_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Braze table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "campaigns": {+ "description": "A Braze messaging campaign that sends content to users across one or more channels.",+ "docs_url": "https://www.braze.com/docs/api/endpoints/export/campaigns/get_campaigns/",+ "columns": {+ "id": "Unique identifier of the campaign.",+ "name": "Name of the campaign.",+ "is_api_campaign": "Whether the campaign is sent via the API.",+ "tags": "Tags associated with the campaign.",+ "last_edited": "Time at which the campaign was last edited.",+ },+ },+ "canvases": {+ "description": "A Braze Canvas — a multi-step customer journey across channels and time.",+ "docs_url": "https://www.braze.com/docs/api/endpoints/export/canvas/get_canvases/",+ "columns": {+ "id": "Unique identifier of the Canvas.",+ "name": "Name of the Canvas.",+ "tags": "Tags associated with the Canvas.",+ "last_edited": "Time at which the Canvas was last edited.",+ },+ },+ "segments": {+ "description": "A Braze segment — a saved group of users defined by filter criteria.",+ "docs_url": "https://www.braze.com/docs/api/endpoints/export/segments/get_segment/",+ "columns": {+ "id": "Unique identifier of the segment.",+ "name": "Name of the segment.",+ "analytics_tracking_enabled": "Whether analytics tracking is enabled for the segment.",+ "tags": "Tags associated with the segment.",+ },+ },+ "events": {+ "description": "The list of custom event names recorded in the Braze workspace.",+ "docs_url": "https://www.braze.com/docs/api/endpoints/export/custom_events/get_custom_events/",+ "columns": {+ "event_name": "Name of the custom event.",+ },+ },+ "email_templates": {+ "description": "A reusable email template stored in Braze.",+ "docs_url": "https://www.braze.com/docs/api/endpoints/templates/email_templates/get_list_email_templates/",+ "columns": {+ "email_template_id": "Unique identifier of the email template.",+ "template_name": "Name of the email template.",+ "created_at": "Time at which the template was created.",+ "updated_at": "Time at which the template was last updated.",+ "tags": "Tags associated with the template.",+ },+ },+ "content_blocks": {+ "description": "A reusable Content Block — a snippet of content shared across Braze messages.",+ "docs_url": "https://www.braze.com/docs/api/endpoints/templates/content_blocks_templates/get_list_email_content_blocks/",+ "columns": {+ "content_block_id": "Unique identifier of the Content Block.",+ "name": "Name of the Content Block.",+ "content_type": "Type of the Content Block content (e.g. html, text).",+ "tags": "Tags associated with the Content Block.",+ "created_at": "Time at which the Content Block was created.",+ "last_edited": "Time at which the Content Block was last edited.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/braze/source.py b/posthog/temporal/data_imports/sources/braze/source.pyindex 25f714700210..a3619c5f0d46 100644--- a/posthog/temporal/data_imports/sources/braze/source.py+++ b/posthog/temporal/data_imports/sources/braze/source.py@@ -18,6 +18,7 @@ from posthog.temporal.data_imports.sources.braze.braze import ()from posthog.temporal.data_imports.sources.braze.settings import BRAZE_ENDPOINTS, ENDPOINTS, INCREMENTAL_FIELDSfrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -32,6 +33,11 @@ class BrazeSource(ResumableSource[BrazeSourceConfig, BrazeResumeConfig]):def source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.BRAZE+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.braze.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+@propertydef get_source_config(self) -> SourceConfig:return SourceConfig(diff --git a/posthog/temporal/data_imports/sources/brevo/canonical_descriptions.py b/posthog/temporal/data_imports/sources/brevo/canonical_descriptions.pynew file mode 100644index 000000000000..f4eac7785f33--- /dev/null+++ b/posthog/temporal/data_imports/sources/brevo/canonical_descriptions.py@@ -0,0 +1,113 @@+"""Canonical, documentation-sourced descriptions for Brevo endpoints and columns.++Sourced from the official Brevo (v3) API reference (https://developers.brevo.com/reference).+Keyed by the endpoint names in `settings.py` `BREVO_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Brevo table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "contacts": {+ "description": "A contact in Brevo — a recipient with attributes, list memberships, and subscription status.",+ "docs_url": "https://developers.brevo.com/reference/getcontacts-1",+ "columns": {+ "id": "Unique identifier of the contact.",+ "email": "Email address of the contact.",+ "emailBlacklisted": "Whether the contact is blacklisted from email campaigns.",+ "smsBlacklisted": "Whether the contact is blacklisted from SMS campaigns.",+ "createdAt": "Time at which the contact was created.",+ "modifiedAt": "Time at which the contact was last modified.",+ "listIds": "Identifiers of the lists the contact belongs to.",+ "attributes": "Custom attributes set on the contact.",+ },+ },+ "contact_lists": {+ "description": "A contact list used to group contacts for Brevo campaigns.",+ "docs_url": "https://developers.brevo.com/reference/getlists-1",+ "columns": {+ "id": "Unique identifier of the list.",+ "name": "Name of the list.",+ "totalSubscribers": "Number of subscribed contacts in the list.",+ "totalBlacklisted": "Number of blacklisted contacts in the list.",+ "folderId": "Identifier of the folder the list belongs to.",+ "uniqueSubscribers": "Number of unique subscribers in the list.",+ },+ },+ "contact_folders": {+ "description": "A folder used to organize Brevo contact lists.",+ "docs_url": "https://developers.brevo.com/reference/getfolders-1",+ "columns": {+ "id": "Unique identifier of the folder.",+ "name": "Name of the folder.",+ "totalSubscribers": "Total number of subscribers across the folder's lists.",+ "uniqueSubscribers": "Number of unique subscribers across the folder's lists.",+ "totalBlacklisted": "Total number of blacklisted contacts across the folder's lists.",+ },+ },+ "contact_segments": {+ "description": "A saved segment of contacts defined by filter criteria in Brevo.",+ "docs_url": "https://developers.brevo.com/reference/getsegments",+ "columns": {+ "id": "Unique identifier of the segment.",+ "segmentName": "Name of the segment.",+ "categoryId": "Identifier of the category the segment belongs to.",+ },+ },+ "email_campaigns": {+ "description": "An email marketing campaign created in Brevo.",+ "docs_url": "https://developers.brevo.com/reference/getemailcampaigns-1",+ "columns": {+ "id": "Unique identifier of the email campaign.",+ "name": "Internal name of the campaign.",+ "subject": "Subject line of the campaign email.",+ "type": "Type of campaign (e.g. classic, trigger).",+ "status": "Status of the campaign (e.g. draft, sent, queued, suspended).",+ "createdAt": "Time at which the campaign was created.",+ "modifiedAt": "Time at which the campaign was last modified.",+ "scheduledAt": "Time at which the campaign is scheduled to send.",+ "sentDate": "Time at which the campaign was sent.",+ "statistics": "Aggregate send and engagement statistics for the campaign.",+ },+ },+ "sms_campaigns": {+ "description": "An SMS marketing campaign created in Brevo.",+ "docs_url": "https://developers.brevo.com/reference/getsmscampaigns-1",+ "columns": {+ "id": "Unique identifier of the SMS campaign.",+ "name": "Internal name of the campaign.",+ "status": "Status of the campaign (e.g. draft, sent, queued, suspended).",+ "content": "Text content of the SMS message.",+ "sender": "Sender name displayed for the SMS.",+ "createdAt": "Time at which the campaign was created.",+ "modifiedAt": "Time at which the campaign was last modified.",+ "scheduledAt": "Time at which the campaign is scheduled to send.",+ "sentDate": "Time at which the campaign was sent.",+ "statistics": "Aggregate send and engagement statistics for the campaign.",+ },+ },+ "email_templates": {+ "description": "A reusable transactional email template stored in Brevo.",+ "docs_url": "https://developers.brevo.com/reference/getsmtptemplates",+ "columns": {+ "id": "Unique identifier of the template.",+ "name": "Name of the template.",+ "subject": "Default subject line of the template email.",+ "isActive": "Whether the template is active.",+ "sender": "Default sender configured for the template.",+ "tag": "Tag associated with the template.",+ "createdAt": "Time at which the template was created.",+ "modifiedAt": "Time at which the template was last modified.",+ },+ },+ "senders": {+ "description": "A verified sender (name and email) available for Brevo campaigns.",+ "docs_url": "https://developers.brevo.com/reference/getsenders-1",+ "columns": {+ "id": "Unique identifier of the sender.",+ "name": "Display name of the sender.",+ "email": "Email address of the sender.",+ "active": "Whether the sender is active and verified.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/brevo/source.py b/posthog/temporal/data_imports/sources/brevo/source.pyindex a26245ea4478..086ecadac199 100644--- a/posthog/temporal/data_imports/sources/brevo/source.py+++ b/posthog/temporal/data_imports/sources/brevo/source.py@@ -17,6 +17,7 @@ from posthog.temporal.data_imports.sources.brevo.brevo import ()from posthog.temporal.data_imports.sources.brevo.settings import ENDPOINTS, INCREMENTAL_FIELDSfrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -31,6 +32,11 @@ class BrevoSource(ResumableSource[BrevoSourceConfig, BrevoResumeConfig]):def source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.BREVO+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.brevo.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized for url": "Brevo authentication failed. Your API key is invalid or expired - please generate a new key and reconnect.",diff --git a/posthog/temporal/data_imports/sources/brex/canonical_descriptions.py b/posthog/temporal/data_imports/sources/brex/canonical_descriptions.pynew file mode 100644index 000000000000..3da51b2aa834--- /dev/null+++ b/posthog/temporal/data_imports/sources/brex/canonical_descriptions.py@@ -0,0 +1,112 @@+"""Canonical, documentation-sourced descriptions for Brex endpoints and columns.++Sourced from the official Brex API reference (https://developer.brex.com/openapi/).+Keyed by the endpoint names in `settings.py` `BREX_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Brex table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "card_transactions": {+ "description": "A transaction on a Brex card — a purchase, refund, or other movement on the primary card account.",+ "docs_url": "https://developer.brex.com/openapi/transactions_api/#tag/Transactions/operation/listPrimaryCardTransactions",+ "columns": {+ "id": "Unique identifier of the transaction.",+ "description": "Description of the transaction (typically the merchant name).",+ "amount": "Monetary amount of the transaction, with amount and currency.",+ "type": "Type of the transaction (e.g. PURCHASE, REFUND, CHARGEBACK).",+ "initiated_at_date": "Date the transaction was initiated.",+ "posted_at_date": "Date the transaction posted to the account.",+ "card_id": "Identifier of the card used for the transaction.",+ "merchant": "Merchant details for the transaction.",+ },+ },+ "cash_transactions": {+ "description": "A transaction on a Brex cash account — a deposit, withdrawal, or transfer.",+ "docs_url": "https://developer.brex.com/openapi/transactions_api/#tag/Transactions/operation/listCashTransactions",+ "columns": {+ "id": "Unique identifier of the transaction.",+ "account_id": "Identifier of the cash account the transaction belongs to.",+ "description": "Description of the transaction.",+ "amount": "Monetary amount of the transaction, with amount and currency.",+ "type": "Type of the transaction (e.g. BOOK_TRANSFER, ACH_TRANSFER, WIRE_TRANSFER).",+ "initiated_at_date": "Date the transaction was initiated.",+ "posted_at_date": "Date the transaction posted to the account.",+ },+ },+ "expenses": {+ "description": "An expense in Brex — a recorded spend item with receipts, status, and accounting details.",+ "docs_url": "https://developer.brex.com/openapi/expenses_api/#tag/Expenses/operation/listExpenses",+ "columns": {+ "id": "Unique identifier of the expense.",+ "memo": "Memo or description attached to the expense.",+ "status": "Current status of the expense (e.g. DRAFT, SUBMITTED, APPROVED, SETTLED).",+ "category": "Spend category assigned to the expense.",+ "merchant_id": "Identifier of the merchant for the expense.",+ "amount": "Monetary amount of the expense, with amount and currency.",+ "purchased_at": "Time at which the purchase occurred.",+ "submitted_at": "Time at which the expense was submitted.",+ "updated_at": "Time at which the expense was last updated.",+ "user_id": "Identifier of the user who incurred the expense.",+ "budget_id": "Identifier of the budget the expense is associated with.",+ },+ },+ "users": {+ "description": "A user (employee) in the Brex account.",+ "docs_url": "https://developer.brex.com/openapi/team_api/#tag/Users/operation/listUsers",+ "columns": {+ "id": "Unique identifier of the user.",+ "first_name": "First name of the user.",+ "last_name": "Last name of the user.",+ "email": "Email address of the user.",+ "status": "Account status of the user (e.g. ACTIVE, INVITED, DISABLED).",+ "manager_id": "Identifier of the user's manager.",+ "department_id": "Identifier of the department the user belongs to.",+ "location_id": "Identifier of the location the user belongs to.",+ },+ },+ "departments": {+ "description": "A department defined in the Brex account for organizing users and budgets.",+ "docs_url": "https://developer.brex.com/openapi/team_api/#tag/Departments/operation/listDepartments",+ "columns": {+ "id": "Unique identifier of the department.",+ "name": "Name of the department.",+ "description": "Description of the department.",+ },+ },+ "locations": {+ "description": "A physical location defined in the Brex account for organizing users and budgets.",+ "docs_url": "https://developer.brex.com/openapi/team_api/#tag/Locations/operation/listLocations",+ "columns": {+ "id": "Unique identifier of the location.",+ "name": "Name of the location.",+ "description": "Description of the location.",+ },+ },+ "vendors": {+ "description": "A vendor (payee) configured in Brex for bill payments.",+ "docs_url": "https://developer.brex.com/openapi/payments_api/#tag/Vendors/operation/listVendors",+ "columns": {+ "id": "Unique identifier of the vendor.",+ "name": "Name of the vendor.",+ "email": "Email address of the vendor.",+ "phone": "Phone number of the vendor.",+ "payment_accounts": "Payment account details configured for the vendor.",+ },+ },+ "budgets": {+ "description": "A budget in Brex that controls and tracks spend for a group or purpose.",+ "docs_url": "https://developer.brex.com/openapi/budgets_api/#tag/Budgets/operation/listBudgets",+ "columns": {+ "budget_id": "Unique identifier of the budget.",+ "name": "Name of the budget.",+ "description": "Description of the budget.",+ "parent_budget_id": "Identifier of the parent budget, if nested.",+ "budget_status": "Status of the budget (e.g. ACTIVE, EXPIRED).",+ "limit": "Spend limit configured for the budget, with amount and currency.",+ "spend_budget_status": "Spend status of the budget relative to its limit.",+ "period_type": "Recurrence period of the budget (e.g. MONTHLY, QUARTERLY, YEARLY, ONE_TIME).",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/brex/source.py b/posthog/temporal/data_imports/sources/brex/source.pyindex 286a10b1d1fe..76a36fca6a61 100644--- a/posthog/temporal/data_imports/sources/brex/source.py+++ b/posthog/temporal/data_imports/sources/brex/source.py@@ -17,6 +17,7 @@ from posthog.temporal.data_imports.sources.brex.brex import ()from posthog.temporal.data_imports.sources.brex.settings import ENDPOINTS, INCREMENTAL_FIELDSfrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -31,6 +32,11 @@ class BrexSource(ResumableSource[BrexSourceConfig, BrexResumeConfig]):def source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.BREX+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.brex.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized for url: https://api.brex.com": "Brex authentication failed. Your API user token is invalid or has expired — Brex tokens expire after 90 days without API activity. Please generate a new token in your Brex dashboard and reconnect.",diff --git a/posthog/temporal/data_imports/sources/buildbetter/canonical_descriptions.py b/posthog/temporal/data_imports/sources/buildbetter/canonical_descriptions.pynew file mode 100644index 000000000000..556054e2ed02--- /dev/null+++ b/posthog/temporal/data_imports/sources/buildbetter/canonical_descriptions.py@@ -0,0 +1,96 @@+"""Canonical, documentation-sourced descriptions for BuildBetter endpoints and columns.++Sourced from the BuildBetter GraphQL API (https://api.buildbetter.app/v1/graphql) and the fields+selected in `queries.py`. Keyed by the endpoint names in `settings.py` `BUILDBETTER_ENDPOINTS`,+which match the `ExternalDataSchema.name` of a synced BuildBetter table. Columns absent here fall+back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "interviews": {+ "description": "A recorded interview or call in BuildBetter, with transcript, summaries, and attendees.",+ "docs_url": "https://docs.buildbetter.app/",+ "columns": {+ "id": "Unique identifier of the interview.",+ "external_id": "Identifier of the interview in the source system it was imported from.",+ "name": "Name or title of the interview.",+ "original_name": "Original name of the interview before any renaming.",+ "short_summary": "Short AI-generated summary of the interview.",+ "summary": "Full AI-generated summary of the interview.",+ "transcript_summary": "Summary derived from the interview transcript.",+ "source": "Source the interview originated from (e.g. Zoom, Google Meet).",+ "interaction": "Type of interaction the interview represents.",+ "permission": "Access permission level for the interview.",+ "asset_url": "URL of the recorded audio or video asset.",+ "asset_duration_seconds": "Duration of the recording in seconds.",+ "asset_is_audio": "Whether the asset is audio-only.",+ "meeting_url": "URL of the meeting the interview was recorded from.",+ "started_at": "Time at which the interview started.",+ "completed_at": "Time at which the interview completed.",+ "recorded_at": "Time at which the interview was recorded.",+ "created_at": "Time at which the interview record was created.",+ "updated_at": "Time at which the interview record was last updated.",+ "deleted_at": "Time at which the interview was deleted, if applicable.",+ "transcript_status": "Processing status of the transcript.",+ "summary_state": "Processing state of the AI summaries.",+ "attendees": "People who attended the interview.",+ "tags": "Tags applied to the interview.",+ },+ },+ "extractions": {+ "description": "An AI-extracted insight from an interview — a quote with sentiment, topics, and context.",+ "docs_url": "https://docs.buildbetter.app/",+ "columns": {+ "id": "Unique identifier of the extraction.",+ "interview_id": "Identifier of the interview the extraction came from.",+ "summary": "Summary of the extracted insight.",+ "context": "Surrounding context for the extracted insight.",+ "sentiment": "Sentiment detected for the extraction.",+ "severity": "Severity assigned to the extraction.",+ "bias": "Bias detected for the extraction.",+ "start_sec": "Start time of the extraction within the recording, in seconds.",+ "end_sec": "End time of the extraction within the recording, in seconds.",+ "created_at": "Time at which the extraction was created.",+ "speaker": "Speaker associated with the extraction.",+ "exact_quote": "The exact quote the extraction is based on.",+ "types": "Insight types assigned to the extraction.",+ "topics": "Topics associated with the extraction.",+ "keywords": "Keywords associated with the extraction.",+ },+ },+ "persons": {+ "description": "A person tracked in BuildBetter — an interview participant or customer contact.",+ "docs_url": "https://docs.buildbetter.app/",+ "columns": {+ "id": "Unique identifier of the person.",+ "external_id": "Identifier of the person in the source system they were imported from.",+ "first_name": "First name of the person.",+ "last_name": "Last name of the person.",+ "email": "Email address of the person.",+ "title": "Job title of the person.",+ "department": "Department the person belongs to.",+ "source": "Source the person originated from.",+ "source_identifier": "Identifier of the person in the originating source.",+ "company_id": "Identifier of the company the person belongs to.",+ "company": "Company the person belongs to.",+ "persona_id": "Identifier of the persona assigned to the person.",+ "persona": "Persona assigned to the person.",+ "created_at": "Time at which the person record was created.",+ "updated_at": "Time at which the person record was last updated.",+ },+ },+ "companies": {+ "description": "A company tracked in BuildBetter, grouping the people associated with it.",+ "docs_url": "https://docs.buildbetter.app/",+ "columns": {+ "id": "Unique identifier of the company.",+ "name": "Name of the company.",+ "domain": "Primary web domain of the company.",+ "photo_url": "URL of the company's logo or photo.",+ "created_at": "Time at which the company record was created.",+ "updated_at": "Time at which the company record was last updated.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/buildbetter/source.py b/posthog/temporal/data_imports/sources/buildbetter/source.pyindex 076abcec2019..bfc5f1572e05 100644--- a/posthog/temporal/data_imports/sources/buildbetter/source.py+++ b/posthog/temporal/data_imports/sources/buildbetter/source.py@@ -17,6 +17,7 @@ from posthog.temporal.data_imports.sources.buildbetter.buildbetter import ()from posthog.temporal.data_imports.sources.buildbetter.settings import ENDPOINTS, INCREMENTAL_FIELDSfrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -31,6 +32,11 @@ class BuildBetterSource(ResumableSource[BuildBetterSourceConfig, BuildBetterResudef source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.BUILDBETTER+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.buildbetter.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error": "BuildBetter authentication failed. Please check your API key.",diff --git a/posthog/temporal/data_imports/sources/calendly/canonical_descriptions.py b/posthog/temporal/data_imports/sources/calendly/canonical_descriptions.pynew file mode 100644index 000000000000..6a3861f6766b--- /dev/null+++ b/posthog/temporal/data_imports/sources/calendly/canonical_descriptions.py@@ -0,0 +1,86 @@+"""Canonical, documentation-sourced descriptions for Calendly endpoints and columns.++Sourced from the official Calendly v2 API reference (https://developer.calendly.com/api-docs).+Keyed by the endpoint names in `settings.py` `CALENDLY_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Calendly table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by most Calendly resources; merged into each entry so we don't repeat them.+_COMMON_COLUMNS = {+ "uri": "Canonical resource reference (URI) that uniquely identifies the object.",+ "created_at": "Time at which the object was created.",+ "updated_at": "Time at which the object was last updated.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "event_types": {+ "description": "A Calendly event type — a configurable meeting that invitees can book.",+ "docs_url": "https://developer.calendly.com/api-docs/b3A6NTgxMjI2-list-user-s-event-types",+ "columns": _columns(+ name="Human-readable name of the event type.",+ active="Whether the event type is currently active and bookable.",+ slug="URL-friendly slug used in the event type's scheduling link.",+ scheduling_url="Public scheduling page URL for this event type.",+ duration="Length of the meeting in minutes.",+ kind="Whether the event type is solo or group.",+ type="Whether the event type is a StandardEventType or AdhocEventType.",+ color="Hex color used for the event type in the Calendly UI.",+ description_plain="Plain-text description of the event type.",+ description_html="HTML description of the event type.",+ pooling_type="How invitees are assigned when the event type has multiple hosts.",+ secret="Whether the event type is hidden from the user's main scheduling page.",+ profile="Profile (user or team) that owns the event type.",+ ),+ },+ "scheduled_events": {+ "description": "A booked meeting (scheduled event) on a user's Calendly calendar.",+ "docs_url": "https://developer.calendly.com/api-docs/513b50a23c4dd-list-events",+ "columns": _columns(+ name="Name of the scheduled event.",+ status="Status of the event: active or canceled.",+ start_time="Scheduled start time of the meeting.",+ end_time="Scheduled end time of the meeting.",+ event_type="URI of the event type this meeting was booked from.",+ location="Location details for the meeting (in-person, video conference link, phone, etc.).",+ invitees_counter="Counts of total, active, and limit invitees for the event.",+ event_memberships="Hosts associated with the scheduled event.",+ cancellation="Cancellation details, present when the event has been canceled.",+ meeting_notes_plain="Plain-text meeting notes.",+ meeting_notes_html="HTML meeting notes.",+ ),+ },+ "groups": {+ "description": "A group within a Calendly organization used to organize members.",+ "docs_url": "https://developer.calendly.com/api-docs/c1957c0e1e44b-list-groups",+ "columns": _columns(+ name="Name of the group.",+ organization="URI of the organization the group belongs to.",+ ),+ },+ "organization_memberships": {+ "description": "A user's membership in a Calendly organization, with their role.",+ "docs_url": "https://developer.calendly.com/api-docs/aff7c447b6a05-list-organization-memberships",+ "columns": _columns(+ role="The member's role in the organization (owner, admin, or user).",+ user="The user account associated with this membership.",+ organization="URI of the organization the user is a member of.",+ ),+ },+ "routing_forms": {+ "description": "A Calendly routing form that qualifies and routes invitees to the right booking.",+ "docs_url": "https://developer.calendly.com/api-docs/c4d4f3a8aa8e4-list-routing-forms",+ "columns": _columns(+ name="Name of the routing form.",+ status="Status of the routing form: published or draft.",+ organization="URI of the organization the routing form belongs to.",+ questions="The questions configured on the routing form.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/calendly/source.py b/posthog/temporal/data_imports/sources/calendly/source.pyindex cb668c751ffe..ed83ebd28cba 100644--- a/posthog/temporal/data_imports/sources/calendly/source.py+++ b/posthog/temporal/data_imports/sources/calendly/source.py@@ -17,6 +17,7 @@ from posthog.temporal.data_imports.sources.calendly.calendly import ()from posthog.temporal.data_imports.sources.calendly.settings import ENDPOINTS, INCREMENTAL_FIELDSfrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -58,6 +59,11 @@ You can create a personal access token in Calendly under **Integrations → API),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.calendly.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: CalendlySourceConfig,diff --git a/posthog/temporal/data_imports/sources/campaign_monitor/canonical_descriptions.py b/posthog/temporal/data_imports/sources/campaign_monitor/canonical_descriptions.pynew file mode 100644index 000000000000..28e7085a441b--- /dev/null+++ b/posthog/temporal/data_imports/sources/campaign_monitor/canonical_descriptions.py@@ -0,0 +1,140 @@+"""Canonical, documentation-sourced descriptions for Campaign Monitor endpoints and columns.++Sourced from the official Campaign Monitor (CreateSend) API v3.3 reference+(https://www.campaignmonitor.com/api/). Keyed by the endpoint names in `settings.py`+`CAMPAIGN_MONITOR_ENDPOINTS`, which match the `ExternalDataSchema.name` of a synced Campaign+Monitor table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "clients": {+ "description": "A Campaign Monitor client — an account that owns lists, campaigns, and subscribers.",+ "docs_url": "https://www.campaignmonitor.com/api/v3-3/account/#getting-your-clients",+ "columns": {+ "ClientID": "Unique identifier for the client.",+ "Name": "Name of the client.",+ },+ },+ "campaigns": {+ "description": "A sent email campaign belonging to the client.",+ "docs_url": "https://www.campaignmonitor.com/api/v3-3/clients/#sent-campaigns",+ "columns": {+ "CampaignID": "Unique identifier for the campaign.",+ "Name": "Internal name of the campaign.",+ "Subject": "Subject line of the campaign email.",+ "FromName": "Sender name shown on the campaign.",+ "FromEmail": "Sender email address used for the campaign.",+ "ReplyTo": "Reply-to email address for the campaign.",+ "SentDate": "Date and time the campaign was sent.",+ "TotalRecipients": "Total number of recipients the campaign was sent to.",+ "WebVersionURL": "Public web (browser) version URL of the campaign.",+ "WebVersionTextURL": "Public web version URL of the plain-text campaign.",+ },+ },+ "scheduled_campaigns": {+ "description": "A campaign that is scheduled to be sent at a future date.",+ "docs_url": "https://www.campaignmonitor.com/api/v3-3/clients/#scheduled-campaigns",+ "columns": {+ "CampaignID": "Unique identifier for the campaign.",+ "Name": "Internal name of the campaign.",+ "Subject": "Subject line of the campaign email.",+ "FromName": "Sender name shown on the campaign.",+ "FromEmail": "Sender email address used for the campaign.",+ "ReplyTo": "Reply-to email address for the campaign.",+ "DateCreated": "Date and time the campaign was created.",+ "DateScheduled": "Date and time the campaign is scheduled to send.",+ "ScheduledTimeZone": "Time zone the scheduled send time is expressed in.",+ "PreviewURL": "Preview URL for the scheduled campaign.",+ },+ },+ "draft_campaigns": {+ "description": "A draft campaign that has not yet been sent or scheduled.",+ "docs_url": "https://www.campaignmonitor.com/api/v3-3/clients/#draft-campaigns",+ "columns": {+ "CampaignID": "Unique identifier for the campaign.",+ "Name": "Internal name of the draft campaign.",+ "Subject": "Subject line of the draft campaign email.",+ "FromName": "Sender name configured on the draft.",+ "FromEmail": "Sender email address configured on the draft.",+ "ReplyTo": "Reply-to email address configured on the draft.",+ "DateCreated": "Date and time the draft was created.",+ "PreviewURL": "Preview URL for the draft campaign.",+ },+ },+ "lists": {+ "description": "A subscriber list belonging to the client.",+ "docs_url": "https://www.campaignmonitor.com/api/v3-3/clients/#subscriber-lists",+ "columns": {+ "ListID": "Unique identifier for the subscriber list.",+ "Name": "Name of the subscriber list.",+ },+ },+ "segments": {+ "description": "A segment — a saved subset of a subscriber list defined by rules.",+ "docs_url": "https://www.campaignmonitor.com/api/v3-3/clients/#subscriber-segments",+ "columns": {+ "SegmentID": "Unique identifier for the segment.",+ "ListID": "Identifier of the list the segment belongs to.",+ "Title": "Title of the segment.",+ },+ },+ "templates": {+ "description": "An email template available to the client for building campaigns.",+ "docs_url": "https://www.campaignmonitor.com/api/v3-3/clients/#templates",+ "columns": {+ "TemplateID": "Unique identifier for the template.",+ "Name": "Name of the template.",+ "PreviewURL": "Preview URL for the template.",+ "ScreenshotURL": "URL of the template's thumbnail screenshot.",+ },+ },+ "suppression_list": {+ "description": "Email addresses suppressed for the client (will not receive campaigns).",+ "docs_url": "https://www.campaignmonitor.com/api/v3-3/clients/#suppression-list",+ "columns": {+ "EmailAddress": "Suppressed email address.",+ "Date": "Date the address was added to the suppression list.",+ "State": "Suppression state (e.g. Suppressed).",+ "SuppressionReason": "Reason the address was suppressed (e.g. Unsubscribed, Bounced).",+ },+ },+ "active_subscribers": {+ "description": "Subscribers currently active (subscribed) on a list.",+ "docs_url": "https://www.campaignmonitor.com/api/v3-3/lists/#active-subscribers",+ "columns": {+ "EmailAddress": "Subscriber's email address.",+ "ListID": "Identifier of the list the subscriber belongs to.",+ "Name": "Subscriber's name.",+ "Date": "Date the subscriber was added to or last changed state on the list.",+ "State": "Subscription state of the subscriber (Active).",+ "CustomFields": "Custom field values stored against the subscriber.",+ "ReadsEmailWith": "Email client the subscriber is detected to read email with.",+ },+ },+ "unsubscribed_subscribers": {+ "description": "Subscribers who have unsubscribed from a list.",+ "docs_url": "https://www.campaignmonitor.com/api/v3-3/lists/#unsubscribed-subscribers",+ "columns": {+ "EmailAddress": "Subscriber's email address.",+ "ListID": "Identifier of the list the subscriber unsubscribed from.",+ "Name": "Subscriber's name.",+ "Date": "Date the subscriber unsubscribed.",+ "State": "Subscription state of the subscriber (Unsubscribed).",+ "CustomFields": "Custom field values stored against the subscriber.",+ },+ },+ "bounced_subscribers": {+ "description": "Subscribers whose email to a list has bounced.",+ "docs_url": "https://www.campaignmonitor.com/api/v3-3/lists/#bounced-subscribers",+ "columns": {+ "EmailAddress": "Subscriber's email address.",+ "ListID": "Identifier of the list the subscriber belongs to.",+ "Name": "Subscriber's name.",+ "Date": "Date the email to the subscriber bounced.",+ "State": "Subscription state of the subscriber (Bounced).",+ "CustomFields": "Custom field values stored against the subscriber.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/campaign_monitor/source.py b/posthog/temporal/data_imports/sources/campaign_monitor/source.pyindex 066e86c14141..499f9e49e78b 100644--- a/posthog/temporal/data_imports/sources/campaign_monitor/source.py+++ b/posthog/temporal/data_imports/sources/campaign_monitor/source.py@@ -17,6 +17,7 @@ from posthog.temporal.data_imports.sources.campaign_monitor.campaign_monitor imp)from posthog.temporal.data_imports.sources.campaign_monitor.settings import ENDPOINTS, INCREMENTAL_FIELDSfrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -44,6 +45,11 @@ class CampaignMonitorSource(ResumableSource[CampaignMonitorSourceConfig, Campaig"403 Client Error: Forbidden for url": "Your Campaign Monitor API key does not have access to this client or resource. Please check the key's permissions and try again.",}+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.campaign_monitor.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: CampaignMonitorSourceConfig,diff --git a/posthog/temporal/data_imports/sources/chargebee/canonical_descriptions.py b/posthog/temporal/data_imports/sources/chargebee/canonical_descriptions.pynew file mode 100644index 000000000000..086299db6dfc--- /dev/null+++ b/posthog/temporal/data_imports/sources/chargebee/canonical_descriptions.py@@ -0,0 +1,121 @@+"""Canonical, documentation-sourced descriptions for Chargebee endpoints and columns.++Sourced from the official Chargebee API v2 reference (https://apidocs.chargebee.com/docs/api).+Keyed by the resource names in `settings.py` `ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Chargebee table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by most Chargebee objects; merged into each entry so we don't repeat them.+_COMMON_COLUMNS = {+ "id": "Unique identifier for the object.",+ "created_at": "Time at which the object was created, as a Unix timestamp.",+ "updated_at": "Time at which the object was last updated, as a Unix timestamp.",+ "object": "String describing the object's Chargebee type (e.g. 'customer', 'invoice').",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "Customers": {+ "description": "A Chargebee customer, who owns subscriptions, invoices, and payment methods.",+ "docs_url": "https://apidocs.chargebee.com/docs/api/customers",+ "columns": _columns(+ first_name="Customer's first name.",+ last_name="Customer's last name.",+ email="Customer's email address.",+ company="Company name associated with the customer.",+ phone="Customer's phone number.",+ auto_collection="Whether payments are collected automatically or off (invoice).",+ net_term_days="Number of days within which payment is due for invoices.",+ allow_direct_debit="Whether the customer can pay using direct debit.",+ taxability="Whether the customer is taxable or exempt.",+ deleted="Whether the customer record has been deleted.",+ ),+ },+ "Events": {+ "description": "An event recording a change in Chargebee (subscription created, payment failed, etc.).",+ "docs_url": "https://apidocs.chargebee.com/docs/api/events",+ "columns": _columns(+ occurred_at="Time at which the event occurred, as a Unix timestamp.",+ event_type="Type of the event (e.g. subscription_created, payment_succeeded).",+ source="Source that triggered the event (e.g. admin_console, api, scheduled_job).",+ webhook_status="Delivery status of the webhook for this event.",+ api_version="Chargebee API version associated with the event's content.",+ content="Snapshot of the resources affected by the event.",+ ),+ },+ "Invoices": {+ "description": "A statement of charges issued to a customer for subscriptions or one-off items.",+ "docs_url": "https://apidocs.chargebee.com/docs/api/invoices",+ "columns": _columns(+ customer_id="Identifier of the customer the invoice is for.",+ subscription_id="Identifier of the subscription the invoice was generated for, if any.",+ status="Status of the invoice: paid, posted, payment_due, not_paid, voided, or pending.",+ currency_code="Three-letter ISO currency code of the invoice.",+ total="Total payable amount of the invoice, in the smallest currency unit.",+ amount_paid="Amount paid against the invoice, in the smallest currency unit.",+ amount_due="Amount still due on the invoice, in the smallest currency unit.",+ amount_adjusted="Amount adjusted on the invoice, in the smallest currency unit.",+ sub_total="Total before taxes and discounts, in the smallest currency unit.",+ tax="Total tax charged on the invoice, in the smallest currency unit.",+ date="Date the invoice was generated, as a Unix timestamp.",+ due_date="Date by which the invoice payment is due, as a Unix timestamp.",+ paid_at="Time at which the invoice was fully paid, as a Unix timestamp.",+ recurring="Whether the invoice was generated from a recurring subscription.",+ ),+ },+ "Orders": {+ "description": "An order created from an invoice to fulfill physical or digital goods.",+ "docs_url": "https://apidocs.chargebee.com/docs/api/orders",+ "columns": _columns(+ invoice_id="Identifier of the invoice the order was created from.",+ subscription_id="Identifier of the subscription associated with the order, if any.",+ customer_id="Identifier of the customer the order is for.",+ status="Status of the order (e.g. new, processing, complete, cancelled, returned).",+ order_date="Date the order was placed, as a Unix timestamp.",+ shipping_date="Date the order is to be shipped, as a Unix timestamp.",+ tracking_id="Shipment tracking identifier for the order.",+ total="Total amount of the order, in the smallest currency unit.",+ currency_code="Three-letter ISO currency code of the order.",+ ),+ },+ "Subscriptions": {+ "description": "A customer's recurring billing arrangement against one or more plans.",+ "docs_url": "https://apidocs.chargebee.com/docs/api/subscriptions",+ "columns": _columns(+ customer_id="Identifier of the customer who owns the subscription.",+ status="Status of the subscription: future, in_trial, active, non_renewing, paused, or cancelled.",+ currency_code="Three-letter ISO currency code the subscription bills in.",+ current_term_start="Start of the current billing term, as a Unix timestamp.",+ current_term_end="End of the current billing term, as a Unix timestamp.",+ next_billing_at="Time of the next scheduled billing, as a Unix timestamp.",+ started_at="Time at which the subscription started, as a Unix timestamp.",+ activated_at="Time at which the subscription was activated, as a Unix timestamp.",+ trial_start="Start of the trial period, as a Unix timestamp, if any.",+ trial_end="End of the trial period, as a Unix timestamp, if any.",+ cancelled_at="Time at which the subscription was cancelled, as a Unix timestamp, if applicable.",+ mrr="Monthly recurring revenue for the subscription, in the smallest currency unit.",+ ),+ },+ "Transactions": {+ "description": "A record of money movement — a payment, refund, or credit applied to a customer.",+ "docs_url": "https://apidocs.chargebee.com/docs/api/transactions",+ "columns": _columns(+ customer_id="Identifier of the customer the transaction belongs to.",+ subscription_id="Identifier of the subscription the transaction is associated with, if any.",+ payment_method="Payment method used for the transaction (e.g. card, paypal, bank_transfer).",+ type="Type of the transaction: payment, refund, authorization, or payment_reversal.",+ status="Status of the transaction: in_progress, success, voided, failure, timeout, or needs_attention.",+ amount="Amount of the transaction, in the smallest currency unit.",+ currency_code="Three-letter ISO currency code of the transaction.",+ date="Date the transaction occurred, as a Unix timestamp.",+ gateway="Payment gateway that processed the transaction.",+ amount_unused="Unused amount remaining from the transaction, in the smallest currency unit.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/chargebee/source.py b/posthog/temporal/data_imports/sources/chargebee/source.pyindex e0169f3a04e4..a3e486277ab7 100644--- a/posthog/temporal/data_imports/sources/chargebee/source.py+++ b/posthog/temporal/data_imports/sources/chargebee/source.py@@ -17,6 +17,7 @@ from posthog.temporal.data_imports.sources.chargebee.chargebee import ()from posthog.temporal.data_imports.sources.chargebee.settings import ENDPOINTS, INCREMENTAL_FIELDSfrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -37,6 +38,11 @@ class ChargebeeSource(ResumableSource[ChargebeeSourceConfig, ChargebeeResumeConf"Unauthorized for url": "Chargebee authentication failed. Please check your API key and site name.",}+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.chargebee.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: ChargebeeSourceConfig,diff --git a/posthog/temporal/data_imports/sources/chartmogul/canonical_descriptions.py b/posthog/temporal/data_imports/sources/chartmogul/canonical_descriptions.pynew file mode 100644index 000000000000..518d735387ad--- /dev/null+++ b/posthog/temporal/data_imports/sources/chartmogul/canonical_descriptions.py@@ -0,0 +1,94 @@+"""Canonical, documentation-sourced descriptions for ChartMogul endpoints and columns.++Sourced from the official ChartMogul API reference (https://dev.chartmogul.com/reference).+Keyed by the endpoint names in `settings.py` `CHARTMOGUL_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced ChartMogul table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "customers": {+ "description": "A ChartMogul customer aggregating subscription and billing activity.",+ "docs_url": "https://dev.chartmogul.com/reference/list-customers",+ "columns": {+ "uuid": "Unique identifier for the customer in ChartMogul.",+ "external_id": "Identifier of the customer in the source billing system.",+ "data_source_uuid": "UUID of the data source the customer was imported from.",+ "name": "Customer's name.",+ "company": "Company name associated with the customer.",+ "email": "Customer's email address.",+ "status": "Lifecycle status of the customer (e.g. Active, Lead, Cancelled).",+ "customer-since": "Date the customer first became active.",+ "mrr": "Customer's current monthly recurring revenue.",+ "arr": "Customer's current annual run rate.",+ "currency": "Three-letter ISO currency code used for the customer.",+ "country": "Customer's country code.",+ "city": "Customer's city.",+ "lead_created_at": "Time at which the customer was created as a lead.",+ "free_trial_started_at": "Time at which the customer's free trial started.",+ },+ },+ "plans": {+ "description": "A billing plan that subscriptions are sold against.",+ "docs_url": "https://dev.chartmogul.com/reference/list-plans",+ "columns": {+ "uuid": "Unique identifier for the plan in ChartMogul.",+ "external_id": "Identifier of the plan in the source billing system.",+ "data_source_uuid": "UUID of the data source the plan was imported from.",+ "name": "Name of the plan.",+ "interval_count": "Number of intervals between billings.",+ "interval_unit": "Unit of the billing interval (day, month, or year).",+ },+ },+ "plan_groups": {+ "description": "A grouping of related plans for combined reporting.",+ "docs_url": "https://dev.chartmogul.com/reference/list-plan-groups",+ "columns": {+ "uuid": "Unique identifier for the plan group in ChartMogul.",+ "name": "Name of the plan group.",+ "plans_count": "Number of plans contained in the group.",+ },+ },+ "invoices": {+ "description": "An invoice imported into ChartMogul, with its line items and transactions.",+ "docs_url": "https://dev.chartmogul.com/reference/list-invoices",+ "columns": {+ "uuid": "Unique identifier for the invoice in ChartMogul.",+ "external_id": "Identifier of the invoice in the source billing system.",+ "customer_uuid": "UUID of the customer the invoice belongs to.",+ "data_source_uuid": "UUID of the data source the invoice was imported from.",+ "date": "Date the invoice was issued.",+ "due_date": "Date the invoice payment is due.",+ "currency": "Three-letter ISO currency code of the invoice.",+ "line_items": "Line items (subscriptions or one-off charges) on the invoice.",+ "transactions": "Payment and refund transactions recorded against the invoice.",+ },+ },+ "activities": {+ "description": "A subscription activity (new business, expansion, churn, etc.) tracked by ChartMogul.",+ "docs_url": "https://dev.chartmogul.com/reference/list-activities",+ "columns": {+ "uuid": "Unique identifier for the activity.",+ "date": "Date and time the activity occurred.",+ "type": "Type of activity (e.g. new_biz, expansion, contraction, churn, reactivation).",+ "activity-mrr": "MRR associated with the activity.",+ "activity-mrr-movement": "Change in MRR caused by the activity.",+ "currency": "Three-letter ISO currency code of the activity.",+ "subscription-external-id": "External identifier of the subscription the activity relates to.",+ "plan-external-id": "External identifier of the plan the activity relates to.",+ "customer-name": "Name of the customer the activity relates to.",+ "customer-uuid": "UUID of the customer the activity relates to.",+ },+ },+ "data_sources": {+ "description": "A configured ChartMogul data source that billing data is imported through.",+ "docs_url": "https://dev.chartmogul.com/reference/list-data-sources",+ "columns": {+ "uuid": "Unique identifier for the data source.",+ "name": "Name of the data source.",+ "status": "Current status of the data source (e.g. idle, importing).",+ "created_at": "Time at which the data source was created.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/chartmogul/source.py b/posthog/temporal/data_imports/sources/chartmogul/source.pyindex 3f5e6ba8e5bd..b07c8424217a 100644--- a/posthog/temporal/data_imports/sources/chartmogul/source.py+++ b/posthog/temporal/data_imports/sources/chartmogul/source.py@@ -17,6 +17,7 @@ from posthog.temporal.data_imports.sources.chartmogul.chartmogul import ()from posthog.temporal.data_imports.sources.chartmogul.settings import ENDPOINTS, INCREMENTAL_FIELDSfrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -58,6 +59,11 @@ You can find your API key in your [ChartMogul admin settings](https://app.chartm),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.chartmogul.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: ChartMogulSourceConfig,diff --git a/posthog/temporal/data_imports/sources/checkout_com/canonical_descriptions.py b/posthog/temporal/data_imports/sources/checkout_com/canonical_descriptions.pynew file mode 100644index 000000000000..b1bd7dd13c57--- /dev/null+++ b/posthog/temporal/data_imports/sources/checkout_com/canonical_descriptions.py@@ -0,0 +1,31 @@+"""Canonical, documentation-sourced descriptions for Checkout.com endpoints and columns.++Sourced from the official Checkout.com API reference (https://api-reference.checkout.com/).+Keyed by the endpoint names in `checkout_com.py` `ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Checkout.com table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "disputes": {+ "description": "A dispute (chargeback) raised by a cardholder against a Checkout.com payment.",+ "docs_url": "https://api-reference.checkout.com/#tag/Disputes",+ "columns": {+ "id": "Unique identifier for the dispute.",+ "category": "Category of the dispute (e.g. fraudulent, product_service_not_received).",+ "status": "Current status of the dispute (e.g. evidence_required, evidence_under_review, won, lost).",+ "amount": "Disputed amount, in the smallest currency unit.",+ "currency": "Three-letter ISO currency code of the dispute.",+ "reason_code": "Card scheme reason code for the dispute.",+ "resolved_reason": "Reason the dispute was resolved, once resolved.",+ "payment_id": "Identifier of the payment that was disputed.",+ "payment_reference": "Reference of the disputed payment.",+ "payment_arn": "Acquirer reference number of the disputed payment.",+ "payment_method": "Payment method used for the disputed payment.",+ "received_on": "Time at which the dispute was received.",+ "last_update": "Time at which the dispute was last updated.",+ "evidence_required_by": "Deadline by which evidence must be submitted.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/checkout_com/source.py b/posthog/temporal/data_imports/sources/checkout_com/source.pyindex 0aa5cd8849e2..ea9cc66b3fec 100644--- a/posthog/temporal/data_imports/sources/checkout_com/source.py+++ b/posthog/temporal/data_imports/sources/checkout_com/source.py@@ -19,6 +19,7 @@ from posthog.temporal.data_imports.sources.checkout_com.checkout_com import (validate_credentials as validate_checkout_credentials,)from posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -97,6 +98,11 @@ Create an access key in the [Checkout.com dashboard](https://dashboard.checkout.),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.checkout_com.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: CheckoutComSourceConfig,diff --git a/posthog/temporal/data_imports/sources/circleci/canonical_descriptions.py b/posthog/temporal/data_imports/sources/circleci/canonical_descriptions.pynew file mode 100644index 000000000000..98ae7c431ba6--- /dev/null+++ b/posthog/temporal/data_imports/sources/circleci/canonical_descriptions.py@@ -0,0 +1,69 @@+"""Canonical, documentation-sourced descriptions for CircleCI endpoints and columns.++Sourced from the official CircleCI API v2 reference (https://circleci.com/docs/api/v2/).+Keyed by the endpoint names in `settings.py` `CIRCLECI_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced CircleCI table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "pipelines": {+ "description": "A CircleCI pipeline — the full unit of work triggered for a project on a commit.",+ "docs_url": "https://circleci.com/docs/api/v2/#operation/listPipelines",+ "columns": {+ "id": "Unique identifier for the pipeline.",+ "number": "Sequential number of the pipeline within its project.",+ "project_slug": "Project slug the pipeline belongs to, in vcs/org/repo format.",+ "state": "State of the pipeline (created, errored, setup-pending, setup, or pending).",+ "created_at": "Time at which the pipeline was created.",+ "updated_at": "Time at which the pipeline was last updated.",+ "trigger": "Information about what triggered the pipeline (e.g. webhook, api, schedule).",+ "vcs": "Version control details for the pipeline (branch, revision, commit).",+ "errors": "Any errors that occurred while creating the pipeline.",+ },+ },+ "workflows": {+ "description": "A workflow — a configured run of jobs within a pipeline.",+ "docs_url": "https://circleci.com/docs/api/v2/#operation/listWorkflowsByPipelineId",+ "columns": {+ "id": "Unique identifier for the workflow.",+ "name": "Name of the workflow as defined in the project config.",+ "pipeline_id": "Identifier of the pipeline the workflow belongs to.",+ "pipeline_number": "Number of the pipeline the workflow belongs to.",+ "project_slug": "Project slug the workflow belongs to, in vcs/org/repo format.",+ "status": "Status of the workflow (e.g. success, running, failed, error, canceled).",+ "created_at": "Time at which the workflow was created.",+ "stopped_at": "Time at which the workflow stopped.",+ "started_by": "Identifier of the user who started the workflow.",+ },+ },+ "jobs": {+ "description": "A job within a workflow — a single execution unit with steps.",+ "docs_url": "https://circleci.com/docs/api/v2/#operation/listWorkflowJobs",+ "columns": {+ "id": "Unique identifier for the job.",+ "name": "Name of the job as defined in the project config.",+ "job_number": "Number of the job within its project.",+ "type": "Type of the job (build or approval).",+ "status": "Status of the job (e.g. success, running, failed, blocked, canceled).",+ "started_at": "Time at which the job started.",+ "stopped_at": "Time at which the job stopped.",+ "project_slug": "Project slug the job belongs to, in vcs/org/repo format.",+ "dependencies": "Identifiers of jobs this job depends on.",+ },+ },+ "projects": {+ "description": "A CircleCI project — a repository configured to build on CircleCI.",+ "docs_url": "https://circleci.com/docs/api/v2/#operation/getProjectBySlug",+ "columns": {+ "id": "Unique identifier for the project.",+ "slug": "Project slug in vcs/org/repo format.",+ "name": "Name of the project (typically the repository name).",+ "organization_name": "Name of the organization the project belongs to.",+ "organization_slug": "Slug of the organization the project belongs to.",+ "organization_id": "Identifier of the organization the project belongs to.",+ "vcs_info": "Version control details for the project (provider, default branch, URL).",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/circleci/source.py b/posthog/temporal/data_imports/sources/circleci/source.pyindex 62c09ab22d65..d97dde4e4bb8 100644--- a/posthog/temporal/data_imports/sources/circleci/source.py+++ b/posthog/temporal/data_imports/sources/circleci/source.py@@ -17,6 +17,7 @@ from posthog.temporal.data_imports.sources.circleci.circleci import ()from posthog.temporal.data_imports.sources.circleci.settings import ENDPOINTS, INCREMENTAL_FIELDSfrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -74,6 +75,11 @@ You can create a personal API token in your [CircleCI user settings](https://app),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.circleci.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: CircleCISourceConfig,diff --git a/posthog/temporal/data_imports/sources/clari/canonical_descriptions.py b/posthog/temporal/data_imports/sources/clari/canonical_descriptions.pynew file mode 100644index 000000000000..2895ba29ffb1--- /dev/null+++ b/posthog/temporal/data_imports/sources/clari/canonical_descriptions.py@@ -0,0 +1,41 @@+"""Canonical, documentation-sourced descriptions for Clari endpoints and columns.++Sourced from the official Clari REST API reference (https://developer.clari.com/). Keyed by the+endpoint names in `settings.py` `ENDPOINTS`, which match the `ExternalDataSchema.name` of a synced+Clari table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "audit_events": {+ "description": "An audit log of user and system actions taken in Clari, such as forecast edits and submissions.",+ "docs_url": "https://developer.clari.com/",+ "columns": {+ "eventId": "Unique identifier for the audit event.",+ "eventType": "Type of action recorded (e.g. forecast update, submission).",+ "eventTimestamp": "Time at which the action occurred.",+ "userId": "Identifier of the user who performed the action.",+ "userEmail": "Email address of the user who performed the action.",+ "fieldName": "Name of the forecast field that was changed, if applicable.",+ "oldValue": "Previous value of the changed field, if applicable.",+ "newValue": "New value of the changed field, if applicable.",+ "timeFrame": "Forecast period (e.g. quarter) the event applies to.",+ },+ },+ "forecast": {+ "description": "A snapshot of forecast values for a quarter, broken down by user, period, and forecast category.",+ "docs_url": "https://developer.clari.com/",+ "columns": {+ "userId": "Identifier of the user the forecast row belongs to.",+ "userName": "Display name of the user the forecast row belongs to.",+ "userEmail": "Email address of the user the forecast row belongs to.",+ "fieldName": "Name of the forecast field (e.g. commit, best case, pipeline).",+ "value": "Numeric forecast value for the field.",+ "currency": "Currency code the forecast value is denominated in.",+ "timeFrame": "Forecast period (e.g. quarter) the value applies to.",+ "timePeriodId": "Identifier of the time period the forecast covers.",+ "updatedTime": "Time at which the forecast value was last updated.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/clari/source.py b/posthog/temporal/data_imports/sources/clari/source.pyindex e89eee5fe093..ec15a95103d0 100644--- a/posthog/temporal/data_imports/sources/clari/source.py+++ b/posthog/temporal/data_imports/sources/clari/source.py@@ -17,6 +17,7 @@ from posthog.temporal.data_imports.sources.clari.clari import ()from posthog.temporal.data_imports.sources.clari.settings import ENDPOINTS, INCREMENTAL_FIELDSfrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -73,6 +74,11 @@ Generate an API key in Clari under your account's API settings. The forecast ID),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.clari.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: ClariSourceConfig,diff --git a/posthog/temporal/data_imports/sources/clerk/canonical_descriptions.py b/posthog/temporal/data_imports/sources/clerk/canonical_descriptions.pynew file mode 100644index 000000000000..6b37fa84432b--- /dev/null+++ b/posthog/temporal/data_imports/sources/clerk/canonical_descriptions.py@@ -0,0 +1,80 @@+"""Canonical, documentation-sourced descriptions for Clerk endpoints and columns.++Sourced from the official Clerk Backend API reference (https://clerk.com/docs/reference/backend-api).+Keyed by the endpoint names in `settings.py` `CLERK_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Clerk table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by most Clerk objects; merged into each entry so we don't repeat them.+_COMMON_COLUMNS = {+ "id": "Unique identifier for the object.",+ "object": "String describing the object's Clerk type (e.g. 'user', 'organization').",+ "created_at": "Time at which the object was created, as a Unix timestamp in milliseconds.",+ "updated_at": "Time at which the object was last updated, as a Unix timestamp in milliseconds.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "users": {+ "description": "A user account in the Clerk instance, including identity and authentication details.",+ "docs_url": "https://clerk.com/docs/reference/backend-api/tag/Users",+ "columns": _columns(+ first_name="The user's first name.",+ last_name="The user's last name.",+ username="The user's unique username, if set.",+ email_addresses="List of email addresses associated with the user.",+ primary_email_address_id="ID of the user's primary email address.",+ phone_numbers="List of phone numbers associated with the user.",+ primary_phone_number_id="ID of the user's primary phone number.",+ image_url="URL of the user's profile image.",+ last_sign_in_at="Time the user last signed in, as a Unix timestamp in milliseconds.",+ banned="Whether the user is banned from signing in.",+ locked="Whether the user is temporarily locked out.",+ two_factor_enabled="Whether the user has two-factor authentication enabled.",+ public_metadata="Metadata visible to the frontend and backend.",+ private_metadata="Metadata visible only to the backend.",+ external_id="An external identifier you can attach to the user.",+ ),+ },+ "organizations": {+ "description": "An organization in the Clerk instance that groups users into a shared team.",+ "docs_url": "https://clerk.com/docs/reference/backend-api/tag/Organizations",+ "columns": _columns(+ name="The organization's name.",+ slug="The organization's URL-friendly unique slug.",+ image_url="URL of the organization's logo image.",+ members_count="Number of members in the organization.",+ max_allowed_memberships="Maximum number of members the organization can have.",+ created_by="ID of the user who created the organization.",+ public_metadata="Metadata visible to the frontend and backend.",+ private_metadata="Metadata visible only to the backend.",+ ),+ },+ "organization_memberships": {+ "description": "A membership linking a user to an organization, with their role in it.",+ "docs_url": "https://clerk.com/docs/reference/backend-api/tag/Organization-Memberships",+ "columns": _columns(+ organization="The organization the membership belongs to.",+ public_user_data="Public profile data of the member user.",+ role="The member's role within the organization (e.g. admin, basic_member).",+ permissions="List of permissions granted to the member.",+ ),+ },+ "invitations": {+ "description": "An invitation sent to an email address to join the Clerk instance.",+ "docs_url": "https://clerk.com/docs/reference/backend-api/tag/Invitations",+ "columns": _columns(+ email_address="Email address the invitation was sent to.",+ status="Status of the invitation (pending, accepted, revoked, or expired).",+ url="URL the invitee follows to accept the invitation.",+ revoked="Whether the invitation has been revoked.",+ public_metadata="Metadata visible to the frontend and backend.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/clerk/source.py b/posthog/temporal/data_imports/sources/clerk/source.pyindex 5b6587d8f9f3..b9a1d37cba0d 100644--- a/posthog/temporal/data_imports/sources/clerk/source.py+++ b/posthog/temporal/data_imports/sources/clerk/source.py@@ -17,6 +17,7 @@ from posthog.temporal.data_imports.sources.clerk.clerk import ()from posthog.temporal.data_imports.sources.clerk.settings import ENDPOINTSfrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -60,6 +61,11 @@ The secret key starts with `sk_live_`.),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.clerk.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: ClerkSourceConfig,diff --git a/posthog/temporal/data_imports/sources/clickup/canonical_descriptions.py b/posthog/temporal/data_imports/sources/clickup/canonical_descriptions.pynew file mode 100644index 000000000000..45cbb6367899--- /dev/null+++ b/posthog/temporal/data_imports/sources/clickup/canonical_descriptions.py@@ -0,0 +1,101 @@+"""Canonical, documentation-sourced descriptions for ClickUp endpoints and columns.++Sourced from the official ClickUp API reference (https://developer.clickup.com/reference). Keyed by+the endpoint names in `settings.py` `CLICKUP_ENDPOINTS`, which match the `ExternalDataSchema.name`+of a synced ClickUp table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "workspaces": {+ "description": "A ClickUp Workspace (Team) — the top-level container for spaces, members, and work.",+ "docs_url": "https://developer.clickup.com/reference/getauthorizedteams",+ "columns": {+ "id": "Unique identifier for the workspace.",+ "name": "The workspace's name.",+ "color": "The workspace's display color.",+ "avatar": "URL of the workspace's avatar image.",+ "members": "List of members belonging to the workspace.",+ },+ },+ "spaces": {+ "description": "A Space within a workspace, grouping folders and lists for a team or area of work.",+ "docs_url": "https://developer.clickup.com/reference/getspaces",+ "columns": {+ "id": "Unique identifier for the space.",+ "name": "The space's name.",+ "private": "Whether the space is private to its members.",+ "statuses": "The set of task statuses configured for the space.",+ "multiple_assignees": "Whether tasks in the space allow multiple assignees.",+ "archived": "Whether the space has been archived.",+ },+ },+ "folders": {+ "description": "A Folder within a space that groups related lists.",+ "docs_url": "https://developer.clickup.com/reference/getfolders",+ "columns": {+ "id": "Unique identifier for the folder.",+ "name": "The folder's name.",+ "space": "The space the folder belongs to.",+ "task_count": "Number of tasks contained in the folder.",+ "lists": "Lists contained in the folder.",+ "hidden": "Whether the folder is hidden.",+ "archived": "Whether the folder has been archived.",+ "_space_id": "Identifier of the parent space, injected during the fan-out sync.",+ },+ },+ "lists": {+ "description": "A List of tasks, belonging either to a folder or directly to a space.",+ "docs_url": "https://developer.clickup.com/reference/getlists",+ "columns": {+ "id": "Unique identifier for the list.",+ "name": "The list's name.",+ "folder": "The folder the list belongs to, if any.",+ "space": "The space the list belongs to.",+ "task_count": "Number of tasks in the list.",+ "status": "The list's status configuration.",+ "due_date": "Due date set on the list, as a Unix timestamp in milliseconds.",+ "start_date": "Start date set on the list, as a Unix timestamp in milliseconds.",+ "archived": "Whether the list has been archived.",+ },+ },+ "tasks": {+ "description": "A task — a unit of work tracked in ClickUp with status, assignees, and dates.",+ "docs_url": "https://developer.clickup.com/reference/gettasks",+ "columns": {+ "id": "Unique identifier for the task.",+ "name": "The task's name.",+ "description": "The task's description.",+ "status": "The task's current status.",+ "date_created": "Time at which the task was created, as a Unix timestamp in milliseconds.",+ "date_updated": "Time at which the task was last updated, as a Unix timestamp in milliseconds.",+ "date_closed": "Time at which the task was closed, as a Unix timestamp in milliseconds.",+ "due_date": "Due date of the task, as a Unix timestamp in milliseconds.",+ "start_date": "Start date of the task, as a Unix timestamp in milliseconds.",+ "creator": "The user who created the task.",+ "assignees": "List of users assigned to the task.",+ "priority": "The task's priority level.",+ "list": "The list the task belongs to.",+ "folder": "The folder the task belongs to.",+ "space": "The space the task belongs to.",+ "tags": "Tags applied to the task.",+ "url": "URL of the task in the ClickUp app.",+ },+ },+ "goals": {+ "description": "A Goal — a measurable objective tracked in ClickUp, made up of targets.",+ "docs_url": "https://developer.clickup.com/reference/getgoals",+ "columns": {+ "id": "Unique identifier for the goal.",+ "name": "The goal's name.",+ "description": "The goal's description.",+ "owner": "The user who owns the goal.",+ "due_date": "Due date of the goal, as a Unix timestamp in milliseconds.",+ "start_date": "Start date of the goal, as a Unix timestamp in milliseconds.",+ "completed": "Whether the goal has been completed.",+ "percent_completed": "Completion progress of the goal, as a percentage.",+ "color": "The goal's display color.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/clickup/source.py b/posthog/temporal/data_imports/sources/clickup/source.pyindex c32a6b56e818..8657f8e4616c 100644--- a/posthog/temporal/data_imports/sources/clickup/source.py+++ b/posthog/temporal/data_imports/sources/clickup/source.py@@ -17,6 +17,7 @@ from posthog.temporal.data_imports.sources.clickup.clickup import ()from posthog.temporal.data_imports.sources.clickup.settings import CLICKUP_ENDPOINTS, ENDPOINTSfrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -82,6 +83,11 @@ The **Workspace ID** is the numeric ID in your ClickUp URL: `https://app.clickup"403 Client Error: Forbidden for url: https://api.clickup.com": "Your ClickUp API token does not have access to this resource. Check the token permissions and try again.",}+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.clickup.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: ClickUpSourceConfig,diff --git a/posthog/temporal/data_imports/sources/close/canonical_descriptions.py b/posthog/temporal/data_imports/sources/close/canonical_descriptions.pynew file mode 100644index 000000000000..0a3b23f4afca--- /dev/null+++ b/posthog/temporal/data_imports/sources/close/canonical_descriptions.py@@ -0,0 +1,141 @@+"""Canonical, documentation-sourced descriptions for Close endpoints and columns.++Sourced from the official Close API reference (https://developer.close.com/) and the source's+`api_inventory.md`. Keyed by the endpoint names in `settings.py` `CLOSE_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Close table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by most Close objects; merged into each entry so we don't repeat them.+_COMMON_COLUMNS = {+ "id": "Unique identifier for the object.",+ "date_created": "Time at which the object was created.",+ "date_updated": "Time at which the object was last updated.",+ "organization_id": "ID of the Close organization the object belongs to.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "Leads": {+ "description": "A lead — a company or person being sold to, the central CRM record in Close.",+ "docs_url": "https://developer.close.com/resources/leads/",+ "columns": _columns(+ name="The lead's name (usually the company name).",+ description="Free-form description of the lead.",+ status_id="ID of the lead's current status.",+ status_label="Human-readable label of the lead's current status.",+ display_name="Display name of the lead.",+ contacts="List of contacts associated with the lead.",+ url="Website URL of the lead.",+ created_by="ID of the user who created the lead.",+ updated_by="ID of the user who last updated the lead.",+ ),+ },+ "Contacts": {+ "description": "A contact — a person associated with a lead, with their emails and phone numbers.",+ "docs_url": "https://developer.close.com/resources/contacts/",+ "columns": _columns(+ name="The contact's full name.",+ title="The contact's job title.",+ lead_id="ID of the lead this contact belongs to.",+ emails="List of email addresses for the contact.",+ phones="List of phone numbers for the contact.",+ created_by="ID of the user who created the contact.",+ ),+ },+ "Opportunities": {+ "description": "An opportunity — a potential sale tied to a lead, with value and pipeline status.",+ "docs_url": "https://developer.close.com/resources/opportunities/",+ "columns": _columns(+ lead_id="ID of the lead the opportunity belongs to.",+ lead_name="Name of the lead the opportunity belongs to.",+ status_id="ID of the opportunity's current status.",+ status_label="Human-readable label of the opportunity's current status.",+ pipeline_id="ID of the pipeline the opportunity is in.",+ value="Monetary value of the opportunity, in the smallest currency unit.",+ value_formatted="Human-readable formatted value of the opportunity.",+ value_currency="Currency code of the opportunity's value.",+ confidence="Estimated probability (0-100) of winning the opportunity.",+ date_won="Date the opportunity was won, if applicable.",+ user_id="ID of the user who owns the opportunity.",+ user_name="Name of the user who owns the opportunity.",+ note="Free-form note attached to the opportunity.",+ ),+ },+ "Activities": {+ "description": "An activity logged against a lead — a call, email, note, meeting, or status change.",+ "docs_url": "https://developer.close.com/resources/activities/",+ "columns": _columns(+ _type="Type of the activity (e.g. Call, Email, Note, Meeting).",+ lead_id="ID of the lead the activity is associated with.",+ contact_id="ID of the contact the activity is associated with, if any.",+ user_id="ID of the user who performed or logged the activity.",+ user_name="Name of the user who performed or logged the activity.",+ ),+ },+ "Tasks": {+ "description": "A task — a to-do item assigned to a user, usually tied to a lead.",+ "docs_url": "https://developer.close.com/resources/tasks/",+ "columns": _columns(+ _type="Type of the task.",+ lead_id="ID of the lead the task is associated with.",+ lead_name="Name of the lead the task is associated with.",+ text="The task's description text.",+ assigned_to="ID of the user the task is assigned to.",+ assigned_to_name="Name of the user the task is assigned to.",+ date="Due date of the task.",+ is_complete="Whether the task has been completed.",+ is_dateless="Whether the task has no due date.",+ ),+ },+ "Users": {+ "description": "A user (member) of the Close organization.",+ "docs_url": "https://developer.close.com/resources/users/",+ "columns": _columns(+ first_name="The user's first name.",+ last_name="The user's last name.",+ email="The user's email address.",+ image="URL of the user's profile image.",+ ),+ },+ "LeadStatuses": {+ "description": "A configured status that a lead can be in within the organization.",+ "docs_url": "https://developer.close.com/resources/status/",+ "columns": _columns(+ label="Human-readable label of the lead status.",+ ),+ },+ "OpportunityStatuses": {+ "description": "A configured status that an opportunity can be in within a pipeline.",+ "docs_url": "https://developer.close.com/resources/status/",+ "columns": _columns(+ label="Human-readable label of the opportunity status.",+ type="Type of the status (e.g. active, won, lost).",+ pipeline_id="ID of the pipeline this status belongs to.",+ ),+ },+ "Pipelines": {+ "description": "A sales pipeline — an ordered set of opportunity statuses in the organization.",+ "docs_url": "https://developer.close.com/resources/pipelines/",+ "columns": _columns(+ name="The pipeline's name.",+ statuses="The ordered list of statuses in the pipeline.",+ ),+ },+ "EmailTemplates": {+ "description": "A reusable email template used when sending emails from Close.",+ "docs_url": "https://developer.close.com/resources/email-templates/",+ "columns": _columns(+ name="The email template's name.",+ subject="The email template's subject line.",+ body="The email template's body content.",+ is_shared="Whether the template is shared with the whole organization.",+ created_by="ID of the user who created the template.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/close/source.py b/posthog/temporal/data_imports/sources/close/source.pyindex 7c868cffcbac..e15ab26d905a 100644--- a/posthog/temporal/data_imports/sources/close/source.py+++ b/posthog/temporal/data_imports/sources/close/source.py@@ -17,6 +17,7 @@ from posthog.temporal.data_imports.sources.close.close import ()from posthog.temporal.data_imports.sources.close.settings import CLOSE_ENDPOINTSfrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -37,6 +38,11 @@ class CloseSource(ResumableSource[CloseSourceConfig, CloseResumeConfig]):"403 Client Error: Forbidden for url": "Your Close API key does not have access to this resource. Please check the key's permissions.",}+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.close.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: CloseSourceConfig,diff --git a/posthog/temporal/data_imports/sources/cloudflare/canonical_descriptions.py b/posthog/temporal/data_imports/sources/cloudflare/canonical_descriptions.pynew file mode 100644index 000000000000..636feb6ebb03--- /dev/null+++ b/posthog/temporal/data_imports/sources/cloudflare/canonical_descriptions.py@@ -0,0 +1,55 @@+"""Canonical, documentation-sourced descriptions for Cloudflare endpoints and columns.++Sourced from the official Cloudflare API reference (https://developers.cloudflare.com/api/). Keyed+by the endpoint names in `settings.py` `CLOUDFLARE_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Cloudflare table. Columns absent here fall back to LLM+enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "accounts": {+ "description": "A Cloudflare account that the API token can access.",+ "docs_url": "https://developers.cloudflare.com/api/resources/accounts/",+ "columns": {+ "id": "Unique identifier for the account.",+ "name": "The account's name.",+ "type": "The account's type (e.g. standard, enterprise).",+ "created_on": "Time at which the account was created.",+ "settings": "Account-level settings object.",+ },+ },+ "zones": {+ "description": "A zone — a domain and its DNS/configuration managed in Cloudflare.",+ "docs_url": "https://developers.cloudflare.com/api/resources/zones/",+ "columns": {+ "id": "Unique identifier for the zone.",+ "name": "The zone's domain name (e.g. example.com).",+ "status": "The zone's status (e.g. active, pending, initializing).",+ "paused": "Whether Cloudflare is paused for the zone.",+ "type": "The zone's type (full or partial).",+ "account": "The account the zone belongs to.",+ "name_servers": "Cloudflare name servers assigned to the zone.",+ "created_on": "Time at which the zone was created.",+ "modified_on": "Time at which the zone was last modified.",+ "activated_on": "Time at which the zone was activated.",+ },+ },+ "dns_records": {+ "description": "A DNS record belonging to a zone (A, CNAME, MX, TXT, and so on).",+ "docs_url": "https://developers.cloudflare.com/api/resources/dns/subresources/records/",+ "columns": {+ "id": "Unique identifier for the DNS record.",+ "type": "The DNS record type (e.g. A, AAAA, CNAME, MX, TXT).",+ "name": "The DNS record name (hostname).",+ "content": "The DNS record's value (e.g. IP address or target hostname).",+ "proxied": "Whether traffic for the record is proxied through Cloudflare.",+ "ttl": "Time to live of the record, in seconds (1 means automatic).",+ "priority": "Priority of the record, used for MX and SRV records.",+ "created_on": "Time at which the record was created.",+ "modified_on": "Time at which the record was last modified.",+ "_zone_id": "Identifier of the parent zone, injected during the fan-out sync.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/cloudflare/source.py b/posthog/temporal/data_imports/sources/cloudflare/source.pyindex d9679c419e76..73a361255a33 100644--- a/posthog/temporal/data_imports/sources/cloudflare/source.py+++ b/posthog/temporal/data_imports/sources/cloudflare/source.py@@ -16,6 +16,7 @@ from posthog.temporal.data_imports.sources.cloudflare.cloudflare import ()from posthog.temporal.data_imports.sources.cloudflare.settings import ENDPOINTSfrom posthog.temporal.data_imports.sources.common.base import FieldType, SimpleSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.schema import SourceSchemafrom posthog.temporal.data_imports.sources.generated_configs import CloudflareSourceConfig@@ -62,6 +63,11 @@ Create an API token in the [Cloudflare dashboard](https://dash.cloudflare.com/pr),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.cloudflare.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: CloudflareSourceConfig,diff --git a/posthog/temporal/data_imports/sources/coda/canonical_descriptions.py b/posthog/temporal/data_imports/sources/coda/canonical_descriptions.pynew file mode 100644index 000000000000..d4bff0394eef--- /dev/null+++ b/posthog/temporal/data_imports/sources/coda/canonical_descriptions.py@@ -0,0 +1,62 @@+"""Canonical, documentation-sourced descriptions for Coda endpoints and columns.++Sourced from the official Coda API reference (https://coda.io/developers/apis/v1). Keyed by the+endpoint names in `settings.py` `CODA_ENDPOINTS`, which match the `ExternalDataSchema.name` of a+synced Coda table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "docs": {+ "description": "A Coda doc — the top-level document containing tables, pages, and content.",+ "docs_url": "https://coda.io/developers/apis/v1#tag/Docs",+ "columns": {+ "id": "Unique identifier for the doc.",+ "name": "The doc's name.",+ "type": "Type of the object, always 'doc'.",+ "href": "API URL of the doc.",+ "browserLink": "URL to open the doc in a browser.",+ "owner": "Email address of the doc's owner.",+ "ownerName": "Name of the doc's owner.",+ "createdAt": "Time at which the doc was created.",+ "updatedAt": "Time at which the doc was last updated.",+ "workspaceId": "ID of the workspace the doc belongs to.",+ "folderId": "ID of the folder the doc belongs to.",+ },+ },+ "tables": {+ "description": "A table within a Coda doc, holding a set of columns and rows.",+ "docs_url": "https://coda.io/developers/apis/v1#tag/Tables",+ "columns": {+ "id": "Identifier for the table, unique within its doc.",+ "name": "The table's name.",+ "type": "Type of the object, always 'table'.",+ "href": "API URL of the table.",+ "browserLink": "URL to open the table in a browser.",+ "tableType": "Whether the object is a table or a view.",+ "rowCount": "Number of rows in the table.",+ "displayColumn": "The table's display column.",+ "createdAt": "Time at which the table was created.",+ "updatedAt": "Time at which the table was last updated.",+ "_doc_id": "Identifier of the parent doc, injected during the fan-out sync.",+ },+ },+ "rows": {+ "description": "A row in a Coda table, with its cell values keyed by column.",+ "docs_url": "https://coda.io/developers/apis/v1#tag/Rows",+ "columns": {+ "id": "Identifier for the row, unique within its table.",+ "name": "The row's display name (value of the display column).",+ "type": "Type of the object, always 'row'.",+ "href": "API URL of the row.",+ "browserLink": "URL to open the row in a browser.",+ "index": "Position (index) of the row within the table.",+ "values": "Map of column identifiers to the row's cell values.",+ "createdAt": "Time at which the row was created.",+ "updatedAt": "Time at which the row was last updated.",+ "_doc_id": "Identifier of the parent doc, injected during the fan-out sync.",+ "_table_id": "Identifier of the parent table, injected during the fan-out sync.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/coda/source.py b/posthog/temporal/data_imports/sources/coda/source.pyindex 7c9aa631b5d9..28b4273c64fd 100644--- a/posthog/temporal/data_imports/sources/coda/source.py+++ b/posthog/temporal/data_imports/sources/coda/source.py@@ -16,6 +16,7 @@ from posthog.temporal.data_imports.sources.coda.coda import ()from posthog.temporal.data_imports.sources.coda.settings import ENDPOINTSfrom posthog.temporal.data_imports.sources.common.base import FieldType, SimpleSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.schema import SourceSchemafrom posthog.temporal.data_imports.sources.generated_configs import CodaSourceConfig@@ -62,6 +63,11 @@ You can generate an API token in [Coda account settings](https://coda.io/account),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.coda.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: CodaSourceConfig,diff --git a/posthog/temporal/data_imports/sources/commercetools/canonical_descriptions.py b/posthog/temporal/data_imports/sources/commercetools/canonical_descriptions.pynew file mode 100644index 000000000000..7bd9a08548fd--- /dev/null+++ b/posthog/temporal/data_imports/sources/commercetools/canonical_descriptions.py@@ -0,0 +1,136 @@+"""Canonical, documentation-sourced descriptions for commercetools endpoints and columns.++Sourced from the official commercetools Composable Commerce HTTP API reference+(https://docs.commercetools.com/api). Keyed by the endpoint names in `settings.py`+`COMMERCETOOLS_ENDPOINTS`, which match the `ExternalDataSchema.name` of a synced+commercetools table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by most commercetools resources; merged into each entry so we don't repeat them.+_COMMON_COLUMNS = {+ "id": "Unique identifier for the resource.",+ "version": "Current version of the resource, incremented on every update.",+ "createdAt": "Date and time the resource was created.",+ "lastModifiedAt": "Date and time the resource was last modified.",+ "key": "User-defined unique identifier for the resource.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "orders": {+ "description": "A confirmed checkout of a cart, representing a purchase made by a customer.",+ "docs_url": "https://docs.commercetools.com/api/projects/orders",+ "columns": _columns(+ orderNumber="Human-readable identifier of the order, unique within the project.",+ customerId="ID of the customer the order belongs to.",+ customerEmail="Email address of the customer who placed the order.",+ orderState="State of the order (Open, Confirmed, Complete, Cancelled).",+ paymentState="Payment state of the order (BalanceDue, Failed, Pending, CreditOwed, Paid).",+ shipmentState="Shipment state of the order (Shipped, Ready, Pending, Delayed, Partial, Backorder).",+ totalPrice="Total price of the order, after discounts and before/after tax depending on settings.",+ taxedPrice="Tax-inclusive and tax breakdown for the order.",+ lineItems="Products purchased in the order, each referencing a product and variant.",+ country="Two-letter country code for the order's shipping/tax context.",+ completedAt="Date and time the order was completed.",+ ),+ },+ "customers": {+ "description": "A registered customer account in the commercetools project.",+ "docs_url": "https://docs.commercetools.com/api/projects/customers",+ "columns": _columns(+ customerNumber="Human-readable identifier of the customer, unique within the project.",+ email="Email address of the customer.",+ firstName="Customer's first name.",+ lastName="Customer's last name.",+ companyName="Company name associated with the customer.",+ isEmailVerified="Whether the customer's email address has been verified.",+ customerGroup="Reference to the customer group the customer belongs to.",+ addresses="List of addresses stored for the customer.",+ defaultShippingAddressId="ID of the customer's default shipping address.",+ defaultBillingAddressId="ID of the customer's default billing address.",+ ),+ },+ "payments": {+ "description": "A payment representing money received or refunded for an order.",+ "docs_url": "https://docs.commercetools.com/api/projects/payments",+ "columns": _columns(+ customer="Reference to the customer the payment belongs to.",+ amountPlanned="Amount that the platform expects to receive or refund.",+ paymentMethodInfo="Information about the payment method used.",+ paymentStatus="Current status of the payment, including interface and state.",+ transactions="List of financial transactions (Authorization, Charge, Refund, etc.).",+ interfaceId="Identifier used by the payment service provider for this payment.",+ ),+ },+ "carts": {+ "description": "A shopping cart holding line items a customer intends to purchase.",+ "docs_url": "https://docs.commercetools.com/api/projects/carts",+ "columns": _columns(+ customerId="ID of the customer the cart belongs to, if any.",+ customerEmail="Email address associated with the cart.",+ cartState="State of the cart (Active, Merged, Ordered, Frozen).",+ totalPrice="Total price of the cart's line items after discounts.",+ taxedPrice="Tax-inclusive and tax breakdown for the cart.",+ lineItems="Products added to the cart, each referencing a product and variant.",+ country="Two-letter country code for the cart's pricing/tax context.",+ anonymousId="Identifier for an anonymous session owning the cart.",+ ),+ },+ "product_projections": {+ "description": "A projected (current or staged) view of a product, ready for storefront display.",+ "docs_url": "https://docs.commercetools.com/api/projects/productProjections",+ "columns": _columns(+ name="Localized name of the product.",+ description="Localized description of the product.",+ slug="Localized, URL-friendly identifier of the product.",+ productType="Reference to the product type defining the product's attributes.",+ categories="References to the categories the product is assigned to.",+ masterVariant="The product's master (default) variant, including SKU and prices.",+ variants="Additional variants of the product.",+ published="Whether the product is currently published.",+ ),+ },+ "categories": {+ "description": "A category used to organize products into a navigable hierarchy.",+ "docs_url": "https://docs.commercetools.com/api/projects/categories",+ "columns": _columns(+ name="Localized name of the category.",+ slug="Localized, URL-friendly identifier of the category.",+ description="Localized description of the category.",+ parent="Reference to the parent category, if this is a subcategory.",+ ancestors="References to all ancestor categories up the hierarchy.",+ orderHint="Decimal string controlling the category's order among siblings.",+ ),+ },+ "discount_codes": {+ "description": "A discount code customers can redeem to apply a cart discount.",+ "docs_url": "https://docs.commercetools.com/api/projects/discountCodes",+ "columns": _columns(+ code="The unique code customers enter to apply the discount.",+ name="Localized name of the discount code.",+ description="Localized description of the discount code.",+ cartDiscounts="References to the cart discounts applied by this code.",+ isActive="Whether the discount code is currently active.",+ maxApplications="Maximum number of times the code can be applied overall.",+ maxApplicationsPerCustomer="Maximum number of times one customer can apply the code.",+ ),+ },+ "inventory": {+ "description": "An inventory entry tracking stock quantity for a SKU at a supply channel.",+ "docs_url": "https://docs.commercetools.com/api/projects/inventory",+ "columns": _columns(+ sku="SKU of the product variant this inventory entry tracks.",+ supplyChannel="Reference to the supply channel the stock is held at, if any.",+ quantityOnStock="Total quantity of items currently on stock.",+ availableQuantity="Quantity available for sale (on stock minus reserved).",+ restockableInDays="Number of days until the item can be restocked.",+ expectedDelivery="Date and time when restocked items are expected to arrive.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/commercetools/source.py b/posthog/temporal/data_imports/sources/commercetools/source.pyindex 8e814e1d09e4..9af57f4d8aad 100644--- a/posthog/temporal/data_imports/sources/commercetools/source.py+++ b/posthog/temporal/data_imports/sources/commercetools/source.py@@ -19,6 +19,7 @@ from posthog.temporal.data_imports.sources.commercetools.commercetools import ()from posthog.temporal.data_imports.sources.commercetools.settings import ENDPOINTS, INCREMENTAL_FIELDSfrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -40,6 +41,11 @@ class CommercetoolsSource(ResumableSource[CommercetoolsSourceConfig, Commercetoo# can't be aimed at a different commercetools project or region.return ["region", "project_key"]+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.commercetools.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized for url: https://auth.": "commercetools authentication failed. Please check your client ID and client secret.",diff --git a/posthog/temporal/data_imports/sources/confluence/canonical_descriptions.py b/posthog/temporal/data_imports/sources/confluence/canonical_descriptions.pynew file mode 100644index 000000000000..af21810babbe--- /dev/null+++ b/posthog/temporal/data_imports/sources/confluence/canonical_descriptions.py@@ -0,0 +1,134 @@+"""Canonical, documentation-sourced descriptions for Confluence endpoints and columns.++Sourced from the official Confluence Cloud REST API v2 reference+(https://developer.atlassian.com/cloud/confluence/rest/v2/). Keyed by the endpoint names in+`settings.py` `CONFLUENCE_ENDPOINTS`, which match the `ExternalDataSchema.name` of a synced+Confluence table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by most Confluence v2 content objects; merged into each entry so we don't repeat them.+_COMMON_COLUMNS = {+ "id": "Unique identifier for the object.",+ "title": "Title of the object.",+ "status": "Status of the object (e.g. current, draft, archived, trashed).",+ "createdAt": "Date and time the object was created.",+ "version": "Version metadata for the object, including number and creation time.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "spaces": {+ "description": "A Confluence space — a top-level container that groups related pages and content.",+ "docs_url": "https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-space/",+ "columns": {+ "id": "Unique identifier for the space.",+ "key": "Unique key of the space, used in URLs.",+ "name": "Display name of the space.",+ "type": "Type of the space (e.g. global, personal, collaboration).",+ "status": "Status of the space (e.g. current, archived).",+ "authorId": "Account ID of the user who created the space.",+ "homepageId": "ID of the space's homepage.",+ "description": "Description of the space.",+ "createdAt": "Date and time the space was created.",+ },+ },+ "pages": {+ "description": "A Confluence page — a unit of content that lives within a space.",+ "docs_url": "https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-page/",+ "columns": _columns(+ spaceId="ID of the space the page belongs to.",+ parentId="ID of the parent page, if the page is nested.",+ parentType="Type of the parent object (e.g. page).",+ authorId="Account ID of the user who created the page.",+ ownerId="Account ID of the page's owner.",+ position="Position of the page among its siblings.",+ body="Body content of the page in the requested representation.",+ ),+ },+ "blogposts": {+ "description": "A Confluence blog post — a dated post that lives within a space.",+ "docs_url": "https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-blog-post/",+ "columns": _columns(+ spaceId="ID of the space the blog post belongs to.",+ authorId="Account ID of the user who created the blog post.",+ body="Body content of the blog post in the requested representation.",+ ),+ },+ "attachments": {+ "description": "A file attachment associated with a page, blog post, or other Confluence content.",+ "docs_url": "https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-attachment/",+ "columns": _columns(+ mediaType="MIME type of the attached file.",+ mediaTypeDescription="Human-readable description of the file's media type.",+ fileSize="Size of the attached file in bytes.",+ fileId="Identifier of the underlying file in media storage.",+ comment="Comment associated with the attachment.",+ pageId="ID of the page the attachment is associated with, if any.",+ blogPostId="ID of the blog post the attachment is associated with, if any.",+ downloadLink="Relative URL to download the attachment.",+ ),+ },+ "tasks": {+ "description": "An action item (checkbox task) embedded within Confluence content.",+ "docs_url": "https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-task/",+ "columns": {+ "id": "Unique identifier for the task.",+ "localId": "Identifier of the task within its containing content.",+ "spaceId": "ID of the space the task belongs to.",+ "pageId": "ID of the page the task is on, if any.",+ "blogPostId": "ID of the blog post the task is on, if any.",+ "status": "Status of the task (complete or incomplete).",+ "body": "Body content of the task.",+ "createdBy": "Account ID of the user who created the task.",+ "assignedTo": "Account ID of the user the task is assigned to.",+ "completedBy": "Account ID of the user who completed the task.",+ "createdAt": "Date and time the task was created.",+ "updatedAt": "Date and time the task was last updated.",+ "dueAt": "Date and time the task is due.",+ "completedAt": "Date and time the task was completed.",+ },+ },+ "labels": {+ "description": "A label (tag) that can be applied to Confluence content for categorization.",+ "docs_url": "https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-label/",+ "columns": {+ "id": "Unique identifier for the label.",+ "name": "Name of the label.",+ "prefix": "Prefix of the label (e.g. global, my, team).",+ },+ },+ "footer_comments": {+ "description": "A footer comment left at the bottom of a Confluence page or blog post.",+ "docs_url": "https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-comment/",+ "columns": {+ "id": "Unique identifier for the comment.",+ "status": "Status of the comment (e.g. current, deleted).",+ "pageId": "ID of the page the comment is on, if any.",+ "blogPostId": "ID of the blog post the comment is on, if any.",+ "parentCommentId": "ID of the parent comment, if this is a threaded reply.",+ "body": "Body content of the comment.",+ "version": "Version metadata for the comment.",+ },+ },+ "inline_comments": {+ "description": "An inline comment anchored to specific text within a Confluence page or blog post.",+ "docs_url": "https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-comment/",+ "columns": {+ "id": "Unique identifier for the comment.",+ "status": "Status of the comment (e.g. current, deleted, resolved).",+ "pageId": "ID of the page the comment is on, if any.",+ "blogPostId": "ID of the blog post the comment is on, if any.",+ "parentCommentId": "ID of the parent comment, if this is a threaded reply.",+ "body": "Body content of the comment.",+ "resolutionStatus": "Resolution status of the inline comment.",+ "properties": "Inline comment properties, including the highlighted text it anchors to.",+ "version": "Version metadata for the comment.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/confluence/source.py b/posthog/temporal/data_imports/sources/confluence/source.pyindex 199d825269d3..5bff8db488d9 100644--- a/posthog/temporal/data_imports/sources/confluence/source.py+++ b/posthog/temporal/data_imports/sources/confluence/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -82,6 +83,11 @@ Only Confluence Cloud sites (`your-domain.atlassian.net`) are supported.""",),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.confluence.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: ConfluenceSourceConfig,diff --git a/posthog/temporal/data_imports/sources/convertkit/canonical_descriptions.py b/posthog/temporal/data_imports/sources/convertkit/canonical_descriptions.pynew file mode 100644index 000000000000..5efbfcb3bb0f--- /dev/null+++ b/posthog/temporal/data_imports/sources/convertkit/canonical_descriptions.py@@ -0,0 +1,108 @@+"""Canonical, documentation-sourced descriptions for ConvertKit (Kit) endpoints and columns.++Sourced from the official Kit (formerly ConvertKit) v4 API reference+(https://developers.kit.com/api-reference). Keyed by the endpoint names in `settings.py`+`CONVERTKIT_ENDPOINTS`, which match the `ExternalDataSchema.name` of a synced ConvertKit table.+Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "subscribers": {+ "description": "A subscriber on your Kit (ConvertKit) account.",+ "docs_url": "https://developers.kit.com/api-reference/subscribers/list-subscribers",+ "columns": {+ "id": "Unique identifier for the subscriber.",+ "first_name": "First name of the subscriber.",+ "email_address": "Email address of the subscriber.",+ "state": "State of the subscriber (active, inactive, bounced, complained, cancelled).",+ "created_at": "Date and time the subscriber was created.",+ "updated_at": "Date and time the subscriber was last updated.",+ "fields": "Custom field values stored for the subscriber.",+ },+ },+ "broadcasts": {+ "description": "A broadcast — a one-time email sent to a segment of your subscribers.",+ "docs_url": "https://developers.kit.com/api-reference/broadcasts/list-broadcasts",+ "columns": {+ "id": "Unique identifier for the broadcast.",+ "subject": "Subject line of the broadcast email.",+ "description": "Internal description of the broadcast.",+ "content": "HTML content of the broadcast email.",+ "public": "Whether the broadcast is publicly visible.",+ "published_at": "Date and time the broadcast was published.",+ "send_at": "Scheduled send date and time of the broadcast.",+ "created_at": "Date and time the broadcast was created.",+ },+ },+ "forms": {+ "description": "A form or landing page used to capture new subscribers.",+ "docs_url": "https://developers.kit.com/api-reference/forms/list-forms",+ "columns": {+ "id": "Unique identifier for the form.",+ "name": "Name of the form.",+ "type": "Type of the form (e.g. embed, hosted).",+ "format": "Display format of the form (e.g. inline, modal, slide in, sticky bar).",+ "url": "URL of the hosted form, if applicable.",+ "archived": "Whether the form has been archived.",+ "created_at": "Date and time the form was created.",+ },+ },+ "sequences": {+ "description": "A sequence — an automated series of emails sent to subscribers over time.",+ "docs_url": "https://developers.kit.com/api-reference/sequences/list-sequences",+ "columns": {+ "id": "Unique identifier for the sequence.",+ "name": "Name of the sequence.",+ "created_at": "Date and time the sequence was created.",+ },+ },+ "tags": {+ "description": "A tag used to label and segment subscribers.",+ "docs_url": "https://developers.kit.com/api-reference/tags/list-tags",+ "columns": {+ "id": "Unique identifier for the tag.",+ "name": "Name of the tag.",+ "created_at": "Date and time the tag was created.",+ },+ },+ "custom_fields": {+ "description": "A custom field used to store additional data about subscribers.",+ "docs_url": "https://developers.kit.com/api-reference/custom-fields/list-custom-fields",+ "columns": {+ "id": "Unique identifier for the custom field.",+ "name": "Internal key of the custom field, used when setting values.",+ "key": "Snake-cased key of the custom field.",+ "label": "Human-readable label of the custom field.",+ },+ },+ "purchases": {+ "description": "A purchase recorded against a subscriber for commerce reporting.",+ "docs_url": "https://developers.kit.com/api-reference/purchases/list-purchases",+ "columns": {+ "id": "Unique identifier for the purchase.",+ "transaction_id": "Identifier of the transaction in your commerce system.",+ "email_address": "Email address of the purchasing subscriber.",+ "currency": "Three-letter ISO currency code of the purchase.",+ "subtotal": "Subtotal amount of the purchase before tax and shipping.",+ "tax": "Tax amount applied to the purchase.",+ "shipping": "Shipping amount applied to the purchase.",+ "discount": "Discount amount applied to the purchase.",+ "total": "Total amount of the purchase.",+ "status": "Status of the purchase (e.g. paid).",+ "transaction_time": "Date and time the transaction occurred.",+ "products": "Line items included in the purchase.",+ },+ },+ "email_templates": {+ "description": "An email template used to style broadcasts and sequence emails.",+ "docs_url": "https://developers.kit.com/api-reference/email-templates/list-email-templates",+ "columns": {+ "id": "Unique identifier for the email template.",+ "name": "Name of the email template.",+ "category": "Category of the email template.",+ "is_default": "Whether this is the account's default template.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/convertkit/source.py b/posthog/temporal/data_imports/sources/convertkit/source.pyindex 02a462b68b8f..80335e5a3598 100644--- a/posthog/temporal/data_imports/sources/convertkit/source.py+++ b/posthog/temporal/data_imports/sources/convertkit/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -59,6 +60,11 @@ You can create a v4 API key in your [Kit account settings](https://app.kit.com/a),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.convertkit.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: ConvertKitSourceConfig,diff --git a/posthog/temporal/data_imports/sources/copper/canonical_descriptions.py b/posthog/temporal/data_imports/sources/copper/canonical_descriptions.pynew file mode 100644index 000000000000..899a178d1197--- /dev/null+++ b/posthog/temporal/data_imports/sources/copper/canonical_descriptions.py@@ -0,0 +1,161 @@+"""Canonical, documentation-sourced descriptions for Copper CRM endpoints and columns.++Sourced from the official Copper Developer API reference (https://developer.copper.com/). Keyed by+the endpoint names in `settings.py` `COPPER_ENDPOINTS`, which match the `ExternalDataSchema.name` of+a synced Copper table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by most Copper records; merged into each entry so we don't repeat them.+_COMMON_COLUMNS = {+ "id": "Unique identifier for the record.",+ "name": "Name of the record.",+ "date_created": "Unix timestamp (seconds) of when the record was created.",+ "date_modified": "Unix timestamp (seconds) of when the record was last modified.",+ "assignee_id": "Unique identifier of the user the record is assigned to.",+ "tags": "List of tags applied to the record.",+ "custom_fields": "Values of custom fields defined for the record.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "people": {+ "description": "A person contact stored in Copper CRM.",+ "docs_url": "https://developer.copper.com/people/list-people-search.html",+ "columns": _columns(+ prefix="Honorific prefix of the person (e.g. Mr., Ms.).",+ first_name="First name of the person.",+ last_name="Last name of the person.",+ title="Job title of the person.",+ company_id="Unique identifier of the company the person belongs to.",+ company_name="Name of the company the person belongs to.",+ emails="List of email addresses for the person.",+ phone_numbers="List of phone numbers for the person.",+ socials="List of social media profiles for the person.",+ websites="List of websites associated with the person.",+ address="Postal address of the person.",+ contact_type_id="Unique identifier of the contact type.",+ ),+ },+ "companies": {+ "description": "A company (organization) stored in Copper CRM.",+ "docs_url": "https://developer.copper.com/companies/list-companies-search.html",+ "columns": _columns(+ email_domain="Primary email domain of the company.",+ details="Free-text details about the company.",+ phone_numbers="List of phone numbers for the company.",+ socials="List of social media profiles for the company.",+ websites="List of websites associated with the company.",+ address="Postal address of the company.",+ contact_type_id="Unique identifier of the contact type.",+ ),+ },+ "leads": {+ "description": "An unqualified prospect (lead) stored in Copper CRM.",+ "docs_url": "https://developer.copper.com/leads/list-leads-search.html",+ "columns": _columns(+ first_name="First name of the lead.",+ last_name="Last name of the lead.",+ title="Job title of the lead.",+ company_name="Name of the company the lead is associated with.",+ email="Primary email address of the lead.",+ phone_numbers="List of phone numbers for the lead.",+ socials="List of social media profiles for the lead.",+ websites="List of websites associated with the lead.",+ address="Postal address of the lead.",+ status="Status of the lead (e.g. New, Open, Junk).",+ status_id="Unique identifier of the lead's status.",+ customer_source_id="Unique identifier of the source the lead came from.",+ monetary_value="Estimated monetary value of the lead.",+ converted_unix_timestamp="Unix timestamp of when the lead was converted.",+ ),+ },+ "opportunities": {+ "description": "A potential sale (opportunity) tracked through a pipeline in Copper CRM.",+ "docs_url": "https://developer.copper.com/opportunities/list-opportunities-search.html",+ "columns": _columns(+ company_id="Unique identifier of the company the opportunity is for.",+ company_name="Name of the company the opportunity is for.",+ primary_contact_id="Unique identifier of the primary contact for the opportunity.",+ customer_source_id="Unique identifier of the source the opportunity came from.",+ loss_reason_id="Unique identifier of the reason the opportunity was lost.",+ pipeline_id="Unique identifier of the pipeline the opportunity belongs to.",+ pipeline_stage_id="Unique identifier of the current pipeline stage.",+ status="Status of the opportunity (Open, Won, Lost, Abandoned).",+ monetary_value="Monetary value of the opportunity.",+ win_probability="Estimated probability of winning the opportunity, as a percentage.",+ close_date="Expected close date of the opportunity.",+ priority="Priority of the opportunity (None, Low, Medium, High).",+ ),+ },+ "projects": {+ "description": "A project used to organize work after a deal closes in Copper CRM.",+ "docs_url": "https://developer.copper.com/projects/list-projects-search.html",+ "columns": _columns(+ related_resource="The resource (e.g. company, person) the project is related to.",+ status="Status of the project (Open, Completed).",+ details="Free-text details about the project.",+ ),+ },+ "tasks": {+ "description": "A to-do item (task) associated with CRM records in Copper.",+ "docs_url": "https://developer.copper.com/tasks/list-tasks-search.html",+ "columns": _columns(+ related_resource="The resource (e.g. company, person, opportunity) the task is related to.",+ due_date="Unix timestamp of when the task is due.",+ reminder_date="Unix timestamp of when a reminder should fire for the task.",+ completed_date="Unix timestamp of when the task was completed.",+ priority="Priority of the task (None, High).",+ status="Status of the task (Open, Completed).",+ details="Free-text details about the task.",+ activity_type="The activity type associated with the task.",+ ),+ },+ "users": {+ "description": "A user (team member) in the Copper CRM account.",+ "docs_url": "https://developer.copper.com/users/list-users-search.html",+ "columns": {+ "id": "Unique identifier for the user.",+ "name": "Full name of the user.",+ "email": "Email address of the user.",+ },+ },+ "pipelines": {+ "description": "A sales pipeline defining the stages opportunities move through.",+ "docs_url": "https://developer.copper.com/pipelines/list-pipelines.html",+ "columns": {+ "id": "Unique identifier for the pipeline.",+ "name": "Name of the pipeline.",+ "stages": "Ordered list of stages within the pipeline.",+ },+ },+ "customer_sources": {+ "description": "A reference list of customer sources used to attribute where leads and opportunities came from.",+ "docs_url": "https://developer.copper.com/customer-sources/list-customer-sources.html",+ "columns": {+ "id": "Unique identifier for the customer source.",+ "name": "Name of the customer source.",+ },+ },+ "loss_reasons": {+ "description": "A reference list of reasons used to record why an opportunity was lost.",+ "docs_url": "https://developer.copper.com/loss-reasons/list-loss-reasons.html",+ "columns": {+ "id": "Unique identifier for the loss reason.",+ "name": "Name of the loss reason.",+ },+ },+ "contact_types": {+ "description": "A reference list of contact types used to classify people and companies.",+ "docs_url": "https://developer.copper.com/contact-types/list-contact-types.html",+ "columns": {+ "id": "Unique identifier for the contact type.",+ "name": "Name of the contact type.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/copper/source.py b/posthog/temporal/data_imports/sources/copper/source.pyindex feb5044b6fb2..7570027b1ea7 100644--- a/posthog/temporal/data_imports/sources/copper/source.py+++ b/posthog/temporal/data_imports/sources/copper/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -31,6 +32,11 @@ class CopperSource(ResumableSource[CopperSourceConfig, CopperResumeConfig]):def source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.COPPER+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.copper.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error": "Copper authentication failed. Check your API key and the email it belongs to.",diff --git a/posthog/temporal/data_imports/sources/coupa/canonical_descriptions.py b/posthog/temporal/data_imports/sources/coupa/canonical_descriptions.pynew file mode 100644index 000000000000..0806f802508d--- /dev/null+++ b/posthog/temporal/data_imports/sources/coupa/canonical_descriptions.py@@ -0,0 +1,146 @@+"""Canonical, documentation-sourced descriptions for Coupa endpoints and columns.++Sourced from the official Coupa Core API reference (https://compass.coupa.com/en-us/products/+core-applications/integrate/integrate-your-data/the-coupa-core-api). Keyed by the endpoint names in+`settings.py` `COUPA_ENDPOINTS`, which match the `ExternalDataSchema.name` of a synced Coupa table.+Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by most Coupa objects; merged into each entry so we don't repeat them.+_COMMON_COLUMNS = {+ "id": "Unique identifier for the object.",+ "created-at": "Date and time the object was created.",+ "updated-at": "Date and time the object was last updated.",+ "created_at": "Date and time the object was created.",+ "updated_at": "Date and time the object was last updated.",+ "status": "Current status of the object in its workflow.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "invoices": {+ "description": "A supplier invoice submitted for payment in Coupa.",+ "docs_url": "https://compass.coupa.com/en-us/products/core-applications/integrate/integrate-your-data/the-coupa-core-api",+ "columns": _columns(+ **{"invoice-number": "Supplier-provided invoice number."},+ supplier="The supplier that issued the invoice.",+ **{+ "total-with-taxes": "Total invoice amount including taxes.",+ "gross-total": "Gross total amount of the invoice.",+ "net-total": "Net total amount of the invoice before taxes.",+ "tax-amount": "Total tax amount on the invoice.",+ "invoice-date": "Date the invoice was issued.",+ "paid-at": "Date and time the invoice was paid.",+ "currency": "Currency of the invoice.",+ },+ ),+ },+ "purchase_orders": {+ "description": "A purchase order issued to a supplier in Coupa.",+ "docs_url": "https://compass.coupa.com/en-us/products/core-applications/integrate/integrate-your-data/the-coupa-core-api",+ "columns": _columns(+ **{+ "po-number": "Human-readable purchase order number.",+ "order-header-num": "Order header number of the purchase order.",+ "total": "Total amount of the purchase order.",+ "currency": "Currency of the purchase order.",+ "ship-to-address": "Address the order is shipped to.",+ },+ supplier="The supplier the purchase order is issued to.",+ requisition_header="The requisition the purchase order originated from.",+ **{"order-lines": "Line items of the purchase order."},+ ),+ },+ "requisitions": {+ "description": "A purchase requisition requesting goods or services in Coupa.",+ "docs_url": "https://compass.coupa.com/en-us/products/core-applications/integrate/integrate-your-data/the-coupa-core-api",+ "columns": _columns(+ requested_by="The user who created the requisition.",+ **{+ "total": "Total amount of the requisition.",+ "currency": "Currency of the requisition.",+ "submitted-at": "Date and time the requisition was submitted for approval.",+ "requisition-lines": "Line items of the requisition.",+ },+ ),+ },+ "suppliers": {+ "description": "A supplier (vendor) that goods or services are purchased from in Coupa.",+ "docs_url": "https://compass.coupa.com/en-us/products/core-applications/integrate/integrate-your-data/the-coupa-core-api",+ "columns": _columns(+ name="Name of the supplier.",+ **{+ "display-name": "Display name of the supplier.",+ "number": "Supplier number assigned in Coupa.",+ "primary-contact": "Primary contact for the supplier.",+ "primary-address": "Primary address of the supplier.",+ "payment-term": "Default payment term for the supplier.",+ "currency": "Default transaction currency of the supplier.",+ },+ ),+ },+ "contracts": {+ "description": "A contract governing terms with a supplier in Coupa.",+ "docs_url": "https://compass.coupa.com/en-us/products/core-applications/integrate/integrate-your-data/the-coupa-core-api",+ "columns": _columns(+ name="Name of the contract.",+ **{+ "number": "Contract number assigned in Coupa.",+ "start-date": "Start date of the contract.",+ "end-date": "End date of the contract.",+ "maximum-value": "Maximum spend value allowed under the contract.",+ "currency": "Currency of the contract.",+ },+ supplier="The supplier the contract is with.",+ ),+ },+ "expense_reports": {+ "description": "An employee expense report submitted for reimbursement in Coupa.",+ "docs_url": "https://compass.coupa.com/en-us/products/core-applications/integrate/integrate-your-data/the-coupa-core-api",+ "columns": _columns(+ **{+ "expense-report-number": "Human-readable expense report number.",+ "submitted-at": "Date and time the expense report was submitted.",+ "total": "Total amount claimed in the expense report.",+ "currency": "Currency of the expense report.",+ "expense-lines": "Individual expense line items.",+ },+ **{"submitted-by": "The user who submitted the expense report."},+ ),+ },+ "users": {+ "description": "A user account within the Coupa instance.",+ "docs_url": "https://compass.coupa.com/en-us/products/core-applications/integrate/integrate-your-data/the-coupa-core-api",+ "columns": _columns(+ login="Login name of the user.",+ email="Email address of the user.",+ **{+ "firstname": "First name of the user.",+ "lastname": "Last name of the user.",+ "fullname": "Full name of the user.",+ "employee-number": "Employee number of the user.",+ "active": "Whether the user account is active.",+ },+ ),+ },+ "approvals": {+ "description": "An approval step recorded against a document in a Coupa approval chain.",+ "docs_url": "https://compass.coupa.com/en-us/products/core-applications/integrate/integrate-your-data/the-coupa-core-api",+ "columns": _columns(+ approver="The user assigned to approve the document.",+ **{+ "approval-chain-id": "Identifier of the approval chain the step belongs to.",+ "approvable-type": "Type of document being approved (e.g. requisition, invoice).",+ "approvable-id": "Identifier of the document being approved.",+ "approved-at": "Date and time the step was approved.",+ "position": "Position of the step within its approval chain.",+ },+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/coupa/source.py b/posthog/temporal/data_imports/sources/coupa/source.pyindex cf6f2ee20240..2486a94f0ca4 100644--- a/posthog/temporal/data_imports/sources/coupa/source.py+++ b/posthog/temporal/data_imports/sources/coupa/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.mixins import ValidateDatabaseHostMixinfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManager@@ -39,6 +40,11 @@ class CoupaSource(ResumableSource[CoupaSourceConfig, CoupaResumeConfig], Validat# retargeting it must re-require the secret.return ["instance_url"]+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.coupa.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"400 Client Error: Bad Request for url": "Coupa rejected the token request. Please check your client ID, client secret, and that the OIDC client has the required scopes.",diff --git a/posthog/temporal/data_imports/sources/crunchbase/canonical_descriptions.py b/posthog/temporal/data_imports/sources/crunchbase/canonical_descriptions.pynew file mode 100644index 000000000000..ba06fa1ee143--- /dev/null+++ b/posthog/temporal/data_imports/sources/crunchbase/canonical_descriptions.py@@ -0,0 +1,98 @@+"""Canonical, documentation-sourced descriptions for Crunchbase endpoints and columns.++Sourced from the official Crunchbase Data API v4 reference+(https://data.crunchbase.com/docs). Keyed by the endpoint names in `settings.py`+`CRUNCHBASE_ENDPOINTS`, which match the `ExternalDataSchema.name` of a synced Crunchbase table.+Column names mirror the `field_ids` requested per collection in `settings.py`. Columns absent here+fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by every Crunchbase entity; merged into each entry so we don't repeat them.+_COMMON_COLUMNS = {+ "uuid": "Unique identifier for the entity.",+ "identifier": "Human-readable reference to the entity, including its name and permalink.",+ "created_at": "Date and time the entity was created in Crunchbase.",+ "updated_at": "Date and time the entity was last updated in Crunchbase.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "organizations": {+ "description": "A company or organization profile in Crunchbase.",+ "docs_url": "https://data.crunchbase.com/docs/crunchbase-basic-getting-started",+ "columns": _columns(+ short_description="Brief summary of what the organization does.",+ website_url="Primary website URL of the organization.",+ founded_on="Date the organization was founded.",+ categories="Industry categories the organization belongs to.",+ location_identifiers="Locations associated with the organization (city, region, country).",+ funding_total="Total funding the organization has raised across all rounds.",+ num_employees_enum="Bucketed range of the organization's employee count.",+ operating_status="Operating status of the organization (e.g. active, closed).",+ ),+ },+ "people": {+ "description": "A person profile in Crunchbase, such as a founder, executive, or investor.",+ "docs_url": "https://data.crunchbase.com/docs/crunchbase-basic-getting-started",+ "columns": _columns(+ first_name="First name of the person.",+ last_name="Last name of the person.",+ ),+ },+ "funding_rounds": {+ "description": "A funding round raised by an organization in Crunchbase.",+ "docs_url": "https://data.crunchbase.com/docs/crunchbase-basic-getting-started",+ "columns": _columns(+ announced_on="Date the funding round was announced.",+ investment_type="Type of the funding round (e.g. seed, series_a, series_b).",+ money_raised="Total amount of money raised in the funding round.",+ funded_organization_identifier="The organization that raised the funding round.",+ num_investors="Number of investors that participated in the funding round.",+ ),+ },+ "acquisitions": {+ "description": "An acquisition of one organization by another in Crunchbase.",+ "docs_url": "https://data.crunchbase.com/docs/crunchbase-basic-getting-started",+ "columns": _columns(+ announced_on="Date the acquisition was announced.",+ acquirer_identifier="The organization that made the acquisition.",+ acquiree_identifier="The organization that was acquired.",+ price="Price paid for the acquisition.",+ ),+ },+ "investments": {+ "description": "An investment made by an investor into a funding round in Crunchbase.",+ "docs_url": "https://data.crunchbase.com/docs/crunchbase-basic-getting-started",+ "columns": _columns(+ announced_on="Date the investment was announced.",+ investor_identifier="The investor that made the investment.",+ funding_round_identifier="The funding round the investment was part of.",+ money_invested="Amount of money invested.",+ ),+ },+ "ipos": {+ "description": "An initial public offering (IPO) by an organization in Crunchbase.",+ "docs_url": "https://data.crunchbase.com/docs/crunchbase-basic-getting-started",+ "columns": _columns(+ went_public_on="Date the organization went public.",+ stock_symbol="Stock ticker symbol assigned at the IPO.",+ money_raised="Amount of money raised in the IPO.",+ valuation="Valuation of the organization at the IPO.",+ ),+ },+ "funds": {+ "description": "A fund raised by an investment firm in Crunchbase.",+ "docs_url": "https://data.crunchbase.com/docs/crunchbase-basic-getting-started",+ "columns": _columns(+ announced_on="Date the fund was announced.",+ money_raised="Total amount of money raised by the fund.",+ name="Name of the fund.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/crunchbase/source.py b/posthog/temporal/data_imports/sources/crunchbase/source.pyindex 1ab8d6dc0086..842a132a24d9 100644--- a/posthog/temporal/data_imports/sources/crunchbase/source.py+++ b/posthog/temporal/data_imports/sources/crunchbase/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -31,6 +32,11 @@ class CrunchbaseSource(ResumableSource[CrunchbaseSourceConfig, CrunchbaseResumeCdef source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.CRUNCHBASE+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.crunchbase.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized for url: https://api.crunchbase.com": "Crunchbase authentication failed. Please check your user key.",diff --git a/posthog/temporal/data_imports/sources/culture_amp/canonical_descriptions.py b/posthog/temporal/data_imports/sources/culture_amp/canonical_descriptions.pynew file mode 100644index 000000000000..9305b8a1f2c8--- /dev/null+++ b/posthog/temporal/data_imports/sources/culture_amp/canonical_descriptions.py@@ -0,0 +1,58 @@+"""Canonical, documentation-sourced descriptions for Culture Amp endpoints and columns.++Sourced from the official Culture Amp Public API reference (https://developer.cultureamp.com/).+Keyed by the endpoint names in `settings.py` `CULTURE_AMP_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Culture Amp table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "employees": {+ "description": "An employee record in the Culture Amp account, with profile and employment details.",+ "docs_url": "https://developer.cultureamp.com/reference/employees",+ "columns": {+ "id": "Unique identifier for the employee.",+ "email": "The employee's email address.",+ "name": "The employee's full name.",+ "employeeId": "The employer-assigned employee identifier.",+ "status": "Employment status of the employee (e.g. active, inactive).",+ "startDate": "Date the employee started employment.",+ "endDate": "Date the employee's employment ended, if applicable.",+ "processedAt": "Time at which the record was processed and made available via the public API.",+ },+ },+ "employee_demographics": {+ "description": "A single demographic attribute (name/value pair) for an employee.",+ "docs_url": "https://developer.cultureamp.com/reference/employee-demographics",+ "columns": {+ "_employee_id": "Identifier of the employee this demographic belongs to.",+ "name": "Name of the demographic attribute (e.g. department, location, gender).",+ "value": "Value of the demographic attribute for the employee.",+ },+ },+ "performance_cycles": {+ "description": "A performance evaluation cycle run for the account over a defined period.",+ "docs_url": "https://developer.cultureamp.com/reference/performance-evaluations",+ "columns": {+ "id": "Unique identifier for the performance cycle.",+ "name": "Name of the performance cycle.",+ "status": "Current status of the cycle (e.g. open, closed).",+ "startDate": "Date the performance cycle starts.",+ "endDate": "Date the performance cycle ends.",+ "processedAt": "Time at which the record was processed and made available via the public API.",+ },+ },+ "manager_reviews": {+ "description": "A manager's review of an employee within a performance evaluation cycle.",+ "docs_url": "https://developer.cultureamp.com/reference/performance-evaluations",+ "columns": {+ "managerReviewId": "Unique identifier for the manager review.",+ "performanceCycleId": "Identifier of the performance cycle this review belongs to.",+ "employeeId": "Identifier of the employee being reviewed.",+ "managerId": "Identifier of the manager who wrote the review.",+ "status": "Completion status of the review.",+ "processedAt": "Time at which the record was processed and made available via the public API.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/culture_amp/source.py b/posthog/temporal/data_imports/sources/culture_amp/source.pyindex cc5fad48571f..534c59acbdbf 100644--- a/posthog/temporal/data_imports/sources/culture_amp/source.py+++ b/posthog/temporal/data_imports/sources/culture_amp/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -81,6 +82,11 @@ An account admin can generate API credentials in Culture Amp under Settings > In),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.culture_amp.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: CultureAmpSourceConfig,diff --git a/posthog/temporal/data_imports/sources/customer_io/canonical_descriptions.py b/posthog/temporal/data_imports/sources/customer_io/canonical_descriptions.pynew file mode 100644index 000000000000..073518ec8bd1--- /dev/null+++ b/posthog/temporal/data_imports/sources/customer_io/canonical_descriptions.py@@ -0,0 +1,189 @@+"""Canonical, documentation-sourced descriptions for Customer.io endpoints and columns.++Sourced from the official Customer.io App API reference (https://docs.customer.io/api/app/) and the+Reporting Webhooks docs (https://customer.io/docs/journeys/reporting-webhooks/). Keyed by the schema+names in `constants.py` (`CIO_WEBHOOK_SCHEMA_NAMES` and `CIO_API_SCHEMA_NAMES`), which match the+`ExternalDataSchema.name` of a synced Customer.io table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions+from posthog.temporal.data_imports.sources.customer_io.constants import (+ CUSTOMER_RESOURCE_NAME,+ EMAIL_RESOURCE_NAME,+ IN_APP_RESOURCE_NAME,+ PUSH_RESOURCE_NAME,+ SLACK_RESOURCE_NAME,+ SMS_RESOURCE_NAME,+ WEBHOOK_RESOURCE_NAME,+)++# Fields shared by every reporting-webhook event row (flattened from the webhook payload).+_WEBHOOK_COLUMNS = {+ "event_id": "Unique identifier for the reporting-webhook event.",+ "timestamp": "Time at which the event occurred, as a Unix timestamp.",+ "metric": "The specific metric for the event (e.g. sent, delivered, opened, clicked, bounced).",+ "object_type": "Type of object the event is about (customer, email, push, sms, in_app, slack, webhook).",+ "delivery_id": "Identifier of the message delivery the event relates to.",+ "customer_id": "Identifier of the customer the event relates to.",+ "campaign_id": "Identifier of the campaign that triggered the message, if any.",+ "newsletter_id": "Identifier of the newsletter that triggered the message, if any.",+}+++def _webhook_columns(**overrides: str) -> dict[str, str]:+ return {**_WEBHOOK_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ # --- Reporting-webhook event tables ---+ CUSTOMER_RESOURCE_NAME: {+ "description": "Customer subscription events delivered via the Customer.io reporting webhook.",+ "docs_url": "https://customer.io/docs/journeys/reporting-webhooks/",+ "columns": _webhook_columns(+ email_address="Email address of the customer the subscription event relates to.",+ ),+ },+ EMAIL_RESOURCE_NAME: {+ "description": "Email message activity events (sent, delivered, opened, clicked, bounced, etc.) delivered via the reporting webhook.",+ "docs_url": "https://customer.io/docs/journeys/reporting-webhooks/",+ "columns": _webhook_columns(+ recipient="Email address the message was sent to.",+ subject="Subject line of the email.",+ href="URL that was clicked, for click events.",+ ),+ },+ PUSH_RESOURCE_NAME: {+ "description": "Push notification activity events delivered via the reporting webhook.",+ "docs_url": "https://customer.io/docs/journeys/reporting-webhooks/",+ "columns": _webhook_columns(),+ },+ SMS_RESOURCE_NAME: {+ "description": "SMS message activity events delivered via the reporting webhook.",+ "docs_url": "https://customer.io/docs/journeys/reporting-webhooks/",+ "columns": _webhook_columns(+ recipient="Phone number the SMS was sent to.",+ ),+ },+ IN_APP_RESOURCE_NAME: {+ "description": "In-app message activity events delivered via the reporting webhook.",+ "docs_url": "https://customer.io/docs/journeys/reporting-webhooks/",+ "columns": _webhook_columns(),+ },+ SLACK_RESOURCE_NAME: {+ "description": "Slack message activity events delivered via the reporting webhook.",+ "docs_url": "https://customer.io/docs/journeys/reporting-webhooks/",+ "columns": _webhook_columns(),+ },+ WEBHOOK_RESOURCE_NAME: {+ "description": "Outgoing webhook (reporting) action events delivered via the reporting webhook.",+ "docs_url": "https://customer.io/docs/journeys/reporting-webhooks/",+ "columns": _webhook_columns(),+ },+ # --- App API list endpoints ---+ "broadcasts": {+ "description": "A broadcast — a one-time message sent to a segment or list of recipients.",+ "docs_url": "https://docs.customer.io/api/app/#operation/listBroadcasts",+ "columns": {+ "id": "Unique identifier for the broadcast.",+ "name": "Name of the broadcast.",+ "type": "Type of the broadcast (e.g. email, push).",+ "state": "Current state of the broadcast (e.g. draft, active, stopped).",+ "created": "Time at which the broadcast was created, as a Unix timestamp.",+ "updated": "Time at which the broadcast was last updated, as a Unix timestamp.",+ "active": "Whether the broadcast is currently active.",+ },+ },+ "campaigns": {+ "description": "A campaign — an automated, triggered messaging workflow.",+ "docs_url": "https://docs.customer.io/api/app/#operation/listCampaigns",+ "columns": {+ "id": "Unique identifier for the campaign.",+ "name": "Name of the campaign.",+ "type": "Type of the campaign (e.g. triggered, event).",+ "state": "Current state of the campaign (e.g. draft, running, stopped).",+ "created": "Time at which the campaign was created, as a Unix timestamp.",+ "updated": "Time at which the campaign was last updated, as a Unix timestamp.",+ "active": "Whether the campaign is currently active.",+ },+ },+ "collections": {+ "description": "A collection — structured reference data you can use in message content.",+ "docs_url": "https://docs.customer.io/api/app/#operation/listCollections",+ "columns": {+ "id": "Unique identifier for the collection.",+ "name": "Name of the collection.",+ "created_at": "Time at which the collection was created, as a Unix timestamp.",+ "updated_at": "Time at which the collection was last updated, as a Unix timestamp.",+ "rows": "Number of rows in the collection.",+ },+ },+ "newsletters": {+ "description": "A newsletter — a one-off email sent to a segment of customers.",+ "docs_url": "https://docs.customer.io/api/app/#operation/listNewsletters",+ "columns": {+ "id": "Unique identifier for the newsletter.",+ "name": "Name of the newsletter.",+ "type": "Type of the newsletter.",+ "created": "Time at which the newsletter was created, as a Unix timestamp.",+ "updated": "Time at which the newsletter was last updated, as a Unix timestamp.",+ },+ },+ "object_types": {+ "description": "An object type — a category of non-person objects (e.g. companies, accounts) in the workspace.",+ "docs_url": "https://docs.customer.io/api/app/#operation/listObjectTypes",+ "columns": {+ "id": "Unique identifier for the object type.",+ "name": "Name of the object type.",+ },+ },+ "segments": {+ "description": "A segment — a group of customers defined by attributes or behavior.",+ "docs_url": "https://docs.customer.io/api/app/#operation/listSegments",+ "columns": {+ "id": "Unique identifier for the segment.",+ "name": "Name of the segment.",+ "description": "Description of the segment.",+ "type": "Type of segment (e.g. dynamic, manual).",+ "created_at": "Time at which the segment was created, as a Unix timestamp.",+ "updated_at": "Time at which the segment was last updated, as a Unix timestamp.",+ },+ },+ "sender_identities": {+ "description": "A sender identity — a configured from-name/address used to send messages.",+ "docs_url": "https://docs.customer.io/api/app/#operation/listSenderIdentities",+ "columns": {+ "id": "Unique identifier for the sender identity.",+ "name": "Display name of the sender.",+ "email": "Email address the sender sends from.",+ },+ },+ "snippets": {+ "description": "A snippet — a reusable block of content for message templates.",+ "docs_url": "https://docs.customer.io/api/app/#operation/listSnippets",+ "columns": {+ "name": "Name of the snippet (its natural key within the workspace).",+ "value": "Content of the snippet.",+ },+ },+ "subscription_topics": {+ "description": "A subscription topic — a category customers can opt in or out of.",+ "docs_url": "https://docs.customer.io/api/app/#operation/listSubscriptionTopics",+ "columns": {+ "id": "Unique identifier for the subscription topic.",+ "name": "Name of the subscription topic.",+ "description": "Description of the subscription topic.",+ "state": "Current state of the subscription topic.",+ },+ },+ "transactional": {+ "description": "A transactional message — a template for one-off, triggered messages such as receipts or password resets.",+ "docs_url": "https://docs.customer.io/api/app/#operation/listTransactional",+ "columns": {+ "id": "Unique identifier for the transactional message.",+ "name": "Name of the transactional message.",+ "description": "Description of the transactional message.",+ "created_at": "Time at which the message was created, as a Unix timestamp.",+ "updated_at": "Time at which the message was last updated, as a Unix timestamp.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/customer_io/source.py b/posthog/temporal/data_imports/sources/customer_io/source.pyindex 5b9cedcb2c42..98b8b97ed38c 100644--- a/posthog/temporal/data_imports/sources/customer_io/source.py+++ b/posthog/temporal/data_imports/sources/customer_io/source.py@@ -26,6 +26,7 @@ from posthog.temporal.data_imports.sources.common.base import (WebhookDeletionResult,WebhookSource,)+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.schema import SourceSchemafrom posthog.temporal.data_imports.sources.common.webhook_s3 import WebhookSourceManager@@ -182,6 +183,11 @@ class CustomerIOSource(),}+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.customer_io.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: CustomerIOSourceConfig,diff --git a/posthog/temporal/data_imports/sources/datadog/canonical_descriptions.py b/posthog/temporal/data_imports/sources/datadog/canonical_descriptions.pynew file mode 100644index 000000000000..22278180a2ec--- /dev/null+++ b/posthog/temporal/data_imports/sources/datadog/canonical_descriptions.py@@ -0,0 +1,144 @@+"""Canonical, documentation-sourced descriptions for Datadog endpoints and columns.++Sourced from the official Datadog API reference (https://docs.datadoghq.com/api/latest/). Keyed by the+endpoint names in `settings.py` `DATADOG_ENDPOINTS`, which match the `ExternalDataSchema.name` of a+synced Datadog table. v2 endpoints have their JSON:API `attributes` flattened to the root, so column+names below reflect the flattened shape. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "logs": {+ "description": "A single log event ingested into Datadog Log Management.",+ "docs_url": "https://docs.datadoghq.com/api/latest/logs/#search-logs",+ "columns": {+ "id": "Unique identifier for the log event.",+ "timestamp": "Time at which the log event occurred.",+ "message": "The log message body.",+ "status": "Severity status of the log (e.g. info, warn, error).",+ "service": "Name of the service that emitted the log.",+ "host": "Host that emitted the log.",+ "tags": "Tags attached to the log event.",+ "attributes": "Structured attributes parsed from the log.",+ },+ },+ "audit_logs": {+ "description": "An audit trail event recording a change or action in the Datadog account.",+ "docs_url": "https://docs.datadoghq.com/api/latest/audit/#search-audit-logs-events",+ "columns": {+ "id": "Unique identifier for the audit event.",+ "timestamp": "Time at which the audited action occurred.",+ "message": "Description of the audited action.",+ "service": "Service or product area the action relates to.",+ "tags": "Tags attached to the audit event.",+ },+ },+ "events": {+ "description": "An event from the Datadog event stream (alerts, deployments, comments, and more).",+ "docs_url": "https://docs.datadoghq.com/api/latest/events/#get-a-list-of-events",+ "columns": {+ "id": "Unique identifier for the event.",+ "timestamp": "Time at which the event occurred.",+ "title": "Title of the event.",+ "message": "Body text of the event.",+ "tags": "Tags attached to the event.",+ "aggregation_key": "Key used to group related events together.",+ },+ },+ "dashboards": {+ "description": "A Datadog dashboard — a configurable set of widgets visualizing metrics and logs.",+ "docs_url": "https://docs.datadoghq.com/api/latest/dashboards/#get-all-dashboards",+ "columns": {+ "id": "Unique identifier for the dashboard.",+ "title": "Title of the dashboard.",+ "description": "Description of the dashboard.",+ "url": "Relative URL of the dashboard within Datadog.",+ "layout_type": "Layout type of the dashboard (e.g. ordered, free).",+ "author_handle": "Handle of the user who created the dashboard.",+ "created_at": "Time at which the dashboard was created.",+ "modified_at": "Time at which the dashboard was last modified.",+ "is_read_only": "Whether the dashboard is read-only.",+ },+ },+ "monitors": {+ "description": "A monitor that watches a metric, log, or check and alerts when conditions are met.",+ "docs_url": "https://docs.datadoghq.com/api/latest/monitors/#get-all-monitor-details",+ "columns": {+ "id": "Unique identifier for the monitor.",+ "name": "Name of the monitor.",+ "type": "Type of the monitor (e.g. metric alert, log alert).",+ "query": "The query that defines the monitor's alerting condition.",+ "message": "Notification message sent when the monitor triggers.",+ "overall_state": "Current overall state of the monitor (e.g. OK, Alert, No Data).",+ "tags": "Tags attached to the monitor.",+ "created": "Time at which the monitor was created.",+ "modified": "Time at which the monitor was last modified.",+ },+ },+ "users": {+ "description": "A user account in the Datadog organization.",+ "docs_url": "https://docs.datadoghq.com/api/latest/users/#list-all-users",+ "columns": {+ "id": "Unique identifier for the user.",+ "name": "The user's full name.",+ "email": "The user's email address.",+ "handle": "The user's handle (login identifier).",+ "status": "Status of the user account (e.g. active, pending, disabled).",+ "disabled": "Whether the user account is disabled.",+ "created_at": "Time at which the user account was created.",+ "modified_at": "Time at which the user account was last modified.",+ },+ },+ "incidents": {+ "description": "An incident tracked in Datadog Incident Management.",+ "docs_url": "https://docs.datadoghq.com/api/latest/incidents/#get-a-list-of-incidents",+ "columns": {+ "id": "Unique identifier for the incident.",+ "title": "Title of the incident.",+ "severity": "Severity level of the incident.",+ "state": "Current state of the incident (e.g. active, stable, resolved).",+ "customer_impacted": "Whether customers were impacted by the incident.",+ "created": "Time at which the incident was created.",+ "modified": "Time at which the incident was last modified.",+ "resolved": "Time at which the incident was resolved, if applicable.",+ },+ },+ "slos": {+ "description": "A service level objective (SLO) defining a reliability target over a time window.",+ "docs_url": "https://docs.datadoghq.com/api/latest/service-level-objectives/#get-all-slos",+ "columns": {+ "id": "Unique identifier for the SLO.",+ "name": "Name of the SLO.",+ "description": "Description of the SLO.",+ "type": "Type of the SLO (e.g. metric, monitor).",+ "tags": "Tags attached to the SLO.",+ "created_at": "Time at which the SLO was created, as a Unix timestamp.",+ "modified_at": "Time at which the SLO was last modified, as a Unix timestamp.",+ },+ },+ "synthetic_tests": {+ "description": "A Synthetic monitoring test (API or browser test) that probes endpoints or flows.",+ "docs_url": "https://docs.datadoghq.com/api/latest/synthetics/#get-the-list-of-all-synthetic-tests",+ "columns": {+ "public_id": "Public identifier for the synthetic test.",+ "name": "Name of the synthetic test.",+ "type": "Type of the test (e.g. api, browser).",+ "subtype": "Subtype of the test (e.g. http, ssl, dns).",+ "status": "Status of the test (e.g. live, paused).",+ "tags": "Tags attached to the test.",+ },+ },+ "downtimes": {+ "description": "A scheduled downtime that mutes monitor alerts over a time window.",+ "docs_url": "https://docs.datadoghq.com/api/latest/downtimes/#get-all-downtimes",+ "columns": {+ "id": "Unique identifier for the downtime.",+ "message": "Message attached to the downtime.",+ "scope": "Scope of monitors the downtime applies to.",+ "status": "Current status of the downtime (e.g. active, canceled, scheduled).",+ "created": "Time at which the downtime was created.",+ "modified": "Time at which the downtime was last modified.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/datadog/source.py b/posthog/temporal/data_imports/sources/datadog/source.pyindex a18f5b518cdc..f02bbd36dbf0 100644--- a/posthog/temporal/data_imports/sources/datadog/source.py+++ b/posthog/temporal/data_imports/sources/datadog/source.py@@ -13,6 +13,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -107,6 +108,11 @@ Logs, audit logs, and events read access is governed by your Datadog account's d"403 Client Error": "Your Datadog application key is missing the required read scopes for this data. Grant the scopes and reconnect.",}+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.datadog.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: DatadogSourceConfig,diff --git a/posthog/temporal/data_imports/sources/deel/canonical_descriptions.py b/posthog/temporal/data_imports/sources/deel/canonical_descriptions.pynew file mode 100644index 000000000000..10f57897869d--- /dev/null+++ b/posthog/temporal/data_imports/sources/deel/canonical_descriptions.py@@ -0,0 +1,67 @@+"""Canonical, documentation-sourced descriptions for Deel endpoints and columns.++Sourced from the official Deel API reference (https://developer.deel.com/reference). Keyed by the+endpoint names in `settings.py` `DEEL_ENDPOINTS`, which match the `ExternalDataSchema.name` of a+synced Deel table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "people": {+ "description": "A worker in the organization — an employee or contractor managed in Deel.",+ "docs_url": "https://developer.deel.com/reference/getpeoplelist",+ "columns": {+ "id": "Unique identifier for the person.",+ "first_name": "The person's first name.",+ "last_name": "The person's last name.",+ "full_name": "The person's full name.",+ "emails": "Email addresses associated with the person.",+ "hiring_status": "Current hiring status of the person (e.g. active, inactive).",+ "hiring_type": "Type of engagement (e.g. employee, contractor).",+ "start_date": "Date the person started with the organization.",+ "job_title": "The person's job title.",+ "country": "Country the person is based in.",+ },+ },+ "contracts": {+ "description": "A work agreement between the organization and a worker in Deel.",+ "docs_url": "https://developer.deel.com/reference/getcontractlist",+ "columns": {+ "id": "Unique identifier for the contract.",+ "title": "Title of the contract.",+ "type": "Type of contract (e.g. ongoing_time_based, pay_as_you_go, milestone, eor).",+ "status": "Current status of the contract (e.g. in_progress, completed, cancelled).",+ "created_at": "Time at which the contract was created.",+ "currency": "Currency the contract is denominated in.",+ "client_name": "Name of the client party on the contract.",+ "worker_name": "Name of the worker on the contract.",+ },+ },+ "invoices": {+ "description": "An invoice issued for a contract or payroll cycle in Deel.",+ "docs_url": "https://developer.deel.com/reference/getinvoicelist",+ "columns": {+ "id": "Unique identifier for the invoice.",+ "contract_id": "Identifier of the contract this invoice relates to.",+ "status": "Current status of the invoice (e.g. paid, pending, processing).",+ "currency": "Currency the invoice is denominated in.",+ "total": "Total amount of the invoice.",+ "issued_at": "Date the invoice was issued.",+ "paid_at": "Date the invoice was paid, if applicable.",+ },+ },+ "invoice_adjustments": {+ "description": "An adjustment (bonus, deduction, expense, etc.) applied to a Deel invoice.",+ "docs_url": "https://developer.deel.com/reference/getinvoiceadjustmentslist",+ "columns": {+ "id": "Unique identifier for the invoice adjustment.",+ "contract_id": "Identifier of the contract this adjustment relates to.",+ "type": "Type of adjustment (e.g. bonus, deduction, expense, overtime).",+ "title": "Title or description of the adjustment.",+ "amount": "Amount of the adjustment.",+ "currency": "Currency the adjustment is denominated in.",+ "status": "Current status of the adjustment.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/deel/source.py b/posthog/temporal/data_imports/sources/deel/source.pyindex 8af30703276e..37f1d4568537 100644--- a/posthog/temporal/data_imports/sources/deel/source.py+++ b/posthog/temporal/data_imports/sources/deel/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -64,6 +65,11 @@ Create an organization token in [Deel](https://app.deel.com/developer-center) un),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.deel.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: DeelSourceConfig,diff --git a/posthog/temporal/data_imports/sources/delighted/canonical_descriptions.py b/posthog/temporal/data_imports/sources/delighted/canonical_descriptions.pynew file mode 100644index 000000000000..02ec6a93367d--- /dev/null+++ b/posthog/temporal/data_imports/sources/delighted/canonical_descriptions.py@@ -0,0 +1,77 @@+"""Canonical, documentation-sourced descriptions for Delighted endpoints and columns.++Sourced from the official Delighted API reference (https://app.delighted.com/docs/api). Keyed by the+endpoint names in `settings.py` `DELIGHTED_ENDPOINTS`, which match the `ExternalDataSchema.name` of a+synced Delighted table. Delighted timestamps are UNIX epoch seconds. Columns absent here fall back to+LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "survey_responses": {+ "description": "A customer's response to a Delighted survey, including the score and any comment.",+ "docs_url": "https://app.delighted.com/docs/api/listing-survey-responses",+ "columns": {+ "id": "Unique identifier for the survey response.",+ "person": "The person who submitted the response (may be null for anonymous eNPS).",+ "person_id": "Identifier of the person who submitted the response.",+ "survey_type": "Type of survey the response is for (e.g. nps, csat, ces, smileys).",+ "score": "The numeric score the respondent gave.",+ "comment": "Free-text comment left by the respondent.",+ "permalink": "URL to view the response in Delighted.",+ "created_at": "Time the response was created, as a Unix timestamp.",+ "updated_at": "Time the response was last updated, as a Unix timestamp.",+ "notes": "Internal notes added to the response.",+ "tags": "Tags applied to the response.",+ "additional_answers": "Answers to any additional survey questions.",+ },+ },+ "people": {+ "description": "A person in Delighted who can be surveyed, with contact details and metadata.",+ "docs_url": "https://app.delighted.com/docs/api/listing-people",+ "columns": {+ "id": "Unique identifier for the person.",+ "name": "The person's name.",+ "email": "The person's email address.",+ "phone_number": "The person's phone number.",+ "created_at": "Time the person was created, as a Unix timestamp.",+ "last_sent_at": "Time a survey was last sent to the person, as a Unix timestamp.",+ "last_responded_at": "Time the person last responded to a survey, as a Unix timestamp.",+ },+ },+ "unsubscribes": {+ "description": "A person who has unsubscribed from Delighted surveys.",+ "docs_url": "https://app.delighted.com/docs/api/listing-unsubscribes",+ "columns": {+ "person_id": "Identifier of the person who unsubscribed.",+ "email": "Email address of the person who unsubscribed.",+ "name": "Name of the person who unsubscribed.",+ "unsubscribed_at": "Time the person unsubscribed, as a Unix timestamp.",+ },+ },+ "bounces": {+ "description": "A person whose survey email bounced and could not be delivered.",+ "docs_url": "https://app.delighted.com/docs/api/listing-bounces",+ "columns": {+ "person_id": "Identifier of the person whose email bounced.",+ "email": "Email address that bounced.",+ "name": "Name of the person whose email bounced.",+ "bounced_at": "Time the email bounced, as a Unix timestamp.",+ },+ },+ "metrics": {+ "description": "A point-in-time snapshot of the account's aggregate survey metrics (e.g. NPS).",+ "docs_url": "https://app.delighted.com/docs/api/getting-metrics",+ "columns": {+ "nps": "Net Promoter Score for the period.",+ "promoter_count": "Number of promoter responses.",+ "promoter_percent": "Percentage of responses that were promoters.",+ "passive_count": "Number of passive responses.",+ "passive_percent": "Percentage of responses that were passives.",+ "detractor_count": "Number of detractor responses.",+ "detractor_percent": "Percentage of responses that were detractors.",+ "response_count": "Total number of responses in the period.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/delighted/source.py b/posthog/temporal/data_imports/sources/delighted/source.pyindex 5ed19cad6519..eba38fef5a20 100644--- a/posthog/temporal/data_imports/sources/delighted/source.py+++ b/posthog/temporal/data_imports/sources/delighted/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -64,6 +65,11 @@ You can find your API key in your Delighted account under **Settings → API**.),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.delighted.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: DelightedSourceConfig,diff --git a/posthog/temporal/data_imports/sources/dixa/canonical_descriptions.py b/posthog/temporal/data_imports/sources/dixa/canonical_descriptions.pynew file mode 100644index 000000000000..59261f0fd6a3--- /dev/null+++ b/posthog/temporal/data_imports/sources/dixa/canonical_descriptions.py@@ -0,0 +1,71 @@+"""Canonical, documentation-sourced descriptions for Dixa endpoints and columns.++Sourced from the official Dixa API reference (https://docs.dixa.io/) — both the main API+(dev.dixa.io/v1) and the Exports API (exports.dixa.io/v1). Keyed by the endpoint names in+`settings.py` `DIXA_ENDPOINTS`, which match the `ExternalDataSchema.name` of a synced Dixa table.+Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "conversations": {+ "description": "A customer service conversation from the Dixa Exports API, with timing and handling metrics.",+ "docs_url": "https://docs.dixa.io/openapi/dixa-api/v1/tag/Conversation-Export/",+ "columns": {+ "id": "Unique identifier for the conversation.",+ "csid": "Conversation (case) sequence identifier shown in the Dixa UI.",+ "channel": "Channel the conversation came through (e.g. email, chat, phone).",+ "status": "Current status of the conversation (e.g. open, pending, closed).",+ "direction": "Direction of the conversation (inbound or outbound).",+ "subject": "Subject line of the conversation.",+ "queue_id": "Identifier of the queue the conversation was assigned to.",+ "assignee_id": "Identifier of the agent assigned to the conversation.",+ "requester_id": "Identifier of the end user who initiated the conversation.",+ "created_at": "Time at which the conversation was created, as a Unix timestamp (ms).",+ "updated_at": "Time at which the conversation was last updated, as a Unix timestamp (ms).",+ "closed_at": "Time at which the conversation was closed, as a Unix timestamp (ms).",+ "tags": "Tags applied to the conversation.",+ },+ },+ "agents": {+ "description": "An agent (team member) in the Dixa account.",+ "docs_url": "https://docs.dixa.io/openapi/dixa-api/v1/tag/Agents/",+ "columns": {+ "id": "Unique identifier for the agent.",+ "displayName": "Display name of the agent.",+ "email": "Email address of the agent.",+ "phoneNumber": "Phone number of the agent.",+ "roles": "Roles assigned to the agent.",+ },+ },+ "endusers": {+ "description": "An end user (customer) record in the Dixa account.",+ "docs_url": "https://docs.dixa.io/openapi/dixa-api/v1/tag/End-Users/",+ "columns": {+ "id": "Unique identifier for the end user.",+ "displayName": "Display name of the end user.",+ "email": "Email address of the end user.",+ "phoneNumber": "Phone number of the end user.",+ "createdAt": "Time at which the end user was created.",+ },+ },+ "queues": {+ "description": "A queue that conversations are routed into for handling by agents.",+ "docs_url": "https://docs.dixa.io/openapi/dixa-api/v1/tag/Queues/",+ "columns": {+ "id": "Unique identifier for the queue.",+ "name": "Name of the queue.",+ "isDefault": "Whether this is the account's default queue.",+ },+ },+ "tags": {+ "description": "A tag that can be applied to conversations to categorize them.",+ "docs_url": "https://docs.dixa.io/openapi/dixa-api/v1/tag/Tags/",+ "columns": {+ "id": "Unique identifier for the tag.",+ "name": "Name of the tag.",+ "state": "State of the tag (e.g. active, deactivated).",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/dixa/source.py b/posthog/temporal/data_imports/sources/dixa/source.pyindex 67b74ef8d1a2..eb2e42d613d3 100644--- a/posthog/temporal/data_imports/sources/dixa/source.py+++ b/posthog/temporal/data_imports/sources/dixa/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -66,6 +67,11 @@ An admin can generate an API token in Dixa under Settings > Integrations > API T),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.dixa.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: DixaSourceConfig,diff --git a/posthog/temporal/data_imports/sources/drip/canonical_descriptions.py b/posthog/temporal/data_imports/sources/drip/canonical_descriptions.pynew file mode 100644index 000000000000..a34fdc81db44--- /dev/null+++ b/posthog/temporal/data_imports/sources/drip/canonical_descriptions.py@@ -0,0 +1,89 @@+"""Canonical, documentation-sourced descriptions for Drip endpoints and columns.++Sourced from the official Drip REST API reference (https://developer.drip.com/). Keyed by the+endpoint names in `settings.py` `DRIP_ENDPOINTS`, which match the `ExternalDataSchema.name` of a+synced Drip table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "subscribers": {+ "description": "A person on a Drip account's email list, with their contact details and engagement state.",+ "docs_url": "https://developer.drip.com/#subscribers",+ "columns": {+ "id": "Unique identifier for the subscriber.",+ "status": "Subscription status (e.g. active, unsubscribed).",+ "email": "The subscriber's email address.",+ "first_name": "The subscriber's first name.",+ "last_name": "The subscriber's last name.",+ "time_zone": "The subscriber's time zone.",+ "ip_address": "IP address recorded for the subscriber.",+ "user_agent": "User agent string recorded for the subscriber.",+ "lifetime_value": "Total revenue attributed to the subscriber, in cents.",+ "custom_fields": "Custom field key-value pairs set on the subscriber.",+ "tags": "List of tags applied to the subscriber.",+ "created_at": "Time at which the subscriber was created.",+ "updated_at": "Time at which the subscriber was last updated.",+ },+ },+ "campaigns": {+ "description": "An email series (drip campaign) that subscribers are enrolled into.",+ "docs_url": "https://developer.drip.com/#campaigns",+ "columns": {+ "id": "Unique identifier for the campaign.",+ "name": "The campaign's name.",+ "status": "Campaign status (e.g. active, paused, draft).",+ "from_name": "Sender name used on the campaign's emails.",+ "from_email": "Sender email address used on the campaign's emails.",+ "subscriber_count": "Number of subscribers currently in the campaign.",+ "created_at": "Time at which the campaign was created.",+ },+ },+ "broadcasts": {+ "description": "A one-time email blast sent to a segment of subscribers.",+ "docs_url": "https://developer.drip.com/#broadcasts",+ "columns": {+ "id": "Unique identifier for the broadcast.",+ "name": "The broadcast's name.",+ "status": "Broadcast status (e.g. draft, scheduled, sent).",+ "subject": "Subject line of the broadcast email.",+ "from_name": "Sender name used on the broadcast.",+ "from_email": "Sender email address used on the broadcast.",+ "send_at": "Time the broadcast is scheduled to send or was sent.",+ "created_at": "Time at which the broadcast was created.",+ },+ },+ "workflows": {+ "description": "An automation workflow that moves subscribers through a series of triggers and actions.",+ "docs_url": "https://developer.drip.com/#workflows",+ "columns": {+ "id": "Unique identifier for the workflow.",+ "name": "The workflow's name.",+ "state": "Workflow state (e.g. active, paused, draft).",+ "created_at": "Time at which the workflow was created.",+ },+ },+ "forms": {+ "description": "A signup form used to capture new subscribers into the account.",+ "docs_url": "https://developer.drip.com/#forms",+ "columns": {+ "id": "Unique identifier for the form.",+ "name": "The form's name.",+ "status": "Form status (e.g. active, inactive).",+ "submission_count": "Number of submissions the form has received.",+ "conversion_count": "Number of submissions that converted to subscribers.",+ "created_at": "Time at which the form was created.",+ },+ },+ "goals": {+ "description": "A conversion goal that tracks when subscribers complete a defined action.",+ "docs_url": "https://developer.drip.com/#goals",+ "columns": {+ "id": "Unique identifier for the goal.",+ "name": "The goal's name.",+ "status": "Goal status (e.g. active, inactive).",+ "created_at": "Time at which the goal was created.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/drip/source.py b/posthog/temporal/data_imports/sources/drip/source.pyindex 1f08699fc89a..6e1219d36683 100644--- a/posthog/temporal/data_imports/sources/drip/source.py+++ b/posthog/temporal/data_imports/sources/drip/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -31,6 +32,11 @@ class DripSource(ResumableSource[DripSourceConfig, DripResumeConfig]):def source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.DRIP+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.drip.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized for url: https://api.getdrip.com": "Your Drip API token is invalid or expired. Please generate a new token and reconnect.",diff --git a/posthog/temporal/data_imports/sources/eventbrite/canonical_descriptions.py b/posthog/temporal/data_imports/sources/eventbrite/canonical_descriptions.pynew file mode 100644index 000000000000..c88e830a9221--- /dev/null+++ b/posthog/temporal/data_imports/sources/eventbrite/canonical_descriptions.py@@ -0,0 +1,129 @@+"""Canonical, documentation-sourced descriptions for Eventbrite endpoints and columns.++Sourced from the official Eventbrite API reference (https://www.eventbrite.com/platform/api).+Keyed by the endpoint names in `settings.py` `EVENTBRITE_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Eventbrite table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "organizations": {+ "description": "An Eventbrite organization (account) that owns events, venues, and orders.",+ "docs_url": "https://www.eventbrite.com/platform/api#/reference/organization",+ "columns": {+ "id": "Unique identifier for the organization.",+ "name": "The organization's name.",+ "vertical": "The organization's business vertical.",+ "image_id": "Identifier of the organization's logo image.",+ },+ },+ "categories": {+ "description": "A top-level event category in Eventbrite's taxonomy (e.g. Music, Business).",+ "docs_url": "https://www.eventbrite.com/platform/api#/reference/category",+ "columns": {+ "id": "Unique identifier for the category.",+ "name": "Localized display name of the category.",+ "name_localized": "Localized name of the category.",+ "short_name": "Short display name of the category.",+ },+ },+ "formats": {+ "description": "An event format describing the style of an event (e.g. Conference, Seminar).",+ "docs_url": "https://www.eventbrite.com/platform/api#/reference/format",+ "columns": {+ "id": "Unique identifier for the format.",+ "name": "Display name of the format.",+ "short_name": "Short display name of the format.",+ },+ },+ "events": {+ "description": "An event published by an organization, with its schedule, status, and venue.",+ "docs_url": "https://www.eventbrite.com/platform/api#/reference/event",+ "columns": {+ "id": "Unique identifier for the event.",+ "name": "The event's title (a multipart text object).",+ "description": "The event's description (a multipart text object).",+ "url": "Public Eventbrite URL of the event.",+ "start": "Event start time, with timezone and UTC representations.",+ "end": "Event end time, with timezone and UTC representations.",+ "created": "Time at which the event was created.",+ "changed": "Time at which the event was last changed.",+ "status": "Event status (e.g. draft, live, started, ended, completed, canceled).",+ "currency": "ISO 4217 currency code used for the event's tickets.",+ "online_event": "Whether the event is held online.",+ "organization_id": "ID of the organization that owns the event.",+ "organizer_id": "ID of the organizer presenting the event.",+ "venue_id": "ID of the venue where the event is held, if any.",+ "category_id": "ID of the event's category.",+ "format_id": "ID of the event's format.",+ "capacity": "Maximum number of attendees for the event.",+ },+ },+ "venues": {+ "description": "A physical location where an organization's events are held.",+ "docs_url": "https://www.eventbrite.com/platform/api#/reference/venue",+ "columns": {+ "id": "Unique identifier for the venue.",+ "name": "The venue's name.",+ "address": "Structured postal address of the venue.",+ "latitude": "Latitude of the venue's location.",+ "longitude": "Longitude of the venue's location.",+ "capacity": "Maximum capacity of the venue.",+ },+ },+ "orders": {+ "description": "An order placed by an attendee to purchase tickets to an event.",+ "docs_url": "https://www.eventbrite.com/platform/api#/reference/order",+ "columns": {+ "id": "Unique identifier for the order.",+ "event_id": "ID of the event the order is for.",+ "created": "Time at which the order was created.",+ "changed": "Time at which the order was last changed.",+ "name": "Full name of the buyer.",+ "first_name": "First name of the buyer.",+ "last_name": "Last name of the buyer.",+ "email": "Email address of the buyer.",+ "status": "Order status (e.g. placed, refunded, deleted).",+ "costs": "Breakdown of the order's costs (base price, fees, tax, total).",+ "time_remaining": "Seconds remaining to complete the order, if pending.",+ },+ },+ "attendees": {+ "description": "An attendee on an order — one ticket holder for an event.",+ "docs_url": "https://www.eventbrite.com/platform/api#/reference/attendee",+ "columns": {+ "id": "Unique identifier for the attendee.",+ "event_id": "ID of the event the attendee is registered for.",+ "order_id": "ID of the order the attendee belongs to.",+ "ticket_class_id": "ID of the ticket class the attendee holds.",+ "created": "Time at which the attendee record was created.",+ "changed": "Time at which the attendee record was last changed.",+ "status": "Attendee status (e.g. Attending, Not Attending, Checked In).",+ "checked_in": "Whether the attendee has been checked in.",+ "cancelled": "Whether the attendee has been cancelled.",+ "refunded": "Whether the attendee's ticket has been refunded.",+ "profile": "Attendee profile details (name, email, and custom answers).",+ "costs": "Cost breakdown for the attendee's ticket.",+ "quantity": "Number of tickets in this attendee record.",+ },+ },+ "ticket_classes": {+ "description": "A type of ticket sold for an event, with its price and availability.",+ "docs_url": "https://www.eventbrite.com/platform/api#/reference/ticket-class",+ "columns": {+ "id": "Unique identifier for the ticket class.",+ "event_id": "ID of the event this ticket class belongs to.",+ "name": "The ticket class's name.",+ "description": "Description of the ticket class.",+ "cost": "Display price of the ticket, including currency and value.",+ "fee": "Eventbrite fee applied to the ticket.",+ "free": "Whether the ticket is free.",+ "quantity_total": "Total number of tickets available in this class.",+ "quantity_sold": "Number of tickets sold from this class.",+ "sales_start": "Time at which sales for this ticket class start.",+ "sales_end": "Time at which sales for this ticket class end.",+ "hidden": "Whether the ticket class is hidden from buyers.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/eventbrite/source.py b/posthog/temporal/data_imports/sources/eventbrite/source.pyindex 9a479d980b12..355bd6a72bae 100644--- a/posthog/temporal/data_imports/sources/eventbrite/source.py+++ b/posthog/temporal/data_imports/sources/eventbrite/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -89,6 +90,11 @@ The token needs read access to your organizations, events, orders, and attendeesreturn schemas+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.eventbrite.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized for url: https://www.eventbriteapi.com": "Your Eventbrite private token is invalid or has been revoked. Please generate a new token and reconnect.",diff --git a/posthog/temporal/data_imports/sources/freshdesk/canonical_descriptions.py b/posthog/temporal/data_imports/sources/freshdesk/canonical_descriptions.pynew file mode 100644index 000000000000..6b51e7417945--- /dev/null+++ b/posthog/temporal/data_imports/sources/freshdesk/canonical_descriptions.py@@ -0,0 +1,195 @@+"""Canonical, documentation-sourced descriptions for Freshdesk endpoints and columns.++Sourced from the official Freshdesk API v2 reference (https://developers.freshdesk.com/api/).+Keyed by the endpoint names in `settings.py` `FRESHDESK_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Freshdesk table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by most Freshdesk objects; merged into each entry so we don't repeat them.+_COMMON_COLUMNS = {+ "id": "Unique identifier for the object.",+ "created_at": "Time at which the object was created.",+ "updated_at": "Time at which the object was last updated.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "tickets": {+ "description": "A support request raised by a customer and tracked through to resolution.",+ "docs_url": "https://developers.freshdesk.com/api/#tickets",+ "columns": _columns(+ subject="Subject of the ticket.",+ description="Description (body) of the ticket, in HTML.",+ description_text="Plain-text version of the ticket description.",+ status="Status of the ticket (2=open, 3=pending, 4=resolved, 5=closed).",+ priority="Priority of the ticket (1=low, 2=medium, 3=high, 4=urgent).",+ source="Channel the ticket came in through (1=email, 2=portal, 3=phone, …).",+ type="Type categorizing the ticket (e.g. Question, Incident, Problem).",+ requester_id="ID of the contact who requested support.",+ responder_id="ID of the agent the ticket is assigned to.",+ group_id="ID of the group the ticket is assigned to.",+ company_id="ID of the company the requester belongs to.",+ email="Email address of the requester.",+ tags="List of tags applied to the ticket.",+ due_by="Time by which the ticket is due for resolution.",+ fr_due_by="Time by which the first response is due.",+ spam="Whether the ticket has been marked as spam.",+ ),+ },+ "contacts": {+ "description": "A customer or requester who can raise tickets with the helpdesk.",+ "docs_url": "https://developers.freshdesk.com/api/#contacts",+ "columns": _columns(+ name="The contact's full name.",+ email="The contact's primary email address.",+ phone="The contact's phone number.",+ mobile="The contact's mobile number.",+ company_id="ID of the company the contact belongs to.",+ active="Whether the contact has been verified.",+ address="The contact's address.",+ job_title="The contact's job title.",+ time_zone="The contact's time zone.",+ language="The contact's language.",+ tags="List of tags applied to the contact.",+ ),+ },+ "companies": {+ "description": "An organization that groups together related contacts.",+ "docs_url": "https://developers.freshdesk.com/api/#companies",+ "columns": _columns(+ name="The company's name.",+ description="Description of the company.",+ domains="List of email domains associated with the company.",+ note="Free-form note about the company.",+ health_score="The company's health score.",+ account_tier="Account tier of the company.",+ industry="Industry the company operates in.",+ ),+ },+ "agents": {+ "description": "A helpdesk agent who responds to and works on tickets.",+ "docs_url": "https://developers.freshdesk.com/api/#agents",+ "columns": _columns(+ available="Whether the agent is accepting new tickets.",+ occasional="Whether the agent is an occasional (vs. full-time) agent.",+ ticket_scope="Scope of tickets the agent can access (1=global, 2=group, 3=restricted).",+ group_ids="IDs of the groups the agent belongs to.",+ role_ids="IDs of the roles assigned to the agent.",+ contact="The agent's contact details (name, email, phone).",+ ),+ },+ "groups": {+ "description": "A group of agents that tickets can be assigned to.",+ "docs_url": "https://developers.freshdesk.com/api/#groups",+ "columns": _columns(+ name="The group's name.",+ description="Description of the group.",+ agent_ids="IDs of the agents in the group.",+ business_hour_id="ID of the business hours applied to the group.",+ ),+ },+ "roles": {+ "description": "A role defining the set of privileges granted to agents.",+ "docs_url": "https://developers.freshdesk.com/api/#roles",+ "columns": _columns(+ name="The role's name.",+ description="Description of the role.",+ default="Whether this is a default (system) role.",+ ),+ },+ "products": {+ "description": "A product that tickets can be associated with.",+ "docs_url": "https://developers.freshdesk.com/api/#products",+ "columns": _columns(+ name="The product's name.",+ description="Description of the product.",+ ),+ },+ "skills": {+ "description": "A skill used to route tickets to agents with matching expertise.",+ "docs_url": "https://developers.freshdesk.com/api/#skills",+ "columns": _columns(+ name="The skill's name.",+ rank="Rank determining the skill's priority during routing.",+ agent_ids="IDs of the agents who have this skill.",+ ),+ },+ "ticket_fields": {+ "description": "A field on the ticket form, default or custom.",+ "docs_url": "https://developers.freshdesk.com/api/#ticket-fields",+ "columns": _columns(+ label="Label shown to agents for the field.",+ label_for_customers="Label shown to customers for the field.",+ name="Internal name of the field.",+ type="Data type of the field.",+ default="Whether this is a default (system) field.",+ required_for_closure="Whether the field is required to close a ticket.",+ position="Display position of the field on the form.",+ ),+ },+ "time_entries": {+ "description": "A record of time logged by an agent against a ticket.",+ "docs_url": "https://developers.freshdesk.com/api/#time-entries",+ "columns": _columns(+ ticket_id="ID of the ticket the time was logged against.",+ agent_id="ID of the agent who logged the time.",+ time_spent="Duration of time spent, in HH:MM.",+ billable="Whether the time entry is billable.",+ note="Note describing the work done.",+ timer_running="Whether the timer is currently running.",+ start_time="Time at which the timer was started.",+ executed_at="Time at which the work was performed.",+ ),+ },+ "satisfaction_ratings": {+ "description": "A customer satisfaction (CSAT) rating submitted for a ticket.",+ "docs_url": "https://developers.freshdesk.com/api/#csat",+ "columns": _columns(+ survey_id="ID of the satisfaction survey.",+ ticket_id="ID of the ticket the rating is for.",+ agent_id="ID of the agent who handled the ticket.",+ group_id="ID of the group the ticket was assigned to.",+ ratings="Map of survey question IDs to the customer's ratings.",+ feedback="Free-form feedback left by the customer.",+ user_id="ID of the customer who submitted the rating.",+ ),+ },+ "sla_policies": {+ "description": "An SLA policy defining response and resolution time targets for tickets.",+ "docs_url": "https://developers.freshdesk.com/api/#sla-policies",+ "columns": _columns(+ name="The SLA policy's name.",+ description="Description of the SLA policy.",+ position="Order in which the policy is evaluated.",+ active="Whether the SLA policy is active.",+ is_default="Whether this is the default SLA policy.",+ sla_target="Response and resolution targets per priority.",+ ),+ },+ "business_hours": {+ "description": "A set of working hours and holidays used for SLA calculations.",+ "docs_url": "https://developers.freshdesk.com/api/#business-hours",+ "columns": _columns(+ name="The business hours configuration's name.",+ description="Description of the business hours.",+ time_zone="Time zone the business hours apply in.",+ is_default="Whether this is the default business hours.",+ business_hours="Working hours for each day of the week.",+ ),+ },+ "canned_response_folders": {+ "description": "A folder grouping related canned (pre-written) agent responses.",+ "docs_url": "https://developers.freshdesk.com/api/#canned-response-folders",+ "columns": _columns(+ name="The folder's name.",+ personal="Whether the folder is personal to a single agent.",+ responses_count="Number of canned responses in the folder.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/freshdesk/source.py b/posthog/temporal/data_imports/sources/freshdesk/source.pyindex e08b90e6baf7..ca0e2821aac1 100644--- a/posthog/temporal/data_imports/sources/freshdesk/source.py+++ b/posthog/temporal/data_imports/sources/freshdesk/source.py@@ -12,6 +12,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -47,6 +48,11 @@ class FreshdeskSource(ResumableSource[FreshdeskSourceConfig, FreshdeskResumeConf# existing source must force the API key to be re-entered.return ["subdomain"]+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.freshdesk.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error": "Freshdesk authentication failed. Please check your API key and domain.",diff --git a/posthog/temporal/data_imports/sources/freshsales/canonical_descriptions.py b/posthog/temporal/data_imports/sources/freshsales/canonical_descriptions.pynew file mode 100644index 000000000000..9e03fafebd20--- /dev/null+++ b/posthog/temporal/data_imports/sources/freshsales/canonical_descriptions.py@@ -0,0 +1,151 @@+"""Canonical, documentation-sourced descriptions for Freshsales endpoints and columns.++Sourced from the official Freshsales (Freshworks CRM) API reference+(https://developers.freshworks.com/crm/api/). Keyed by the endpoint names in `settings.py`+`FRESHSALES_ENDPOINTS`, which match the `ExternalDataSchema.name` of a synced Freshsales table.+Some endpoints share an underlying resource but differ by filter (e.g. open_tasks vs completed_tasks).+Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by most Freshsales objects; merged into each entry so we don't repeat them.+_COMMON_COLUMNS = {+ "id": "Unique identifier for the object.",+ "created_at": "Time at which the object was created.",+ "updated_at": "Time at which the object was last updated.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++_TASK_COLUMNS = _columns(+ title="Title of the task.",+ description="Description of the task.",+ due_date="Date and time the task is due.",+ status="Status of the task (0=open, 1=completed).",+ owner_id="ID of the user who owns the task.",+ targetable_id="ID of the record the task is associated with.",+ targetable_type="Type of the record the task is associated with (e.g. Contact, Deal).",+ outcome_id="ID of the recorded outcome of the task.",+)++_APPOINTMENT_COLUMNS = _columns(+ title="Title of the appointment.",+ description="Description of the appointment.",+ location="Location of the appointment.",+ from_date="Start date and time of the appointment.",+ end_date="End date and time of the appointment.",+ creater_id="ID of the user who created the appointment.",+ targetable_id="ID of the record the appointment is associated with.",+ targetable_type="Type of the record the appointment is associated with.",+ is_allday="Whether the appointment lasts all day.",+ time_zone="Time zone of the appointment.",+)+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "contacts": {+ "description": "A person tracked in the CRM as a potential or existing customer.",+ "docs_url": "https://developers.freshworks.com/crm/api/#contacts",+ "columns": _columns(+ first_name="The contact's first name.",+ last_name="The contact's last name.",+ display_name="The contact's display name.",+ email="The contact's primary email address.",+ mobile_number="The contact's mobile number.",+ work_number="The contact's work phone number.",+ job_title="The contact's job title.",+ owner_id="ID of the user who owns the contact.",+ sales_account_id="ID of the account the contact belongs to.",+ lead_score="Lead score assigned to the contact.",+ last_contacted="Time the contact was last contacted.",+ city="City of the contact.",+ country="Country of the contact.",+ ),+ },+ "sales_accounts": {+ "description": "A company or organization tracked in the CRM.",+ "docs_url": "https://developers.freshworks.com/crm/api/#accounts",+ "columns": _columns(+ name="The account's name.",+ website="The account's website URL.",+ phone="The account's phone number.",+ industry_type_id="ID of the account's industry type.",+ owner_id="ID of the user who owns the account.",+ number_of_employees="Number of employees at the account.",+ annual_revenue="Annual revenue of the account.",+ city="City of the account.",+ country="Country of the account.",+ ),+ },+ "deals": {+ "description": "A sales opportunity tracked through the CRM's pipeline stages.",+ "docs_url": "https://developers.freshworks.com/crm/api/#deals",+ "columns": _columns(+ name="The deal's name.",+ amount="Monetary value of the deal.",+ currency_id="ID of the currency the deal amount is in.",+ deal_stage_id="ID of the pipeline stage the deal is in.",+ deal_pipeline_id="ID of the pipeline the deal belongs to.",+ owner_id="ID of the user who owns the deal.",+ sales_account_id="ID of the account the deal is associated with.",+ probability="Probability the deal will be won, as a percentage.",+ expected_close="Expected close date of the deal.",+ closed_date="Date the deal was closed.",+ stage_updated_time="Time the deal's stage was last updated.",+ ),+ },+ "leads": {+ "description": "An unqualified prospect not yet converted to a contact (legacy lead-based accounts).",+ "docs_url": "https://developers.freshworks.com/crm/api/#leads",+ "columns": _columns(+ first_name="The lead's first name.",+ last_name="The lead's last name.",+ display_name="The lead's display name.",+ email="The lead's email address.",+ mobile_number="The lead's mobile number.",+ company="Company details associated with the lead.",+ owner_id="ID of the user who owns the lead.",+ lead_score="Lead score assigned to the lead.",+ job_title="The lead's job title.",+ ),+ },+ "sales_activities": {+ "description": "A logged sales activity (call, email, meeting) recorded against a record.",+ "docs_url": "https://developers.freshworks.com/crm/api/#sales-activities",+ "columns": _columns(+ title="Title of the sales activity.",+ notes="Notes recorded for the activity.",+ sales_activity_type_id="ID of the activity type.",+ owner_id="ID of the user who owns the activity.",+ targetable_id="ID of the record the activity is associated with.",+ targetable_type="Type of the record the activity is associated with.",+ start_date="Start date and time of the activity.",+ end_date="End date and time of the activity.",+ location="Location of the activity.",+ ),+ },+ "open_tasks": {+ "description": "A task that is still open (incomplete).",+ "docs_url": "https://developers.freshworks.com/crm/api/#tasks",+ "columns": _TASK_COLUMNS,+ },+ "completed_tasks": {+ "description": "A task that has been completed.",+ "docs_url": "https://developers.freshworks.com/crm/api/#tasks",+ "columns": _TASK_COLUMNS,+ },+ "past_appointments": {+ "description": "An appointment whose scheduled time is in the past.",+ "docs_url": "https://developers.freshworks.com/crm/api/#appointments",+ "columns": _APPOINTMENT_COLUMNS,+ },+ "upcoming_appointments": {+ "description": "An appointment scheduled for the future.",+ "docs_url": "https://developers.freshworks.com/crm/api/#appointments",+ "columns": _APPOINTMENT_COLUMNS,+ },+}diff --git a/posthog/temporal/data_imports/sources/freshsales/source.py b/posthog/temporal/data_imports/sources/freshsales/source.pyindex b06ac5a53de4..47866560be9c 100644--- a/posthog/temporal/data_imports/sources/freshsales/source.py+++ b/posthog/temporal/data_imports/sources/freshsales/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -109,6 +110,11 @@ Both are available under **Profile settings → API settings** in Freshsales.return True, Nonereturn False, error+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.freshsales.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error": "Your Freshsales API key is invalid or expired. Please generate a new key and reconnect.",diff --git a/posthog/temporal/data_imports/sources/front/canonical_descriptions.py b/posthog/temporal/data_imports/sources/front/canonical_descriptions.pynew file mode 100644index 000000000000..af9d4410f0a1--- /dev/null+++ b/posthog/temporal/data_imports/sources/front/canonical_descriptions.py@@ -0,0 +1,129 @@+"""Canonical, documentation-sourced descriptions for Front endpoints and columns.++Sourced from the official Front API reference (https://dev.frontapp.com/reference). Keyed by the+endpoint names in `settings.py` `FRONT_ENDPOINTS`, which match the `ExternalDataSchema.name` of a+synced Front table. Front timestamps are Unix epoch seconds. Columns absent here fall back to LLM+enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "events": {+ "description": "An activity event in Front, such as a conversation being assigned, tagged, or moved.",+ "docs_url": "https://dev.frontapp.com/reference/events",+ "columns": {+ "id": "Unique identifier for the event.",+ "type": "Type of the event (e.g. assign, archive, inbound, comment).",+ "emitted_at": "Time at which the event was emitted, as Unix epoch seconds.",+ "conversation": "The conversation the event relates to.",+ "source": "The actor or system that triggered the event.",+ "target": "The object affected by the event.",+ },+ },+ "contacts": {+ "description": "A person or company in Front's contact directory, with their handles across channels.",+ "docs_url": "https://dev.frontapp.com/reference/contacts",+ "columns": {+ "id": "Unique identifier for the contact.",+ "name": "The contact's name.",+ "description": "Description of the contact.",+ "handles": "List of the contact's handles (email, phone, etc.) across channels.",+ "groups": "Contact groups the contact belongs to.",+ "is_private": "Whether the contact is private to its owner.",+ "is_spammer": "Whether the contact is marked as a spammer.",+ "links": "External links associated with the contact.",+ "custom_fields": "Custom field values set on the contact.",+ "updated_at": "Time at which the contact was last updated, as Unix epoch seconds.",+ },+ },+ "conversations": {+ "description": "A thread of messages and comments in Front, the core unit of work in an inbox.",+ "docs_url": "https://dev.frontapp.com/reference/conversations",+ "columns": {+ "id": "Unique identifier for the conversation.",+ "subject": "Subject of the conversation.",+ "status": "Status of the conversation (e.g. open, archived, deleted, spam).",+ "assignee": "The teammate the conversation is assigned to, if any.",+ "recipient": "The primary recipient of the conversation.",+ "tags": "Tags applied to the conversation.",+ "links": "External links associated with the conversation.",+ "created_at": "Time at which the conversation was created, as Unix epoch seconds.",+ "is_private": "Whether the conversation is a private discussion.",+ "scheduled_reminders": "Reminders scheduled on the conversation.",+ },+ },+ "accounts": {+ "description": "A company account in Front, grouping related contacts together.",+ "docs_url": "https://dev.frontapp.com/reference/accounts",+ "columns": {+ "id": "Unique identifier for the account.",+ "name": "The account's name.",+ "description": "Description of the account.",+ "domains": "Email domains associated with the account.",+ "external_id": "External identifier set on the account.",+ "custom_fields": "Custom field values set on the account.",+ "created_at": "Time at which the account was created, as Unix epoch seconds.",+ "updated_at": "Time at which the account was last updated, as Unix epoch seconds.",+ },+ },+ "tags": {+ "description": "A label that can be applied to conversations to categorize them.",+ "docs_url": "https://dev.frontapp.com/reference/tags",+ "columns": {+ "id": "Unique identifier for the tag.",+ "name": "The tag's name.",+ "highlight": "Highlight color of the tag.",+ "is_private": "Whether the tag is private to its owner.",+ "is_visible_in_conversation_lists": "Whether the tag is shown in conversation lists.",+ "created_at": "Time at which the tag was created, as Unix epoch seconds.",+ "updated_at": "Time at which the tag was last updated, as Unix epoch seconds.",+ },+ },+ "teammates": {+ "description": "A user (teammate) in the Front workspace.",+ "docs_url": "https://dev.frontapp.com/reference/teammates",+ "columns": {+ "id": "Unique identifier for the teammate.",+ "email": "The teammate's email address.",+ "username": "The teammate's username.",+ "first_name": "The teammate's first name.",+ "last_name": "The teammate's last name.",+ "is_admin": "Whether the teammate is an admin of the workspace.",+ "is_available": "Whether the teammate is currently available.",+ "is_blocked": "Whether the teammate is blocked.",+ },+ },+ "inboxes": {+ "description": "A shared inbox that receives and organizes conversations.",+ "docs_url": "https://dev.frontapp.com/reference/inboxes",+ "columns": {+ "id": "Unique identifier for the inbox.",+ "name": "The inbox's name.",+ "is_private": "Whether the inbox is private to specific teammates.",+ },+ },+ "channels": {+ "description": "A communication channel (email, SMS, etc.) connected to an inbox.",+ "docs_url": "https://dev.frontapp.com/reference/channels",+ "columns": {+ "id": "Unique identifier for the channel.",+ "name": "The channel's name.",+ "address": "Address (e.g. email address) the channel sends and receives from.",+ "type": "Type of the channel (e.g. smtp, imap, twilio, custom).",+ "send_as": "Address used in the From field when sending from the channel.",+ "is_private": "Whether the channel is private.",+ "is_valid": "Whether the channel is currently valid and operational.",+ },+ },+ "teams": {+ "description": "A team in the Front workspace that owns inboxes and teammates.",+ "docs_url": "https://dev.frontapp.com/reference/teams",+ "columns": {+ "id": "Unique identifier for the team.",+ "name": "The team's name.",+ "inboxes": "Inboxes that belong to the team.",+ "members": "Teammates that belong to the team.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/front/source.py b/posthog/temporal/data_imports/sources/front/source.pyindex 450bf8c82a4d..ad8b90e6b4f3 100644--- a/posthog/temporal/data_imports/sources/front/source.py+++ b/posthog/temporal/data_imports/sources/front/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -60,6 +61,11 @@ Grant read scopes for the resources you want to sync (e.g. `shared_resources:rea),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.front.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error": "Invalid Front API token. Please reconnect with a valid token.",diff --git a/posthog/temporal/data_imports/sources/fullstory/canonical_descriptions.py b/posthog/temporal/data_imports/sources/fullstory/canonical_descriptions.pynew file mode 100644index 000000000000..7d5eae568bf3--- /dev/null+++ b/posthog/temporal/data_imports/sources/fullstory/canonical_descriptions.py@@ -0,0 +1,24 @@+"""Canonical, documentation-sourced descriptions for Fullstory endpoints and columns.++Sourced from the official Fullstory Server API v2 reference (https://developer.fullstory.com/server/v2/).+Keyed by the endpoint names in `fullstory.py` `ENDPOINTS`, which match the `ExternalDataSchema.name`+of a synced Fullstory table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "users": {+ "description": "A tracked end user in Fullstory, identified by your application's user id.",+ "docs_url": "https://developer.fullstory.com/server/v2/users/list-users/",+ "columns": {+ "id": "Fullstory-assigned unique identifier for the user.",+ "uid": "Application-specific user id you set when identifying the user.",+ "display_name": "Human-readable display name for the user.",+ "email": "Email address associated with the user.",+ "properties": "Set of custom key-value attributes attached to the user.",+ "is_being_deleted": "Whether the user is currently queued for deletion.",+ "created": "Time at which the user record was created in Fullstory.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/fullstory/source.py b/posthog/temporal/data_imports/sources/fullstory/source.pyindex 663eeb48b1e9..cc7ce2de38ec 100644--- a/posthog/temporal/data_imports/sources/fullstory/source.py+++ b/posthog/temporal/data_imports/sources/fullstory/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -31,6 +32,11 @@ class FullStorySource(ResumableSource[FullStorySourceConfig, FullStoryResumeConfdef source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.FULLSTORY+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.fullstory.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized for url: https://api.fullstory.com": "Fullstory authentication failed. Please check your API key.",diff --git a/posthog/temporal/data_imports/sources/github/canonical_descriptions.py b/posthog/temporal/data_imports/sources/github/canonical_descriptions.pynew file mode 100644index 000000000000..3163af4a3267--- /dev/null+++ b/posthog/temporal/data_imports/sources/github/canonical_descriptions.py@@ -0,0 +1,136 @@+"""Canonical, documentation-sourced descriptions for GitHub endpoints and columns.++Sourced from the official GitHub REST API reference (https://docs.github.com/en/rest). Keyed by the+endpoint names in `settings.py` `GITHUB_ENDPOINTS`, which match the `ExternalDataSchema.name` of a+synced GitHub table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "issues": {+ "description": "An issue in the repository — a task, bug report, or feature request (pull requests are also returned here).",+ "docs_url": "https://docs.github.com/en/rest/issues/issues",+ "columns": {+ "id": "Unique identifier for the issue.",+ "number": "Number uniquely identifying the issue within its repository.",+ "title": "The issue's title.",+ "body": "The issue's description in markdown.",+ "state": "Whether the issue is open or closed.",+ "state_reason": "Reason the issue was closed (completed, not_planned, reopened).",+ "user": "The user who opened the issue.",+ "assignee": "The user assigned to the issue, if any.",+ "assignees": "The users assigned to the issue.",+ "labels": "Labels applied to the issue.",+ "milestone": "The milestone the issue is associated with, if any.",+ "comments": "Number of comments on the issue.",+ "locked": "Whether the issue conversation is locked.",+ "created_at": "Time at which the issue was created.",+ "updated_at": "Time at which the issue was last updated.",+ "closed_at": "Time at which the issue was closed, if applicable.",+ },+ },+ "pull_requests": {+ "description": "A request to merge changes from one branch into another in the repository.",+ "docs_url": "https://docs.github.com/en/rest/pulls/pulls",+ "columns": {+ "id": "Unique identifier for the pull request.",+ "number": "Number uniquely identifying the pull request within its repository.",+ "title": "The pull request's title.",+ "body": "The pull request's description in markdown.",+ "state": "Whether the pull request is open or closed.",+ "user": "The user who opened the pull request.",+ "assignee": "The user assigned to the pull request, if any.",+ "head": "The branch the changes come from (source).",+ "base": "The branch the changes are merged into (target).",+ "draft": "Whether the pull request is a draft.",+ "merged_at": "Time at which the pull request was merged, if applicable.",+ "merge_commit_sha": "SHA of the commit created when the pull request was merged.",+ "labels": "Labels applied to the pull request.",+ "milestone": "The milestone the pull request is associated with, if any.",+ "created_at": "Time at which the pull request was created.",+ "updated_at": "Time at which the pull request was last updated.",+ "closed_at": "Time at which the pull request was closed, if applicable.",+ },+ },+ "commits": {+ "description": "A commit in the repository's history.",+ "docs_url": "https://docs.github.com/en/rest/commits/commits",+ "columns": {+ "sha": "SHA hash uniquely identifying the commit.",+ "commit": "The commit payload (message, author, committer, tree).",+ "author": "The GitHub user account that authored the commit, if matched.",+ "committer": "The GitHub user account that committed the commit, if matched.",+ "parents": "Parent commits of this commit.",+ "url": "API URL for the commit.",+ "html_url": "Web URL for the commit on GitHub.",+ "created_at": "Authoring time of the commit (flattened from commit.author.date).",+ },+ },+ "stargazers": {+ "description": "A user who has starred the repository.",+ "docs_url": "https://docs.github.com/en/rest/activity/starring",+ "columns": {+ "id": "Unique identifier for the user who starred the repository.",+ "login": "Username of the user who starred the repository.",+ "type": "Type of account (User or Organization).",+ "starred_at": "Time at which the user starred the repository.",+ },+ },+ "releases": {+ "description": "A published release of the repository, tied to a git tag.",+ "docs_url": "https://docs.github.com/en/rest/releases/releases",+ "columns": {+ "id": "Unique identifier for the release.",+ "tag_name": "Name of the git tag the release points to.",+ "name": "The release's display name.",+ "body": "The release notes in markdown.",+ "target_commitish": "Branch or commit the tag was created from.",+ "draft": "Whether the release is an unpublished draft.",+ "prerelease": "Whether the release is identified as a pre-release.",+ "author": "The user who created the release.",+ "assets": "Binary assets attached to the release.",+ "created_at": "Time at which the release was created.",+ "published_at": "Time at which the release was published, if applicable.",+ },+ },+ "workflow_runs": {+ "description": "A single execution of a GitHub Actions workflow.",+ "docs_url": "https://docs.github.com/en/rest/actions/workflow-runs",+ "columns": {+ "id": "Unique identifier for the workflow run.",+ "name": "Name of the workflow run.",+ "workflow_id": "Identifier of the workflow that was run.",+ "run_number": "Auto-incrementing number for this run of the workflow.",+ "run_attempt": "Attempt number of the run (incremented on re-runs).",+ "event": "The event that triggered the run (e.g. push, pull_request).",+ "status": "Current execution status (e.g. queued, in_progress, completed).",+ "conclusion": "Final result of the run (e.g. success, failure, cancelled).",+ "head_branch": "Branch the run was triggered on.",+ "head_sha": "Commit SHA the run was triggered on.",+ "actor": "The user that triggered the run.",+ "created_at": "Time at which the run was created.",+ "updated_at": "Time at which the run was last updated.",+ "run_started_at": "Time at which the run began executing.",+ },+ },+ "workflow_jobs": {+ "description": "A single job within a GitHub Actions workflow run.",+ "docs_url": "https://docs.github.com/en/rest/actions/workflow-jobs",+ "columns": {+ "id": "Unique identifier for the job.",+ "run_id": "Identifier of the workflow run this job belongs to.",+ "run_attempt": "Attempt number of the parent run this job ran under.",+ "name": "Name of the job.",+ "status": "Current execution status of the job (e.g. queued, in_progress, completed).",+ "conclusion": "Final result of the job (e.g. success, failure, skipped).",+ "head_sha": "Commit SHA the job ran against.",+ "runner_name": "Name of the runner that executed the job.",+ "labels": "Runner labels requested by the job.",+ "steps": "The individual steps that ran within the job.",+ "started_at": "Time at which the job started.",+ "completed_at": "Time at which the job completed, if applicable.",+ "created_at": "Time at which the job was created.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/github/source.py b/posthog/temporal/data_imports/sources/github/source.pyindex a89979cc64a7..cbddea4a2c81 100644--- a/posthog/temporal/data_imports/sources/github/source.py+++ b/posthog/temporal/data_imports/sources/github/source.py@@ -26,6 +26,7 @@ from posthog.temporal.data_imports.sources.common.base import (WebhookDeletionResult,WebhookSource,)+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.mixins import OAuthMixinfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManager@@ -162,6 +163,11 @@ If automatic creation failed, your token needs webhook permissions — the **adm),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.github.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error": "Invalid GitHub credentials. Please reconnect your account.",diff --git a/posthog/temporal/data_imports/sources/gitlab/canonical_descriptions.py b/posthog/temporal/data_imports/sources/gitlab/canonical_descriptions.pynew file mode 100644index 000000000000..7db1730cc6a9--- /dev/null+++ b/posthog/temporal/data_imports/sources/gitlab/canonical_descriptions.py@@ -0,0 +1,167 @@+"""Canonical, documentation-sourced descriptions for GitLab endpoints and columns.++Sourced from the official GitLab REST API reference (https://docs.gitlab.com/ee/api/). Keyed by the+endpoint names in `settings.py` `GITLAB_ENDPOINTS`, which match the `ExternalDataSchema.name` of a+synced GitLab table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "issues": {+ "description": "An issue in the project — a task, bug report, or discussion item.",+ "docs_url": "https://docs.gitlab.com/ee/api/issues.html",+ "columns": {+ "id": "Globally unique identifier for the issue.",+ "iid": "Internal id of the issue, unique within its project.",+ "project_id": "Identifier of the project the issue belongs to.",+ "title": "The issue's title.",+ "description": "The issue's description in markdown.",+ "state": "Whether the issue is opened or closed.",+ "author": "The user who created the issue.",+ "assignee": "The primary user assigned to the issue, if any.",+ "assignees": "The users assigned to the issue.",+ "labels": "Labels applied to the issue.",+ "milestone": "The milestone the issue is assigned to, if any.",+ "due_date": "Date by which the issue should be completed.",+ "created_at": "Time at which the issue was created.",+ "updated_at": "Time at which the issue was last updated.",+ "closed_at": "Time at which the issue was closed, if applicable.",+ },+ },+ "merge_requests": {+ "description": "A request to merge changes from one branch into another in the project.",+ "docs_url": "https://docs.gitlab.com/ee/api/merge_requests.html",+ "columns": {+ "id": "Globally unique identifier for the merge request.",+ "iid": "Internal id of the merge request, unique within its project.",+ "project_id": "Identifier of the project the merge request belongs to.",+ "title": "The merge request's title.",+ "description": "The merge request's description in markdown.",+ "state": "State of the merge request (opened, closed, merged, locked).",+ "author": "The user who created the merge request.",+ "assignee": "The primary user assigned to review the merge request.",+ "source_branch": "Branch the changes come from.",+ "target_branch": "Branch the changes are merged into.",+ "merge_status": "Whether the merge request can be merged.",+ "draft": "Whether the merge request is marked as a draft.",+ "labels": "Labels applied to the merge request.",+ "milestone": "The milestone the merge request is assigned to, if any.",+ "merged_at": "Time at which the merge request was merged, if applicable.",+ "created_at": "Time at which the merge request was created.",+ "updated_at": "Time at which the merge request was last updated.",+ "closed_at": "Time at which the merge request was closed, if applicable.",+ },+ },+ "commits": {+ "description": "A commit in the project's repository history.",+ "docs_url": "https://docs.gitlab.com/ee/api/commits.html",+ "columns": {+ "id": "Full SHA hash uniquely identifying the commit.",+ "short_id": "Abbreviated SHA hash of the commit.",+ "title": "First line of the commit message.",+ "message": "Full commit message.",+ "author_name": "Name of the commit author.",+ "author_email": "Email of the commit author.",+ "authored_date": "Time at which the commit was authored.",+ "committer_name": "Name of the committer.",+ "committer_email": "Email of the committer.",+ "committed_date": "Time at which the commit was committed.",+ "parent_ids": "SHAs of the commit's parent commits.",+ "web_url": "Web URL for the commit in GitLab.",+ "created_at": "Creation time of the commit.",+ },+ },+ "pipelines": {+ "description": "A CI/CD pipeline run for the project.",+ "docs_url": "https://docs.gitlab.com/ee/api/pipelines.html",+ "columns": {+ "id": "Unique identifier for the pipeline.",+ "iid": "Internal id of the pipeline, unique within its project.",+ "project_id": "Identifier of the project the pipeline belongs to.",+ "status": "Status of the pipeline (e.g. running, success, failed, canceled).",+ "source": "What triggered the pipeline (e.g. push, schedule, merge_request_event).",+ "ref": "Branch or tag the pipeline ran on.",+ "sha": "Commit SHA the pipeline ran against.",+ "web_url": "Web URL for the pipeline in GitLab.",+ "created_at": "Time at which the pipeline was created.",+ "updated_at": "Time at which the pipeline was last updated.",+ },+ },+ "releases": {+ "description": "A published release of the project, tied to a git tag.",+ "docs_url": "https://docs.gitlab.com/ee/api/releases/index.html",+ "columns": {+ "tag_name": "Name of the git tag the release points to.",+ "name": "The release's display name.",+ "description": "The release notes in markdown.",+ "author": "The user who created the release.",+ "commit": "The commit the release is associated with.",+ "released_at": "Time at which the release was published.",+ "created_at": "Time at which the release was created.",+ },+ },+ "milestones": {+ "description": "A milestone used to group issues and merge requests toward a goal.",+ "docs_url": "https://docs.gitlab.com/ee/api/milestones.html",+ "columns": {+ "id": "Globally unique identifier for the milestone.",+ "iid": "Internal id of the milestone, unique within its project.",+ "project_id": "Identifier of the project the milestone belongs to.",+ "title": "The milestone's title.",+ "description": "Description of the milestone.",+ "state": "Whether the milestone is active or closed.",+ "due_date": "Date by which the milestone should be completed.",+ "start_date": "Date on which the milestone starts.",+ "created_at": "Time at which the milestone was created.",+ "updated_at": "Time at which the milestone was last updated.",+ },+ },+ "branches": {+ "description": "A branch in the project's repository.",+ "docs_url": "https://docs.gitlab.com/ee/api/branches.html",+ "columns": {+ "name": "Name of the branch (the unique key).",+ "merged": "Whether the branch has been merged into the default branch.",+ "protected": "Whether the branch is protected.",+ "default": "Whether this is the project's default branch.",+ "commit": "The latest commit on the branch.",+ "web_url": "Web URL for the branch in GitLab.",+ },+ },+ "tags": {+ "description": "A git tag in the project's repository.",+ "docs_url": "https://docs.gitlab.com/ee/api/tags.html",+ "columns": {+ "name": "Name of the tag (the unique key).",+ "message": "Annotation message of the tag, if any.",+ "target": "SHA the tag points to.",+ "commit": "The commit the tag references.",+ "release": "Release associated with the tag, if any.",+ },+ },+ "labels": {+ "description": "A label that can be applied to issues and merge requests to categorize them.",+ "docs_url": "https://docs.gitlab.com/ee/api/labels.html",+ "columns": {+ "id": "Unique identifier for the label.",+ "name": "The label's name.",+ "description": "Description of the label.",+ "color": "The label's color, as a hex value.",+ "open_issues_count": "Number of open issues with this label.",+ "open_merge_requests_count": "Number of open merge requests with this label.",+ },+ },+ "members": {+ "description": "A member of the project, including those inherited from ancestor groups.",+ "docs_url": "https://docs.gitlab.com/ee/api/members.html",+ "columns": {+ "id": "Unique identifier for the member's user.",+ "username": "Username of the member.",+ "name": "Full name of the member.",+ "state": "State of the member's account (active or blocked).",+ "access_level": "The member's access level (e.g. 10 guest, 30 developer, 50 owner).",+ "expires_at": "Date the member's access expires, if set.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/gitlab/source.py b/posthog/temporal/data_imports/sources/gitlab/source.pyindex fc7d5651f56a..1637fd7d1e86 100644--- a/posthog/temporal/data_imports/sources/gitlab/source.py+++ b/posthog/temporal/data_imports/sources/gitlab/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -82,6 +83,11 @@ For self-managed GitLab, set the instance URL (for example `https://gitlab.examp),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.gitlab.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error": "Invalid GitLab personal access token. Please generate a new token and reconnect.",diff --git a/posthog/temporal/data_imports/sources/gladly/canonical_descriptions.py b/posthog/temporal/data_imports/sources/gladly/canonical_descriptions.pynew file mode 100644index 000000000000..32cd61e3751d--- /dev/null+++ b/posthog/temporal/data_imports/sources/gladly/canonical_descriptions.py@@ -0,0 +1,65 @@+"""Canonical, documentation-sourced descriptions for Gladly endpoints and columns.++Sourced from the official Gladly Data Export / API reference (https://developer.gladly.com/). Keyed+by the endpoint names in `settings.py` `GLADLY_ENDPOINTS`, which match the `ExternalDataSchema.name`+of a synced Gladly table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "customers": {+ "description": "A customer profile in Gladly, with contact details and custom attributes.",+ "docs_url": "https://developer.gladly.com/rest/#tag/Customers",+ "columns": {+ "id": "Unique identifier for the customer.",+ "name": "The customer's name.",+ "emails": "Email addresses associated with the customer.",+ "phones": "Phone numbers associated with the customer.",+ "address": "Postal address of the customer.",+ "customAttributes": "Custom key-value attributes attached to the customer.",+ "externalCustomerId": "Identifier for the customer in your own system, if set.",+ "createdAt": "Time at which the customer profile was created.",+ "_job_updated_at": "updatedAt of the export job that produced this row (incremental cursor).",+ },+ },+ "conversation_items": {+ "description": "An item within a customer conversation — a message, call, chat, or status change.",+ "docs_url": "https://developer.gladly.com/rest/#tag/Conversations",+ "columns": {+ "id": "Unique identifier for the conversation item.",+ "conversationId": "Identifier of the conversation this item belongs to.",+ "customerId": "Identifier of the customer the conversation is with.",+ "content": "Payload of the item (the message, call, or event details).",+ "contentType": "Type of the item (e.g. message, chat, phone call, status change).",+ "initiator": "Who initiated the item (the customer or an agent).",+ "timestamp": "Time at which the item occurred.",+ "_job_updated_at": "updatedAt of the export job that produced this row (incremental cursor).",+ },+ },+ "agents": {+ "description": "An agent (staff user) in the Gladly workspace.",+ "docs_url": "https://developer.gladly.com/rest/#tag/Agents",+ "columns": {+ "id": "Unique identifier for the agent.",+ "name": "The agent's name.",+ "emailAddress": "The agent's email address.",+ "roles": "Roles assigned to the agent.",+ "disabled": "Whether the agent account is disabled.",+ "createdAt": "Time at which the agent was created.",+ "_job_updated_at": "updatedAt of the export job that produced this row (incremental cursor).",+ },+ },+ "topics": {+ "description": "A topic used to categorize and tag conversations in Gladly.",+ "docs_url": "https://developer.gladly.com/rest/#tag/Topics",+ "columns": {+ "id": "Unique identifier for the topic.",+ "name": "The topic's name.",+ "parentId": "Identifier of the parent topic, if this topic is nested.",+ "disabled": "Whether the topic is disabled.",+ "createdAt": "Time at which the topic was created.",+ "_job_updated_at": "updatedAt of the export job that produced this row (incremental cursor).",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/gladly/source.py b/posthog/temporal/data_imports/sources/gladly/source.pyindex 7cabe2024462..f2e8f205d9d0 100644--- a/posthog/temporal/data_imports/sources/gladly/source.py+++ b/posthog/temporal/data_imports/sources/gladly/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -37,6 +38,11 @@ class GladlySource(ResumableSource[GladlySourceConfig, GladlyResumeConfig]):# retargeting it must re-require the token.return ["organization"]+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.gladly.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized for url": "Gladly authentication failed. Please check your agent email and API token.",diff --git a/posthog/temporal/data_imports/sources/gocardless/canonical_descriptions.py b/posthog/temporal/data_imports/sources/gocardless/canonical_descriptions.pynew file mode 100644index 000000000000..4a47415e87db--- /dev/null+++ b/posthog/temporal/data_imports/sources/gocardless/canonical_descriptions.py@@ -0,0 +1,113 @@+"""Canonical, documentation-sourced descriptions for GoCardless endpoints and columns.++Sourced from the official GoCardless API reference (https://developer.gocardless.com/api-reference/).+Keyed by the endpoint names in `settings.py` `GOCARDLESS_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced GoCardless table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by most GoCardless resources; merged into each entry so we don't repeat them.+_COMMON_COLUMNS = {+ "id": "Unique identifier for the resource, beginning with a resource-type prefix.",+ "created_at": "Time at which the resource was created (ISO 8601).",+ "metadata": "Set of up to three key-value pairs you can attach to the resource.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "customers": {+ "description": "A customer who pays you through GoCardless.",+ "docs_url": "https://developer.gocardless.com/api-reference/#core-endpoints-customers",+ "columns": _columns(+ email="Customer's email address.",+ given_name="Customer's first name.",+ family_name="Customer's last name.",+ company_name="Customer's company name, for business customers.",+ address_line1="First line of the customer's address.",+ city="City of the customer's address.",+ postal_code="Postal code of the customer's address.",+ country_code="ISO 3166-1 two-letter country code of the customer.",+ language="ISO 639-1 language code used for communication with the customer.",+ ),+ },+ "mandates": {+ "description": "An authorization from a customer permitting you to collect recurring payments.",+ "docs_url": "https://developer.gocardless.com/api-reference/#core-endpoints-mandates",+ "columns": _columns(+ status="Status of the mandate (e.g. pending_submission, active, cancelled, expired).",+ reference="Unique reference identifying the mandate, shown on bank statements.",+ scheme="Direct debit scheme of the mandate (e.g. bacs, sepa_core, ach).",+ next_possible_charge_date="Earliest date a payment can next be charged against the mandate.",+ links="Related resources (customer, creditor, customer_bank_account).",+ ),+ },+ "payments": {+ "description": "A payment collected from a customer against a mandate.",+ "docs_url": "https://developer.gocardless.com/api-reference/#core-endpoints-payments",+ "columns": _columns(+ amount="Amount of the payment, in the smallest currency unit (e.g. pence, cents).",+ currency="ISO 4217 three-letter currency code of the payment.",+ status="Status of the payment (e.g. pending_submission, submitted, confirmed, paid_out, failed).",+ charge_date="Date the payment is or was charged to the customer.",+ description="Human-readable description of the payment.",+ reference="Reference for the payment, shown on the customer's bank statement.",+ amount_refunded="Amount already refunded from the payment, in the smallest currency unit.",+ links="Related resources (mandate, creditor, subscription, payout).",+ ),+ },+ "subscriptions": {+ "description": "A recurring payment schedule that collects payments against a mandate.",+ "docs_url": "https://developer.gocardless.com/api-reference/#core-endpoints-subscriptions",+ "columns": _columns(+ amount="Amount of each payment, in the smallest currency unit.",+ currency="ISO 4217 three-letter currency code of the subscription.",+ status="Status of the subscription (e.g. pending_customer_approval, active, finished, cancelled).",+ name="Optional name for the subscription.",+ interval="Number of interval_units between payments.",+ interval_unit="Unit of the payment interval (weekly, monthly, or yearly).",+ day_of_month="Day of the month payments are collected on.",+ start_date="Date of the first payment.",+ end_date="Date of the last payment, if the subscription is time-limited.",+ links="Related resources (mandate).",+ ),+ },+ "payouts": {+ "description": "A transfer of collected funds from GoCardless to your bank account.",+ "docs_url": "https://developer.gocardless.com/api-reference/#core-endpoints-payouts",+ "columns": _columns(+ amount="Net amount paid out, in the smallest currency unit.",+ currency="ISO 4217 three-letter currency code of the payout.",+ status="Status of the payout (pending or paid).",+ deducted_fees="Total fees GoCardless deducted from the payout, in the smallest currency unit.",+ payout_type="Whether the payout covers merchant funds or partner fees.",+ reference="Reference for the payout shown on your bank statement.",+ arrival_date="Date the payout is expected to arrive in your bank account.",+ links="Related resources (creditor, creditor_bank_account).",+ ),+ },+ "refunds": {+ "description": "A refund of all or part of a payment back to the customer.",+ "docs_url": "https://developer.gocardless.com/api-reference/#core-endpoints-refunds",+ "columns": _columns(+ amount="Amount refunded, in the smallest currency unit.",+ currency="ISO 4217 three-letter currency code of the refund.",+ reference="Reference for the refund shown on the customer's bank statement.",+ links="Related resources (payment, mandate).",+ ),+ },+ "events": {+ "description": "An entry in GoCardless's append-only change log, recording what happened to a resource.",+ "docs_url": "https://developer.gocardless.com/api-reference/#core-endpoints-events",+ "columns": _columns(+ action="The action that occurred (e.g. created, submitted, confirmed, failed, cancelled).",+ resource_type="Type of resource the event relates to (e.g. payments, mandates, payouts).",+ details="Structured details about the event, including cause and origin.",+ links="Related resources the event concerns (payment, mandate, subscription, etc.).",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/gocardless/source.py b/posthog/temporal/data_imports/sources/gocardless/source.pyindex 175faecd7fc3..69e80c79d8e8 100644--- a/posthog/temporal/data_imports/sources/gocardless/source.py+++ b/posthog/temporal/data_imports/sources/gocardless/source.py@@ -13,6 +13,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -33,6 +34,11 @@ class GoCardlessSource(ResumableSource[GoCardlessSourceConfig, GoCardlessResumeCdef source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.GOCARDLESS+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.gocardless.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized for url: https://api.gocardless.com": "GoCardless authentication failed. Please check your access token.",diff --git a/posthog/temporal/data_imports/sources/gong/canonical_descriptions.py b/posthog/temporal/data_imports/sources/gong/canonical_descriptions.pynew file mode 100644index 000000000000..04de0c09c101--- /dev/null+++ b/posthog/temporal/data_imports/sources/gong/canonical_descriptions.py@@ -0,0 +1,66 @@+"""Canonical, documentation-sourced descriptions for Gong endpoints and columns.++Sourced from the official Gong API reference (https://gong.app.gong.io/settings/api/documentation).+Keyed by the endpoint names in `settings.py` `GONG_ENDPOINTS`, which match the `ExternalDataSchema.name`+of a synced Gong table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "calls": {+ "description": "A recorded call or meeting captured in Gong.",+ "docs_url": "https://gong.app.gong.io/settings/api/documentation#post-/v2/calls/extensive",+ "columns": {+ "id": "Unique identifier for the call.",+ "title": "Title of the call.",+ "url": "URL of the call within the Gong web app.",+ "started": "Time at which the call started (ISO 8601).",+ "duration": "Duration of the call in seconds.",+ "direction": "Direction of the call (Inbound, Outbound, Conference, or Unknown).",+ "scope": "Whether the call was internal or external.",+ "media": "Media type of the call (Audio or Video).",+ "language": "Detected primary language of the call.",+ "workspaceId": "Identifier of the workspace the call belongs to.",+ "primaryUserId": "Identifier of the main Gong user (host) on the call.",+ "scheduled": "Scheduled start time of the call, if applicable.",+ },+ },+ "users": {+ "description": "A Gong user (team member whose calls and activity are tracked).",+ "docs_url": "https://gong.app.gong.io/settings/api/documentation#get-/v2/users",+ "columns": {+ "id": "Unique identifier for the user.",+ "emailAddress": "The user's primary email address.",+ "firstName": "The user's first name.",+ "lastName": "The user's last name.",+ "active": "Whether the user account is active.",+ "title": "The user's job title.",+ "managerId": "Identifier of the user's manager, if set.",+ "phoneNumber": "The user's phone number.",+ "created": "Time at which the user was created in Gong.",+ },+ },+ "scorecards": {+ "description": "A scorecard template used to evaluate calls in Gong.",+ "docs_url": "https://gong.app.gong.io/settings/api/documentation#get-/v2/settings/scorecards",+ "columns": {+ "scorecardId": "Unique identifier for the scorecard.",+ "scorecardName": "Name of the scorecard.",+ "workspaceId": "Identifier of the workspace the scorecard belongs to.",+ "enabled": "Whether the scorecard is currently enabled.",+ "questions": "The evaluation questions that make up the scorecard.",+ "created": "Time at which the scorecard was created.",+ "updated": "Time at which the scorecard was last updated.",+ },+ },+ "workspaces": {+ "description": "A Gong workspace grouping users, calls, and settings.",+ "docs_url": "https://gong.app.gong.io/settings/api/documentation#get-/v2/workspaces",+ "columns": {+ "id": "Unique identifier for the workspace.",+ "name": "Name of the workspace.",+ "description": "Description of the workspace.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/gong/source.py b/posthog/temporal/data_imports/sources/gong/source.pyindex 11e6b67a4c64..f2ae39cf5437 100644--- a/posthog/temporal/data_imports/sources/gong/source.py+++ b/posthog/temporal/data_imports/sources/gong/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -74,6 +75,11 @@ Grant the following read scopes so the connected endpoints can sync:),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.gong.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: GongSourceConfig,diff --git a/posthog/temporal/data_imports/sources/google_ads/canonical_descriptions.py b/posthog/temporal/data_imports/sources/google_ads/canonical_descriptions.pynew file mode 100644index 000000000000..babcbcddd8a8--- /dev/null+++ b/posthog/temporal/data_imports/sources/google_ads/canonical_descriptions.py@@ -0,0 +1,304 @@+"""Canonical, documentation-sourced descriptions for Google Ads endpoints and columns.++Sourced from the official Google Ads API reference+(https://developers.google.com/google-ads/api/fields/v17/overview). Keyed by the table aliases in+`schemas.py` `RESOURCE_SCHEMAS`, which match the `ExternalDataSchema.name` of a synced Google Ads+table. Column names use the synced form (the qualified API field with dots replaced by underscores,+e.g. `campaign.id` -> `campaign_id`, `metrics.clicks` -> `metrics_clicks`). Columns absent here fall+back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Resource-identifier columns shared by most reports.+_IDS = {+ "customer_id": "The Google Ads customer (account) ID the row belongs to.",+ "customer_currency_code": "Three-letter ISO 4217 currency code of the account.",+ "campaign_id": "The campaign ID the row belongs to.",+ "ad_group_id": "The ad group ID the row belongs to.",+}++# Performance metrics shared by the *_stats reports. Google Ads returns money in micros+# (1,000,000 micros = one unit of the account currency).+_METRICS = {+ "metrics_clicks": "Number of clicks.",+ "metrics_impressions": "Number of times the ad was shown.",+ "metrics_ctr": "Click-through rate (clicks divided by impressions).",+ "metrics_cost_micros": "Total cost in micros (1,000,000 micros = one currency unit).",+ "metrics_average_cpc": "Average cost-per-click, in micros.",+ "metrics_average_cpm": "Average cost-per-thousand-impressions, in micros.",+ "metrics_average_cost": "Average amount paid per interaction, in micros.",+ "metrics_conversions": "Number of conversions.",+ "metrics_conversions_value": "Total value of conversions.",+ "metrics_conversions_from_interactions_rate": "Conversions divided by interactions.",+ "metrics_cost_per_conversion": "Average cost per conversion, in micros.",+ "metrics_value_per_conversion": "Average value per conversion.",+ "metrics_interactions": "Number of interactions (the main user action for the ad format).",+ "metrics_interaction_rate": "Interactions divided by impressions.",+ "metrics_all_conversions": "Number of conversions across all conversion actions, including non-primary.",+ "metrics_all_conversions_value": "Total value of all conversions.",+ "metrics_view_through_conversions": "Conversions counted from view-through (no click) attribution.",+}++# Date/time segmentation columns shared by the *_stats reports.+_SEGMENTS = {+ "segments_date": "The date the metrics are reported for (YYYY-MM-DD).",+ "segments_day_of_week": "Day of week the metrics are reported for.",+ "segments_week": "Week (starting Monday) the metrics are reported for.",+ "segments_month": "Month the metrics are reported for.",+ "segments_quarter": "Quarter the metrics are reported for.",+ "segments_year": "Year the metrics are reported for.",+ "segments_device": "Device the metrics are reported for (e.g. mobile, desktop, tablet).",+ "segments_ad_network_type": "Ad network the metrics are reported for (e.g. search, display, YouTube).",+ "segments_click_type": "Type of click the metrics are reported for.",+}+++def _stats_columns(**overrides: str) -> dict[str, str]:+ return {**_IDS, **_METRICS, **_SEGMENTS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "ad": {+ "description": "An ad within an ad group (ad_group_ad), including its creative content and status.",+ "docs_url": "https://developers.google.com/google-ads/api/fields/v17/ad_group_ad",+ "columns": {+ **_IDS,+ "ad_group_ad_ad_id": "Unique ID of the ad.",+ "ad_group_ad_ad_name": "Name of the ad.",+ "ad_group_ad_ad_type": "Type of the ad (e.g. responsive search ad, image ad).",+ "ad_group_ad_status": "Status of the ad (enabled, paused, or removed).",+ "ad_group_ad_ad_display_url": "Display URL shown with the ad.",+ "ad_group_ad_ad_final_urls": "Landing-page URLs the ad sends users to.",+ "ad_group_ad_ad_strength": "Google's rated strength of the ad.",+ "ad_group_ad_policy_summary_approval_status": "Overall policy approval status of the ad.",+ },+ },+ "ad_stats": {+ "description": "Daily performance metrics for ads (ad_group_ad), segmented by date, device, and network.",+ "docs_url": "https://developers.google.com/google-ads/api/fields/v17/ad_group_ad",+ "columns": _stats_columns(+ ad_group_ad_ad_id="Unique ID of the ad the metrics belong to.",+ ),+ },+ "ad_group": {+ "description": "An ad group — a set of ads and keywords sharing bids and targeting within a campaign.",+ "docs_url": "https://developers.google.com/google-ads/api/fields/v17/ad_group",+ "columns": {+ **_IDS,+ "ad_group_name": "Name of the ad group.",+ "ad_group_status": "Status of the ad group (enabled, paused, or removed).",+ "ad_group_type": "Type of the ad group (e.g. search standard, display standard).",+ "ad_group_cpc_bid_micros": "Maximum cost-per-click bid for the ad group, in micros.",+ "ad_group_cpm_bid_micros": "Maximum cost-per-thousand-impressions bid, in micros.",+ "campaign_bidding_strategy_type": "Bidding strategy type of the parent campaign.",+ },+ },+ "ad_group_stats": {+ "description": "Daily performance metrics for ad groups, segmented by date, device, and network.",+ "docs_url": "https://developers.google.com/google-ads/api/fields/v17/ad_group",+ "columns": _stats_columns(),+ },+ "campaign": {+ "description": "A Google Ads campaign — a budgeted set of ad groups sharing settings and goals.",+ "docs_url": "https://developers.google.com/google-ads/api/fields/v17/campaign",+ "columns": {+ **_IDS,+ "campaign_name": "Name of the campaign.",+ "campaign_status": "Status of the campaign (enabled, paused, or removed).",+ "campaign_serving_status": "Whether the campaign is currently able to serve ads.",+ "campaign_advertising_channel_type": "Primary serving target (e.g. search, display, shopping, video).",+ "campaign_advertising_channel_sub_type": "More specific serving target within the channel type.",+ "campaign_bidding_strategy_type": "Automated or manual bidding strategy in use.",+ "campaign_start_date": "Date the campaign started serving.",+ "campaign_end_date": "Date the campaign stops serving.",+ "campaign_budget_amount_micros": "Daily budget of the campaign, in micros.",+ },+ },+ "campaign_stats": {+ "description": "Daily performance metrics for campaigns, segmented by date, device, and network.",+ "docs_url": "https://developers.google.com/google-ads/api/fields/v17/campaign",+ "columns": _stats_columns(+ campaign_name="Name of the campaign.",+ campaign_advertising_channel_type="Primary serving target of the campaign.",+ campaign_bidding_strategy_type="Bidding strategy of the campaign.",+ ),+ },+ "campaign_overview_stats": {+ "description": "Daily campaign performance overview including video metrics, segmented by date and device.",+ "docs_url": "https://developers.google.com/google-ads/api/fields/v17/campaign",+ "columns": _stats_columns(+ campaign_name="Name of the campaign.",+ campaign_advertising_channel_type="Primary serving target of the campaign.",+ metrics_video_views="Number of views of a video ad.",+ metrics_average_cpv="Average cost-per-view of a video ad, in micros.",+ metrics_video_view_rate="Video views divided by video ad impressions.",+ ),+ },+ "keyword": {+ "description": "A keyword criterion (keyword_view) — a search term that triggers an ad, with its bid and quality.",+ "docs_url": "https://developers.google.com/google-ads/api/fields/v17/keyword_view",+ "columns": {+ **_IDS,+ "ad_group_criterion_criterion_id": "Unique ID of the keyword criterion.",+ "ad_group_criterion_keyword_text": "The keyword text.",+ "ad_group_criterion_keyword_match_type": "Match type (exact, phrase, or broad).",+ "ad_group_criterion_status": "Status of the keyword (enabled, paused, or removed).",+ "ad_group_criterion_negative": "Whether the keyword is a negative (exclusion) keyword.",+ "ad_group_criterion_quality_info_quality_score": "Google's 1-10 quality score for the keyword.",+ },+ },+ "keyword_stats": {+ "description": "Daily performance metrics for keywords (keyword_view), segmented by date, device, and network.",+ "docs_url": "https://developers.google.com/google-ads/api/fields/v17/keyword_view",+ "columns": _stats_columns(+ ad_group_criterion_criterion_id="Unique ID of the keyword criterion the metrics belong to.",+ ),+ },+ "video": {+ "description": "A video asset used in video ads, with its title and duration.",+ "docs_url": "https://developers.google.com/google-ads/api/fields/v17/video",+ "columns": {+ **_IDS,+ "video_id": "Unique ID of the video (the YouTube video ID).",+ "video_title": "Title of the video.",+ "video_duration_millis": "Duration of the video in milliseconds.",+ "ad_group_ad_status": "Status of the ad serving the video.",+ },+ },+ "video_stats": {+ "description": "Daily performance metrics for videos, segmented by date, device, and network.",+ "docs_url": "https://developers.google.com/google-ads/api/fields/v17/video",+ "columns": _stats_columns(+ video_id="Unique ID of the video the metrics belong to.",+ video_channel_id="YouTube channel ID the video belongs to.",+ ),+ },+ "video_performance_stats": {+ "description": "Daily video performance with view-quartile metrics, segmented by date and device.",+ "docs_url": "https://developers.google.com/google-ads/api/fields/v17/video",+ "columns": _stats_columns(+ video_id="Unique ID of the video the metrics belong to.",+ video_channel_id="YouTube channel ID the video belongs to.",+ metrics_video_views="Number of views of the video ad.",+ metrics_average_cpv="Average cost-per-view, in micros.",+ metrics_video_view_rate="Video views divided by video ad impressions.",+ metrics_video_quartile_p25_rate="Share of impressions that watched at least 25% of the video.",+ metrics_video_quartile_p50_rate="Share of impressions that watched at least 50% of the video.",+ metrics_video_quartile_p75_rate="Share of impressions that watched at least 75% of the video.",+ metrics_video_quartile_p100_rate="Share of impressions that watched the entire video.",+ ),+ },+ "customer_stats": {+ "description": "Daily account-level performance totals for the Google Ads customer.",+ "docs_url": "https://developers.google.com/google-ads/api/fields/v17/customer",+ "columns": {+ "customer_id": "The Google Ads customer (account) ID.",+ "customer_descriptive_name": "Human-readable name of the account.",+ "customer_currency_code": "Three-letter ISO 4217 currency code of the account.",+ "metrics_clicks": "Number of clicks.",+ "metrics_impressions": "Number of impressions.",+ "metrics_cost_micros": "Total cost in micros.",+ "metrics_conversions": "Number of conversions.",+ "segments_date": "The date the metrics are reported for.",+ },+ },+ "search_term_stats": {+ "description": "Daily performance for the actual search terms that triggered ads (search_term_view).",+ "docs_url": "https://developers.google.com/google-ads/api/fields/v17/search_term_view",+ "columns": {+ **_IDS,+ "search_term_view_search_term": "The search query a user entered that triggered an ad.",+ "search_term_view_status": "Whether the search term has been added or excluded as a keyword.",+ "metrics_clicks": "Number of clicks.",+ "metrics_impressions": "Number of impressions.",+ "metrics_cost_micros": "Total cost in micros.",+ "metrics_conversions": "Number of conversions.",+ "segments_date": "The date the metrics are reported for.",+ },+ },+ "geographic_stats": {+ "description": "Daily performance broken out by user geographic location (geographic_view).",+ "docs_url": "https://developers.google.com/google-ads/api/fields/v17/geographic_view",+ "columns": {+ **_IDS,+ "geographic_view_country_criterion_id": "Criterion ID of the country the user was in.",+ "geographic_view_location_type": "Whether location is based on area of interest or physical presence.",+ "metrics_clicks": "Number of clicks.",+ "metrics_impressions": "Number of impressions.",+ "metrics_cost_micros": "Total cost in micros.",+ "metrics_conversions": "Number of conversions.",+ "segments_date": "The date the metrics are reported for.",+ },+ },+ "asset_group": {+ "description": "An asset group within a Performance Max campaign, grouping creative assets for a theme.",+ "docs_url": "https://developers.google.com/google-ads/api/fields/v17/asset_group",+ "columns": {+ "customer_id": "The Google Ads customer (account) ID the asset group belongs to.",+ "campaign_id": "The campaign the asset group belongs to.",+ "asset_group_id": "Unique ID of the asset group.",+ "asset_group_name": "Name of the asset group.",+ "asset_group_status": "Status of the asset group (enabled, paused, or removed).",+ "asset_group_primary_status": "Aggregated primary serving status of the asset group.",+ "asset_group_ad_strength": "Google's rated ad strength of the asset group.",+ "asset_group_final_urls": "Landing-page URLs for the asset group.",+ },+ },+ "asset_group_stats": {+ "description": "Daily performance metrics for Performance Max asset groups, segmented by date.",+ "docs_url": "https://developers.google.com/google-ads/api/fields/v17/asset_group",+ "columns": {+ "customer_id": "The Google Ads customer (account) ID.",+ "customer_currency_code": "Three-letter ISO 4217 currency code of the account.",+ "campaign_id": "The campaign the asset group belongs to.",+ "asset_group_id": "Unique ID of the asset group the metrics belong to.",+ "metrics_clicks": "Number of clicks.",+ "metrics_impressions": "Number of impressions.",+ "metrics_cost_micros": "Total cost in micros.",+ "metrics_conversions": "Number of conversions.",+ "metrics_conversions_value": "Total value of conversions.",+ "metrics_all_conversions": "Number of conversions across all conversion actions.",+ "metrics_all_conversions_value": "Total value of all conversions.",+ "metrics_view_through_conversions": "View-through conversions.",+ "segments_date": "The date the metrics are reported for.",+ },+ },+ "shopping_performance_view": {+ "description": "Daily Shopping ad performance broken out by product attributes (shopping_performance_view).",+ "docs_url": "https://developers.google.com/google-ads/api/fields/v17/shopping_performance_view",+ "columns": {+ "customer_id": "The Google Ads customer (account) ID.",+ "customer_currency_code": "Three-letter ISO 4217 currency code of the account.",+ "campaign_id": "The campaign the metrics belong to.",+ "segments_product_item_id": "Merchant Center item ID of the product.",+ "segments_product_title": "Title of the product.",+ "segments_product_brand": "Brand of the product.",+ "segments_product_condition": "Condition of the product (new, used, refurbished).",+ "segments_product_channel": "Sales channel of the product (online or local).",+ "segments_product_type_l1": "First-level product type category.",+ "segments_product_type_l2": "Second-level product type category.",+ "metrics_clicks": "Number of clicks.",+ "metrics_impressions": "Number of impressions.",+ "metrics_cost_micros": "Total cost in micros.",+ "metrics_conversions": "Number of conversions.",+ "metrics_conversions_value": "Total value of conversions.",+ "segments_date": "The date the metrics are reported for.",+ },+ },+ "conversion_action": {+ "description": "A conversion action — an event (purchase, sign-up, call) that Google Ads counts as a conversion.",+ "docs_url": "https://developers.google.com/google-ads/api/fields/v17/conversion_action",+ "columns": {+ "customer_id": "The Google Ads customer (account) ID the conversion action belongs to.",+ "conversion_action_id": "Unique ID of the conversion action.",+ "conversion_action_name": "Name of the conversion action.",+ "conversion_action_status": "Status of the conversion action (enabled, removed, or hidden).",+ "conversion_action_type": "Type/source of the conversion action (e.g. website, app, phone calls).",+ "conversion_action_category": "Category of the conversion (e.g. purchase, lead, sign-up).",+ "conversion_action_origin": "Origin of the conversion action.",+ "conversion_action_primary_for_goal": "Whether this action is primary for its conversion goal.",+ "conversion_action_counting_type": "Whether every conversion or one per click/interaction is counted.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/google_ads/source.py b/posthog/temporal/data_imports/sources/google_ads/source.pyindex 80a943cfee31..2fa9251fb012 100644--- a/posthog/temporal/data_imports/sources/google_ads/source.py+++ b/posthog/temporal/data_imports/sources/google_ads/source.py@@ -20,6 +20,7 @@ from posthog.temporal.data_imports.sources.common.base import (FieldType,ResumableSource,)+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.mixins import OAuthMixinfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManager@@ -42,6 +43,13 @@ class GoogleAdsSource(def source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.GOOGLEADS+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.google_ads.canonical_descriptions import ( # noqa: PLC0415+ CANONICAL_DESCRIPTIONS,+ )++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"PERMISSION_DENIED": None,diff --git a/posthog/temporal/data_imports/sources/google_analytics/canonical_descriptions.py b/posthog/temporal/data_imports/sources/google_analytics/canonical_descriptions.pynew file mode 100644index 000000000000..2b8a3930df32--- /dev/null+++ b/posthog/temporal/data_imports/sources/google_analytics/canonical_descriptions.py@@ -0,0 +1,125 @@+"""Canonical, documentation-sourced descriptions for Google Analytics (GA4) report endpoints.++Sourced from the official GA4 Data API reference and the dimensions & metrics catalog+(https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema). Keyed by the report+names in `settings.py` `GOOGLE_ANALYTICS_REPORT_SCHEMAS`, which match the `ExternalDataSchema.name` of+a synced GA4 report table. Each report is a daily aggregate (a GA4 `runReport` request) with a fixed+dimension + metric set; columns are the GA4 dimension/metric API names. Columns absent here fall back+to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# GA4 dimensions reused across reports.+_DATE = {"date": "The date the report row aggregates, in YYYYMMDD form."}++# GA4 metrics reused across reports.+_CORE_METRICS = {+ "totalUsers": "Total number of unique users.",+ "newUsers": "Number of users who interacted for the first time.",+ "sessions": "Number of sessions.",+ "screenPageViews": "Number of app screens or web pages viewed.",+ "averageSessionDuration": "Average duration of a session, in seconds.",+ "bounceRate": "Share of sessions that were not engaged.",+}+++def _date_columns(**overrides: str) -> dict[str, str]:+ return {**_DATE, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "website_overview": {+ "description": "Daily totals for users, sessions, page views, session duration, and bounce rate.",+ "docs_url": "https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema",+ "columns": _date_columns(+ **_CORE_METRICS,+ sessionsPerUser="Average number of sessions per user.",+ ),+ },+ "daily_active_users": {+ "description": "Number of 1-day active users per day (DAU).",+ "docs_url": "https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema",+ "columns": _date_columns(+ active1DayUsers="Number of users who engaged in the prior 1 day (daily active users).",+ ),+ },+ "weekly_active_users": {+ "description": "Rolling 7-day active users per day (WAU).",+ "docs_url": "https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema",+ "columns": _date_columns(+ active7DayUsers="Number of users who engaged in the prior 7 days (weekly active users).",+ ),+ },+ "four_weekly_active_users": {+ "description": "Rolling 28-day active users per day.",+ "docs_url": "https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema",+ "columns": _date_columns(+ active28DayUsers="Number of users who engaged in the prior 28 days.",+ ),+ },+ "devices": {+ "description": "Daily usage broken out by device category, operating system, and browser.",+ "docs_url": "https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema",+ "columns": _date_columns(+ **_CORE_METRICS,+ deviceCategory="Type of device (desktop, mobile, or tablet).",+ operatingSystem="Operating system of the device.",+ browser="Browser used to view the site.",+ ),+ },+ "locations": {+ "description": "Daily usage broken out by country, region, and city.",+ "docs_url": "https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema",+ "columns": _date_columns(+ **_CORE_METRICS,+ country="Country the user's activity originated from.",+ region="Region (state/province) the user's activity originated from.",+ city="City the user's activity originated from.",+ ),+ },+ "pages": {+ "description": "Daily page performance broken out by host name and page path (including query string).",+ "docs_url": "https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema",+ "columns": _date_columns(+ screenPageViews="Number of times the page was viewed.",+ sessions="Number of sessions that included the page.",+ totalUsers="Number of unique users who viewed the page.",+ averageSessionDuration="Average session duration, in seconds.",+ bounceRate="Share of sessions that were not engaged.",+ hostName="Host name (domain) of the page.",+ pagePathPlusQueryString="Page path including the query string.",+ ),+ },+ "traffic_sources": {+ "description": "Daily traffic broken out by session source and medium.",+ "docs_url": "https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema",+ "columns": _date_columns(+ **_CORE_METRICS,+ sessionSource="The source that brought the user to the site for the session (e.g. google).",+ sessionMedium="The medium that brought the user for the session (e.g. organic, cpc, referral).",+ ),+ },+ "user_acquisition": {+ "description": "Daily acquisition broken out by the source and medium that first acquired each user.",+ "docs_url": "https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema",+ "columns": _date_columns(+ totalUsers="Number of unique users.",+ newUsers="Number of first-time users.",+ sessions="Number of sessions.",+ engagedSessions="Number of sessions that were engaged (lasted 10s+, had a conversion, or 2+ page views).",+ firstUserSource="Source that first acquired the user.",+ firstUserMedium="Medium that first acquired the user.",+ ),+ },+ "events": {+ "description": "Daily event counts broken out by event name.",+ "docs_url": "https://developers.google.com/analytics/devguides/reporting/data/v1/api-schema",+ "columns": _date_columns(+ eventName="Name of the event.",+ eventCount="Number of times the event was triggered.",+ totalUsers="Number of unique users who triggered the event.",+ eventCountPerUser="Average number of times each user triggered the event.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/google_analytics/source.py b/posthog/temporal/data_imports/sources/google_analytics/source.pyindex 37381ccc36d9..917eeb177433 100644--- a/posthog/temporal/data_imports/sources/google_analytics/source.py+++ b/posthog/temporal/data_imports/sources/google_analytics/source.py@@ -14,6 +14,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.mixins import OAuthMixinfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManager@@ -40,6 +41,13 @@ class GoogleAnalyticsSource(ResumableSource[GoogleAnalyticsSourceConfig, GoogleAdef source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.GOOGLEANALYTICS+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.google_analytics.canonical_descriptions import ( # noqa: PLC0415+ CANONICAL_DESCRIPTIONS,+ )++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error": "Your Google Analytics connection is invalid or expired. Please reconnect your account.",diff --git a/posthog/temporal/data_imports/sources/gorgias/canonical_descriptions.py b/posthog/temporal/data_imports/sources/gorgias/canonical_descriptions.pynew file mode 100644index 000000000000..99081e4c0019--- /dev/null+++ b/posthog/temporal/data_imports/sources/gorgias/canonical_descriptions.py@@ -0,0 +1,133 @@+"""Canonical, documentation-sourced descriptions for Gorgias endpoints and columns.++Sourced from the official Gorgias REST API reference (https://developers.gorgias.com/reference).+Keyed by the endpoint names in `settings.py` `GORGIAS_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Gorgias table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by most Gorgias objects.+_COMMON_COLUMNS = {+ "id": "Unique identifier for the object.",+ "created_datetime": "Time at which the object was created.",+ "updated_datetime": "Time at which the object was last updated.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "tickets": {+ "description": "A customer support conversation in Gorgias, holding messages and metadata.",+ "docs_url": "https://developers.gorgias.com/reference/get-a-ticket",+ "columns": _columns(+ status="Status of the ticket (open, closed).",+ channel="Channel the ticket came through (e.g. email, chat, phone).",+ subject="Subject line of the ticket.",+ priority="Priority of the ticket.",+ customer="The customer the ticket is with.",+ assignee_user="The agent assigned to the ticket.",+ assignee_team="The team assigned to the ticket.",+ via="The channel the ticket was created through.",+ from_agent="Whether the ticket was created by an agent rather than the customer.",+ is_unread="Whether the ticket has unread messages.",+ opened_datetime="Time at which the ticket was opened.",+ closed_datetime="Time at which the ticket was closed.",+ last_message_datetime="Time of the most recent message on the ticket.",+ tags="Tags applied to the ticket.",+ ),+ },+ "messages": {+ "description": "An individual message within a ticket (inbound or outbound).",+ "docs_url": "https://developers.gorgias.com/reference/get-a-message",+ "columns": _columns(+ ticket_id="ID of the ticket this message belongs to.",+ channel="Channel the message was sent through.",+ via="The medium the message was sent via.",+ source="Sender and recipient details of the message.",+ sender="The author of the message.",+ subject="Subject line of the message.",+ body_text="Plain-text body of the message.",+ body_html="HTML body of the message.",+ from_agent="Whether the message was sent by an agent.",+ sent_datetime="Time at which the message was sent.",+ ),+ },+ "customers": {+ "description": "A customer (end user) who contacts support in Gorgias.",+ "docs_url": "https://developers.gorgias.com/reference/get-a-customer",+ "columns": _columns(+ name="Full name of the customer.",+ email="Primary email address of the customer.",+ firstname="First name of the customer.",+ lastname="Last name of the customer.",+ language="Preferred language of the customer.",+ timezone="Timezone of the customer.",+ channels="Contact channels associated with the customer.",+ ),+ },+ "users": {+ "description": "An internal Gorgias user (support agent or admin).",+ "docs_url": "https://developers.gorgias.com/reference/get-a-user",+ "columns": _columns(+ name="Full name of the user.",+ email="Email address of the user.",+ firstname="First name of the user.",+ lastname="Last name of the user.",+ role="Role of the user (e.g. agent, admin).",+ active="Whether the user account is active.",+ ),+ },+ "satisfaction_surveys": {+ "description": "A customer satisfaction (CSAT) survey response tied to a ticket.",+ "docs_url": "https://developers.gorgias.com/reference/get-a-satisfaction-survey",+ "columns": _columns(+ ticket_id="ID of the ticket the survey relates to.",+ customer_id="ID of the customer who responded.",+ score="Satisfaction score given by the customer.",+ body_text="Free-text feedback left by the customer.",+ scored_datetime="Time at which the survey was scored.",+ sent_datetime="Time at which the survey was sent.",+ ),+ },+ "macros": {+ "description": "A reusable canned response or action template used by agents.",+ "docs_url": "https://developers.gorgias.com/reference/get-a-macro",+ "columns": _columns(+ name="Name of the macro.",+ body_text="Plain-text body of the macro.",+ body_html="HTML body of the macro.",+ language="Language of the macro.",+ actions="Actions performed when the macro is applied.",+ ),+ },+ "tags": {+ "description": "A label that can be applied to tickets to categorize them.",+ "docs_url": "https://developers.gorgias.com/reference/get-a-tag",+ "columns": _columns(+ name="Name of the tag.",+ decoration="Color or styling of the tag.",+ ),+ },+ "views": {+ "description": "A saved, filtered view of tickets used to organize the agent workspace.",+ "docs_url": "https://developers.gorgias.com/reference/get-a-view",+ "columns": _columns(+ name="Name of the view.",+ category="Category the view belongs to.",+ type="Type of object the view lists (e.g. ticket).",+ shared="Whether the view is shared with other users.",+ ),+ },+ "teams": {+ "description": "A team of agents in Gorgias used to route and assign tickets.",+ "docs_url": "https://developers.gorgias.com/reference/get-a-team",+ "columns": _columns(+ name="Name of the team.",+ decoration="Color or styling of the team.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/gorgias/source.py b/posthog/temporal/data_imports/sources/gorgias/source.pyindex 95d870e719d0..10c42ba4bc1a 100644--- a/posthog/temporal/data_imports/sources/gorgias/source.py+++ b/posthog/temporal/data_imports/sources/gorgias/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -31,6 +32,13 @@ class GorgiasSource(ResumableSource[GorgiasSourceConfig, GorgiasResumeConfig]):def source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.GORGIAS+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.gorgias.canonical_descriptions import ( # noqa: PLC0415+ CANONICAL_DESCRIPTIONS,+ )++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized for url": "Gorgias authentication failed. Check your email and API key.",diff --git a/posthog/temporal/data_imports/sources/granola/canonical_descriptions.py b/posthog/temporal/data_imports/sources/granola/canonical_descriptions.pynew file mode 100644index 000000000000..ad79746c18c8--- /dev/null+++ b/posthog/temporal/data_imports/sources/granola/canonical_descriptions.py@@ -0,0 +1,32 @@+"""Canonical, documentation-sourced descriptions for Granola endpoints and columns.++Sourced from the official Granola API reference (https://docs.granola.ai/api-reference). Keyed by the+endpoint names in `settings.py` `GRANOLA_ENDPOINTS`, which match the `ExternalDataSchema.name` of a+synced Granola table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "notes": {+ "description": "A meeting note in Granola with its AI-generated summary and transcript.",+ "docs_url": "https://docs.granola.ai/api-reference/list-notes",+ "columns": {+ "id": "Unique identifier for the note.",+ "title": "Title of the meeting note.",+ "summary": "AI-generated summary of the meeting.",+ "transcript": "Transcript of the meeting.",+ "created_at": "Time at which the note was created.",+ "updated_at": "Time at which the note was last updated.",+ "folder_id": "ID of the folder the note belongs to, if any.",+ },+ },+ "folders": {+ "description": "A folder used to organize notes in Granola.",+ "docs_url": "https://docs.granola.ai/api-reference/list-folders",+ "columns": {+ "id": "Unique identifier for the folder.",+ "name": "Name of the folder.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/granola/source.py b/posthog/temporal/data_imports/sources/granola/source.pyindex 8d5390786c5c..13eff1ee7d44 100644--- a/posthog/temporal/data_imports/sources/granola/source.py+++ b/posthog/temporal/data_imports/sources/granola/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -65,6 +66,13 @@ Only notes with a generated AI summary and transcript are returned by the API.),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.granola.canonical_descriptions import ( # noqa: PLC0415+ CANONICAL_DESCRIPTIONS,+ )++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: GranolaSourceConfig,diff --git a/posthog/temporal/data_imports/sources/greenhouse/canonical_descriptions.py b/posthog/temporal/data_imports/sources/greenhouse/canonical_descriptions.pynew file mode 100644index 000000000000..1e25cbf11203--- /dev/null+++ b/posthog/temporal/data_imports/sources/greenhouse/canonical_descriptions.py@@ -0,0 +1,194 @@+"""Canonical, documentation-sourced descriptions for Greenhouse Harvest endpoints and columns.++Sourced from the official Greenhouse Harvest API reference (https://developers.greenhouse.io/harvest.html).+Keyed by the endpoint names in `settings.py` `GREENHOUSE_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Greenhouse table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by most Greenhouse objects.+_COMMON_COLUMNS = {+ "id": "Unique identifier for the object.",+ "created_at": "Time at which the object was created.",+ "updated_at": "Time at which the object was last updated.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "candidates": {+ "description": "A person who has applied to or been sourced for a job in Greenhouse.",+ "docs_url": "https://developers.greenhouse.io/harvest.html#the-candidate-object",+ "columns": _columns(+ first_name="Candidate's first name.",+ last_name="Candidate's last name.",+ company="Candidate's current company.",+ title="Candidate's current job title.",+ is_private="Whether the candidate record is private.",+ email_addresses="The candidate's email addresses.",+ phone_numbers="The candidate's phone numbers.",+ social_media_addresses="The candidate's social media handles.",+ recruiter="The recruiter assigned to the candidate.",+ coordinator="The coordinator assigned to the candidate.",+ tags="Tags applied to the candidate.",+ applications="Applications associated with the candidate.",+ last_activity="Time of the candidate's most recent activity.",+ ),+ },+ "applications": {+ "description": "A candidate's application to a specific job in Greenhouse.",+ "docs_url": "https://developers.greenhouse.io/harvest.html#the-application-object",+ "columns": _columns(+ candidate_id="ID of the candidate who applied.",+ jobs="Jobs the application is for.",+ status="Status of the application (active, rejected, hired, or converted).",+ applied_at="Time at which the candidate applied.",+ rejected_at="Time at which the application was rejected, if applicable.",+ last_activity_at="Time of the most recent activity on the application.",+ source="The source the application came from.",+ current_stage="The interview stage the application is currently in.",+ rejection_reason="Reason the application was rejected, if applicable.",+ credited_to="The user credited with the application source.",+ ),+ },+ "jobs": {+ "description": "A job (role) being recruited for in Greenhouse.",+ "docs_url": "https://developers.greenhouse.io/harvest.html#the-job-object",+ "columns": _columns(+ name="Title of the job.",+ status="Status of the job (open, closed, or draft).",+ confidential="Whether the job is confidential.",+ requisition_id="External requisition ID for the job.",+ departments="Departments the job belongs to.",+ offices="Offices the job is located in.",+ hiring_team="Users on the job's hiring team.",+ openings="Open headcount for the job.",+ opened_at="Time at which the job was opened.",+ closed_at="Time at which the job was closed.",+ ),+ },+ "job_posts": {+ "description": "A public posting of a job to a job board or career site.",+ "docs_url": "https://developers.greenhouse.io/harvest.html#the-job-post-object",+ "columns": _columns(+ job_id="ID of the job this post is for.",+ title="Title of the job post.",+ location="Location shown on the job post.",+ internal="Whether the post is internal-only.",+ external="Whether the post is published externally.",+ active="Whether the post is currently active.",+ live="Whether the post is currently live.",+ content="Body content of the job post.",+ ),+ },+ "offers": {+ "description": "An offer extended to a candidate for a job in Greenhouse.",+ "docs_url": "https://developers.greenhouse.io/harvest.html#the-offer-object",+ "columns": _columns(+ application_id="ID of the application the offer is tied to.",+ job_id="ID of the job the offer is for.",+ candidate_id="ID of the candidate receiving the offer.",+ version="Version number of the offer.",+ status="Status of the offer (e.g. draft, approved, sent, accepted).",+ sent_at="Time at which the offer was sent.",+ resolved_at="Time at which the offer was resolved.",+ starts_at="Proposed start date in the offer.",+ ),+ },+ "scorecards": {+ "description": "An interviewer's evaluation of a candidate for an interview.",+ "docs_url": "https://developers.greenhouse.io/harvest.html#the-scorecard-object",+ "columns": _columns(+ application_id="ID of the application being evaluated.",+ candidate_id="ID of the candidate being evaluated.",+ interview="Name of the interview the scorecard is for.",+ interview_step="The interview step the scorecard belongs to.",+ interviewer="The interviewer who submitted the scorecard.",+ submitted_by="The user who submitted the scorecard.",+ submitted_at="Time at which the scorecard was submitted.",+ overall_recommendation="The interviewer's overall recommendation (e.g. yes, no, strong yes).",+ attributes="Per-attribute ratings on the scorecard.",+ ),+ },+ "scheduled_interviews": {+ "description": "A scheduled interview event for a candidate's application.",+ "docs_url": "https://developers.greenhouse.io/harvest.html#the-scheduled-interview-object",+ "columns": _columns(+ application_id="ID of the application the interview is for.",+ interview="Name of the interview.",+ organizer="The user who organized the interview.",+ interviewers="The users conducting the interview.",+ status="Status of the scheduled interview.",+ location="Location of the interview.",+ start="Scheduled start time of the interview.",+ end="Scheduled end time of the interview.",+ ),+ },+ "users": {+ "description": "A Greenhouse user account (recruiter, hiring manager, or admin).",+ "docs_url": "https://developers.greenhouse.io/harvest.html#the-user-object",+ "columns": _columns(+ name="Full name of the user.",+ first_name="First name of the user.",+ last_name="Last name of the user.",+ primary_email_address="Primary email address of the user.",+ emails="Email addresses associated with the user.",+ employee_id="External employee ID of the user.",+ disabled="Whether the user account is disabled.",+ site_admin="Whether the user is a site admin.",+ ),+ },+ "departments": {+ "description": "A department that jobs can be assigned to in Greenhouse.",+ "docs_url": "https://developers.greenhouse.io/harvest.html#the-department-object",+ "columns": {+ "id": "Unique identifier for the department.",+ "name": "Name of the department.",+ "parent_id": "ID of the parent department, if nested.",+ "child_ids": "IDs of child departments.",+ "external_id": "External identifier for the department.",+ },+ },+ "offices": {+ "description": "An office location that jobs can be assigned to in Greenhouse.",+ "docs_url": "https://developers.greenhouse.io/harvest.html#the-office-object",+ "columns": {+ "id": "Unique identifier for the office.",+ "name": "Name of the office.",+ "location": "Location details of the office.",+ "parent_id": "ID of the parent office, if nested.",+ "child_ids": "IDs of child offices.",+ "external_id": "External identifier for the office.",+ },+ },+ "sources": {+ "description": "A source that candidates can be attributed to (e.g. a job board or referral).",+ "docs_url": "https://developers.greenhouse.io/harvest.html#the-source-object",+ "columns": {+ "id": "Unique identifier for the source.",+ "name": "Name of the source.",+ "type": "Type of the source.",+ },+ },+ "rejection_reasons": {+ "description": "A configurable reason an application can be rejected for.",+ "docs_url": "https://developers.greenhouse.io/harvest.html#the-rejection-reason-object",+ "columns": {+ "id": "Unique identifier for the rejection reason.",+ "name": "Name of the rejection reason.",+ "type": "Category of the rejection reason.",+ },+ },+ "close_reasons": {+ "description": "A configurable reason a job opening can be closed for.",+ "docs_url": "https://developers.greenhouse.io/harvest.html#the-close-reason-object",+ "columns": {+ "id": "Unique identifier for the close reason.",+ "name": "Name of the close reason.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/greenhouse/source.py b/posthog/temporal/data_imports/sources/greenhouse/source.pyindex 89323a2d9955..fc880f38300c 100644--- a/posthog/temporal/data_imports/sources/greenhouse/source.py+++ b/posthog/temporal/data_imports/sources/greenhouse/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -64,6 +65,13 @@ Grant the key read (`GET`) access to the resources you want to sync — for exam),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.greenhouse.canonical_descriptions import ( # noqa: PLC0415+ CANONICAL_DESCRIPTIONS,+ )++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: GreenhouseSourceConfig,diff --git a/posthog/temporal/data_imports/sources/guru/canonical_descriptions.py b/posthog/temporal/data_imports/sources/guru/canonical_descriptions.pynew file mode 100644index 000000000000..169720150984--- /dev/null+++ b/posthog/temporal/data_imports/sources/guru/canonical_descriptions.py@@ -0,0 +1,69 @@+"""Canonical, documentation-sourced descriptions for Guru endpoints and columns.++Sourced from the official Guru API reference (https://developer.getguru.com/reference). Keyed by the+endpoint names in `settings.py` `GURU_ENDPOINTS`, which match the `ExternalDataSchema.name` of a+synced Guru table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "cards": {+ "description": "A knowledge card (article) in Guru, the core unit of documented knowledge.",+ "docs_url": "https://developer.getguru.com/reference/getv1searchquery",+ "columns": {+ "id": "Unique identifier for the card.",+ "preferredPhrase": "Title of the card.",+ "content": "HTML content of the card.",+ "collection": "The collection the card belongs to.",+ "owner": "The user who owns the card.",+ "verificationState": "Whether the card is trusted, needs verification, etc.",+ "verificationInterval": "How often the card must be re-verified, in days.",+ "lastVerified": "Time at which the card was last verified.",+ "lastModified": "Time at which the card was last modified.",+ "lastModifiedBy": "The user who last modified the card.",+ "dateCreated": "Time at which the card was created.",+ "boards": "Boards the card is organized under.",+ "tags": "Tags applied to the card.",+ "shareStatus": "Sharing scope of the card (e.g. team, author).",+ },+ },+ "collections": {+ "description": "A collection — a top-level grouping of cards in Guru, owned by a group.",+ "docs_url": "https://developer.getguru.com/reference/getv1collections",+ "columns": {+ "id": "Unique identifier for the collection.",+ "name": "Name of the collection.",+ "description": "Description of the collection.",+ "color": "Display color of the collection.",+ "collectionType": "Type of the collection (e.g. internal, external).",+ "publicCardsEnabled": "Whether public cards are enabled for the collection.",+ "roiEnabled": "Whether ROI tracking is enabled for the collection.",+ "cards": "Number of cards in the collection.",+ "dateCreated": "Time at which the collection was created.",+ },+ },+ "groups": {+ "description": "A group of users in Guru used to control access to collections.",+ "docs_url": "https://developer.getguru.com/reference/getv1groups",+ "columns": {+ "id": "Unique identifier for the group.",+ "name": "Name of the group.",+ "modifiable": "Whether the group can be modified.",+ "dateCreated": "Time at which the group was created.",+ "numberOfMembers": "Number of members in the group.",+ },+ },+ "members": {+ "description": "A member (user) of the Guru team.",+ "docs_url": "https://developer.getguru.com/reference/getv1members",+ "columns": {+ "email": "Email address of the member (used as the primary key).",+ "user": "The underlying user object for the member.",+ "status": "Account status of the member (e.g. active, invited).",+ "dateCreated": "Time at which the member was added.",+ "lastSeen": "Time the member was last active.",+ "groups": "Groups the member belongs to.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/guru/source.py b/posthog/temporal/data_imports/sources/guru/source.pyindex 8b1e38cd922a..229936ade30a 100644--- a/posthog/temporal/data_imports/sources/guru/source.py+++ b/posthog/temporal/data_imports/sources/guru/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -31,6 +32,13 @@ class GuruSource(ResumableSource[GuruSourceConfig, GuruResumeConfig]):def source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.GURU+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.guru.canonical_descriptions import ( # noqa: PLC0415+ CANONICAL_DESCRIPTIONS,+ )++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized for url: https://api.getguru.com": "Guru authentication failed. Please check your username and API token.",diff --git a/posthog/temporal/data_imports/sources/hibob/canonical_descriptions.py b/posthog/temporal/data_imports/sources/hibob/canonical_descriptions.pynew file mode 100644index 000000000000..b411529d7050--- /dev/null+++ b/posthog/temporal/data_imports/sources/hibob/canonical_descriptions.py@@ -0,0 +1,44 @@+"""Canonical, documentation-sourced descriptions for HiBob (Bob) endpoints and columns.++Sourced from the official HiBob (Bob) API reference (https://apidocs.hibob.com/reference). Keyed by+the endpoint names in `settings.py` `HIBOB_ENDPOINTS`, which match the `ExternalDataSchema.name` of a+synced HiBob table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "employees": {+ "description": "An employee record in Bob, including their personal, work, and employment details.",+ "docs_url": "https://apidocs.hibob.com/reference/post_people-search",+ "columns": {+ "id": "Unique identifier for the employee.",+ "firstName": "The employee's first name.",+ "surname": "The employee's surname (last name).",+ "displayName": "The employee's display name.",+ "email": "The employee's work email address.",+ "personal": "Personal details such as date of birth, nationality, and contact information.",+ "work": "Work details such as department, site, title, manager, and start date.",+ "about": "About details such as social links, hobbies, and food preferences.",+ "fullName": "The employee's full name.",+ "companyId": "Identifier of the company the employee belongs to.",+ "creationDate": "Date the employee record was created.",+ "humanReadable": "Whether reference and list values are flattened into readable strings.",+ },+ },+ "tasks": {+ "description": "A task assigned to employees in Bob, typically part of an onboarding or offboarding workflow.",+ "docs_url": "https://apidocs.hibob.com/reference/get_tasks",+ "columns": {+ "id": "Unique identifier for the task.",+ "employeeId": "Identifier of the employee the task is assigned to.",+ "name": "The task's name or title.",+ "description": "Description of what the task involves.",+ "status": "Current status of the task (e.g. open, completed).",+ "dueDate": "Date by which the task should be completed.",+ "completionDate": "Date the task was completed, if it has been.",+ "listId": "Identifier of the task list the task belongs to.",+ "listName": "Name of the task list the task belongs to.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/hibob/source.py b/posthog/temporal/data_imports/sources/hibob/source.pyindex 6729c00571b9..293fbaa02700 100644--- a/posthog/temporal/data_imports/sources/hibob/source.py+++ b/posthog/temporal/data_imports/sources/hibob/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, SimpleSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.schema import SourceSchemafrom posthog.temporal.data_imports.sources.generated_configs import HiBobSourceConfig@@ -29,6 +30,11 @@ class HiBobSource(SimpleSource[HiBobSourceConfig]):def source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.HIBOB+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.hibob.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:# Repeated 401/403s trip HiBob's WAF (5-minute IP block), so failing# fast on auth errors matters more than usual here.diff --git a/posthog/temporal/data_imports/sources/incident_io/canonical_descriptions.py b/posthog/temporal/data_imports/sources/incident_io/canonical_descriptions.pynew file mode 100644index 000000000000..0e293839be96--- /dev/null+++ b/posthog/temporal/data_imports/sources/incident_io/canonical_descriptions.py@@ -0,0 +1,180 @@+"""Canonical, documentation-sourced descriptions for incident.io endpoints and columns.++Sourced from the official incident.io API reference (https://api-docs.incident.io). Keyed by the+endpoint names in `settings.py` `INCIDENT_IO_ENDPOINTS`, which match the `ExternalDataSchema.name` of a+synced incident.io table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "incidents": {+ "description": "An incident tracked in incident.io, with its status, severity, and timeline.",+ "docs_url": "https://api-docs.incident.io/tag/Incidents-V2",+ "columns": {+ "id": "Unique identifier for the incident.",+ "name": "The incident's name.",+ "summary": "Summary describing what the incident is about.",+ "reference": "Human-readable reference for the incident (e.g. INC-123).",+ "incident_status": "The current status of the incident (e.g. triage, investigating, resolved, closed).",+ "severity": "The severity assigned to the incident.",+ "incident_type": "The type of the incident.",+ "mode": "Whether the incident is real, a test, a tutorial, or retrospective.",+ "visibility": "Whether the incident is public or private.",+ "permalink": "Link to the incident in the incident.io dashboard.",+ "slack_channel_id": "Identifier of the Slack channel created for the incident.",+ "slack_channel_name": "Name of the Slack channel created for the incident.",+ "incident_role_assignments": "Users assigned to incident roles (e.g. lead, reporter).",+ "custom_field_entries": "Values of custom fields set on the incident.",+ "created_at": "Time at which the incident was created.",+ "updated_at": "Time at which the incident was last updated.",+ },+ },+ "incident_updates": {+ "description": "A status update posted to the timeline of an incident in incident.io.",+ "docs_url": "https://api-docs.incident.io/tag/Incident-Updates-V2",+ "columns": {+ "id": "Unique identifier for the incident update.",+ "incident_id": "Identifier of the incident this update belongs to.",+ "message": "The message content of the update.",+ "new_incident_status": "The incident status set by this update.",+ "new_severity": "The incident severity set by this update.",+ "updater": "The user who posted the update.",+ "created_at": "Time at which the update was posted.",+ },+ },+ "follow_ups": {+ "description": "A follow-up action item created from an incident in incident.io.",+ "docs_url": "https://api-docs.incident.io/tag/Follow-ups-V2",+ "columns": {+ "id": "Unique identifier for the follow-up.",+ "incident_id": "Identifier of the incident this follow-up came from.",+ "title": "The follow-up's title.",+ "description": "Description of the follow-up action.",+ "status": "Current status of the follow-up (e.g. outstanding, completed, deleted).",+ "assignee": "The user the follow-up is assigned to.",+ "priority": "The priority assigned to the follow-up.",+ "external_issue_reference": "Reference to the linked external issue (e.g. Jira, GitHub).",+ "completed_at": "Time at which the follow-up was completed.",+ "created_at": "Time at which the follow-up was created.",+ "updated_at": "Time at which the follow-up was last updated.",+ },+ },+ "alerts": {+ "description": "An alert ingested into incident.io that may be attached to or trigger an incident.",+ "docs_url": "https://api-docs.incident.io/tag/Alerts-V2",+ "columns": {+ "id": "Unique identifier for the alert.",+ "title": "The alert's title.",+ "description": "Description of the alert.",+ "status": "Current status of the alert (e.g. firing, resolved).",+ "alert_source_id": "Identifier of the source that created the alert.",+ "deduplication_key": "Key used to deduplicate repeated alerts.",+ "attributes": "Custom attribute values attached to the alert.",+ "created_at": "Time at which the alert was created.",+ "updated_at": "Time at which the alert was last updated.",+ "resolved_at": "Time at which the alert was resolved.",+ },+ },+ "escalations": {+ "description": "An escalation in incident.io that pages on-call responders for an alert or incident.",+ "docs_url": "https://api-docs.incident.io/tag/Escalations-V2",+ "columns": {+ "id": "Unique identifier for the escalation.",+ "title": "The escalation's title.",+ "status": "Current status of the escalation (e.g. pending, triggered, acknowledged, resolved).",+ "priority": "The priority of the escalation.",+ "created_at": "Time at which the escalation was created.",+ "updated_at": "Time at which the escalation was last updated.",+ },+ },+ "users": {+ "description": "A user in the incident.io organization.",+ "docs_url": "https://api-docs.incident.io/tag/Users-V2",+ "columns": {+ "id": "Unique identifier for the user.",+ "name": "The user's full name.",+ "email": "The user's email address.",+ "slack_user_id": "Identifier of the user's linked Slack account.",+ "role": "The user's role in the organization (e.g. viewer, responder, administrator).",+ },+ },+ "schedules": {+ "description": "An on-call schedule defining who is on-call and when in incident.io.",+ "docs_url": "https://api-docs.incident.io/tag/Schedules-V2",+ "columns": {+ "id": "Unique identifier for the schedule.",+ "name": "The schedule's name.",+ "timezone": "The timezone the schedule's rotations are defined in.",+ "config": "The rotation configuration for the schedule.",+ "current_shifts": "The shifts currently active on the schedule.",+ "created_at": "Time at which the schedule was created.",+ "updated_at": "Time at which the schedule was last updated.",+ },+ },+ "severities": {+ "description": "A severity level that can be assigned to incidents in incident.io.",+ "docs_url": "https://api-docs.incident.io/tag/Severities-V1",+ "columns": {+ "id": "Unique identifier for the severity.",+ "name": "The severity's name (e.g. Minor, Major, Critical).",+ "description": "Description of when this severity applies.",+ "rank": "Numeric rank used to order severities by seriousness.",+ "created_at": "Time at which the severity was created.",+ "updated_at": "Time at which the severity was last updated.",+ },+ },+ "incident_roles": {+ "description": "A role that can be assigned to responders during an incident in incident.io.",+ "docs_url": "https://api-docs.incident.io/tag/Incident-Roles-V2",+ "columns": {+ "id": "Unique identifier for the incident role.",+ "name": "The role's name (e.g. Incident Lead).",+ "description": "Description of the role's responsibilities.",+ "instructions": "Instructions shown to the person assigned this role.",+ "shortform": "Short form of the role name.",+ "required": "Whether this role must be assigned for every incident.",+ "role_type": "The type of the role (e.g. lead, reporter, custom).",+ "created_at": "Time at which the role was created.",+ "updated_at": "Time at which the role was last updated.",+ },+ },+ "incident_statuses": {+ "description": "A status an incident can be in within incident.io (e.g. triage, investigating, closed).",+ "docs_url": "https://api-docs.incident.io/tag/Incident-Statuses-V1",+ "columns": {+ "id": "Unique identifier for the incident status.",+ "name": "The status's name.",+ "description": "Description of what the status represents.",+ "category": "The lifecycle category of the status (e.g. active, post-incident, closed).",+ "rank": "Numeric rank used to order statuses.",+ "created_at": "Time at which the status was created.",+ "updated_at": "Time at which the status was last updated.",+ },+ },+ "incident_types": {+ "description": "A type that categorizes incidents in incident.io, controlling which custom fields apply.",+ "docs_url": "https://api-docs.incident.io/tag/Incident-Types-V1",+ "columns": {+ "id": "Unique identifier for the incident type.",+ "name": "The incident type's name.",+ "description": "Description of the incident type.",+ "is_default": "Whether this is the default incident type.",+ "created_at": "Time at which the type was created.",+ "updated_at": "Time at which the type was last updated.",+ },+ },+ "custom_fields": {+ "description": "A custom field that can be set on incidents in incident.io.",+ "docs_url": "https://api-docs.incident.io/tag/Custom-Fields-V2",+ "columns": {+ "id": "Unique identifier for the custom field.",+ "name": "The custom field's name.",+ "description": "Description of the custom field.",+ "field_type": "The data type of the field (e.g. single_select, multi_select, text, link, numeric).",+ "options": "Available options for select-type custom fields.",+ "created_at": "Time at which the custom field was created.",+ "updated_at": "Time at which the custom field was last updated.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/incident_io/source.py b/posthog/temporal/data_imports/sources/incident_io/source.pyindex eb243431a2e5..cdcdb69531cc 100644--- a/posthog/temporal/data_imports/sources/incident_io/source.py+++ b/posthog/temporal/data_imports/sources/incident_io/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -31,6 +32,11 @@ class IncidentIoSource(ResumableSource[IncidentIoSourceConfig, IncidentIoResumeCdef source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.INCIDENTIO+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.incident_io.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized for url: https://api.incident.io": "incident.io authentication failed. Please check that your API key is valid and has not been revoked.",diff --git a/posthog/temporal/data_imports/sources/intercom/canonical_descriptions.py b/posthog/temporal/data_imports/sources/intercom/canonical_descriptions.pynew file mode 100644index 000000000000..953638fbf928--- /dev/null+++ b/posthog/temporal/data_imports/sources/intercom/canonical_descriptions.py@@ -0,0 +1,230 @@+"""Canonical, documentation-sourced descriptions for Intercom endpoints and columns.++Sourced from the official Intercom REST API reference (https://developers.intercom.com/docs/references/rest-api).+Keyed by the endpoint names in `settings.py` `INTERCOM_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Intercom table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "admins": {+ "description": "A teammate (admin) in the Intercom workspace who can reply to and manage conversations.",+ "docs_url": "https://developers.intercom.com/docs/references/rest-api/api.intercom.io/admins/listadmins",+ "columns": {+ "id": "Unique identifier for the admin.",+ "type": "The object type, always 'admin'.",+ "name": "The admin's name.",+ "email": "The admin's email address.",+ "job_title": "The admin's job title.",+ "away_mode_enabled": "Whether the admin has away mode turned on.",+ "away_mode_reassign": "Whether conversations are reassigned while the admin is away.",+ "has_inbox_seat": "Whether the admin has a seat in the Intercom inbox.",+ "team_ids": "Identifiers of the teams the admin belongs to.",+ },+ },+ "teams": {+ "description": "A team of admins in the Intercom workspace.",+ "docs_url": "https://developers.intercom.com/docs/references/rest-api/api.intercom.io/teams/listteams",+ "columns": {+ "id": "Unique identifier for the team.",+ "type": "The object type, always 'team'.",+ "name": "The team's name.",+ "admin_ids": "Identifiers of the admins who are members of the team.",+ },+ },+ "tags": {+ "description": "A tag used to label conversations, contacts, and companies in Intercom.",+ "docs_url": "https://developers.intercom.com/docs/references/rest-api/api.intercom.io/tags/listtags",+ "columns": {+ "id": "Unique identifier for the tag.",+ "type": "The object type, always 'tag'.",+ "name": "The tag's name.",+ },+ },+ "segments": {+ "description": "A segment grouping contacts that match a set of conditions in Intercom.",+ "docs_url": "https://developers.intercom.com/docs/references/rest-api/api.intercom.io/segments/listsegments",+ "columns": {+ "id": "Unique identifier for the segment.",+ "type": "The object type, always 'segment'.",+ "name": "The segment's name.",+ "person_type": "Whether the segment applies to users or leads.",+ "count": "Number of contacts currently in the segment.",+ "created_at": "Time at which the segment was created, as a Unix timestamp.",+ "updated_at": "Time at which the segment was last updated, as a Unix timestamp.",+ },+ },+ "companies": {+ "description": "A company (account) in Intercom that contacts can be associated with.",+ "docs_url": "https://developers.intercom.com/docs/references/rest-api/api.intercom.io/companies/listallcompanies",+ "columns": {+ "id": "Unique identifier for the company.",+ "type": "The object type, always 'company'.",+ "company_id": "The external company identifier you assigned.",+ "name": "The company's name.",+ "plan": "The plan the company is on.",+ "size": "The number of employees at the company.",+ "website": "The company's website.",+ "industry": "The company's industry.",+ "monthly_spend": "The company's monthly spend.",+ "session_count": "Number of sessions recorded for the company.",+ "user_count": "Number of contacts associated with the company.",+ "custom_attributes": "Custom attribute values set on the company.",+ "created_at": "Time at which the company was added to Intercom, as a Unix timestamp.",+ "updated_at": "Time at which the company was last updated, as a Unix timestamp.",+ "last_request_at": "Time of the company's most recent activity, as a Unix timestamp.",+ },+ },+ "contacts": {+ "description": "A contact in Intercom — a user or lead you communicate with.",+ "docs_url": "https://developers.intercom.com/docs/references/rest-api/api.intercom.io/contacts/listcontacts",+ "columns": {+ "id": "Unique identifier for the contact.",+ "type": "The object type, always 'contact'.",+ "role": "Whether the contact is a user or a lead.",+ "external_id": "The external identifier you assigned to the contact.",+ "name": "The contact's name.",+ "email": "The contact's email address.",+ "phone": "The contact's phone number.",+ "avatar": "The contact's avatar image.",+ "owner_id": "Identifier of the admin who owns the contact.",+ "custom_attributes": "Custom attribute values set on the contact.",+ "last_seen_at": "Time the contact was last seen, as a Unix timestamp.",+ "signed_up_at": "Time the contact signed up, as a Unix timestamp.",+ "created_at": "Time at which the contact was created, as a Unix timestamp.",+ "updated_at": "Time at which the contact was last updated, as a Unix timestamp.",+ },+ },+ "conversations": {+ "description": "A conversation between a contact and your team in Intercom.",+ "docs_url": "https://developers.intercom.com/docs/references/rest-api/api.intercom.io/conversations/listconversations",+ "columns": {+ "id": "Unique identifier for the conversation.",+ "type": "The object type, always 'conversation'.",+ "title": "The conversation's title.",+ "state": "Current state of the conversation (e.g. open, closed, snoozed).",+ "open": "Whether the conversation is currently open.",+ "read": "Whether the conversation has been read.",+ "priority": "The priority of the conversation (priority or not_priority).",+ "admin_assignee_id": "Identifier of the admin the conversation is assigned to.",+ "team_assignee_id": "Identifier of the team the conversation is assigned to.",+ "source": "Details of the message that started the conversation.",+ "contacts": "The contacts participating in the conversation.",+ "statistics": "Aggregate statistics about the conversation (response times, counts).",+ "created_at": "Time at which the conversation was created, as a Unix timestamp.",+ "updated_at": "Time at which the conversation was last updated, as a Unix timestamp.",+ },+ },+ "tickets": {+ "description": "A ticket in Intercom tracking a customer request through to resolution.",+ "docs_url": "https://developers.intercom.com/docs/references/rest-api/api.intercom.io/tickets/listtickets",+ "columns": {+ "id": "Unique identifier for the ticket.",+ "type": "The object type, always 'ticket'.",+ "ticket_id": "The user-facing ticket number.",+ "ticket_state": "Current state of the ticket (e.g. submitted, in_progress, resolved).",+ "ticket_type": "The type of the ticket.",+ "category": "The ticket category (e.g. Customer, Back-office, Tracker).",+ "ticket_attributes": "Values of the ticket's attributes.",+ "admin_assignee_id": "Identifier of the admin the ticket is assigned to.",+ "team_assignee_id": "Identifier of the team the ticket is assigned to.",+ "contacts": "The contacts associated with the ticket.",+ "open": "Whether the ticket is currently open.",+ "created_at": "Time at which the ticket was created, as a Unix timestamp.",+ "updated_at": "Time at which the ticket was last updated, as a Unix timestamp.",+ },+ },+ "articles": {+ "description": "A help center article in Intercom.",+ "docs_url": "https://developers.intercom.com/docs/references/rest-api/api.intercom.io/articles/listarticles",+ "columns": {+ "id": "Unique identifier for the article.",+ "type": "The object type, always 'article'.",+ "title": "The article's title.",+ "description": "Short description of the article.",+ "body": "The article's HTML body.",+ "author_id": "Identifier of the admin who authored the article.",+ "state": "Whether the article is published or a draft.",+ "parent_id": "Identifier of the collection the article belongs to.",+ "url": "Public URL of the article.",+ "created_at": "Time at which the article was created, as a Unix timestamp.",+ "updated_at": "Time at which the article was last updated, as a Unix timestamp.",+ },+ },+ "activity_logs": {+ "description": "An entry in the admin activity log recording an action taken in the Intercom workspace.",+ "docs_url": "https://developers.intercom.com/docs/references/rest-api/api.intercom.io/admins/listactivitylogs",+ "columns": {+ "id": "Unique identifier for the activity log entry.",+ "performed_by": "The admin who performed the action.",+ "metadata": "Details about the action that was performed.",+ "activity_type": "The type of action performed (e.g. admin_login, message_state_change).",+ "activity_description": "Human-readable description of the action.",+ "created_at": "Time at which the action was performed, as a Unix timestamp.",+ },+ },+ "company_attributes": {+ "description": "A data attribute (built-in or custom) defined on the company model in Intercom.",+ "docs_url": "https://developers.intercom.com/docs/references/rest-api/api.intercom.io/data-attributes/lisdataattributes",+ "columns": {+ "name": "The attribute's name, unique within the company model.",+ "type": "The object type, always 'data_attribute'.",+ "model": "The model the attribute belongs to, always 'company'.",+ "full_name": "Fully qualified name of the attribute.",+ "label": "Human-readable label for the attribute.",+ "description": "Description of the attribute.",+ "data_type": "The data type of the attribute (e.g. string, integer, boolean, date).",+ "custom": "Whether the attribute is custom (true) or built-in (false).",+ "archived": "Whether the attribute has been archived.",+ "created_at": "Time at which the attribute was created, as a Unix timestamp.",+ "updated_at": "Time at which the attribute was last updated, as a Unix timestamp.",+ },+ },+ "contact_attributes": {+ "description": "A data attribute (built-in or custom) defined on the contact model in Intercom.",+ "docs_url": "https://developers.intercom.com/docs/references/rest-api/api.intercom.io/data-attributes/lisdataattributes",+ "columns": {+ "name": "The attribute's name, unique within the contact model.",+ "type": "The object type, always 'data_attribute'.",+ "model": "The model the attribute belongs to, always 'contact'.",+ "full_name": "Fully qualified name of the attribute.",+ "label": "Human-readable label for the attribute.",+ "description": "Description of the attribute.",+ "data_type": "The data type of the attribute (e.g. string, integer, boolean, date).",+ "custom": "Whether the attribute is custom (true) or built-in (false).",+ "archived": "Whether the attribute has been archived.",+ "created_at": "Time at which the attribute was created, as a Unix timestamp.",+ "updated_at": "Time at which the attribute was last updated, as a Unix timestamp.",+ },+ },+ "conversation_parts": {+ "description": "An individual part (message, note, or assignment) within an Intercom conversation.",+ "docs_url": "https://developers.intercom.com/docs/references/rest-api/api.intercom.io/conversations/retrieveconversation",+ "columns": {+ "id": "Unique identifier for the conversation part.",+ "type": "The object type, always 'conversation_part'.",+ "conversation_id": "Identifier of the conversation this part belongs to.",+ "part_type": "The kind of part (e.g. comment, note, assignment, close).",+ "body": "The HTML body of the part.",+ "author": "The author (admin, contact, or bot) of the part.",+ "assigned_to": "The admin or team the part assigned the conversation to, if any.",+ "created_at": "Time at which the part was created, as a Unix timestamp.",+ "updated_at": "Time at which the part was last updated, as a Unix timestamp.",+ "notified_at": "Time at which participants were notified of the part, as a Unix timestamp.",+ },+ },+ "company_segments": {+ "description": "The link between a company and a segment it belongs to in Intercom.",+ "docs_url": "https://developers.intercom.com/docs/references/rest-api/api.intercom.io/companies/listsegmentsacompanybelongsto",+ "columns": {+ "id": "Unique identifier for the segment.",+ "company_id": "Identifier of the company the segment is associated with.",+ "type": "The object type, always 'segment'.",+ "name": "The segment's name.",+ "person_type": "Whether the segment applies to users or leads.",+ "created_at": "Time at which the segment was created, as a Unix timestamp.",+ "updated_at": "Time at which the segment was last updated, as a Unix timestamp.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/intercom/source.py b/posthog/temporal/data_imports/sources/intercom/source.pyindex db93f914d352..315309c70cf5 100644--- a/posthog/temporal/data_imports/sources/intercom/source.py+++ b/posthog/temporal/data_imports/sources/intercom/source.py@@ -10,6 +10,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, SimpleSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.mixins import OAuthMixinfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -29,6 +30,11 @@ class IntercomSource(SimpleSource[IntercomSourceConfig], OAuthMixin):def source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.INTERCOM+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.intercom.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error": "Your Intercom connection is invalid or expired. Please reconnect it.",diff --git a/posthog/temporal/data_imports/sources/iterable/canonical_descriptions.py b/posthog/temporal/data_imports/sources/iterable/canonical_descriptions.pynew file mode 100644index 000000000000..9ef8247f6856--- /dev/null+++ b/posthog/temporal/data_imports/sources/iterable/canonical_descriptions.py@@ -0,0 +1,80 @@+"""Canonical, documentation-sourced descriptions for Iterable endpoints and columns.++Sourced from the official Iterable API reference (https://api.iterable.com/api/docs). Keyed by the+endpoint names in `settings.py` `ITERABLE_ENDPOINTS`, which match the `ExternalDataSchema.name` of a+synced Iterable table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "campaigns": {+ "description": "A marketing campaign in Iterable that sends messages to a target audience.",+ "docs_url": "https://api.iterable.com/api/docs#campaigns_campaigns",+ "columns": {+ "id": "Unique identifier for the campaign.",+ "name": "The campaign's name.",+ "templateId": "Identifier of the template used by the campaign.",+ "messageMedium": "The medium the campaign sends through (e.g. Email, Push, SMS).",+ "campaignState": "Current state of the campaign (e.g. Draft, Ready, Running, Finished).",+ "type": "The campaign type (e.g. Blast, Triggered).",+ "listIds": "Identifiers of the lists the campaign sends to.",+ "suppressionListIds": "Identifiers of the lists suppressed from the campaign.",+ "labels": "Labels applied to the campaign.",+ "createdAt": "Time at which the campaign was created, as a Unix timestamp in milliseconds.",+ "updatedAt": "Time at which the campaign was last updated, as a Unix timestamp in milliseconds.",+ "startAt": "Scheduled send time of the campaign, as a Unix timestamp in milliseconds.",+ "endedAt": "Time at which the campaign finished sending, as a Unix timestamp in milliseconds.",+ "createdByUserId": "Identifier of the user who created the campaign.",+ "sendSize": "Number of recipients the campaign was sent to.",+ },+ },+ "channels": {+ "description": "A messaging channel in Iterable that groups message types (e.g. a marketing or transactional channel).",+ "docs_url": "https://api.iterable.com/api/docs#channels_channels",+ "columns": {+ "id": "Unique identifier for the channel.",+ "name": "The channel's name.",+ "channelType": "The channel's type (e.g. Marketing, Transactional).",+ "messageMedium": "The medium the channel sends through (e.g. Email, Push, SMS).",+ },+ },+ "lists": {+ "description": "A list of subscribers in Iterable used to target messages.",+ "docs_url": "https://api.iterable.com/api/docs#lists_getLists",+ "columns": {+ "id": "Unique identifier for the list.",+ "name": "The list's name.",+ "description": "Description of the list.",+ "listType": "The list's type (e.g. Standard).",+ "createdAt": "Time at which the list was created, as a Unix timestamp.",+ },+ },+ "message_types": {+ "description": "A message type in Iterable, used for subscription management within a channel.",+ "docs_url": "https://api.iterable.com/api/docs#messageTypes_messageTypes",+ "columns": {+ "id": "Unique identifier for the message type.",+ "name": "The message type's name.",+ "channelId": "Identifier of the channel this message type belongs to.",+ "subscriptionPolicy": "The subscription policy (e.g. OptIn, OptOut).",+ "rateLimitPerMinute": "Maximum number of messages of this type sent per minute.",+ "frequencyCap": "Frequency cap applied to this message type.",+ "createdAt": "Time at which the message type was created, as a Unix timestamp.",+ "updatedAt": "Time at which the message type was last updated, as a Unix timestamp.",+ },+ },+ "templates": {+ "description": "A reusable message template in Iterable used by campaigns and triggered sends.",+ "docs_url": "https://api.iterable.com/api/docs#templates_getTemplates",+ "columns": {+ "templateId": "Unique identifier for the template.",+ "name": "The template's name.",+ "messageTypeId": "Identifier of the message type the template belongs to.",+ "creatorUserId": "Identifier of the user who created the template.",+ "clientTemplateId": "Client-assigned identifier for the template.",+ "createdAt": "Time at which the template was created, as a Unix timestamp.",+ "updatedAt": "Time at which the template was last updated, as a Unix timestamp.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/iterable/source.py b/posthog/temporal/data_imports/sources/iterable/source.pyindex 636fc25a78bb..449589783439 100644--- a/posthog/temporal/data_imports/sources/iterable/source.py+++ b/posthog/temporal/data_imports/sources/iterable/source.py@@ -13,6 +13,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -33,6 +34,11 @@ class IterableSource(ResumableSource[IterableSourceConfig, IterableResumeConfig]def source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.ITERABLE+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.iterable.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error": (diff --git a/posthog/temporal/data_imports/sources/jira/canonical_descriptions.py b/posthog/temporal/data_imports/sources/jira/canonical_descriptions.pynew file mode 100644index 000000000000..86de009e8d28--- /dev/null+++ b/posthog/temporal/data_imports/sources/jira/canonical_descriptions.py@@ -0,0 +1,139 @@+"""Canonical, documentation-sourced descriptions for Jira endpoints and columns.++Sourced from the official Jira Cloud REST API v3 reference+(https://developer.atlassian.com/cloud/jira/platform/rest/v3/). Keyed by the endpoint names in+`settings.py` `JIRA_ENDPOINTS`, which match the `ExternalDataSchema.name` of a synced Jira table.+Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "issues": {+ "description": "A Jira issue — a task, bug, story, or other unit of work tracked in a project.",+ "docs_url": "https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-search/#api-rest-api-3-search-jql-get",+ "columns": {+ "id": "Unique identifier for the issue.",+ "key": "Human-readable issue key (e.g. PROJ-123).",+ "self": "URL of the issue's REST resource.",+ "fields": "The issue's field values (summary, status, assignee, dates, custom fields, and more).",+ "expand": "Which parts of the issue were expanded in the response.",+ },+ },+ "projects": {+ "description": "A Jira project that groups issues and configuration.",+ "docs_url": "https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-projects/#api-rest-api-3-project-search-get",+ "columns": {+ "id": "Unique identifier for the project.",+ "key": "The project's key, used as a prefix for issue keys.",+ "name": "The project's name.",+ "projectTypeKey": "The project type (e.g. software, service_desk, business).",+ "lead": "The user who leads the project.",+ "simplified": "Whether the project is a simplified (team-managed) project.",+ "style": "The project style (classic or next-gen).",+ "isPrivate": "Whether the project is private.",+ "self": "URL of the project's REST resource.",+ },+ },+ "users": {+ "description": "A user account that can access the Jira site.",+ "docs_url": "https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-users/#api-rest-api-3-users-search-get",+ "columns": {+ "accountId": "Unique account identifier for the user.",+ "accountType": "The account type (e.g. atlassian, app, customer).",+ "displayName": "The user's display name.",+ "emailAddress": "The user's email address, if visible.",+ "active": "Whether the user account is active.",+ "self": "URL of the user's REST resource.",+ },+ },+ "fields": {+ "description": "A field (system or custom) available on Jira issues.",+ "docs_url": "https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-fields/#api-rest-api-3-field-get",+ "columns": {+ "id": "Unique identifier for the field.",+ "key": "The field's key.",+ "name": "The field's display name.",+ "custom": "Whether the field is a custom field.",+ "navigable": "Whether the field can appear in issue navigator columns.",+ "searchable": "Whether the field can be searched via JQL.",+ "schema": "The field's data type schema.",+ },+ },+ "issue_types": {+ "description": "A type that categorizes Jira issues (e.g. Bug, Story, Task, Epic).",+ "docs_url": "https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-types/#api-rest-api-3-issuetype-get",+ "columns": {+ "id": "Unique identifier for the issue type.",+ "name": "The issue type's name.",+ "description": "Description of the issue type.",+ "subtask": "Whether this issue type is a subtask type.",+ "hierarchyLevel": "The hierarchy level of the issue type (e.g. epic, standard, subtask).",+ "iconUrl": "URL of the issue type's icon.",+ "self": "URL of the issue type's REST resource.",+ },+ },+ "statuses": {+ "description": "A workflow status an issue can be in (e.g. To Do, In Progress, Done).",+ "docs_url": "https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflow-statuses/#api-rest-api-3-status-get",+ "columns": {+ "id": "Unique identifier for the status.",+ "name": "The status's name.",+ "description": "Description of the status.",+ "statusCategory": "The category the status belongs to (To Do, In Progress, Done).",+ "iconUrl": "URL of the status's icon.",+ "self": "URL of the status's REST resource.",+ },+ },+ "priorities": {+ "description": "A priority level that can be assigned to a Jira issue (e.g. Highest, High, Medium).",+ "docs_url": "https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-priorities/#api-rest-api-3-priority-get",+ "columns": {+ "id": "Unique identifier for the priority.",+ "name": "The priority's name.",+ "description": "Description of the priority.",+ "statusColor": "Hex color associated with the priority.",+ "iconUrl": "URL of the priority's icon.",+ "self": "URL of the priority's REST resource.",+ },+ },+ "resolutions": {+ "description": "A resolution that explains how an issue was closed (e.g. Done, Won't Do, Duplicate).",+ "docs_url": "https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-resolutions/#api-rest-api-3-resolution-get",+ "columns": {+ "id": "Unique identifier for the resolution.",+ "name": "The resolution's name.",+ "description": "Description of the resolution.",+ "self": "URL of the resolution's REST resource.",+ },+ },+ "dashboards": {+ "description": "A Jira dashboard that displays gadgets summarizing issues and activity.",+ "docs_url": "https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-dashboards/#api-rest-api-3-dashboard-get",+ "columns": {+ "id": "Unique identifier for the dashboard.",+ "name": "The dashboard's name.",+ "description": "Description of the dashboard.",+ "owner": "The user who owns the dashboard.",+ "view": "URL to view the dashboard.",+ "popularity": "Number of users who have favorited the dashboard.",+ "isFavourite": "Whether the requesting user has favorited the dashboard.",+ "self": "URL of the dashboard's REST resource.",+ },+ },+ "filters": {+ "description": "A saved JQL filter in Jira used to find a set of issues.",+ "docs_url": "https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-filters/#api-rest-api-3-filter-search-get",+ "columns": {+ "id": "Unique identifier for the filter.",+ "name": "The filter's name.",+ "description": "Description of the filter.",+ "owner": "The user who owns the filter.",+ "jql": "The JQL query that defines the filter.",+ "viewUrl": "URL to view the filter's results.",+ "favourite": "Whether the requesting user has favorited the filter.",+ "favouritedCount": "Number of users who have favorited the filter.",+ "self": "URL of the filter's REST resource.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/jira/source.py b/posthog/temporal/data_imports/sources/jira/source.pyindex 882c16e212ff..d5ed1e230dd9 100644--- a/posthog/temporal/data_imports/sources/jira/source.py+++ b/posthog/temporal/data_imports/sources/jira/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -120,6 +121,11 @@ The token authenticates as your Atlassian account, so the data we can sync is lireturn False, "Could not connect to Jira. Check your subdomain, email, and API token."+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.jira.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized": "Your Jira credentials are invalid or expired. Reconnect with a new API token.",diff --git a/posthog/temporal/data_imports/sources/klaviyo/canonical_descriptions.py b/posthog/temporal/data_imports/sources/klaviyo/canonical_descriptions.pynew file mode 100644index 000000000000..506de8bddb6c--- /dev/null+++ b/posthog/temporal/data_imports/sources/klaviyo/canonical_descriptions.py@@ -0,0 +1,114 @@+"""Canonical, documentation-sourced descriptions for Klaviyo endpoints and columns.++Sourced from the official Klaviyo API reference (https://developers.klaviyo.com/en/reference/api_overview).+Keyed by the endpoint names in `settings.py` `KLAVIYO_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Klaviyo table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Klaviyo's JSON:API responses flatten the nested `attributes` object onto each row, so attribute+# fields (name, status, created, updated, ...) appear as top-level columns.+_CAMPAIGN_COLUMNS = {+ "id": "Unique identifier for the campaign.",+ "name": "The campaign's name.",+ "status": "Current status of the campaign (e.g. Draft, Queued without Recipients, Sent).",+ "archived": "Whether the campaign has been archived.",+ "channel": "The channel the campaign sends through (email or sms).",+ "audiences": "The lists and segments the campaign is sent to and excluded from.",+ "send_options": "Options controlling how the campaign is sent.",+ "tracking_options": "Tracking options for opens, clicks, and UTM parameters.",+ "send_strategy": "The strategy used to schedule and send the campaign.",+ "created_at": "Time at which the campaign was created.",+ "updated_at": "Time at which the campaign was last updated.",+ "scheduled_at": "Time at which the campaign is scheduled to send.",+ "send_time": "Time at which the campaign was sent.",+}++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "email_campaigns": {+ "description": "An email marketing campaign in Klaviyo sent to a target audience.",+ "docs_url": "https://developers.klaviyo.com/en/reference/get_campaigns",+ "columns": _CAMPAIGN_COLUMNS,+ },+ "sms_campaigns": {+ "description": "An SMS marketing campaign in Klaviyo sent to a target audience.",+ "docs_url": "https://developers.klaviyo.com/en/reference/get_campaigns",+ "columns": _CAMPAIGN_COLUMNS,+ },+ "events": {+ "description": "An event in Klaviyo recording a profile's action, such as a placed order or opened email.",+ "docs_url": "https://developers.klaviyo.com/en/reference/get_events",+ "columns": {+ "id": "Unique identifier for the event.",+ "datetime": "Time at which the event occurred.",+ "timestamp": "Unix timestamp at which the event occurred.",+ "event_properties": "Properties attached to the event.",+ "uuid": "Universally unique identifier for the event.",+ "metric": "The metric this event is an occurrence of (related resource).",+ "profile": "The profile that performed the event (related resource).",+ },+ },+ "flows": {+ "description": "An automated flow in Klaviyo that sends messages based on triggers and conditions.",+ "docs_url": "https://developers.klaviyo.com/en/reference/get_flows",+ "columns": {+ "id": "Unique identifier for the flow.",+ "name": "The flow's name.",+ "status": "Current status of the flow (e.g. draft, manual, live).",+ "archived": "Whether the flow has been archived.",+ "trigger_type": "The type of trigger that starts the flow.",+ "created": "Time at which the flow was created.",+ "updated": "Time at which the flow was last updated.",+ },+ },+ "lists": {+ "description": "A list of profiles in Klaviyo used to target campaigns and flows.",+ "docs_url": "https://developers.klaviyo.com/en/reference/get_lists",+ "columns": {+ "id": "Unique identifier for the list.",+ "name": "The list's name.",+ "opt_in_process": "The opt-in process for the list (single or double opt-in).",+ "created": "Time at which the list was created.",+ "updated": "Time at which the list was last updated.",+ },+ },+ "metrics": {+ "description": "A metric in Klaviyo that defines a type of tracked event (e.g. Placed Order, Opened Email).",+ "docs_url": "https://developers.klaviyo.com/en/reference/get_metrics",+ "columns": {+ "id": "Unique identifier for the metric.",+ "name": "The metric's name.",+ "integration": "The integration that reports this metric.",+ "created": "Time at which the metric was created.",+ "updated": "Time at which the metric was last updated.",+ },+ },+ "profiles": {+ "description": "A profile in Klaviyo representing a person you can message and track.",+ "docs_url": "https://developers.klaviyo.com/en/reference/get_profiles",+ "columns": {+ "id": "Unique identifier for the profile.",+ "email": "The profile's email address.",+ "phone_number": "The profile's phone number.",+ "external_id": "The external identifier you assigned to the profile.",+ "first_name": "The profile's first name.",+ "last_name": "The profile's last name.",+ "organization": "The organization the profile is associated with.",+ "title": "The profile's job title.",+ "location": "The profile's location details.",+ "properties": "Custom properties set on the profile.",+ "created": "Time at which the profile was created.",+ "updated": "Time at which the profile was last updated.",+ "last_event_date": "Time of the profile's most recent event.",+ },+ },+ "list_profiles": {+ "description": "A flat join table mapping which profiles belong to which Klaviyo list.",+ "docs_url": "https://developers.klaviyo.com/en/reference/get_list_relationships_profiles",+ "columns": {+ "list_id": "Identifier of the list.",+ "profile_id": "Identifier of a profile that is a member of the list.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/klaviyo/source.py b/posthog/temporal/data_imports/sources/klaviyo/source.pyindex 82c8ac539008..780064e85ec4 100644--- a/posthog/temporal/data_imports/sources/klaviyo/source.py+++ b/posthog/temporal/data_imports/sources/klaviyo/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -68,6 +69,11 @@ Make sure to grant the following read permissions:),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.klaviyo.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {# An invalid, revoked, or insufficiently-scoped Klaviyo API key surfaces as a requestsdiff --git a/posthog/temporal/data_imports/sources/kustomer/canonical_descriptions.py b/posthog/temporal/data_imports/sources/kustomer/canonical_descriptions.pynew file mode 100644index 000000000000..b41d6afd5655--- /dev/null+++ b/posthog/temporal/data_imports/sources/kustomer/canonical_descriptions.py@@ -0,0 +1,101 @@+"""Canonical, documentation-sourced descriptions for Kustomer endpoints and columns.++Sourced from the official Kustomer API reference (https://developer.kustomer.com/kustomer-api-docs).+Keyed by the endpoint names in `settings.py` `KUSTOMER_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Kustomer table. Kustomer rows follow the JSON:API shape+(`id`, `type`, `attributes`, `relationships`); the columns below describe the fields nested under+`attributes`. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by every Kustomer JSON:API resource; merged into each entry so we don't repeat them.+_COMMON_COLUMNS = {+ "id": "Unique identifier for the object.",+ "type": "JSON:API resource type of the object (e.g. 'customer', 'conversation').",+ "createdAt": "Time at which the object was created.",+ "updatedAt": "Time at which the object was last updated.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "customers": {+ "description": "A person or company that interacts with your business — the central record in Kustomer.",+ "docs_url": "https://developer.kustomer.com/kustomer-api-docs/reference/customers",+ "columns": _columns(+ name="The customer's display name.",+ displayName="The customer's formatted display name.",+ externalId="Your own external identifier for the customer, if set.",+ emails="The customer's email addresses.",+ phones="The customer's phone numbers.",+ locations="The customer's known locations.",+ tags="Tags applied to the customer.",+ sentiment="Sentiment information derived for the customer.",+ company="The company the customer is associated with, if any.",+ lastActivityAt="Time of the customer's most recent activity.",+ lastSeenAt="Time the customer was last seen.",+ ),+ },+ "conversations": {+ "description": "A thread of messages and activity between a customer and your support team.",+ "docs_url": "https://developer.kustomer.com/kustomer-api-docs/reference/conversations",+ "columns": _columns(+ name="The conversation's subject or name.",+ status="Current status of the conversation (e.g. open, snoozed, done).",+ priority="Priority assigned to the conversation.",+ channels="Channels the conversation took place on (e.g. email, chat).",+ tags="Tags applied to the conversation.",+ assignedUsers="Users assigned to the conversation.",+ assignedTeams="Teams assigned to the conversation.",+ customer="The customer this conversation belongs to.",+ messageCount="Number of messages in the conversation.",+ satisfaction="Satisfaction rating left for the conversation, if any.",+ firstResponse="Information about the first response in the conversation.",+ lastActivityAt="Time of the conversation's most recent activity.",+ ),+ },+ "users": {+ "description": "A member of your Kustomer organization (an agent, admin, or other team member).",+ "docs_url": "https://developer.kustomer.com/kustomer-api-docs/reference/users",+ "columns": _columns(+ name="The user's full name.",+ displayName="The user's display name.",+ email="The user's email address.",+ roles="Roles granted to the user, controlling their permissions.",+ avatarUrl="URL of the user's avatar image.",+ lastActivityAt="Time of the user's most recent activity.",+ lastLoginAt="Time the user last logged in.",+ ),+ },+ "teams": {+ "description": "A group of users in Kustomer used for routing and assignment.",+ "docs_url": "https://developer.kustomer.com/kustomer-api-docs/reference/teams",+ "columns": _columns(+ name="The team's name.",+ displayName="The team's display name.",+ ),+ },+ "tags": {+ "description": "A label that can be applied to customers, conversations, or messages to categorize them.",+ "docs_url": "https://developer.kustomer.com/kustomer-api-docs/reference/tags",+ "columns": _columns(+ name="The tag's name.",+ color="The tag's color.",+ visibility="Where the tag can be applied (e.g. customer, conversation).",+ ),+ },+ "brands": {+ "description": "A brand identity in Kustomer, used to support multiple products or businesses from one org.",+ "docs_url": "https://developer.kustomer.com/kustomer-api-docs/reference/brands",+ "columns": _columns(+ name="The brand's name.",+ displayName="The brand's display name.",+ email="The brand's support email address.",+ domains="Domains associated with the brand.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/kustomer/source.py b/posthog/temporal/data_imports/sources/kustomer/source.pyindex fcb629da9274..c19e051832d3 100644--- a/posthog/temporal/data_imports/sources/kustomer/source.py+++ b/posthog/temporal/data_imports/sources/kustomer/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -37,6 +38,11 @@ class KustomerSource(ResumableSource[KustomerSourceConfig, KustomerResumeConfig]# retargeting it must re-require the key.return ["org_name"]+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.kustomer.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized for url": "Kustomer authentication failed. Please check your API key and organization name.",diff --git a/posthog/temporal/data_imports/sources/lattice/canonical_descriptions.py b/posthog/temporal/data_imports/sources/lattice/canonical_descriptions.pynew file mode 100644index 000000000000..da4648e60ee9--- /dev/null+++ b/posthog/temporal/data_imports/sources/lattice/canonical_descriptions.py@@ -0,0 +1,88 @@+"""Canonical, documentation-sourced descriptions for Lattice endpoints and columns.++Sourced from the official Lattice Talent (Public) API reference (https://developers.lattice.com).+Keyed by the endpoint names in `settings.py` `LATTICE_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Lattice table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by most Lattice objects; merged into each entry so we don't repeat them.+_COMMON_COLUMNS = {+ "id": "Unique identifier for the object.",+ "createdAt": "Time at which the object was created.",+ "updatedAt": "Time at which the object was last updated.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "users": {+ "description": "An employee or member of the Lattice organization.",+ "docs_url": "https://developers.lattice.com/reference/get-users",+ "columns": _columns(+ name="The user's full name.",+ email="The user's email address.",+ title="The user's job title.",+ department="The department the user belongs to.",+ manager="The user's manager.",+ status="The user's employment status (e.g. active, inactive).",+ startDate="The user's employment start date.",+ ),+ },+ "departments": {+ "description": "A department or team within the Lattice organization.",+ "docs_url": "https://developers.lattice.com/reference/get-departments",+ "columns": _columns(+ name="The department's name.",+ parent="The parent department, if this is a sub-department.",+ ),+ },+ "goals": {+ "description": "A goal or objective tracked in Lattice for an individual, team, or company.",+ "docs_url": "https://developers.lattice.com/reference/get-goals",+ "columns": _columns(+ name="The goal's name.",+ description="Description of the goal.",+ status="Current status of the goal (e.g. on track, at risk, completed).",+ progress="Completion progress of the goal.",+ owner="The user who owns the goal.",+ priority="Priority assigned to the goal.",+ dueDate="Date by which the goal should be completed.",+ startDate="Date the goal started.",+ completedAt="Time at which the goal was completed.",+ ),+ },+ "feedbacks": {+ "description": "A piece of feedback given between users in Lattice.",+ "docs_url": "https://developers.lattice.com/reference/get-feedbacks",+ "columns": _columns(+ sender="The user who gave the feedback.",+ recipient="The user who received the feedback.",+ body="The content of the feedback.",+ visibility="Who can see the feedback (e.g. public, private, manager).",+ ),+ },+ "review_cycles": {+ "description": "A performance review cycle in Lattice, with a set timeframe and participants.",+ "docs_url": "https://developers.lattice.com/reference/get-review-cycles",+ "columns": _columns(+ name="The review cycle's name.",+ status="Current status of the review cycle (e.g. active, closed).",+ startDate="Start date of the review cycle.",+ endDate="End date of the review cycle.",+ ),+ },+ "updates": {+ "description": "A status update posted by a user in Lattice, often tied to goals or check-ins.",+ "docs_url": "https://developers.lattice.com/reference/get-updates",+ "columns": _columns(+ user="The user who posted the update.",+ body="The content of the update.",+ goal="The goal the update relates to, if any.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/lattice/source.py b/posthog/temporal/data_imports/sources/lattice/source.pyindex 1d724685da80..c5e442110709 100644--- a/posthog/temporal/data_imports/sources/lattice/source.py+++ b/posthog/temporal/data_imports/sources/lattice/source.py@@ -13,6 +13,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -33,6 +34,11 @@ class LatticeSource(ResumableSource[LatticeSourceConfig, LatticeResumeConfig]):def source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.LATTICE+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.lattice.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized for url: https://api.latticehq.com": "Lattice authentication failed. Please check your API key.",diff --git a/posthog/temporal/data_imports/sources/launchdarkly/canonical_descriptions.py b/posthog/temporal/data_imports/sources/launchdarkly/canonical_descriptions.pynew file mode 100644index 000000000000..8a6a2b3eb74d--- /dev/null+++ b/posthog/temporal/data_imports/sources/launchdarkly/canonical_descriptions.py@@ -0,0 +1,99 @@+"""Canonical, documentation-sourced descriptions for LaunchDarkly endpoints and columns.++Sourced from the official LaunchDarkly REST API reference (https://apidocs.launchdarkly.com).+Keyed by the endpoint names in `settings.py` `LAUNCHDARKLY_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced LaunchDarkly table. Fan-out endpoints carry an injected+`_project_key` column identifying the project the row was fetched from. Columns absent here fall+back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "projects": {+ "description": "A LaunchDarkly project — a container for environments, feature flags, and metrics.",+ "docs_url": "https://apidocs.launchdarkly.com/tag/Projects",+ "columns": {+ "_id": "Unique identifier for the project.",+ "key": "The project's unique key.",+ "name": "The project's human-readable name.",+ "tags": "Tags applied to the project.",+ "environments": "The environments belonging to the project.",+ },+ },+ "members": {+ "description": "A member of the LaunchDarkly account.",+ "docs_url": "https://apidocs.launchdarkly.com/tag/Account-members",+ "columns": {+ "_id": "Unique identifier for the member.",+ "email": "The member's email address.",+ "firstName": "The member's first name.",+ "lastName": "The member's last name.",+ "role": "The member's built-in role (e.g. reader, writer, admin, owner).",+ "customRoles": "Custom roles assigned to the member.",+ "_pendingInvite": "Whether the member has a pending invitation.",+ "_lastSeen": "Time the member was last active, as an epoch-millisecond timestamp.",+ },+ },+ "auditlog": {+ "description": "An entry in the LaunchDarkly audit log recording a change made in the account.",+ "docs_url": "https://apidocs.launchdarkly.com/tag/Audit-log",+ "columns": {+ "_id": "Unique identifier for the audit log entry.",+ "date": "Time the change occurred, as an epoch-millisecond timestamp.",+ "kind": "The kind of resource the entry relates to.",+ "name": "Name of the resource that was changed.",+ "description": "Human-readable description of the change.",+ "member": "The member who made the change.",+ "titleVerb": "The action verb describing what happened.",+ "accesses": "The set of actions performed in this change.",+ },+ },+ "environments": {+ "description": "An environment within a LaunchDarkly project (e.g. production, staging).",+ "docs_url": "https://apidocs.launchdarkly.com/tag/Environments",+ "columns": {+ "_id": "Unique identifier for the environment.",+ "_project_key": "Key of the project this environment belongs to (injected during sync).",+ "key": "The environment's unique key within its project.",+ "name": "The environment's human-readable name.",+ "color": "The environment's display color.",+ "tags": "Tags applied to the environment.",+ "apiKey": "The environment's SDK API key.",+ "mobileKey": "The environment's mobile SDK key.",+ "defaultTtl": "Default time-to-live for the environment's flag settings.",+ },+ },+ "metrics": {+ "description": "A metric used to measure the impact of feature flags and experiments.",+ "docs_url": "https://apidocs.launchdarkly.com/tag/Metrics",+ "columns": {+ "_id": "Unique identifier for the metric.",+ "_project_key": "Key of the project this metric belongs to (injected during sync).",+ "key": "The metric's unique key within its project.",+ "name": "The metric's human-readable name.",+ "description": "Description of the metric.",+ "kind": "The metric's kind (e.g. custom, pageview, click).",+ "tags": "Tags applied to the metric.",+ "isNumeric": "Whether the metric measures a numeric value.",+ "unit": "The unit of the metric's measured value.",+ },+ },+ "flags": {+ "description": "A LaunchDarkly feature flag and its targeting configuration across environments.",+ "docs_url": "https://apidocs.launchdarkly.com/tag/Feature-flags",+ "columns": {+ "_project_key": "Key of the project this flag belongs to (injected during sync).",+ "key": "The flag's unique key within its project.",+ "name": "The flag's human-readable name.",+ "description": "Description of the flag.",+ "kind": "The flag's kind (boolean or multivariate).",+ "tags": "Tags applied to the flag.",+ "variations": "The set of variations the flag can serve.",+ "temporary": "Whether the flag is intended to be temporary.",+ "maintainerId": "ID of the member who maintains the flag.",+ "environments": "Per-environment targeting and rollout configuration for the flag.",+ "creationDate": "Time the flag was created, as an epoch-millisecond timestamp.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/launchdarkly/source.py b/posthog/temporal/data_imports/sources/launchdarkly/source.pyindex 35129ed85cd9..74d6bce82239 100644--- a/posthog/temporal/data_imports/sources/launchdarkly/source.py+++ b/posthog/temporal/data_imports/sources/launchdarkly/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -63,6 +64,11 @@ You can create a personal or service access token in your [LaunchDarkly account),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.launchdarkly.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error": "Your LaunchDarkly access token is invalid or expired. Please generate a new token and reconnect.",diff --git a/posthog/temporal/data_imports/sources/lever/canonical_descriptions.py b/posthog/temporal/data_imports/sources/lever/canonical_descriptions.pynew file mode 100644index 000000000000..028585a22ddc--- /dev/null+++ b/posthog/temporal/data_imports/sources/lever/canonical_descriptions.py@@ -0,0 +1,113 @@+"""Canonical, documentation-sourced descriptions for Lever endpoints and columns.++Sourced from the official Lever Data API reference (https://hire.lever.co/developer/documentation).+Keyed by the endpoint names in `settings.py` `LEVER_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Lever table. Lever returns timestamps as epoch-millisecond+integers (normalized to epoch seconds during sync). Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "opportunities": {+ "description": "A candidate's pipeline for a specific role — Lever's central record tying a person to an opening.",+ "docs_url": "https://hire.lever.co/developer/documentation#opportunities",+ "columns": {+ "id": "Unique identifier for the opportunity.",+ "name": "The candidate's name.",+ "headline": "The candidate's headline (e.g. companies they've worked at).",+ "contact": "ID of the contact (person) this opportunity belongs to.",+ "emails": "The candidate's email addresses.",+ "phones": "The candidate's phone numbers.",+ "stage": "ID of the pipeline stage the opportunity is currently in.",+ "owner": "ID of the user who owns the opportunity.",+ "followers": "IDs of users following the opportunity.",+ "sources": "Sources the candidate came from.",+ "origin": "How the opportunity was added (e.g. applied, sourced, referred).",+ "tags": "Tags applied to the opportunity.",+ "applications": "IDs of applications associated with the opportunity.",+ "archived": "Archive information, including reason and date, if archived.",+ "createdAt": "Time the opportunity was created, as an epoch-millisecond timestamp.",+ "updatedAt": "Time the opportunity was last updated, as an epoch-millisecond timestamp.",+ "lastInteractionAt": "Time of the most recent interaction on the opportunity.",+ },+ },+ "postings": {+ "description": "A job posting (opening) in Lever that candidates can apply to.",+ "docs_url": "https://hire.lever.co/developer/documentation#postings",+ "columns": {+ "id": "Unique identifier for the posting.",+ "text": "The posting's title.",+ "state": "Current state of the posting (e.g. published, internal, closed, draft).",+ "user": "ID of the user who owns the posting.",+ "owner": "ID of the posting owner.",+ "hiringManager": "ID of the hiring manager for the posting.",+ "categories": "Categorization of the posting (team, department, location, commitment).",+ "tags": "Tags applied to the posting.",+ "urls": "URLs for the posting (e.g. the public apply page).",+ "createdAt": "Time the posting was created, as an epoch-millisecond timestamp.",+ "updatedAt": "Time the posting was last updated, as an epoch-millisecond timestamp.",+ },+ },+ "users": {+ "description": "A Lever user — a member of your hiring team.",+ "docs_url": "https://hire.lever.co/developer/documentation#users",+ "columns": {+ "id": "Unique identifier for the user.",+ "name": "The user's full name.",+ "email": "The user's email address.",+ "accessRole": "The user's access role (e.g. admin, team member, interviewer).",+ "deactivatedAt": "Time the user was deactivated, if applicable.",+ "createdAt": "Time the user was created, as an epoch-millisecond timestamp.",+ },+ },+ "requisitions": {+ "description": "A requisition tracking approved headcount for a role in Lever.",+ "docs_url": "https://hire.lever.co/developer/documentation#requisitions",+ "columns": {+ "id": "Unique identifier for the requisition.",+ "requisitionCode": "Your own code identifying the requisition.",+ "name": "The requisition's name.",+ "status": "Current status of the requisition (e.g. open, closed, on hold).",+ "headcountTotal": "Total approved headcount for the requisition.",+ "headcountHired": "Number of candidates hired against the requisition.",+ "owner": "ID of the user who owns the requisition.",+ "hiringManager": "ID of the hiring manager for the requisition.",+ "createdAt": "Time the requisition was created, as an epoch-millisecond timestamp.",+ "updatedAt": "Time the requisition was last updated, as an epoch-millisecond timestamp.",+ },+ },+ "archive_reasons": {+ "description": "A reason a candidate's opportunity can be archived (e.g. hired, rejected).",+ "docs_url": "https://hire.lever.co/developer/documentation#archive-reasons",+ "columns": {+ "id": "Unique identifier for the archive reason.",+ "text": "The archive reason's display text.",+ "status": "Whether the archive reason represents a hired or non-hired outcome.",+ },+ },+ "stages": {+ "description": "A stage in the Lever hiring pipeline that opportunities move through.",+ "docs_url": "https://hire.lever.co/developer/documentation#stages",+ "columns": {+ "id": "Unique identifier for the stage.",+ "text": "The stage's display name.",+ },+ },+ "sources": {+ "description": "A source through which candidates are added to Lever, keyed by its unique text value.",+ "docs_url": "https://hire.lever.co/developer/documentation#sources",+ "columns": {+ "text": "The source's name (also its unique identifier).",+ "count": "Number of candidates attributed to this source.",+ },+ },+ "tags": {+ "description": "A tag that can be applied to opportunities, keyed by its unique text value.",+ "docs_url": "https://hire.lever.co/developer/documentation#tags",+ "columns": {+ "text": "The tag's text (also its unique identifier).",+ "count": "Number of opportunities the tag is applied to.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/lever/source.py b/posthog/temporal/data_imports/sources/lever/source.pyindex 26a3b89d6c95..07f80d20e127 100644--- a/posthog/temporal/data_imports/sources/lever/source.py+++ b/posthog/temporal/data_imports/sources/lever/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -89,6 +90,11 @@ The key has full read access to your account's data; no individual scopes need t) -> tuple[bool, str | None]:return validate_lever_credentials(config.api_key)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.lever.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized for url: https://api.lever.co": "Your Lever API key is invalid or expired. Please generate a new key and reconnect.",diff --git a/posthog/temporal/data_imports/sources/lightspeed_retail/canonical_descriptions.py b/posthog/temporal/data_imports/sources/lightspeed_retail/canonical_descriptions.pynew file mode 100644index 000000000000..f393a1d41fe6--- /dev/null+++ b/posthog/temporal/data_imports/sources/lightspeed_retail/canonical_descriptions.py@@ -0,0 +1,136 @@+"""Canonical, documentation-sourced descriptions for Lightspeed Retail (X-Series) endpoints and columns.++Sourced from the official Lightspeed X-Series (formerly Vend) API 2.0 reference+(https://x-series-api.lightspeedhq.com/reference). Keyed by the endpoint names in `settings.py`+`LIGHTSPEED_RETAIL_ENDPOINTS`, which match the `ExternalDataSchema.name` of a synced table. Every+record carries a monotonically increasing integer `version` used as the incremental cursor. Columns+absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by most X-Series objects; merged into each entry so we don't repeat them.+_COMMON_COLUMNS = {+ "id": "Unique identifier for the object.",+ "version": "Monotonically increasing version number, incremented whenever the record changes.",+ "deleted_at": "Time at which the object was deleted, if it has been deleted.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "sales": {+ "description": "A point-of-sale transaction (a register sale) in Lightspeed Retail.",+ "docs_url": "https://x-series-api.lightspeedhq.com/reference/listsales",+ "columns": _columns(+ outlet_id="ID of the outlet where the sale took place.",+ register_id="ID of the register the sale was made on.",+ user_id="ID of the user (cashier) who made the sale.",+ customer_id="ID of the customer the sale is associated with, if any.",+ status="Status of the sale (e.g. CLOSED, OPEN, ONACCOUNT, LAYBY, VOIDED).",+ total_price="Total price of the sale excluding tax.",+ total_tax="Total tax charged on the sale.",+ note="Free-form note attached to the sale.",+ line_items="The products sold in this transaction.",+ payments="Payments applied to the sale.",+ sale_date="Date and time the sale occurred.",+ created_at="Time at which the sale record was created.",+ updated_at="Time at which the sale was last updated.",+ ),+ },+ "customers": {+ "description": "A customer record in Lightspeed Retail.",+ "docs_url": "https://x-series-api.lightspeedhq.com/reference/listcustomers",+ "columns": _columns(+ customer_code="Your own code identifying the customer.",+ first_name="The customer's first name.",+ last_name="The customer's last name.",+ company_name="The customer's company name, if any.",+ email="The customer's email address.",+ phone="The customer's phone number.",+ mobile="The customer's mobile number.",+ customer_group_id="ID of the customer group the customer belongs to.",+ balance="The customer's outstanding account balance.",+ year_to_date="Total the customer has spent year to date.",+ created_at="Time at which the customer was created.",+ updated_at="Time at which the customer was last updated.",+ ),+ },+ "products": {+ "description": "A product in the Lightspeed Retail catalog.",+ "docs_url": "https://x-series-api.lightspeedhq.com/reference/listproducts",+ "columns": _columns(+ name="The product's name.",+ handle="The product's URL-friendly handle.",+ sku="The product's stock-keeping unit (SKU).",+ description="Description of the product.",+ supply_price="Cost price paid to acquire the product.",+ brand_id="ID of the product's brand.",+ supplier_id="ID of the product's supplier.",+ product_type_id="ID of the product's type.",+ active="Whether the product is active.",+ is_composite="Whether the product is a composite (bundle) of other products.",+ has_variants="Whether the product has variants.",+ variant_parent_id="ID of the parent product if this is a variant.",+ created_at="Time at which the product was created.",+ updated_at="Time at which the product was last updated.",+ ),+ },+ "inventory": {+ "description": "Per-outlet stock levels for a product in Lightspeed Retail.",+ "docs_url": "https://x-series-api.lightspeedhq.com/reference/listinventory",+ "columns": _columns(+ product_id="ID of the product this inventory record is for.",+ outlet_id="ID of the outlet the stock is held at.",+ current_amount="Current quantity on hand at the outlet.",+ reorder_point="Stock level at which the product should be reordered.",+ reorder_amount="Quantity to reorder when the reorder point is reached.",+ ),+ },+ "outlets": {+ "description": "A physical store location (outlet) in Lightspeed Retail.",+ "docs_url": "https://x-series-api.lightspeedhq.com/reference/listoutlets",+ "columns": _columns(+ name="The outlet's name.",+ time_zone="The outlet's time zone.",+ currency="The currency the outlet trades in.",+ physical_address_1="First line of the outlet's physical address.",+ physical_city="City of the outlet's physical address.",+ physical_country_id="Country of the outlet's physical address.",+ ),+ },+ "registers": {+ "description": "A point-of-sale register (till) at an outlet in Lightspeed Retail.",+ "docs_url": "https://x-series-api.lightspeedhq.com/reference/listregisters",+ "columns": _columns(+ name="The register's name.",+ outlet_id="ID of the outlet the register belongs to.",+ is_open="Whether the register currently has an open session.",+ ),+ },+ "users": {+ "description": "A staff user account in Lightspeed Retail.",+ "docs_url": "https://x-series-api.lightspeedhq.com/reference/listusers",+ "columns": _columns(+ username="The user's login username.",+ display_name="The user's display name.",+ email="The user's email address.",+ account_type="The user's account type / permission level.",+ target_daily="The user's daily sales target, if set.",+ created_at="Time at which the user was created.",+ updated_at="Time at which the user was last updated.",+ ),+ },+ "taxes": {+ "description": "A sales tax rate configured in Lightspeed Retail.",+ "docs_url": "https://x-series-api.lightspeedhq.com/reference/listtaxes",+ "columns": _columns(+ name="The tax's name.",+ rate="The tax rate, as a decimal fraction.",+ is_default="Whether this is the default tax applied to sales.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/lightspeed_retail/source.py b/posthog/temporal/data_imports/sources/lightspeed_retail/source.pyindex a77638323e8f..8e160b5c7694 100644--- a/posthog/temporal/data_imports/sources/lightspeed_retail/source.py+++ b/posthog/temporal/data_imports/sources/lightspeed_retail/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -37,6 +38,13 @@ class LightspeedRetailSource(ResumableSource[LightspeedRetailSourceConfig, Light# to; retargeting it must re-require the token.return ["domain_prefix"]+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.lightspeed_retail.canonical_descriptions import (+ CANONICAL_DESCRIPTIONS,+ )++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized for url": "Lightspeed Retail authentication failed. Please check your personal token and store domain prefix.",diff --git a/posthog/temporal/data_imports/sources/linear/canonical_descriptions.py b/posthog/temporal/data_imports/sources/linear/canonical_descriptions.pynew file mode 100644index 000000000000..94d56b029813--- /dev/null+++ b/posthog/temporal/data_imports/sources/linear/canonical_descriptions.py@@ -0,0 +1,133 @@+"""Canonical, documentation-sourced descriptions for Linear endpoints and columns.++Sourced from the official Linear GraphQL API reference (https://developers.linear.app/docs).+Keyed by the endpoint names in `settings.py` `LINEAR_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Linear table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by most Linear objects; merged into each entry so we don't repeat them.+_COMMON_COLUMNS = {+ "id": "Unique identifier for the object.",+ "createdAt": "Time at which the object was first created.",+ "updatedAt": "Time at which the object was last updated.",+ "archivedAt": "Time at which the object was archived, if it has been archived.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "issues": {+ "description": "A unit of work tracked in Linear — a task, bug, or feature request.",+ "docs_url": "https://developers.linear.app/docs/graphql/working-with-the-graphql-api",+ "columns": _columns(+ title="The issue's title.",+ description="The issue's description in markdown.",+ priority="Priority of the issue (0 = no priority, 1 = urgent, 2 = high, 3 = normal, 4 = low).",+ identifier="Human-readable issue identifier (e.g. ENG-123).",+ number="Issue's unique number within its team.",+ state="Workflow state (status) the issue is currently in.",+ assignee="The user assigned to work on the issue.",+ creator="The user who created the issue.",+ team="The team the issue belongs to.",+ project="The project the issue is part of, if any.",+ estimate="Estimate of the issue's complexity or effort in points.",+ dueDate="Date by which the issue should be completed.",+ startedAt="Time at which the issue was moved into a started state.",+ completedAt="Time at which the issue was completed.",+ canceledAt="Time at which the issue was canceled.",+ ),+ },+ "projects": {+ "description": "A collection of issues working toward a common goal, with a timeline and progress.",+ "docs_url": "https://developers.linear.app/docs/graphql/working-with-the-graphql-api",+ "columns": _columns(+ name="The project's name.",+ description="Short summary of the project.",+ state="The project's current status (e.g. planned, started, completed, canceled).",+ progress="Completion progress of the project, from 0 to 1.",+ lead="The user leading the project.",+ creator="The user who created the project.",+ startDate="Planned start date of the project.",+ targetDate="Planned target (completion) date of the project.",+ startedAt="Time at which the project was started.",+ completedAt="Time at which the project was completed.",+ canceledAt="Time at which the project was canceled.",+ ),+ },+ "teams": {+ "description": "A team in the Linear workspace that owns issues, projects, and a workflow.",+ "docs_url": "https://developers.linear.app/docs/graphql/working-with-the-graphql-api",+ "columns": _columns(+ name="The team's name.",+ key="The team's short key, used as a prefix for issue identifiers (e.g. ENG).",+ description="Description of the team.",+ private="Whether the team is private to its members.",+ ),+ },+ "users": {+ "description": "A member of the Linear workspace.",+ "docs_url": "https://developers.linear.app/docs/graphql/working-with-the-graphql-api",+ "columns": _columns(+ name="The user's full name.",+ displayName="The user's display name, unique within the workspace.",+ email="The user's email address.",+ active="Whether the user account is active.",+ admin="Whether the user is an admin of the workspace.",+ guest="Whether the user is a guest with restricted access.",+ lastSeen="Time the user was last active in Linear.",+ ),+ },+ "comments": {+ "description": "A comment left by a user on an issue or project in Linear.",+ "docs_url": "https://developers.linear.app/docs/graphql/working-with-the-graphql-api",+ "columns": _columns(+ body="The comment's content in markdown.",+ user="The user who wrote the comment.",+ issue="The issue the comment was left on.",+ parent="The parent comment, if this comment is a threaded reply.",+ editedAt="Time at which the comment was last edited.",+ ),+ },+ "labels": {+ "description": "A label that can be applied to issues to categorize them.",+ "docs_url": "https://developers.linear.app/docs/graphql/working-with-the-graphql-api",+ "columns": _columns(+ name="The label's name.",+ description="Description of the label.",+ color="The label's color, as a hex value.",+ team="The team the label belongs to, if it is team-scoped.",+ parent="The parent label, if this label is part of a group.",+ ),+ },+ "cycles": {+ "description": "A time-boxed sprint of work for a team, with a set of issues and a date range.",+ "docs_url": "https://developers.linear.app/docs/graphql/working-with-the-graphql-api",+ "columns": _columns(+ name="The cycle's name.",+ number="The cycle's sequential number within its team.",+ description="Description of the cycle.",+ team="The team the cycle belongs to.",+ startsAt="Start time of the cycle.",+ endsAt="End time of the cycle.",+ completedAt="Time at which the cycle was completed.",+ progress="Completion progress of the cycle, from 0 to 1.",+ ),+ },+ "resources": {+ "description": "An attachment linking an issue to an external resource (a URL, document, or integration).",+ "docs_url": "https://developers.linear.app/docs/graphql/working-with-the-graphql-api",+ "columns": _columns(+ title="The attachment's title.",+ subtitle="The attachment's subtitle.",+ url="The external URL the attachment points to.",+ issue="The issue the attachment is associated with.",+ creator="The user who created the attachment.",+ source="Information about the integration or service that created the attachment.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/linear/source.py b/posthog/temporal/data_imports/sources/linear/source.pyindex b4107945c61b..9316de199bbe 100644--- a/posthog/temporal/data_imports/sources/linear/source.py+++ b/posthog/temporal/data_imports/sources/linear/source.py@@ -10,6 +10,7 @@ from posthog.schema import (from posthog.models.integration import OauthIntegrationfrom posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.mixins import OAuthMixinfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManager@@ -53,6 +54,11 @@ class LinearSource(ResumableSource[LinearSourceConfig, LinearResumeConfig], OAut),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.linear.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error": "Invalid Linear credentials. Please reconnect your account.",diff --git a/posthog/temporal/data_imports/sources/linkedin_ads/canonical_descriptions.py b/posthog/temporal/data_imports/sources/linkedin_ads/canonical_descriptions.pynew file mode 100644index 000000000000..d12e26bb77e7--- /dev/null+++ b/posthog/temporal/data_imports/sources/linkedin_ads/canonical_descriptions.py@@ -0,0 +1,120 @@+"""Canonical, documentation-sourced descriptions for LinkedIn Ads endpoints and columns.++Sourced from the official LinkedIn Marketing API reference+(https://learn.microsoft.com/en-us/linkedin/marketing). Keyed by the `resource_name` values in+`schemas.py` `RESOURCE_SCHEMAS`, which match the `ExternalDataSchema.name` of a synced table. URN+reference fields are flattened into `*_id` virtual columns (e.g. `campaign_id`, `account_id`) and+analytics date ranges into `date_start` / `date_end` during sync. Columns absent here fall back to+LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Metrics shared by every analytics (stats) resource; merged into each stats entry.+_STATS_COLUMNS = {+ "date_start": "Start date of the reporting period for this row.",+ "date_end": "End date of the reporting period for this row.",+ "impressions": "Number of times an ad was shown.",+ "clicks": "Number of clicks on the ad.",+ "costInUsd": "Amount spent in USD over the reporting period.",+ "costInLocalCurrency": "Amount spent in the account's local currency over the reporting period.",+ "externalWebsiteConversions": "Conversions tracked on an external website attributed to the ad.",+ "conversionValueInLocalCurrency": "Total value of conversions in the account's local currency.",+ "landingPageClicks": "Clicks that led to the ad's landing page.",+ "totalEngagements": "Total engagements (clicks, reactions, comments, shares, follows) on the ad.",+ "videoViews": "Number of video views.",+ "videoCompletions": "Number of times the video was watched to completion.",+ "oneClickLeads": "Leads collected via one-click LinkedIn Lead Gen forms.",+ "follows": "Number of new followers attributed to the ad.",+}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "accounts": {+ "description": "A LinkedIn advertising account (ad account) used to run and bill campaigns.",+ "docs_url": "https://learn.microsoft.com/en-us/linkedin/marketing/integrations/ads/account-structure/create-and-manage-accounts",+ "columns": {+ "id": "Unique identifier for the ad account.",+ "name": "The ad account's name.",+ "status": "Status of the ad account (e.g. ACTIVE, CANCELED, DRAFT).",+ "type": "Type of the ad account (e.g. BUSINESS, ENTERPRISE).",+ "currency": "The account's billing currency.",+ "version": "Version metadata for optimistic concurrency.",+ },+ },+ "campaigns": {+ "description": "A LinkedIn ad campaign — a budget, schedule, and targeting wrapper around creatives.",+ "docs_url": "https://learn.microsoft.com/en-us/linkedin/marketing/integrations/ads/account-structure/create-and-manage-campaigns",+ "columns": {+ "id": "Unique identifier for the campaign.",+ "name": "The campaign's name.",+ "account_id": "ID of the ad account the campaign belongs to.",+ "campaign_group_id": "ID of the campaign group the campaign belongs to.",+ "status": "Status of the campaign (e.g. ACTIVE, PAUSED, DRAFT, COMPLETED, ARCHIVED).",+ "type": "The campaign's type (e.g. SPONSORED_UPDATES, TEXT_AD).",+ "costType": "How the campaign is charged (e.g. CPC, CPM, CPV).",+ "dailyBudget": "The campaign's daily budget.",+ "unitCost": "Bid amount per unit (click, impression, etc.).",+ "runSchedule": "Start and end schedule for the campaign.",+ "targetingCriteria": "The audience targeting criteria applied to the campaign.",+ "locale": "The campaign's locale.",+ "changeAuditStamps": "Created and last-modified audit timestamps.",+ "created_time": "Time the campaign was created.",+ "version": "Version metadata for optimistic concurrency.",+ },+ },+ "campaign_groups": {+ "description": "A group of LinkedIn ad campaigns sharing a budget and schedule.",+ "docs_url": "https://learn.microsoft.com/en-us/linkedin/marketing/integrations/ads/account-structure/create-and-manage-campaign-groups",+ "columns": {+ "id": "Unique identifier for the campaign group.",+ "name": "The campaign group's name.",+ "account_id": "ID of the ad account the campaign group belongs to.",+ "status": "Status of the campaign group (e.g. ACTIVE, PAUSED, DRAFT, ARCHIVED).",+ "totalBudget": "The campaign group's total budget.",+ "runSchedule": "Start and end schedule for the campaign group.",+ "changeAuditStamps": "Created and last-modified audit timestamps.",+ "created_time": "Time the campaign group was created.",+ },+ },+ "creatives": {+ "description": "A LinkedIn ad creative — the content shown to members within a campaign.",+ "docs_url": "https://learn.microsoft.com/en-us/linkedin/marketing/integrations/ads/account-structure/create-and-manage-creatives",+ "columns": {+ "id": "Unique identifier for the creative.",+ "name": "The creative's name.",+ "account_id": "ID of the ad account the creative belongs to.",+ "campaign_id": "ID of the campaign the creative belongs to.",+ "intendedStatus": "The creative's intended status (e.g. ACTIVE, PAUSED, DRAFT).",+ "isServing": "Whether the creative is currently being served.",+ "review": "The creative's ad review status.",+ "createdAt": "Time the creative was created.",+ "lastModifiedAt": "Time the creative was last modified.",+ "created_time": "Time the creative was created.",+ },+ },+ "campaign_stats": {+ "description": "Daily performance analytics for LinkedIn ad campaigns, pivoted by campaign.",+ "docs_url": "https://learn.microsoft.com/en-us/linkedin/marketing/integrations/ads-reporting/ads-reporting",+ "columns": {+ **_STATS_COLUMNS,+ "campaign_id": "ID of the campaign these metrics are for.",+ },+ },+ "campaign_group_stats": {+ "description": "Daily performance analytics for LinkedIn ad campaign groups, pivoted by campaign group.",+ "docs_url": "https://learn.microsoft.com/en-us/linkedin/marketing/integrations/ads-reporting/ads-reporting",+ "columns": {+ **_STATS_COLUMNS,+ "campaign_group_id": "ID of the campaign group these metrics are for.",+ },+ },+ "creative_stats": {+ "description": "Daily performance analytics for LinkedIn ad creatives, pivoted by creative.",+ "docs_url": "https://learn.microsoft.com/en-us/linkedin/marketing/integrations/ads-reporting/ads-reporting",+ "columns": {+ **_STATS_COLUMNS,+ "creative_id": "ID of the creative these metrics are for.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/linkedin_ads/source.py b/posthog/temporal/data_imports/sources/linkedin_ads/source.pyindex 0e84b573787a..77bdbd8d1644 100644--- a/posthog/temporal/data_imports/sources/linkedin_ads/source.py+++ b/posthog/temporal/data_imports/sources/linkedin_ads/source.py@@ -18,6 +18,7 @@ from posthog.temporal.data_imports.sources.common.base import (FieldType,ResumableSource,)+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -39,6 +40,11 @@ class LinkedInAdsSource(ResumableSource[LinkedinAdsSourceConfig, LinkedInAdsResudef source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.LINKEDINADS+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.linkedin_ads.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"REVOKED_ACCESS_TOKEN": None,diff --git a/posthog/temporal/data_imports/sources/mailchimp/canonical_descriptions.py b/posthog/temporal/data_imports/sources/mailchimp/canonical_descriptions.pynew file mode 100644index 000000000000..0d57fb6e8ab4--- /dev/null+++ b/posthog/temporal/data_imports/sources/mailchimp/canonical_descriptions.py@@ -0,0 +1,87 @@+"""Canonical, documentation-sourced descriptions for Mailchimp endpoints and columns.++Sourced from the official Mailchimp Marketing API reference (https://mailchimp.com/developer/marketing/api/).+Keyed by the endpoint names in `settings.py` `MAILCHIMP_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Mailchimp table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "lists": {+ "description": "An audience (mailing list) in Mailchimp that contains contacts and their subscription status.",+ "docs_url": "https://mailchimp.com/developer/marketing/api/lists/",+ "columns": {+ "id": "Unique identifier for the audience (list).",+ "web_id": "The ID used in the Mailchimp web application URLs for the list.",+ "name": "The name of the audience.",+ "date_created": "Time the audience was created.",+ "member_count": "The number of active members in the audience.",+ "unsubscribe_count": "The number of members who have unsubscribed from the audience.",+ "cleaned_count": "The number of cleaned (bounced) members in the audience.",+ "permission_reminder": "The permission reminder shown to contacts about how they were added.",+ "campaign_defaults": "Default values for campaigns sent to this audience (from name, email, subject).",+ "contact": "The physical contact (mailing) address for the audience owner.",+ "visibility": "Whether the audience is public or private.",+ "stats": "Statistics for the audience, including member counts and engagement rates.",+ },+ },+ "campaigns": {+ "description": "An email campaign created in Mailchimp, including its settings, recipients, and content.",+ "docs_url": "https://mailchimp.com/developer/marketing/api/campaigns/",+ "columns": {+ "id": "Unique identifier for the campaign.",+ "web_id": "The ID used in the Mailchimp web application URLs for the campaign.",+ "type": "The type of campaign (regular, plaintext, absplit, rss, variate).",+ "create_time": "Time the campaign was created.",+ "send_time": "Time the campaign was sent.",+ "status": "The current status of the campaign (save, paused, schedule, sending, sent).",+ "emails_sent": "The total number of emails sent for this campaign.",+ "archive_url": "The URL of the archived (web) version of the campaign.",+ "recipients": "Recipient details, including the target audience and segment.",+ "settings": "Campaign settings, including subject line, from name, and reply-to address.",+ "tracking": "Tracking options enabled for the campaign (opens, clicks, etc.).",+ "report_summary": "A summary of the campaign's performance (opens, clicks, subscriber activity).",+ },+ },+ "reports": {+ "description": "A performance report for a sent campaign, summarizing opens, clicks, bounces, and engagement.",+ "docs_url": "https://mailchimp.com/developer/marketing/api/reports/",+ "columns": {+ "id": "Unique identifier for the campaign this report is for.",+ "campaign_title": "The title of the campaign.",+ "type": "The type of campaign the report is for.",+ "list_id": "The unique identifier for the audience the campaign was sent to.",+ "emails_sent": "The total number of emails sent for the campaign.",+ "abuse_reports": "The number of abuse (spam) complaints received.",+ "unsubscribed": "The number of members who unsubscribed after the campaign.",+ "send_time": "Time the campaign was sent.",+ "bounces": "Bounce summary for the campaign (hard, soft, syntax errors).",+ "forwards": "Forwarding activity for the campaign.",+ "opens": "Open activity for the campaign, including total and unique opens.",+ "clicks": "Click activity for the campaign, including total and unique clicks.",+ "list_stats": "Audience-level statistics, including average open and click rates.",+ },+ },+ "contacts": {+ "description": "A member (contact) of a Mailchimp audience, including subscription status and engagement.",+ "docs_url": "https://mailchimp.com/developer/marketing/api/list-members/",+ "columns": {+ "id": "The MD5 hash of the member's lowercase email address, used as the identifier.",+ "email_address": "The contact's email address.",+ "unique_email_id": "An identifier for the address across all of an account's lists.",+ "web_id": "The ID used in the Mailchimp web application URLs for the contact.",+ "email_type": "The type of email the contact prefers (html or text).",+ "status": "Subscription status (subscribed, unsubscribed, cleaned, pending, transactional).",+ "merge_fields": "Audience merge fields and values for the contact (e.g. first name, last name).",+ "list_id": "The unique identifier for the audience the contact belongs to.",+ "timestamp_signup": "Time the contact signed up to the audience.",+ "timestamp_opt": "Time the contact confirmed their opt-in status.",+ "member_rating": "The contact's star rating, based on engagement.",+ "last_changed": "Time the contact's data was last changed.",+ "language": "The contact's language preference.",+ "vip": "Whether the contact is marked as a VIP.",+ "stats": "Engagement statistics for the contact (average open and click rates).",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/mailchimp/source.py b/posthog/temporal/data_imports/sources/mailchimp/source.pyindex 6d2e898687c3..a9e5f5220a01 100644--- a/posthog/temporal/data_imports/sources/mailchimp/source.py+++ b/posthog/temporal/data_imports/sources/mailchimp/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -61,6 +62,11 @@ The API key format is: `key-dc` (e.g., `abc123def456-us6`), where `dc` is the da),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.mailchimp.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error": "Invalid Mailchimp API key. Please check your API key and try again.",diff --git a/posthog/temporal/data_imports/sources/mailerlite/canonical_descriptions.py b/posthog/temporal/data_imports/sources/mailerlite/canonical_descriptions.pynew file mode 100644index 000000000000..1f907d8339e6--- /dev/null+++ b/posthog/temporal/data_imports/sources/mailerlite/canonical_descriptions.py@@ -0,0 +1,152 @@+"""Canonical, documentation-sourced descriptions for MailerLite endpoints and columns.++Sourced from the official MailerLite API reference (https://developers.mailerlite.com/docs).+Keyed by the endpoint names in `settings.py` `MAILERLITE_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced MailerLite table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "subscribers": {+ "description": "A subscriber (contact) in the MailerLite account, including status and custom fields.",+ "docs_url": "https://developers.mailerlite.com/docs/subscribers.html",+ "columns": {+ "id": "Unique identifier for the subscriber.",+ "email": "The subscriber's email address.",+ "status": "Subscription status (active, unsubscribed, unconfirmed, bounced, junk).",+ "source": "How the subscriber was added to the account.",+ "sent": "The total number of emails sent to the subscriber.",+ "opens_count": "The number of emails the subscriber has opened.",+ "clicks_count": "The number of emails in which the subscriber clicked a link.",+ "open_rate": "The subscriber's average email open rate.",+ "click_rate": "The subscriber's average email click rate.",+ "ip_address": "The IP address the subscriber signed up from.",+ "subscribed_at": "Time the subscriber subscribed.",+ "unsubscribed_at": "Time the subscriber unsubscribed, if applicable.",+ "created_at": "Time the subscriber was created.",+ "updated_at": "Time the subscriber was last updated.",+ "fields": "Custom field values for the subscriber.",+ "groups": "The groups the subscriber belongs to.",+ },+ },+ "campaigns": {+ "description": "An email campaign in MailerLite, including its type, status, and delivery settings.",+ "docs_url": "https://developers.mailerlite.com/docs/campaigns.html",+ "columns": {+ "id": "Unique identifier for the campaign.",+ "name": "The internal name of the campaign.",+ "type": "The type of campaign (regular, ab, resend).",+ "status": "The current status of the campaign (draft, ready, sent).",+ "emails": "The emails (content variations) associated with the campaign.",+ "settings": "Delivery and tracking settings for the campaign.",+ "scheduled_for": "Time the campaign is scheduled to be delivered.",+ "delivered_at": "Time the campaign was delivered.",+ "created_at": "Time the campaign was created.",+ "updated_at": "Time the campaign was last updated.",+ },+ },+ "groups": {+ "description": "A group (segment-like collection) of subscribers in MailerLite.",+ "docs_url": "https://developers.mailerlite.com/docs/groups.html",+ "columns": {+ "id": "Unique identifier for the group.",+ "name": "The name of the group.",+ "active_count": "The number of active subscribers in the group.",+ "sent_count": "The number of emails sent to the group.",+ "opens_count": "The number of opens for the group.",+ "clicks_count": "The number of clicks for the group.",+ "unsubscribed_count": "The number of subscribers who unsubscribed from the group.",+ "open_rate": "The average open rate for the group.",+ "click_rate": "The average click rate for the group.",+ "created_at": "Time the group was created.",+ },+ },+ "segments": {+ "description": "A dynamic segment of subscribers in MailerLite defined by filter conditions.",+ "docs_url": "https://developers.mailerlite.com/docs/segments.html",+ "columns": {+ "id": "Unique identifier for the segment.",+ "name": "The name of the segment.",+ "total": "The total number of subscribers matching the segment.",+ "open_rate": "The average open rate for the segment.",+ "click_rate": "The average click rate for the segment.",+ "created_at": "Time the segment was created.",+ },+ },+ "fields": {+ "description": "A custom field definition used to store extra data on subscribers.",+ "docs_url": "https://developers.mailerlite.com/docs/fields.html",+ "columns": {+ "id": "Unique identifier for the field.",+ "name": "The display name of the field.",+ "key": "The key used to reference the field on subscribers.",+ "type": "The data type of the field (text, number, date).",+ },+ },+ "automations": {+ "description": "An automation (workflow) in MailerLite that triggers emails based on subscriber events.",+ "docs_url": "https://developers.mailerlite.com/docs/automations.html",+ "columns": {+ "id": "Unique identifier for the automation.",+ "name": "The name of the automation.",+ "enabled": "Whether the automation is currently enabled.",+ "trigger_data": "The trigger configuration that starts the automation.",+ "steps": "The sequence of steps in the automation workflow.",+ "stats": "Statistics for the automation (subscribers, opens, clicks).",+ "created_at": "Time the automation was created.",+ },+ },+ "forms_popup": {+ "description": "A pop-up subscription form in MailerLite used to capture new subscribers.",+ "docs_url": "https://developers.mailerlite.com/docs/forms.html",+ "columns": {+ "id": "Unique identifier for the form.",+ "name": "The name of the form.",+ "type": "The type of form (popup).",+ "conversions_count": "The number of conversions (sign-ups) from the form.",+ "opens_count": "The number of times the form was shown.",+ "conversion_rate": "The conversion rate for the form.",+ "created_at": "Time the form was created.",+ },+ },+ "forms_embedded": {+ "description": "An embedded subscription form in MailerLite used to capture new subscribers.",+ "docs_url": "https://developers.mailerlite.com/docs/forms.html",+ "columns": {+ "id": "Unique identifier for the form.",+ "name": "The name of the form.",+ "type": "The type of form (embedded).",+ "conversions_count": "The number of conversions (sign-ups) from the form.",+ "opens_count": "The number of times the form was shown.",+ "conversion_rate": "The conversion rate for the form.",+ "created_at": "Time the form was created.",+ },+ },+ "forms_promotion": {+ "description": "A promotion form in MailerLite used to display promotional content to visitors.",+ "docs_url": "https://developers.mailerlite.com/docs/forms.html",+ "columns": {+ "id": "Unique identifier for the form.",+ "name": "The name of the form.",+ "type": "The type of form (promotion).",+ "conversions_count": "The number of conversions from the form.",+ "opens_count": "The number of times the form was shown.",+ "conversion_rate": "The conversion rate for the form.",+ "created_at": "Time the form was created.",+ },+ },+ "webhooks": {+ "description": "A webhook subscription in MailerLite that delivers event notifications to an external URL.",+ "docs_url": "https://developers.mailerlite.com/docs/webhooks.html",+ "columns": {+ "id": "Unique identifier for the webhook.",+ "name": "The name of the webhook.",+ "url": "The destination URL the webhook posts events to.",+ "events": "The list of events the webhook is subscribed to.",+ "enabled": "Whether the webhook is currently enabled.",+ "created_at": "Time the webhook was created.",+ "updated_at": "Time the webhook was last updated.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/mailerlite/source.py b/posthog/temporal/data_imports/sources/mailerlite/source.pyindex 047d8d2f713f..a5e080c67202 100644--- a/posthog/temporal/data_imports/sources/mailerlite/source.py+++ b/posthog/temporal/data_imports/sources/mailerlite/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -64,6 +65,11 @@ You can create an API key in your [MailerLite integrations settings](https://das"403 Client Error: Forbidden for url: https://connect.mailerlite.com": "Your MailerLite API key does not have the required permissions. Please check the key and reconnect.",}+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.mailerlite.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: MailerLiteSourceConfig,diff --git a/posthog/temporal/data_imports/sources/mailgun/canonical_descriptions.py b/posthog/temporal/data_imports/sources/mailgun/canonical_descriptions.pynew file mode 100644index 000000000000..8699b35a6f45--- /dev/null+++ b/posthog/temporal/data_imports/sources/mailgun/canonical_descriptions.py@@ -0,0 +1,109 @@+"""Canonical, documentation-sourced descriptions for Mailgun endpoints and columns.++Sourced from the official Mailgun API reference (https://documentation.mailgun.com/docs/mailgun/api-reference/).+Keyed by the endpoint names in `settings.py` `MAILGUN_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Mailgun table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "domains": {+ "description": "A sending domain configured on the Mailgun account.",+ "docs_url": "https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Domains/",+ "columns": {+ "id": "Unique identifier for the domain.",+ "name": "The domain name (e.g. mg.example.com).",+ "type": "The domain type (custom or sandbox).",+ "state": "The verification state of the domain (active, unverified, disabled).",+ "is_disabled": "Whether the domain is disabled.",+ "created_at": "Time the domain was created.",+ "smtp_login": "The SMTP login (username) for the domain.",+ "web_prefix": "The prefix used for tracking and unsubscribe links.",+ "web_scheme": "The URL scheme used for tracking links (http or https).",+ "spam_action": "How spam is handled for the domain (disabled, block, tag).",+ "wildcard": "Whether the domain accepts mail for all subdomains.",+ },+ },+ "events": {+ "description": "An event in the Mailgun event log (delivered, opened, clicked, bounced, etc.) for a domain.",+ "docs_url": "https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Events/",+ "columns": {+ "id": "Unique identifier for the event.",+ "domain": "The sending domain the event belongs to.",+ "event": "The event type (accepted, delivered, opened, clicked, failed, complained, etc.).",+ "timestamp": "Time the event occurred, as a Unix timestamp.",+ "recipient": "The recipient email address the event relates to.",+ "message": "Details about the message that generated the event.",+ "tags": "The tags associated with the message.",+ "campaigns": "The campaigns associated with the message.",+ "delivery-status": "Delivery status details, including SMTP response codes.",+ "severity": "Severity of a failure event (temporary or permanent).",+ "reason": "The reason a delivery failed, if applicable.",+ },+ },+ "bounces": {+ "description": "A bounced recipient address recorded for a domain in Mailgun's suppression list.",+ "docs_url": "https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Suppressions/",+ "columns": {+ "domain": "The sending domain the bounce belongs to.",+ "address": "The recipient email address that bounced.",+ "code": "The SMTP error code returned for the bounce.",+ "error": "The error message describing why the address bounced.",+ "created_at": "Time the bounce was recorded.",+ },+ },+ "complaints": {+ "description": "A spam complaint recorded for a domain in Mailgun's suppression list.",+ "docs_url": "https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Suppressions/",+ "columns": {+ "domain": "The sending domain the complaint belongs to.",+ "address": "The recipient email address that filed the complaint.",+ "created_at": "Time the complaint was recorded.",+ },+ },+ "unsubscribes": {+ "description": "An unsubscribed recipient address recorded for a domain in Mailgun's suppression list.",+ "docs_url": "https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Suppressions/",+ "columns": {+ "domain": "The sending domain the unsubscribe belongs to.",+ "address": "The recipient email address that unsubscribed.",+ "tags": "The tags the address unsubscribed from.",+ "created_at": "Time the unsubscribe was recorded.",+ },+ },+ "mailing_lists": {+ "description": "A mailing list configured on the Mailgun account, addressable by a single list address.",+ "docs_url": "https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Mailing-Lists/",+ "columns": {+ "address": "The email address of the mailing list.",+ "name": "The display name of the mailing list.",+ "description": "A description of the mailing list.",+ "members_count": "The number of members in the mailing list.",+ "access_level": "Who can post to the list (readonly, members, everyone).",+ "created_at": "Time the mailing list was created.",+ },+ },+ "tags": {+ "description": "A tag used to categorize and track messages for a domain in Mailgun.",+ "docs_url": "https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Tags/",+ "columns": {+ "domain": "The sending domain the tag belongs to.",+ "tag": "The tag string.",+ "description": "A description of the tag.",+ "first-seen": "Time the tag was first used.",+ "last-seen": "Time the tag was last used.",+ },+ },+ "templates": {+ "description": "A stored, reusable message template for a domain in Mailgun.",+ "docs_url": "https://documentation.mailgun.com/docs/mailgun/api-reference/openapi-final/tag/Templates/",+ "columns": {+ "domain": "The sending domain the template belongs to.",+ "name": "The name of the template.",+ "description": "A description of the template.",+ "createdAt": "Time the template was created.",+ "version": "The version details of the template's stored content.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/mailgun/source.py b/posthog/temporal/data_imports/sources/mailgun/source.pyindex 8dc6fb873340..21384f56c652 100644--- a/posthog/temporal/data_imports/sources/mailgun/source.py+++ b/posthog/temporal/data_imports/sources/mailgun/source.py@@ -13,6 +13,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -80,6 +81,11 @@ Note: Mailgun only retains events for a limited period (1 day on free plans, up),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.mailgun.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: MailgunSourceConfig,diff --git a/posthog/temporal/data_imports/sources/mailjet/canonical_descriptions.py b/posthog/temporal/data_imports/sources/mailjet/canonical_descriptions.pynew file mode 100644index 000000000000..2db46d0715d6--- /dev/null+++ b/posthog/temporal/data_imports/sources/mailjet/canonical_descriptions.py@@ -0,0 +1,144 @@+"""Canonical, documentation-sourced descriptions for Mailjet endpoints and columns.++Sourced from the official Mailjet API reference (https://dev.mailjet.com/email/reference/).+Keyed by the resource names in `settings.py` `MAILJET_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Mailjet table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "contact": {+ "description": "A contact (recipient) stored in the Mailjet account.",+ "docs_url": "https://dev.mailjet.com/email/reference/contacts/contact/",+ "columns": {+ "ID": "Unique identifier for the contact.",+ "Email": "The contact's email address.",+ "Name": "The contact's name.",+ "IsExcludedFromCampaigns": "Whether the contact is excluded from all campaigns.",+ "IsOptInPending": "Whether the contact's opt-in confirmation is still pending.",+ "IsSpamComplaining": "Whether the contact has filed a spam complaint.",+ "CreatedAt": "Time the contact was created.",+ "LastActivityAt": "Time of the contact's last activity.",+ "LastUpdateAt": "Time the contact was last updated.",+ "DeliveredCount": "The number of messages successfully delivered to the contact.",+ },+ },+ "contactslist": {+ "description": "A contact list in Mailjet that groups contacts for sending campaigns.",+ "docs_url": "https://dev.mailjet.com/email/reference/contacts/contact-list/",+ "columns": {+ "ID": "Unique identifier for the contact list.",+ "Name": "The name of the contact list.",+ "Address": "The internal sending address of the contact list.",+ "IsDeleted": "Whether the contact list has been deleted.",+ "SubscriberCount": "The number of subscribers in the contact list.",+ "CreatedAt": "Time the contact list was created.",+ },+ },+ "listrecipient": {+ "description": "The relationship linking a contact to a contact list, with its subscription status.",+ "docs_url": "https://dev.mailjet.com/email/reference/contacts/subscriptions/",+ "columns": {+ "ID": "Unique identifier for the list-recipient relationship.",+ "ContactID": "The identifier of the contact.",+ "ListID": "The identifier of the contact list.",+ "IsUnsubscribed": "Whether the contact has unsubscribed from the list.",+ "IsActive": "Whether the subscription is active.",+ "SubscribedAt": "Time the contact subscribed to the list.",+ "UnsubscribedAt": "Time the contact unsubscribed from the list, if applicable.",+ },+ },+ "campaign": {+ "description": "A sent campaign in Mailjet representing a batch of messages.",+ "docs_url": "https://dev.mailjet.com/email/reference/campaigns/",+ "columns": {+ "ID": "Unique identifier for the campaign.",+ "Subject": "The subject line of the campaign.",+ "ListID": "The identifier of the contact list the campaign was sent to.",+ "Status": "The status of the campaign.",+ "CreatedAt": "Time the campaign was created.",+ "SendStartAt": "Time the campaign started sending.",+ "SendEndAt": "Time the campaign finished sending.",+ "IsDeleted": "Whether the campaign has been deleted.",+ "IsStarred": "Whether the campaign has been starred.",+ },+ },+ "campaigndraft": {+ "description": "A draft campaign in Mailjet, including its content and recipient configuration.",+ "docs_url": "https://dev.mailjet.com/email/reference/campaigns/campaign-draft/",+ "columns": {+ "ID": "Unique identifier for the campaign draft.",+ "Title": "The internal title of the campaign draft.",+ "Subject": "The subject line of the campaign draft.",+ "ContactsListID": "The identifier of the contact list targeted by the draft.",+ "Status": "The status of the campaign draft (e.g. draft, programmed, sent).",+ "SenderEmail": "The sender email address for the draft.",+ "CreatedAt": "Time the campaign draft was created.",+ "ModifiedAt": "Time the campaign draft was last modified.",+ },+ },+ "message": {+ "description": "An individual message (email) processed by Mailjet, with its delivery status.",+ "docs_url": "https://dev.mailjet.com/email/reference/messages/",+ "columns": {+ "ID": "Unique identifier for the message.",+ "ContactID": "The identifier of the recipient contact.",+ "CampaignID": "The identifier of the campaign the message belongs to.",+ "Status": "The delivery status of the message (sent, opened, clicked, bounced, etc.).",+ "ArrivedAt": "Time the message was delivered.",+ "Delay": "The delay before the message was sent.",+ "MessageSize": "The size of the message in bytes.",+ "SpamassassinScore": "The SpamAssassin score assigned to the message.",+ "IsOpenTracked": "Whether open tracking is enabled for the message.",+ "IsClickTracked": "Whether click tracking is enabled for the message.",+ },+ },+ "contactmetadata": {+ "description": "A custom contact property (metadata field) definition in Mailjet.",+ "docs_url": "https://dev.mailjet.com/email/reference/contacts/contact-properties/",+ "columns": {+ "ID": "Unique identifier for the contact metadata field.",+ "Name": "The name of the metadata field.",+ "Datatype": "The data type of the field (str, int, float, bool, datetime).",+ "NameSpace": "The namespace of the metadata field (static or historic).",+ },+ },+ "template": {+ "description": "A reusable email template stored in the Mailjet account.",+ "docs_url": "https://dev.mailjet.com/email/reference/templates/",+ "columns": {+ "ID": "Unique identifier for the template.",+ "Name": "The name of the template.",+ "Author": "The author of the template.",+ "Purposes": "The intended purposes of the template (marketing, transactional, automation).",+ "OwnerType": "The ownership type of the template (user, global, apikey).",+ "CreatedAt": "Time the template was created.",+ },+ },+ "openinformation": {+ "description": "An open event recording that a recipient opened a message in Mailjet.",+ "docs_url": "https://dev.mailjet.com/email/reference/messages/#v3_get_openinformation",+ "columns": {+ "ID": "Unique identifier for the open event.",+ "ContactID": "The identifier of the recipient contact who opened the message.",+ "MessageID": "The identifier of the message that was opened.",+ "CampaignID": "The identifier of the campaign the message belongs to.",+ "OpenedAt": "Time the message was opened.",+ "UserAgent": "The user agent of the device that opened the message.",+ },+ },+ "clickstatistics": {+ "description": "A click event recording that a recipient clicked a link in a message in Mailjet.",+ "docs_url": "https://dev.mailjet.com/email/reference/messages/#v3_get_clickstatistics",+ "columns": {+ "ID": "Unique identifier for the click event.",+ "ContactID": "The identifier of the recipient contact who clicked.",+ "MessageID": "The identifier of the message that contained the link.",+ "CampaignID": "The identifier of the campaign the message belongs to.",+ "Url": "The URL that was clicked.",+ "ClickedAt": "Time the link was clicked.",+ "UserAgent": "The user agent of the device that clicked the link.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/mailjet/source.py b/posthog/temporal/data_imports/sources/mailjet/source.pyindex 4e8e9e5bd943..822c775b306d 100644--- a/posthog/temporal/data_imports/sources/mailjet/source.py+++ b/posthog/temporal/data_imports/sources/mailjet/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -67,6 +68,11 @@ You can find your API key and secret key in your [Mailjet API key management pag),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.mailjet.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: MailjetSourceConfig,diff --git a/posthog/temporal/data_imports/sources/matomo/canonical_descriptions.py b/posthog/temporal/data_imports/sources/matomo/canonical_descriptions.pynew file mode 100644index 000000000000..4d2a8123589d--- /dev/null+++ b/posthog/temporal/data_imports/sources/matomo/canonical_descriptions.py@@ -0,0 +1,90 @@+"""Canonical, documentation-sourced descriptions for Matomo endpoints and columns.++Sourced from the official Matomo Reporting API reference (https://developer.matomo.org/api-reference/reporting-api).+Keyed by the endpoint names in `settings.py` `MATOMO_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Matomo table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "visits": {+ "description": "The raw visit log from Matomo's Live API — one row per visit with its actions and visitor details.",+ "docs_url": "https://developer.matomo.org/api-reference/reporting-api#Live",+ "columns": {+ "idVisit": "Unique identifier for the visit.",+ "idSite": "The identifier of the site the visit was recorded on.",+ "visitorId": "The anonymized identifier for the visitor.",+ "serverTimestamp": "Server-side Unix timestamp of the visit, used as the incremental cursor.",+ "firstActionTimestamp": "Unix timestamp of the visit's first action.",+ "lastActionTimestamp": "Unix timestamp of the visit's last action.",+ "visitDuration": "The duration of the visit in seconds.",+ "actions": "The number of actions (page views, events, etc.) in the visit.",+ "referrerType": "The type of referrer that drove the visit (direct, search, website, campaign).",+ "referrerName": "The name of the referrer.",+ "country": "The country the visit originated from.",+ "city": "The city the visit originated from.",+ "deviceType": "The type of device used for the visit.",+ "browserName": "The browser used for the visit.",+ "operatingSystemName": "The operating system used for the visit.",+ "actionDetails": "The detailed list of actions performed during the visit.",+ },+ },+ "visits_summary": {+ "description": "Per-day aggregate visit metrics from Matomo's VisitsSummary API.",+ "docs_url": "https://developer.matomo.org/api-reference/reporting-api#VisitsSummary",+ "columns": {+ "_date": "The report day this aggregate row is for.",+ "nb_visits": "The number of visits in the period.",+ "nb_uniq_visitors": "The number of unique visitors in the period.",+ "nb_users": "The number of unique logged-in users in the period.",+ "nb_actions": "The total number of actions in the period.",+ "nb_actions_per_visit": "The average number of actions per visit.",+ "avg_time_on_site": "The average visit duration in seconds.",+ "bounce_rate": "The percentage of visits with a single action (bounces).",+ "max_actions": "The maximum number of actions in a single visit.",+ "sum_visit_length": "The total duration of all visits in seconds.",+ },+ },+ "actions_summary": {+ "description": "Per-day aggregate action metrics from Matomo's Actions API.",+ "docs_url": "https://developer.matomo.org/api-reference/reporting-api#Actions",+ "columns": {+ "_date": "The report day this aggregate row is for.",+ "nb_pageviews": "The total number of page views in the period.",+ "nb_uniq_pageviews": "The number of unique page views in the period.",+ "nb_downloads": "The total number of downloads in the period.",+ "nb_uniq_downloads": "The number of unique downloads in the period.",+ "nb_outlinks": "The total number of outbound link clicks in the period.",+ "nb_uniq_outlinks": "The number of unique outbound link clicks in the period.",+ "nb_searches": "The total number of site searches in the period.",+ "avg_time_on_page": "The average time spent on a page in seconds.",+ "bounce_rate": "The percentage of single-action visits (bounces).",+ },+ },+ "referrers": {+ "description": "Per-day referrer breakdown from Matomo's Referrers API — one row per referrer.",+ "docs_url": "https://developer.matomo.org/api-reference/reporting-api#Referrers",+ "columns": {+ "_date": "The report day this row is for.",+ "label": "The referrer label (e.g. the search engine, website, or campaign name).",+ "referrer_type": "The type of referrer (direct, search, website, campaign, social).",+ "nb_visits": "The number of visits from this referrer.",+ "nb_uniq_visitors": "The number of unique visitors from this referrer.",+ "nb_actions": "The number of actions from this referrer.",+ "nb_conversions": "The number of conversions attributed to this referrer.",+ },+ },+ "countries": {+ "description": "Per-day country breakdown from Matomo's UserCountry API — one row per country.",+ "docs_url": "https://developer.matomo.org/api-reference/reporting-api#UserCountry",+ "columns": {+ "_date": "The report day this row is for.",+ "label": "The country name.",+ "code": "The two-letter country code.",+ "nb_visits": "The number of visits from this country.",+ "nb_uniq_visitors": "The number of unique visitors from this country.",+ "nb_actions": "The number of actions from this country.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/matomo/source.py b/posthog/temporal/data_imports/sources/matomo/source.pyindex fd4f5b4f6b96..ec888dae6c46 100644--- a/posthog/temporal/data_imports/sources/matomo/source.py+++ b/posthog/temporal/data_imports/sources/matomo/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.mixins import ValidateDatabaseHostMixinfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManager@@ -89,6 +90,11 @@ Works with Matomo Cloud and self-hosted instances. Enter your instance URL (e.g.),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.matomo.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: MatomoSourceConfig,diff --git a/posthog/temporal/data_imports/sources/meta_ads/canonical_descriptions.py b/posthog/temporal/data_imports/sources/meta_ads/canonical_descriptions.pynew file mode 100644index 000000000000..6082254a38b5--- /dev/null+++ b/posthog/temporal/data_imports/sources/meta_ads/canonical_descriptions.py@@ -0,0 +1,139 @@+"""Canonical, documentation-sourced descriptions for Meta Ads endpoints and columns.++Sourced from the official Meta Marketing API reference (https://developers.facebook.com/docs/marketing-apis/).+Keyed by the resource names in `schemas.py` `MetaAdsResource`, which match the+`ExternalDataSchema.name` of a synced Meta Ads table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions+from posthog.temporal.data_imports.sources.meta_ads.schemas import MetaAdsResource++# Columns shared by every Insights (stats) endpoint; merged into each stats entry.+_COMMON_STATS_COLUMNS = {+ "account_id": "The ID of the ad account the metrics belong to.",+ "account_currency": "The currency of the ad account, used for spend and value metrics.",+ "date_start": "Start date of the metrics row (daily, used as the incremental cursor).",+ "date_stop": "End date of the metrics row (daily).",+ "impressions": "The number of times the ads were on screen.",+ "clicks": "The total number of clicks on the ads.",+ "spend": "The total amount spent, in the account currency.",+ "reach": "The number of unique people who saw the ads.",+ "frequency": "The average number of times each person saw the ads.",+ "cpm": "Average cost per 1,000 impressions.",+ "cpc": "Average cost per click.",+ "ctr": "Click-through rate (clicks divided by impressions).",+ "cpp": "Average cost per 1,000 people reached.",+ "cost_per_unique_click": "Average cost per unique click.",+ "unique_clicks": "The number of unique people who clicked.",+ "unique_ctr": "Unique click-through rate.",+ "actions": "Counts of conversion actions attributed to the ads, by action type.",+ "conversions": "The number of conversions attributed to the ads.",+ "conversion_values": "The total value of conversions attributed to the ads.",+ "cost_per_action_type": "Average cost per action, broken down by action type.",+ "action_values": "The total value of actions, broken down by action type.",+}+++def _stats_columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_STATS_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ MetaAdsResource.Campaigns: {+ "description": "An advertising campaign in Meta Ads, defining the objective for its ad sets and ads.",+ "docs_url": "https://developers.facebook.com/docs/marketing-api/reference/ad-campaign-group/",+ "columns": {+ "id": "Unique identifier for the campaign.",+ "account_id": "The ID of the ad account the campaign belongs to.",+ "name": "The name of the campaign.",+ "status": "The current status of the campaign (ACTIVE, PAUSED, DELETED, ARCHIVED).",+ "configured_status": "The status set by the advertiser, before effective rules are applied.",+ "effective_status": "The effective status after account and delivery rules are applied.",+ "objective": "The campaign objective (e.g. OUTCOME_TRAFFIC, OUTCOME_SALES).",+ "buying_type": "The buying type for the campaign (AUCTION or RESERVED).",+ "daily_budget": "The daily budget for the campaign, in the account's minor currency unit.",+ "lifetime_budget": "The lifetime budget for the campaign, in the account's minor currency unit.",+ "budget_remaining": "The remaining budget for the campaign.",+ "created_time": "Time the campaign was created.",+ "updated_time": "Time the campaign was last updated.",+ "start_time": "The scheduled start time of the campaign.",+ "stop_time": "The scheduled stop time of the campaign.",+ "special_ad_categories": "Special ad categories the campaign is declared under (e.g. HOUSING, CREDIT).",+ },+ },+ MetaAdsResource.Adsets: {+ "description": "An ad set in Meta Ads, grouping ads that share a budget, schedule, and targeting.",+ "docs_url": "https://developers.facebook.com/docs/marketing-api/reference/ad-campaign/",+ "columns": {+ "id": "Unique identifier for the ad set.",+ "account_id": "The ID of the ad account the ad set belongs to.",+ "campaign_id": "The ID of the campaign the ad set belongs to.",+ "name": "The name of the ad set.",+ "status": "The current status of the ad set (ACTIVE, PAUSED, DELETED, ARCHIVED).",+ "configured_status": "The status set by the advertiser, before effective rules are applied.",+ "effective_status": "The effective status after account and delivery rules are applied.",+ "optimization_goal": "The optimization goal for the ad set (e.g. LINK_CLICKS, CONVERSIONS).",+ "billing_event": "The event the advertiser is billed for (e.g. IMPRESSIONS, LINK_CLICKS).",+ "bid_amount": "The bid amount for the ad set, in the account's minor currency unit.",+ "budget_remaining": "The remaining budget for the ad set.",+ "daily_budget": "The daily budget for the ad set, in the account's minor currency unit.",+ "lifetime_budget": "The lifetime budget for the ad set, in the account's minor currency unit.",+ "created_time": "Time the ad set was created.",+ "updated_time": "Time the ad set was last updated.",+ "start_time": "The scheduled start time of the ad set.",+ "end_time": "The scheduled end time of the ad set.",+ "targeting": "The targeting specification for the ad set.",+ "promoted_object": "The object this ad set is promoting (e.g. page, app, pixel).",+ },+ },+ MetaAdsResource.Ads: {+ "description": "An individual ad in Meta Ads, pairing a creative with its ad set.",+ "docs_url": "https://developers.facebook.com/docs/marketing-api/reference/adgroup/",+ "columns": {+ "id": "Unique identifier for the ad.",+ "account_id": "The ID of the ad account the ad belongs to.",+ "adset_id": "The ID of the ad set the ad belongs to.",+ "campaign_id": "The ID of the campaign the ad belongs to.",+ "name": "The name of the ad.",+ "status": "The current status of the ad (ACTIVE, PAUSED, DELETED, ARCHIVED).",+ "configured_status": "The status set by the advertiser, before effective rules are applied.",+ "effective_status": "The effective status after account and delivery rules are applied.",+ "creative": "The creative associated with the ad.",+ "bid_amount": "The bid amount for the ad, in the account's minor currency unit.",+ "created_time": "Time the ad was created.",+ "updated_time": "Time the ad was last updated.",+ "tracking_specs": "The tracking specifications for the ad.",+ "conversion_specs": "The conversion specifications for the ad.",+ },+ },+ MetaAdsResource.CampaignStats: {+ "description": "Daily performance metrics (Insights) at the campaign level in Meta Ads.",+ "docs_url": "https://developers.facebook.com/docs/marketing-api/insights/",+ "columns": _stats_columns(+ campaign_id="The ID of the campaign the metrics belong to.",+ ),+ },+ MetaAdsResource.AdsetStats: {+ "description": "Daily performance metrics (Insights) at the ad set level in Meta Ads.",+ "docs_url": "https://developers.facebook.com/docs/marketing-api/insights/",+ "columns": _stats_columns(+ adset_id="The ID of the ad set the metrics belong to.",+ campaign_id="The ID of the campaign the ad set belongs to.",+ ),+ },+ MetaAdsResource.AdStats: {+ "description": "Daily performance metrics (Insights) at the ad level in Meta Ads.",+ "docs_url": "https://developers.facebook.com/docs/marketing-api/insights/",+ "columns": _stats_columns(+ ad_id="The ID of the ad the metrics belong to.",+ adset_id="The ID of the ad set the ad belongs to.",+ campaign_id="The ID of the campaign the ad belongs to.",+ video_30_sec_watched_actions="The number of times the video was watched for at least 30 seconds.",+ video_p25_watched_actions="The number of times the video was watched to 25% of its length.",+ video_p50_watched_actions="The number of times the video was watched to 50% of its length.",+ video_p75_watched_actions="The number of times the video was watched to 75% of its length.",+ video_p95_watched_actions="The number of times the video was watched to 95% of its length.",+ video_p100_watched_actions="The number of times the video was watched to 100% of its length.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/meta_ads/source.py b/posthog/temporal/data_imports/sources/meta_ads/source.pyindex 2460419e0dfa..a9e1ba01671c 100644--- a/posthog/temporal/data_imports/sources/meta_ads/source.py+++ b/posthog/temporal/data_imports/sources/meta_ads/source.py@@ -17,6 +17,7 @@ from posthog.temporal.data_imports.sources.common.base import (FieldType,ResumableSource,)+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -37,6 +38,11 @@ class MetaAdsSource(ResumableSource[MetaAdsSourceConfig, MetaAdsResumeConfig]):def source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.METAADS+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.meta_ads.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"Failed to refresh token for Meta Ads integration. Please re-authorize the integration.": None,diff --git a/posthog/temporal/data_imports/sources/mixpanel/canonical_descriptions.py b/posthog/temporal/data_imports/sources/mixpanel/canonical_descriptions.pynew file mode 100644index 000000000000..2dcf673bb8de--- /dev/null+++ b/posthog/temporal/data_imports/sources/mixpanel/canonical_descriptions.py@@ -0,0 +1,63 @@+"""Canonical, documentation-sourced descriptions for Mixpanel endpoints and columns.++Sourced from the official Mixpanel API reference (https://developer.mixpanel.com/reference/overview).+Keyed by the endpoint names in `settings.py` `MIXPANEL_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Mixpanel table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "export": {+ "description": "Raw event stream — every tracked event with its properties, exported from Mixpanel.",+ "docs_url": "https://developer.mixpanel.com/reference/raw-event-export",+ "columns": {+ "event": "Name of the event that was tracked.",+ "distinct_id": "Identifier of the user who triggered the event.",+ "time": "Time at which the event occurred, as a Unix timestamp (seconds).",+ "$insert_id": "Unique identifier used by Mixpanel to deduplicate events.",+ "$user_id": "Mixpanel-resolved user id for the event, when identity merge is enabled.",+ "$device_id": "Anonymous device identifier associated with the event.",+ "mp_processing_time_ms": "Time at which Mixpanel processed the event, in milliseconds.",+ },+ },+ "engage": {+ "description": "User profiles — the people in Mixpanel and their current profile properties.",+ "docs_url": "https://developer.mixpanel.com/reference/engage-query",+ "columns": {+ "$distinct_id": "Unique identifier for the user profile.",+ "$properties": "Set of profile properties stored on the user.",+ "$email": "User's email address, if set on the profile.",+ "$name": "User's full name, if set on the profile.",+ "$first_name": "User's first name, if set on the profile.",+ "$last_name": "User's last name, if set on the profile.",+ "$last_seen": "Time the user was last seen, as recorded on the profile.",+ "$city": "City stored on the user profile.",+ "$country_code": "Two-letter country code stored on the user profile.",+ },+ },+ "cohorts": {+ "description": "Saved cohorts — named, reusable groups of users defined in the Mixpanel project.",+ "docs_url": "https://developer.mixpanel.com/reference/cohorts-list",+ "columns": {+ "id": "Unique identifier for the cohort.",+ "name": "The cohort's name.",+ "description": "Description of the cohort.",+ "count": "Number of users currently in the cohort.",+ "is_visible": "Whether the cohort is visible in the Mixpanel UI.",+ "created": "Time at which the cohort was created.",+ "project_id": "Identifier of the Mixpanel project the cohort belongs to.",+ },+ },+ "annotations": {+ "description": "Project annotations — dated notes overlaid on Mixpanel reports to mark events.",+ "docs_url": "https://developer.mixpanel.com/reference/list-all-annotations-for-project",+ "columns": {+ "id": "Unique identifier for the annotation.",+ "date": "Date the annotation applies to.",+ "description": "Text of the annotation.",+ "project_id": "Identifier of the Mixpanel project the annotation belongs to.",+ "user": "User who created the annotation.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/mixpanel/source.py b/posthog/temporal/data_imports/sources/mixpanel/source.pyindex e040b3f280b9..c24cdeb08cc1 100644--- a/posthog/temporal/data_imports/sources/mixpanel/source.py+++ b/posthog/temporal/data_imports/sources/mixpanel/source.py@@ -13,6 +13,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -98,6 +99,11 @@ Authenticate with a [Mixpanel Service Account](https://developer.mixpanel.com/re),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.mixpanel.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: MixpanelSourceConfig,diff --git a/posthog/temporal/data_imports/sources/mollie/canonical_descriptions.py b/posthog/temporal/data_imports/sources/mollie/canonical_descriptions.pynew file mode 100644index 000000000000..0b2e7c02eaa0--- /dev/null+++ b/posthog/temporal/data_imports/sources/mollie/canonical_descriptions.py@@ -0,0 +1,118 @@+"""Canonical, documentation-sourced descriptions for Mollie endpoints and columns.++Sourced from the official Mollie API reference (https://docs.mollie.com/reference/overview).+Keyed by the endpoint names in `settings.py` `MOLLIE_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Mollie table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by most Mollie resources; merged into each entry so we don't repeat them.+_COMMON_COLUMNS = {+ "id": "Unique identifier for the object (e.g. tr_xxx for payments).",+ "resource": "String describing the object's Mollie resource type (e.g. 'payment').",+ "mode": "Whether the object exists in 'live' or 'test' mode.",+ "createdAt": "Time at which the object was created, in ISO 8601 format.",+ "_links": "HAL links to related resources and the Mollie dashboard.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "payments": {+ "description": "A single attempt to collect money from a customer through Mollie.",+ "docs_url": "https://docs.mollie.com/reference/get-payment",+ "columns": _columns(+ status="Status of the payment: open, pending, authorized, paid, canceled, expired, or failed.",+ amount="Amount of the payment, as a value/currency object.",+ description="Description of the payment shown to the customer and in the dashboard.",+ method="Payment method used (e.g. creditcard, ideal, paypal).",+ customerId="ID of the customer this payment is for, if any.",+ mandateId="ID of the mandate used for this payment, if any.",+ subscriptionId="ID of the subscription this payment belongs to, if any.",+ paidAt="Time at which the payment turned paid, in ISO 8601 format.",+ canceledAt="Time at which the payment was canceled, in ISO 8601 format.",+ expiredAt="Time at which the payment expired, in ISO 8601 format.",+ failedAt="Time at which the payment failed, in ISO 8601 format.",+ amountRefunded="Total amount refunded against this payment.",+ amountRemaining="Amount still available to refund against this payment.",+ metadata="Custom key-value data you attached to the payment.",+ profileId="ID of the Mollie profile that owns this payment.",+ ),+ },+ "refunds": {+ "description": "A refund of all or part of a Mollie payment back to the customer.",+ "docs_url": "https://docs.mollie.com/reference/get-refund",+ "columns": _columns(+ status="Status of the refund: queued, pending, processing, refunded, or failed.",+ amount="Amount refunded, as a value/currency object.",+ description="Description of the refund shown on the customer's statement.",+ paymentId="ID of the payment this refund belongs to.",+ settlementAmount="Amount deducted from your settlement balance for the refund.",+ ),+ },+ "chargebacks": {+ "description": "A reversed payment initiated by the customer's bank or card issuer.",+ "docs_url": "https://docs.mollie.com/reference/get-chargeback",+ "columns": _columns(+ amount="Amount charged back, as a value/currency object.",+ paymentId="ID of the payment that was charged back.",+ settlementAmount="Amount deducted from your settlement balance for the chargeback.",+ reversedAt="Time at which the chargeback was reversed, if applicable.",+ ),+ },+ "customers": {+ "description": "A customer stored in Mollie, used to link payments, mandates, and subscriptions.",+ "docs_url": "https://docs.mollie.com/reference/get-customer",+ "columns": _columns(+ name="The customer's name.",+ email="The customer's email address.",+ locale="Preferred locale for the customer (e.g. en_US).",+ metadata="Custom key-value data you attached to the customer.",+ ),+ },+ "subscriptions": {+ "description": "A recurring payment arrangement that charges a customer on a fixed interval.",+ "docs_url": "https://docs.mollie.com/reference/get-subscription",+ "columns": _columns(+ status="Status of the subscription: pending, active, canceled, suspended, or completed.",+ amount="Amount charged on each interval, as a value/currency object.",+ description="Description used on each recurring payment.",+ interval="Interval between charges (e.g. '1 month').",+ customerId="ID of the customer the subscription belongs to.",+ mandateId="ID of the mandate used to collect recurring payments.",+ startDate="Date the subscription's first payment is scheduled.",+ nextPaymentDate="Date of the next scheduled payment.",+ canceledAt="Time at which the subscription was canceled, if applicable.",+ timesCharged="Number of charges already made on the subscription.",+ metadata="Custom key-value data you attached to the subscription.",+ ),+ },+ "settlements": {+ "description": "A payout of collected funds from Mollie to your bank account.",+ "docs_url": "https://docs.mollie.com/reference/get-settlement",+ "columns": _columns(+ reference="Bank reference shown on the settlement transfer.",+ status="Status of the settlement: open, pending, or paidout.",+ amount="Total amount of the settlement, as a value/currency object.",+ settledAt="Time at which the settlement was paid out, in ISO 8601 format.",+ periods="Breakdown of revenue and costs per month included in the settlement.",+ ),+ },+ "payment_links": {+ "description": "A shareable URL that lets a customer pay a set amount through Mollie.",+ "docs_url": "https://docs.mollie.com/reference/get-payment-link",+ "columns": _columns(+ description="Description of the payment link shown to the customer.",+ amount="Amount to be paid via the link, as a value/currency object.",+ archived="Whether the payment link has been archived.",+ redirectUrl="URL the customer is sent to after paying.",+ webhookUrl="URL Mollie calls with status updates for payments via the link.",+ paidAt="Time at which the payment link was paid, in ISO 8601 format.",+ expiresAt="Time at which the payment link expires, in ISO 8601 format.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/mollie/source.py b/posthog/temporal/data_imports/sources/mollie/source.pyindex 0ed5870ac158..b6754a988ea0 100644--- a/posthog/temporal/data_imports/sources/mollie/source.py+++ b/posthog/temporal/data_imports/sources/mollie/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -64,6 +65,11 @@ You can find your API key in the [Mollie dashboard](https://my.mollie.com/dashbo),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.mollie.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: MollieSourceConfig,diff --git a/posthog/temporal/data_imports/sources/monday/canonical_descriptions.py b/posthog/temporal/data_imports/sources/monday/canonical_descriptions.pynew file mode 100644index 000000000000..15c480e0d1c1--- /dev/null+++ b/posthog/temporal/data_imports/sources/monday/canonical_descriptions.py@@ -0,0 +1,69 @@+"""Canonical, documentation-sourced descriptions for monday.com endpoints and columns.++Sourced from the official monday.com GraphQL API reference (https://developer.monday.com/api-reference).+Keyed by the endpoint names in `settings.py` `MONDAY_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced monday.com table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "boards": {+ "description": "A monday.com board — a workspace that organizes items into groups and columns.",+ "docs_url": "https://developer.monday.com/api-reference/reference/boards",+ "columns": {+ "id": "Unique identifier for the board.",+ "name": "The board's name.",+ "description": "Description of the board.",+ "state": "State of the board: active, archived, or deleted.",+ "board_kind": "Kind of board: public, private, or share.",+ "board_folder_id": "Identifier of the folder the board lives in, if any.",+ "workspace_id": "Identifier of the workspace the board belongs to.",+ "items_count": "Number of items on the board.",+ "permissions": "Permission level controlling who can view or edit the board.",+ "updated_at": "Time at which the board was last updated.",+ },+ },+ "items": {+ "description": "A monday.com item — a single row on a board, with values across its columns.",+ "docs_url": "https://developer.monday.com/api-reference/reference/items",+ "columns": {+ "id": "Unique identifier for the item.",+ "_board_id": "Identifier of the board the item belongs to.",+ "name": "The item's name.",+ "state": "State of the item: active, archived, or deleted.",+ "group": "The group on the board the item belongs to.",+ "column_values": "Values of the item across the board's columns.",+ "creator_id": "Identifier of the user who created the item.",+ "created_at": "Time at which the item was created.",+ "updated_at": "Time at which the item was last updated.",+ },+ },+ "users": {+ "description": "A member of the monday.com account.",+ "docs_url": "https://developer.monday.com/api-reference/reference/users",+ "columns": {+ "id": "Unique identifier for the user.",+ "name": "The user's full name.",+ "email": "The user's email address.",+ "enabled": "Whether the user account is enabled.",+ "is_admin": "Whether the user is an admin of the account.",+ "is_guest": "Whether the user is a guest with restricted access.",+ "is_pending": "Whether the user has a pending invitation.",+ "title": "The user's job title.",+ "created_at": "Time at which the user was created.",+ },+ },+ "workspaces": {+ "description": "A monday.com workspace — a container that groups related boards and folders.",+ "docs_url": "https://developer.monday.com/api-reference/reference/workspaces",+ "columns": {+ "id": "Unique identifier for the workspace.",+ "name": "The workspace's name.",+ "description": "Description of the workspace.",+ "kind": "Kind of workspace: open or closed.",+ "state": "State of the workspace: active, archived, or deleted.",+ "created_at": "Time at which the workspace was created.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/monday/source.py b/posthog/temporal/data_imports/sources/monday/source.pyindex f251100a983f..1bd34ce40029 100644--- a/posthog/temporal/data_imports/sources/monday/source.py+++ b/posthog/temporal/data_imports/sources/monday/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, SimpleSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.schema import SourceSchemafrom posthog.temporal.data_imports.sources.generated_configs import MondaySourceConfig@@ -66,6 +67,11 @@ You can find your personal API token in monday.com under your avatar > Developer),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.monday.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: MondaySourceConfig,diff --git a/posthog/temporal/data_imports/sources/notion/canonical_descriptions.py b/posthog/temporal/data_imports/sources/notion/canonical_descriptions.pynew file mode 100644index 000000000000..d65a0c37222d--- /dev/null+++ b/posthog/temporal/data_imports/sources/notion/canonical_descriptions.py@@ -0,0 +1,89 @@+"""Canonical, documentation-sourced descriptions for Notion endpoints and columns.++Sourced from the official Notion API reference (https://developers.notion.com/reference/intro).+Keyed by the endpoint names in `settings.py` `NOTION_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Notion table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by most Notion objects; merged into each entry so we don't repeat them.+_COMMON_COLUMNS = {+ "id": "Unique identifier for the object.",+ "object": "String describing the object's Notion type (e.g. 'page', 'block', 'user').",+ "created_time": "Time at which the object was created, in ISO 8601 format.",+ "last_edited_time": "Time at which the object was last edited, in ISO 8601 format.",+ "created_by": "Reference to the user who created the object.",+ "last_edited_by": "Reference to the user who last edited the object.",+ "archived": "Whether the object has been archived (moved to trash).",+ "parent": "Reference to the parent object that contains this one.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "pages": {+ "description": "A Notion page — a document of content blocks, optionally with database properties.",+ "docs_url": "https://developers.notion.com/reference/page",+ "columns": _columns(+ properties="Property values of the page (title and any database column values).",+ url="URL of the page in Notion.",+ public_url="Public web URL of the page, if it has been published.",+ icon="The page's icon (emoji or external/file image).",+ cover="The page's cover image.",+ in_trash="Whether the page is in the trash.",+ ),+ },+ "databases": {+ "description": "A Notion database (data source) — a collection of pages with a defined set of properties.",+ "docs_url": "https://developers.notion.com/reference/database",+ "columns": _columns(+ title="Title of the database, as rich text.",+ description="Description of the database, as rich text.",+ properties="Schema of the database's columns and their types.",+ url="URL of the database in Notion.",+ public_url="Public web URL of the database, if it has been published.",+ icon="The database's icon (emoji or external/file image).",+ cover="The database's cover image.",+ is_inline="Whether the database is displayed inline within a page.",+ ),+ },+ "users": {+ "description": "A user or bot in the Notion workspace.",+ "docs_url": "https://developers.notion.com/reference/user",+ "columns": {+ "id": "Unique identifier for the user.",+ "object": "Always 'user' for this object.",+ "type": "Type of user: 'person' or 'bot'.",+ "name": "The user's display name.",+ "avatar_url": "URL of the user's avatar image.",+ "person": "Person details, including email, when the user is a person.",+ "bot": "Bot details when the user is an integration bot.",+ },+ },+ "blocks": {+ "description": "A block of content within a Notion page (paragraph, heading, list item, etc.).",+ "docs_url": "https://developers.notion.com/reference/block",+ "columns": _columns(+ type="Type of the block (e.g. paragraph, heading_1, to_do, child_page).",+ has_children="Whether the block has nested child blocks.",+ ),+ },+ "comments": {+ "description": "A comment left on a Notion page or block.",+ "docs_url": "https://developers.notion.com/reference/comment-object",+ "columns": {+ "id": "Unique identifier for the comment.",+ "object": "Always 'comment' for this object.",+ "parent": "Reference to the page or block the comment is attached to.",+ "discussion_id": "Identifier of the discussion thread the comment belongs to.",+ "rich_text": "Content of the comment, as rich text.",+ "created_time": "Time at which the comment was created, in ISO 8601 format.",+ "last_edited_time": "Time at which the comment was last edited, in ISO 8601 format.",+ "created_by": "Reference to the user who created the comment.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/notion/source.py b/posthog/temporal/data_imports/sources/notion/source.pyindex 8ef75c1b5969..85c116c88338 100644--- a/posthog/temporal/data_imports/sources/notion/source.py+++ b/posthog/temporal/data_imports/sources/notion/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -67,6 +68,11 @@ Then **share** each page or database you want to sync with the integration (via),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.notion.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: NotionSourceConfig,diff --git a/posthog/temporal/data_imports/sources/okta/canonical_descriptions.py b/posthog/temporal/data_imports/sources/okta/canonical_descriptions.pynew file mode 100644index 000000000000..0b5e606fcac9--- /dev/null+++ b/posthog/temporal/data_imports/sources/okta/canonical_descriptions.py@@ -0,0 +1,99 @@+"""Canonical, documentation-sourced descriptions for Okta endpoints and columns.++Sourced from the official Okta Management API reference (https://developer.okta.com/docs/api/).+Keyed by the endpoint names in `settings.py` `OKTA_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Okta table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "users": {+ "description": "An Okta user account, with profile, credentials, and lifecycle status.",+ "docs_url": "https://developer.okta.com/docs/reference/api/users/",+ "columns": {+ "id": "Unique identifier for the user.",+ "status": "Lifecycle status of the user (e.g. ACTIVE, STAGED, PROVISIONED, SUSPENDED, DEPROVISIONED).",+ "profile": "User profile attributes (login, email, firstName, lastName, etc.).",+ "credentials": "Authentication credentials and recovery configuration for the user.",+ "type": "Reference to the user type that defines the profile schema.",+ "created": "Time at which the user was created.",+ "activated": "Time at which the user was activated.",+ "statusChanged": "Time at which the user's status last changed.",+ "lastLogin": "Time of the user's most recent successful login.",+ "lastUpdated": "Time at which the user was last updated.",+ "passwordChanged": "Time at which the user's password was last changed.",+ },+ },+ "groups": {+ "description": "An Okta group used to manage membership and assign apps and policies.",+ "docs_url": "https://developer.okta.com/docs/reference/api/groups/",+ "columns": {+ "id": "Unique identifier for the group.",+ "type": "Type of group: OKTA_GROUP, APP_GROUP, or BUILT_IN.",+ "profile": "Group profile attributes (name and description).",+ "objectClass": "Object classes that define the group's profile schema.",+ "created": "Time at which the group was created.",+ "lastUpdated": "Time at which the group was last updated.",+ "lastMembershipUpdated": "Time at which the group's membership last changed.",+ },+ },+ "applications": {+ "description": "An application integrated with Okta for single sign-on and provisioning.",+ "docs_url": "https://developer.okta.com/docs/reference/api/apps/",+ "columns": {+ "id": "Unique identifier for the application.",+ "name": "Internal name (key) of the application.",+ "label": "User-facing display name of the application.",+ "status": "Status of the application: ACTIVE or INACTIVE.",+ "signOnMode": "Authentication scheme used by the app (e.g. SAML_2_0, OPENID_CONNECT, AUTO_LOGIN).",+ "features": "Enabled features for the application (e.g. provisioning).",+ "settings": "Configuration settings for the application.",+ "created": "Time at which the application was created.",+ "lastUpdated": "Time at which the application was last updated.",+ },+ },+ "logs": {+ "description": "System Log events — the audit trail of actions and authentication events in the Okta org.",+ "docs_url": "https://developer.okta.com/docs/reference/api/system-log/",+ "columns": {+ "uuid": "Unique identifier for the log event.",+ "published": "Time at which the event was published.",+ "eventType": "Type of the event (e.g. user.session.start).",+ "displayMessage": "Human-readable description of the event.",+ "severity": "Severity of the event: DEBUG, INFO, WARN, or ERROR.",+ "outcome": "Outcome of the event, including result (SUCCESS, FAILURE) and reason.",+ "actor": "The entity (user, app, or system) that performed the action.",+ "client": "Client details (IP, user agent, geographical context) for the event.",+ "target": "The objects the action was performed against.",+ "transaction": "Transaction details linking related events.",+ },+ },+ "group_rules": {+ "description": "A rule that automatically assigns users to Okta groups based on conditions.",+ "docs_url": "https://developer.okta.com/docs/reference/api/groups/#group-rule-operations",+ "columns": {+ "id": "Unique identifier for the group rule.",+ "name": "The group rule's name.",+ "type": "Type of the group rule.",+ "status": "Status of the rule: ACTIVE or INACTIVE.",+ "conditions": "Conditions (expression and people scope) that trigger the rule.",+ "actions": "Actions applied when the rule matches, such as target group assignments.",+ "created": "Time at which the rule was created.",+ "lastUpdated": "Time at which the rule was last updated.",+ },+ },+ "user_types": {+ "description": "A user type that defines the profile schema available to Okta users.",+ "docs_url": "https://developer.okta.com/docs/reference/api/user-types/",+ "columns": {+ "id": "Unique identifier for the user type.",+ "name": "Internal name of the user type.",+ "displayName": "User-facing display name of the user type.",+ "description": "Description of the user type.",+ "default": "Whether this is the default user type for the org.",+ "created": "Time at which the user type was created.",+ "lastUpdated": "Time at which the user type was last updated.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/okta/source.py b/posthog/temporal/data_imports/sources/okta/source.pyindex 84e312989c3d..6ed9ed5bf85e 100644--- a/posthog/temporal/data_imports/sources/okta/source.py+++ b/posthog/temporal/data_imports/sources/okta/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -86,6 +87,11 @@ The token's user should have read access to the resources you want to sync, forHOST_NOT_ALLOWED_ERROR: "The Okta domain is not allowed. Please use your organization's Okta domain.",}+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.okta.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: OktaSourceConfig,diff --git a/posthog/temporal/data_imports/sources/omnisend/canonical_descriptions.py b/posthog/temporal/data_imports/sources/omnisend/canonical_descriptions.pynew file mode 100644index 000000000000..c99334294431--- /dev/null+++ b/posthog/temporal/data_imports/sources/omnisend/canonical_descriptions.py@@ -0,0 +1,101 @@+"""Canonical, documentation-sourced descriptions for Omnisend endpoints and columns.++Sourced from the official Omnisend API reference (https://api-docs.omnisend.com/reference).+Keyed by the endpoint names in `settings.py` `OMNISEND_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Omnisend table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "contacts": {+ "description": "A contact in Omnisend — a subscriber with channel statuses and profile attributes.",+ "docs_url": "https://api-docs.omnisend.com/reference/get-contacts",+ "columns": {+ "contactID": "Unique identifier for the contact.",+ "email": "The contact's email address.",+ "phone": "The contact's phone number.",+ "firstName": "The contact's first name.",+ "lastName": "The contact's last name.",+ "status": "Subscription status of the contact (e.g. subscribed, unsubscribed, nonSubscribed).",+ "statusDate": "Time at which the contact's status last changed.",+ "tags": "Tags applied to the contact.",+ "customProperties": "Custom attributes stored on the contact.",+ "createdAt": "Time at which the contact was created.",+ "updatedAt": "Time at which the contact was last updated.",+ },+ },+ "campaigns": {+ "description": "An email or SMS campaign sent through Omnisend.",+ "docs_url": "https://api-docs.omnisend.com/reference/get-campaigns",+ "columns": {+ "campaignID": "Unique identifier for the campaign.",+ "name": "The campaign's name.",+ "subject": "Subject line of the campaign.",+ "fromName": "Sender name shown to recipients.",+ "fromEmail": "Sender email address.",+ "type": "Type of campaign (e.g. email, sms).",+ "status": "Status of the campaign (e.g. draft, sending, sent).",+ "createdAt": "Time at which the campaign was created.",+ "startDate": "Time at which the campaign was or is scheduled to start sending.",+ },+ },+ "carts": {+ "description": "A shopping cart tracked in Omnisend, used for abandoned-cart automations.",+ "docs_url": "https://api-docs.omnisend.com/reference/get-carts",+ "columns": {+ "cartID": "Unique identifier for the cart.",+ "contactID": "Identifier of the contact the cart belongs to.",+ "email": "Email address associated with the cart.",+ "currency": "Three-letter ISO currency code of the cart.",+ "cartSum": "Total value of the cart.",+ "products": "Line items (products) in the cart.",+ "cartRecoveryUrl": "URL the contact can use to recover the cart.",+ "createdAt": "Time at which the cart was created.",+ "updatedAt": "Time at which the cart was last updated.",+ },+ },+ "orders": {+ "description": "An order placed by a contact, tracked in Omnisend for purchase-based automations.",+ "docs_url": "https://api-docs.omnisend.com/reference/get-orders",+ "columns": {+ "orderID": "Unique identifier for the order.",+ "contactID": "Identifier of the contact who placed the order.",+ "email": "Email address associated with the order.",+ "currency": "Three-letter ISO currency code of the order.",+ "orderSum": "Total value of the order.",+ "paymentStatus": "Payment status of the order (e.g. paid, awaitingPayment).",+ "fulfillmentStatus": "Fulfillment status of the order.",+ "products": "Line items (products) in the order.",+ "createdAt": "Time at which the order was created.",+ "updatedAt": "Time at which the order was last updated.",+ },+ },+ "products": {+ "description": "A product in the Omnisend catalog.",+ "docs_url": "https://api-docs.omnisend.com/reference/get-products",+ "columns": {+ "productID": "Unique identifier for the product.",+ "title": "The product's title.",+ "description": "Description of the product.",+ "status": "Status of the product (e.g. active, notAvailable).",+ "currency": "Three-letter ISO currency code for the product's prices.",+ "productUrl": "URL of the product page.",+ "imageUrl": "URL of the product's image.",+ "variants": "Variants of the product (e.g. sizes, colors) with their prices.",+ "categoryIDs": "Identifiers of the categories the product belongs to.",+ "createdAt": "Time at which the product was created.",+ "updatedAt": "Time at which the product was last updated.",+ },+ },+ "categories": {+ "description": "A product category in the Omnisend catalog.",+ "docs_url": "https://api-docs.omnisend.com/reference/get-categories",+ "columns": {+ "categoryID": "Unique identifier for the category.",+ "title": "The category's title.",+ "createdAt": "Time at which the category was created.",+ "updatedAt": "Time at which the category was last updated.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/omnisend/source.py b/posthog/temporal/data_imports/sources/omnisend/source.pyindex 5dfa3aaea89e..c025d2c2d25d 100644--- a/posthog/temporal/data_imports/sources/omnisend/source.py+++ b/posthog/temporal/data_imports/sources/omnisend/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -59,6 +60,11 @@ You can create an API key in your [Omnisend account settings](https://app.omnise),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.omnisend.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: OmnisendSourceConfig,diff --git a/posthog/temporal/data_imports/sources/optimizely/canonical_descriptions.py b/posthog/temporal/data_imports/sources/optimizely/canonical_descriptions.pynew file mode 100644index 000000000000..b120961d9418--- /dev/null+++ b/posthog/temporal/data_imports/sources/optimizely/canonical_descriptions.py@@ -0,0 +1,106 @@+"""Canonical, documentation-sourced descriptions for Optimizely endpoints and columns.++Sourced from the official Optimizely Web Experimentation REST API v2 reference+(https://library.optimizely.com/docs/api/app/v2/index.html). Keyed by the endpoint names in+`settings.py` `OPTIMIZELY_ENDPOINTS`, which match the `ExternalDataSchema.name` of a synced+Optimizely table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by most Optimizely v2 objects; merged into each entry so we don't repeat them.+_COMMON_COLUMNS = {+ "id": "Unique numeric identifier for the object.",+ "name": "The object's name.",+ "created": "Time at which the object was created.",+ "last_modified": "Time at which the object was last modified.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "projects": {+ "description": "A container for experiments, audiences, events, and pages within an Optimizely account.",+ "docs_url": "https://library.optimizely.com/docs/api/app/v2/index.html#tag/Projects",+ "columns": _columns(+ account_id="ID of the account the project belongs to.",+ description="Description of the project.",+ platform="The project's platform (e.g. web, custom).",+ status="Whether the project is active or archived.",+ project_javascript="Custom JavaScript applied to all pages in the project.",+ web_snippet="Web snippet configuration (e.g. enable_force_variation, library, code revision).",+ ),+ },+ "experiments": {+ "description": "An A/B test or experiment that splits traffic across variations to measure impact.",+ "docs_url": "https://library.optimizely.com/docs/api/app/v2/index.html#tag/Experiments",+ "columns": _columns(+ project_id="ID of the project the experiment belongs to.",+ description="Description of the experiment.",+ status="Lifecycle status of the experiment (e.g. running, paused, not_started, archived, concluded).",+ type="Type of experiment (e.g. a/b, multivariate, personalization).",+ variations="The variations traffic is split across in the experiment.",+ metrics="Metrics tracked to measure the experiment's results.",+ audience_conditions="Conditions defining which visitors are eligible for the experiment.",+ campaign_id="ID of the campaign this experiment belongs to, if any.",+ holdback="Percentage of traffic held back from the experiment.",+ earliest="Earliest time the experiment started serving.",+ latest="Latest time the experiment served.",+ ),+ },+ "audiences": {+ "description": "A targetable segment of visitors defined by attribute and behavior conditions.",+ "docs_url": "https://library.optimizely.com/docs/api/app/v2/index.html#tag/Audiences",+ "columns": _columns(+ project_id="ID of the project the audience belongs to.",+ description="Description of the audience.",+ conditions="Logical conditions that define which visitors belong to the audience.",+ archived="Whether the audience has been archived.",+ segmentation="Whether the audience is used for segmentation.",+ ),+ },+ "events": {+ "description": "A tracked visitor action (click, pageview, or custom event) used as an experiment metric.",+ "docs_url": "https://library.optimizely.com/docs/api/app/v2/index.html#tag/Events",+ "columns": _columns(+ project_id="ID of the project the event belongs to.",+ description="Description of the event.",+ event_type="Type of event (e.g. click, custom, pageview).",+ key="API key used to reference the event when tracking.",+ page_id="ID of the page this event is associated with, if any.",+ category="Category the event is grouped under (e.g. add_to_cart, purchase, other).",+ archived="Whether the event has been archived.",+ ),+ },+ "pages": {+ "description": "A definition of a page or set of URLs where experiments and events can run.",+ "docs_url": "https://library.optimizely.com/docs/api/app/v2/index.html#tag/Pages",+ "columns": _columns(+ project_id="ID of the project the page belongs to.",+ edit_url="URL of the page used when editing in the visual editor.",+ conditions="URL-matching conditions that define when the page is considered active.",+ activation_type="How the page activates (e.g. immediate, manual, polling, callback).",+ category="Category the page is grouped under (e.g. article, cart, home, search).",+ archived="Whether the page has been archived.",+ ),+ },+ "campaigns": {+ "description": "A personalization campaign that delivers experiences to targeted audiences across pages.",+ "docs_url": "https://library.optimizely.com/docs/api/app/v2/index.html#tag/Campaigns",+ "columns": _columns(+ project_id="ID of the project the campaign belongs to.",+ description="Description of the campaign.",+ status="Lifecycle status of the campaign (e.g. active, paused, draft, archived).",+ type="Type of campaign (e.g. a/b, personalization).",+ experiment_ids="IDs of the experiments (experiences) that make up the campaign.",+ page_ids="IDs of the pages the campaign runs on.",+ metrics="Metrics tracked to measure the campaign's results.",+ holdback="Percentage of traffic held back from the campaign.",+ earliest="Earliest time the campaign started serving.",+ latest="Latest time the campaign served.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/optimizely/source.py b/posthog/temporal/data_imports/sources/optimizely/source.pyindex 70c80d312b0a..8cbfe985641e 100644--- a/posthog/temporal/data_imports/sources/optimizely/source.py+++ b/posthog/temporal/data_imports/sources/optimizely/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, SimpleSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.schema import SourceSchemafrom posthog.temporal.data_imports.sources.generated_configs import OptimizelySourceConfig@@ -29,6 +30,11 @@ class OptimizelySource(SimpleSource[OptimizelySourceConfig]):def source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.OPTIMIZELY+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.optimizely.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized for url: https://api.optimizely.com": "Optimizely authentication failed. Please check your personal access token.",diff --git a/posthog/temporal/data_imports/sources/ortto/canonical_descriptions.py b/posthog/temporal/data_imports/sources/ortto/canonical_descriptions.pynew file mode 100644index 000000000000..1367332d0a1c--- /dev/null+++ b/posthog/temporal/data_imports/sources/ortto/canonical_descriptions.py@@ -0,0 +1,81 @@+"""Canonical, documentation-sourced descriptions for Ortto endpoints and columns.++Sourced from the official Ortto API reference (https://help.ortto.com/developer/latest/api-reference/).+Keyed by the endpoint names in `settings.py` `ORTTO_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Ortto table. Ortto exposes people and accounts as+field-id collections (built-in IDs like `str::email`, plus runtime-discovered `cm:*` custom+fields), so column coverage focuses on the documented built-in fields. Columns absent here fall+back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "people": {+ "description": "A person (contact) in Ortto's customer data platform, with profile and activity fields.",+ "docs_url": "https://help.ortto.com/developer/latest/api-reference/person/",+ "columns": {+ "id": "Unique identifier for the person.",+ "str::first": "Person's first name.",+ "str::last": "Person's last name.",+ "str::email": "Person's email address.",+ "str::postal": "Person's postal/ZIP code.",+ "str::ei": "Person's external (customer) identifier.",+ "phn::phone": "Person's phone number.",+ "geo::city": "Person's city, derived from geolocation.",+ "geo::region": "Person's region/state, derived from geolocation.",+ "geo::country": "Person's country, derived from geolocation.",+ "bol::gdpr": "Whether the person is subject to GDPR.",+ "bol::p": "Whether the person is subscribed (permission to contact).",+ "bol::sp": "Whether the person is subscribed to SMS.",+ "dtz::b": "Person's date of birth.",+ "u4s::t": "Person's tags.",+ "idt::o": "IDs of the accounts (organizations) the person is associated with.",+ },+ },+ "accounts": {+ "description": "An account (organization/company) record in Ortto that people can be associated with.",+ "docs_url": "https://help.ortto.com/developer/latest/api-reference/accounts/",+ "columns": {+ "id": "Unique identifier for the account.",+ "str:o:name": "Account (organization) name.",+ "str:o:website": "Account's website URL.",+ "str:o:industry": "Industry the account operates in.",+ "int:o:employees": "Number of employees at the account.",+ },+ },+ "audiences": {+ "description": "A saved audience (segment) of people defined by filter conditions in Ortto.",+ "docs_url": "https://help.ortto.com/developer/latest/api-reference/audiences/",+ "columns": {+ "id": "Unique identifier for the audience.",+ "name": "The audience's name.",+ },+ },+ "tags": {+ "description": "A tag that can be applied to people in Ortto to label and segment them.",+ "docs_url": "https://help.ortto.com/developer/latest/api-reference/tags/",+ "columns": {+ "id": "Unique identifier for the tag.",+ "name": "The tag's name.",+ },+ },+ "person_custom_fields": {+ "description": "Definitions of the custom fields available on person records in Ortto.",+ "docs_url": "https://help.ortto.com/developer/latest/api-reference/person/",+ "columns": {+ "id": "Field identifier (e.g. str:cm:my-field) used to reference the custom field.",+ "name": "Human-readable name of the custom field.",+ "type": "Data type of the custom field (e.g. text, number, boolean, date).",+ },+ },+ "account_custom_fields": {+ "description": "Definitions of the custom fields available on account records in Ortto.",+ "docs_url": "https://help.ortto.com/developer/latest/api-reference/accounts/",+ "columns": {+ "id": "Field identifier (e.g. str:o:my-field) used to reference the custom field.",+ "name": "Human-readable name of the custom field.",+ "type": "Data type of the custom field (e.g. text, number, boolean, date).",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/ortto/source.py b/posthog/temporal/data_imports/sources/ortto/source.pyindex e088925ab4c6..0addbbcd858d 100644--- a/posthog/temporal/data_imports/sources/ortto/source.py+++ b/posthog/temporal/data_imports/sources/ortto/source.py@@ -13,6 +13,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -33,6 +34,11 @@ class OrttoSource(ResumableSource[OrttoSourceConfig, OrttoResumeConfig]):def source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.ORTTO+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.ortto.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized for url": "Ortto authentication failed. Please check your API key (and that it matches the selected region).",diff --git a/posthog/temporal/data_imports/sources/outbrain/canonical_descriptions.py b/posthog/temporal/data_imports/sources/outbrain/canonical_descriptions.pynew file mode 100644index 000000000000..57a0d1088aad--- /dev/null+++ b/posthog/temporal/data_imports/sources/outbrain/canonical_descriptions.py@@ -0,0 +1,113 @@+"""Canonical, documentation-sourced descriptions for Outbrain Amplify endpoints and columns.++Sourced from the official Outbrain Amplify API reference (https://amplifyv01.docs.apiary.io/).+Keyed by the endpoint names in `settings.py` `OUTBRAIN_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Outbrain table. Report endpoints carry synthetic+identifier columns (`_marketer_id`, `_date`) injected by the transport. Columns absent here fall+back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Performance metrics shared by the Amplify report endpoints.+_REPORT_METRICS = {+ "impressions": "Number of times the promoted content was shown.",+ "clicks": "Number of clicks on the promoted content.",+ "spend": "Amount spent over the reporting window.",+ "ecpc": "Effective cost per click over the reporting window.",+ "ctr": "Click-through rate (clicks divided by impressions).",+ "conversions": "Number of conversions attributed over the reporting window.",+ "conversionRate": "Conversion rate (conversions divided by clicks).",+ "cpa": "Cost per acquisition (spend divided by conversions).",+ "currency": "Three-letter ISO currency code the monetary metrics are reported in.",+}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "marketers": {+ "description": "An Outbrain Amplify marketer (advertiser account) that owns campaigns.",+ "docs_url": "https://amplifyv01.docs.apiary.io/#reference/marketers",+ "columns": {+ "id": "Unique identifier for the marketer.",+ "name": "The marketer's name.",+ "currency": "Three-letter ISO currency code the marketer's account bills in.",+ "enabled": "Whether the marketer account is enabled.",+ "creationTime": "Time at which the marketer account was created.",+ "lastModified": "Time at which the marketer account was last modified.",+ "blockedSiteFateMessage": "Status message for blocked-site policy, if applicable.",+ },+ },+ "campaigns": {+ "description": "An advertising campaign run by a marketer, with budget, bidding, and targeting.",+ "docs_url": "https://amplifyv01.docs.apiary.io/#reference/campaigns",+ "columns": {+ "id": "Unique identifier for the campaign.",+ "name": "The campaign's name.",+ "_marketer_id": "ID of the marketer that owns the campaign (injected during sync).",+ "enabled": "Whether the campaign is enabled.",+ "budget": "The budget object associated with the campaign.",+ "cpc": "Cost-per-click bid for the campaign.",+ "autoArchived": "Whether the campaign was automatically archived.",+ "status": "Current status of the campaign (e.g. RUNNING, PAUSED, PENDING).",+ "objective": "The campaign's objective (e.g. traffic, conversions).",+ "creationTime": "Time at which the campaign was created.",+ "lastModified": "Time at which the campaign was last modified.",+ "startDate": "Date the campaign is scheduled to start.",+ "endDate": "Date the campaign is scheduled to end, if set.",+ },+ },+ "budgets": {+ "description": "A spending budget shared across one or more of a marketer's campaigns.",+ "docs_url": "https://amplifyv01.docs.apiary.io/#reference/budgets",+ "columns": {+ "id": "Unique identifier for the budget.",+ "name": "The budget's name.",+ "_marketer_id": "ID of the marketer that owns the budget (injected during sync).",+ "amount": "Total budget amount.",+ "currency": "Three-letter ISO currency code of the budget amount.",+ "amountSpent": "Amount of the budget already spent.",+ "amountRemaining": "Amount of the budget remaining.",+ "type": "Budget renewal type (e.g. CAMPAIGN, MONTHLY).",+ "pacing": "Pacing mode for spending the budget (e.g. SPEND_ASAP, AUTOMATIC).",+ "startDate": "Date the budget becomes active.",+ "endDate": "Date the budget expires, if set.",+ "runForever": "Whether the budget has no end date.",+ },+ },+ "promoted_links": {+ "description": "A piece of promoted content (ad creative) within a campaign.",+ "docs_url": "https://amplifyv01.docs.apiary.io/#reference/promoted-links",+ "columns": {+ "id": "Unique identifier for the promoted link.",+ "_campaign_id": "ID of the campaign the promoted link belongs to (injected during sync).",+ "text": "Headline text of the promoted link.",+ "url": "Destination URL the promoted link points to.",+ "siteName": "Display name of the site the content is promoted from.",+ "imageUrl": "URL of the promoted link's image.",+ "enabled": "Whether the promoted link is enabled.",+ "status": "Approval/serving status of the promoted link.",+ "creationTime": "Time at which the promoted link was created.",+ "lastModified": "Time at which the promoted link was last modified.",+ "cachedImageUrl": "URL of the cached version of the promoted link's image.",+ },+ },+ "marketer_performance_daily": {+ "description": "Daily performance metrics (impressions, clicks, spend, conversions) per marketer.",+ "docs_url": "https://amplifyv01.docs.apiary.io/#reference/performance-reporting",+ "columns": {+ "_marketer_id": "ID of the marketer the metrics belong to (injected during sync).",+ "_date": "The day the metrics cover, used as the incremental cursor (injected during sync).",+ "metadata": "Metadata for the report row, including the date range it covers.",+ **_REPORT_METRICS,+ },+ },+ "campaign_performance": {+ "description": "Per-campaign performance totals for a trailing window (a snapshot, full-refreshed each sync).",+ "docs_url": "https://amplifyv01.docs.apiary.io/#reference/performance-reporting",+ "columns": {+ "_marketer_id": "ID of the marketer the metrics belong to (injected during sync).",+ "metadata": "Metadata identifying the campaign the metrics belong to.",+ **_REPORT_METRICS,+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/outbrain/source.py b/posthog/temporal/data_imports/sources/outbrain/source.pyindex 815724d1a692..36ef290f8851 100644--- a/posthog/temporal/data_imports/sources/outbrain/source.py+++ b/posthog/temporal/data_imports/sources/outbrain/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -31,6 +32,11 @@ class OutbrainSource(ResumableSource[OutbrainSourceConfig, OutbrainResumeConfig]def source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.OUTBRAIN+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.outbrain.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized for url: https://api.outbrain.com/amplify/v0.1/login": "Outbrain authentication failed. Please check your username and password.",diff --git a/posthog/temporal/data_imports/sources/paddle/canonical_descriptions.py b/posthog/temporal/data_imports/sources/paddle/canonical_descriptions.pynew file mode 100644index 000000000000..d4a37eb92bd0--- /dev/null+++ b/posthog/temporal/data_imports/sources/paddle/canonical_descriptions.py@@ -0,0 +1,138 @@+"""Canonical, documentation-sourced descriptions for Paddle endpoints and columns.++Sourced from the official Paddle Billing API reference (https://developer.paddle.com/api-reference).+Keyed by the resource names in `constants.py` (used by `settings.py` `ENDPOINTS`), which match the+`ExternalDataSchema.name` of a synced Paddle table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions+from posthog.temporal.data_imports.sources.paddle.constants import (+ ADJUSTMENT_RESOURCE_NAME,+ CUSTOMER_RESOURCE_NAME,+ DISCOUNT_RESOURCE_NAME,+ PRICE_RESOURCE_NAME,+ PRODUCT_RESOURCE_NAME,+ SUBSCRIPTION_RESOURCE_NAME,+ TRANSACTION_RESOURCE_NAME,+)++# Fields shared by most Paddle Billing entities; merged into each entry so we don't repeat them.+_COMMON_COLUMNS = {+ "id": "Unique Paddle identifier for the object (prefixed by type, e.g. txn_, sub_).",+ "status": "Current status of the object.",+ "created_at": "Time at which the object was created (RFC 3339).",+ "updated_at": "Time at which the object was last updated (RFC 3339).",+ "custom_data": "Set of custom key-value data attached to the object.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ CUSTOMER_RESOURCE_NAME: {+ "description": "A customer who can hold subscriptions and be billed in Paddle.",+ "docs_url": "https://developer.paddle.com/api-reference/customers/overview",+ "columns": _columns(+ email="Customer's email address.",+ name="Customer's full name.",+ locale="Customer's preferred locale (IETF BCP 47 language tag).",+ marketing_consent="Whether the customer has opted in to marketing communications.",+ ),+ },+ DISCOUNT_RESOURCE_NAME: {+ "description": "A discount (coupon) that reduces the amount charged on transactions or subscriptions.",+ "docs_url": "https://developer.paddle.com/api-reference/discounts/overview",+ "columns": _columns(+ description="Internal description of the discount.",+ type="Type of discount: flat, flat_per_seat, or percentage.",+ amount="Amount of the discount (a percentage or a monetary amount, depending on type).",+ currency_code="Three-letter ISO currency code for flat discounts.",+ code="Code customers can enter at checkout to apply the discount, if any.",+ enabled_for_checkout="Whether the discount can be applied at checkout.",+ recur="Whether the discount applies to recurring billing periods.",+ maximum_recurring_intervals="Number of billing periods the recurring discount applies for.",+ usage_limit="Maximum number of times the discount can be redeemed.",+ times_used="Number of times the discount has been redeemed.",+ expires_at="Time at which the discount expires (RFC 3339), if set.",+ ),+ },+ PRICE_RESOURCE_NAME: {+ "description": "A price for a product, including amount, billing cycle, and trial settings.",+ "docs_url": "https://developer.paddle.com/api-reference/prices/overview",+ "columns": _columns(+ product_id="ID of the product this price belongs to.",+ description="Internal description of the price.",+ name="Name of the price, shown to customers.",+ type="Whether the price is standard or custom.",+ billing_cycle="Billing cycle (interval and frequency) for recurring prices; null for one-time.",+ trial_period="Trial period (interval and frequency) offered before billing starts, if any.",+ tax_mode="How tax is calculated for the price (account_setting, external, or internal).",+ unit_price="Base unit price (amount and currency_code) for the price.",+ quantity="Allowed minimum and maximum quantity for the price.",+ ),+ },+ PRODUCT_RESOURCE_NAME: {+ "description": "A product or service you sell, which prices are attached to.",+ "docs_url": "https://developer.paddle.com/api-reference/products/overview",+ "columns": _columns(+ name="The product's name.",+ description="Description of the product.",+ type="Whether the product is standard or custom.",+ tax_category="Tax category that determines the tax rate applied (e.g. standard, saas, ebook).",+ image_url="URL of the product's image.",+ ),+ },+ SUBSCRIPTION_RESOURCE_NAME: {+ "description": "A customer's recurring billing arrangement against one or more prices.",+ "docs_url": "https://developer.paddle.com/api-reference/subscriptions/overview",+ "columns": _columns(+ customer_id="ID of the customer who owns the subscription.",+ address_id="ID of the customer address used for the subscription.",+ business_id="ID of the customer business associated with the subscription, if any.",+ currency_code="Three-letter ISO currency code the subscription bills in.",+ collection_mode="How the subscription is collected: automatic or manual.",+ started_at="Time at which the subscription started (RFC 3339).",+ first_billed_at="Time at which the subscription was first billed (RFC 3339).",+ next_billed_at="Time at which the subscription will next bill (RFC 3339).",+ paused_at="Time at which the subscription was paused (RFC 3339), if applicable.",+ canceled_at="Time at which the subscription was canceled (RFC 3339), if applicable.",+ current_billing_period="Start and end of the current billing period.",+ billing_cycle="Billing cycle (interval and frequency) of the subscription.",+ items="Line items (prices and quantities) included in the subscription.",+ ),+ },+ TRANSACTION_RESOURCE_NAME: {+ "description": "A financial transaction — a payment, refund, or credit — for a customer.",+ "docs_url": "https://developer.paddle.com/api-reference/transactions/overview",+ "columns": _columns(+ customer_id="ID of the customer the transaction is for.",+ subscription_id="ID of the subscription the transaction relates to, if any.",+ invoice_id="ID of the invoice generated for the transaction, if any.",+ invoice_number="Human-readable invoice number for the transaction, if any.",+ origin="What triggered the transaction (e.g. web, subscription_recurring, api).",+ currency_code="Three-letter ISO currency code of the transaction.",+ collection_mode="How the transaction is collected: automatic or manual.",+ billed_at="Time at which the transaction was billed (RFC 3339); the incremental cursor.",+ details="Calculated totals and tax breakdown for the transaction.",+ items="Line items (prices and quantities) included in the transaction.",+ payments="Payment attempts made against the transaction.",+ ),+ },+ ADJUSTMENT_RESOURCE_NAME: {+ "description": "A refund or credit applied to a transaction, reducing or returning charged amounts.",+ "docs_url": "https://developer.paddle.com/api-reference/adjustments/overview",+ "columns": _columns(+ action="Type of adjustment: refund, credit, chargeback, chargeback_reverse, or chargeback_warning.",+ transaction_id="ID of the transaction the adjustment is against.",+ subscription_id="ID of the subscription related to the adjustment, if any.",+ customer_id="ID of the customer the adjustment is for.",+ reason="Reason given for the adjustment.",+ currency_code="Three-letter ISO currency code of the adjustment.",+ items="Line items the adjustment applies to.",+ totals="Calculated totals (subtotal, tax, total) for the adjustment.",+ payout_totals="Adjustment totals in your payout currency.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/paddle/source.py b/posthog/temporal/data_imports/sources/paddle/source.pyindex b8c2bbcc8688..a77b463f5915 100644--- a/posthog/temporal/data_imports/sources/paddle/source.py+++ b/posthog/temporal/data_imports/sources/paddle/source.py@@ -10,6 +10,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -56,6 +57,11 @@ class PaddleSource(ResumableSource[PaddleSourceConfig, PaddleResumeConfig]):),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.paddle.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"400 Client Error: Bad Request for url: https://api.paddle.com": "Paddle rejected the request parameters. Please check your source configuration and incremental sync state, then try again.",diff --git a/posthog/temporal/data_imports/sources/pagerduty/canonical_descriptions.py b/posthog/temporal/data_imports/sources/pagerduty/canonical_descriptions.pynew file mode 100644index 000000000000..274ac02df165--- /dev/null+++ b/posthog/temporal/data_imports/sources/pagerduty/canonical_descriptions.py@@ -0,0 +1,138 @@+"""Canonical, documentation-sourced descriptions for PagerDuty endpoints and columns.++Sourced from the official PagerDuty REST API reference (https://developer.pagerduty.com/api-reference/).+Keyed by the endpoint names in `settings.py` `PAGERDUTY_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced PagerDuty table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by most PagerDuty REST objects; merged into each entry so we don't repeat them.+_COMMON_COLUMNS = {+ "id": "Unique identifier for the object.",+ "type": "String describing the object's PagerDuty type (e.g. 'incident', 'service').",+ "summary": "Short, human-readable label for the object.",+ "self": "API URL at which the object can be retrieved.",+ "html_url": "URL at which the object is viewable in the PagerDuty web UI.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "incidents": {+ "description": "An incident representing a problem on a service that requires response.",+ "docs_url": "https://developer.pagerduty.com/api-reference/9d0b4b12e36f9-list-incidents",+ "columns": _columns(+ incident_number="Sequential, human-readable number for the incident.",+ title="Title describing the incident.",+ description="Description of the incident.",+ status="Current status of the incident: triggered, acknowledged, or resolved.",+ urgency="Urgency of the incident: high or low.",+ created_at="Time at which the incident was created; the incremental cursor.",+ resolved_at="Time at which the incident was resolved, if applicable.",+ service="The service the incident is associated with.",+ assignments="Current assignments of the incident to responders.",+ escalation_policy="The escalation policy applied to the incident.",+ teams="Teams the incident is associated with.",+ priority="Priority assigned to the incident, if any.",+ last_status_change_at="Time at which the incident's status last changed.",+ incident_key="Deduplication key used to prevent duplicate incidents.",+ ),+ },+ "log_entries": {+ "description": "A log entry recording an action or change on an incident (triggered, acknowledged, notified, etc.).",+ "docs_url": "https://developer.pagerduty.com/api-reference/2bcc6065c3fc1-list-log-entries",+ "columns": _columns(+ created_at="Time at which the log entry was created.",+ agent="The user or service that caused the logged action.",+ channel="The means by which the action was performed (e.g. web, api, timeout).",+ incident="The incident the log entry belongs to.",+ service="The service associated with the log entry.",+ event_details="Additional details about the logged event.",+ ),+ },+ "services": {+ "description": "A service representing an application, component, or team monitored in PagerDuty.",+ "docs_url": "https://developer.pagerduty.com/api-reference/e960cca205c0f-list-services",+ "columns": _columns(+ name="The service's name.",+ description="Description of the service.",+ status="Current status of the service (e.g. active, warning, critical, disabled).",+ created_at="Time at which the service was created.",+ updated_at="Time at which the service was last updated.",+ escalation_policy="The escalation policy used by the service.",+ teams="Teams the service is associated with.",+ auto_resolve_timeout="Seconds after which an incident is auto-resolved, if set.",+ acknowledgement_timeout="Seconds after which an acknowledged incident re-triggers, if set.",+ ),+ },+ "users": {+ "description": "A user account in the PagerDuty account.",+ "docs_url": "https://developer.pagerduty.com/api-reference/4cf28d189a98e-list-users",+ "columns": _columns(+ name="The user's full name.",+ email="The user's email address.",+ role="The user's account role (e.g. admin, manager, responder, observer).",+ time_zone="The user's time zone.",+ job_title="The user's job title.",+ teams="Teams the user belongs to.",+ contact_methods="The user's configured contact methods.",+ notification_rules="Rules governing how and when the user is notified.",+ ),+ },+ "teams": {+ "description": "A team that groups users, services, and escalation policies in PagerDuty.",+ "docs_url": "https://developer.pagerduty.com/api-reference/d44a37c5e6113-list-teams",+ "columns": _columns(+ name="The team's name.",+ description="Description of the team.",+ parent="The parent team, if this team is nested.",+ ),+ },+ "escalation_policies": {+ "description": "An ordered set of escalation rules that determine who is notified when an incident is not handled.",+ "docs_url": "https://developer.pagerduty.com/api-reference/9b7e88f9c3df3-list-escalation-policies",+ "columns": _columns(+ name="The escalation policy's name.",+ description="Description of the escalation policy.",+ num_loops="Number of times the policy repeats if no one responds.",+ escalation_rules="Ordered rules defining who is escalated to and after how long.",+ services="Services that use this escalation policy.",+ teams="Teams the escalation policy is associated with.",+ ),+ },+ "schedules": {+ "description": "An on-call schedule defining which users are on call over time.",+ "docs_url": "https://developer.pagerduty.com/api-reference/8a08c0b16d98b-list-schedules",+ "columns": _columns(+ name="The schedule's name.",+ description="Description of the schedule.",+ time_zone="The time zone the schedule is defined in.",+ schedule_layers="Rotation layers defining who is on call and when.",+ teams="Teams the schedule is associated with.",+ escalation_policies="Escalation policies that reference this schedule.",+ ),+ },+ "priorities": {+ "description": "A priority level that can be assigned to incidents to rank their importance.",+ "docs_url": "https://developer.pagerduty.com/api-reference/f1a8d9d52f0f8-list-priorities",+ "columns": _columns(+ name="The priority's name (e.g. P1, P2).",+ description="Description of the priority.",+ ),+ },+ "vendors": {+ "description": "A third-party vendor that integrates with PagerDuty (e.g. a monitoring tool).",+ "docs_url": "https://developer.pagerduty.com/api-reference/8d6dd7e7e6f8e-list-vendors",+ "columns": _columns(+ name="The vendor's name.",+ description="Description of the vendor.",+ website_url="The vendor's website URL.",+ logo_url="URL of the vendor's logo.",+ integration_guide_url="URL of the vendor's PagerDuty integration guide.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/pagerduty/source.py b/posthog/temporal/data_imports/sources/pagerduty/source.pyindex 7d6cfdc1f610..a1b865f42edc 100644--- a/posthog/temporal/data_imports/sources/pagerduty/source.py+++ b/posthog/temporal/data_imports/sources/pagerduty/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -58,6 +59,11 @@ You can create a read-only API key in your PagerDuty account under **IntegrationreleaseStatus=ReleaseStatus.ALPHA,)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.pagerduty.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: PagerDutySourceConfig,diff --git a/posthog/temporal/data_imports/sources/pandadoc/canonical_descriptions.py b/posthog/temporal/data_imports/sources/pandadoc/canonical_descriptions.pynew file mode 100644index 000000000000..2bcd591d0e57--- /dev/null+++ b/posthog/temporal/data_imports/sources/pandadoc/canonical_descriptions.py@@ -0,0 +1,106 @@+"""Canonical, documentation-sourced descriptions for PandaDoc endpoints and columns.++Sourced from the official PandaDoc API reference (https://developers.pandadoc.com/reference/about).+Keyed by the endpoint names in `settings.py` `PANDADOC_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced PandaDoc table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "documents": {+ "description": "A document in PandaDoc — a proposal, quote, or contract that can be sent and signed.",+ "docs_url": "https://developers.pandadoc.com/reference/list-documents",+ "columns": {+ "id": "Unique identifier for the document.",+ "name": "The document's name.",+ "status": "Current status of the document (e.g. document.draft, document.sent, document.completed).",+ "date_created": "Time at which the document was created.",+ "date_modified": "Time at which the document was last modified; an incremental cursor.",+ "date_completed": "Time at which the document was completed (signed by all parties), if applicable.",+ "expiration_date": "Time at which the document expires, if set.",+ "version": "Version number of the document.",+ "template_id": "ID of the template the document was created from, if any.",+ "created_by": "The user who created the document.",+ "metadata": "Custom key-value metadata attached to the document.",+ "tokens": "Token (variable) values populated in the document.",+ "fields": "Form fields defined on the document.",+ "recipients": "Recipients the document is shared with or sent to.",+ "grand_total": "Grand total amount for documents that contain pricing.",+ },+ },+ "templates": {+ "description": "A reusable template used to create documents with predefined content and fields.",+ "docs_url": "https://developers.pandadoc.com/reference/list-templates",+ "columns": {+ "id": "Unique identifier for the template.",+ "name": "The template's name.",+ "date_created": "Time at which the template was created.",+ "date_modified": "Time at which the template was last modified.",+ "version": "Version number of the template.",+ },+ },+ "forms": {+ "description": "A PandaDoc form that collects responses and can generate documents from submissions.",+ "docs_url": "https://developers.pandadoc.com/reference/list-forms",+ "columns": {+ "id": "Unique identifier for the form.",+ "name": "The form's name.",+ "status": "Current status of the form (e.g. active, paused, draft).",+ "created_by": "The user who created the form.",+ "date_created": "Time at which the form was created.",+ "date_modified": "Time at which the form was last modified.",+ },+ },+ "contacts": {+ "description": "A contact stored in PandaDoc that can be added as a recipient on documents.",+ "docs_url": "https://developers.pandadoc.com/reference/contacts-list",+ "columns": {+ "id": "Unique identifier for the contact.",+ "email": "Contact's email address.",+ "first_name": "Contact's first name.",+ "last_name": "Contact's last name.",+ "company": "Contact's company name.",+ "job_title": "Contact's job title.",+ "phone": "Contact's phone number.",+ "state": "Contact's state/region.",+ "country": "Contact's country.",+ "city": "Contact's city.",+ "postal_code": "Contact's postal/ZIP code.",+ },+ },+ "members": {+ "description": "A member (user) of the PandaDoc workspace.",+ "docs_url": "https://developers.pandadoc.com/reference/members-list",+ "columns": {+ "user_id": "Unique identifier for the member.",+ "email": "Member's email address.",+ "first_name": "Member's first name.",+ "last_name": "Member's last name.",+ "is_active": "Whether the member's account is active.",+ "role": "The member's role in the workspace.",+ "date_created": "Time at which the member was added.",+ "date_modified": "Time at which the member was last modified.",+ },+ },+ "document_folders": {+ "description": "A folder used to organize documents in PandaDoc.",+ "docs_url": "https://developers.pandadoc.com/reference/list-document-folders",+ "columns": {+ "uuid": "Unique identifier for the folder.",+ "name": "The folder's name.",+ "date_created": "Time at which the folder was created.",+ "parent_uuid": "Identifier of the parent folder, if nested.",+ },+ },+ "template_folders": {+ "description": "A folder used to organize templates in PandaDoc.",+ "docs_url": "https://developers.pandadoc.com/reference/list-template-folders",+ "columns": {+ "uuid": "Unique identifier for the folder.",+ "name": "The folder's name.",+ "date_created": "Time at which the folder was created.",+ "parent_uuid": "Identifier of the parent folder, if nested.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/pandadoc/source.py b/posthog/temporal/data_imports/sources/pandadoc/source.pyindex eda9e5fa3dee..7bddd07d50e7 100644--- a/posthog/temporal/data_imports/sources/pandadoc/source.py+++ b/posthog/temporal/data_imports/sources/pandadoc/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -31,6 +32,11 @@ class PandaDocSource(ResumableSource[PandaDocSourceConfig, PandaDocResumeConfig]def source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.PANDADOC+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.pandadoc.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized for url: https://api.pandadoc.com": "PandaDoc authentication failed. Please check your API key.",diff --git a/posthog/temporal/data_imports/sources/pendo/canonical_descriptions.py b/posthog/temporal/data_imports/sources/pendo/canonical_descriptions.pynew file mode 100644index 000000000000..83161ed59213--- /dev/null+++ b/posthog/temporal/data_imports/sources/pendo/canonical_descriptions.py@@ -0,0 +1,78 @@+"""Canonical, documentation-sourced descriptions for Pendo endpoints and columns.++Sourced from the official Pendo API reference (https://engageapi.pendo.io). Keyed by the endpoint+names in `settings.py` `PENDO_ENDPOINTS`, which match the `ExternalDataSchema.name` of a synced+Pendo table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "features": {+ "description": "A tagged UI element (button, link, etc.) whose usage Pendo tracks within your application.",+ "docs_url": "https://engageapi.pendo.io/#a55c1ce4-1e9c-4e64-a78e-fc824ade8edd",+ "columns": {+ "id": "Unique identifier for the feature.",+ "name": "The feature's display name.",+ "appId": "ID of the application the feature belongs to.",+ "kind": "The kind of element the feature tags (e.g. button, link).",+ "group": "The product area or group the feature is organized under.",+ "createdAt": "Time at which the feature was created, as a Unix timestamp in milliseconds.",+ "lastUpdatedAt": "Time at which the feature was last updated, as a Unix timestamp in milliseconds.",+ "createdByUser": "The user who created the feature.",+ "lastUpdatedByUser": "The user who last updated the feature.",+ "color": "Display color assigned to the feature in Pendo.",+ "dirty": "Whether the feature's processing data is stale and being recomputed.",+ },+ },+ "pages": {+ "description": "A tagged page or screen in your application whose views Pendo tracks.",+ "docs_url": "https://engageapi.pendo.io/#a55c1ce4-1e9c-4e64-a78e-fc824ade8edd",+ "columns": {+ "id": "Unique identifier for the page.",+ "name": "The page's display name.",+ "appId": "ID of the application the page belongs to.",+ "group": "The product area or group the page is organized under.",+ "rules": "URL matching rules that define which URLs map to this page.",+ "createdAt": "Time at which the page was created, as a Unix timestamp in milliseconds.",+ "lastUpdatedAt": "Time at which the page was last updated, as a Unix timestamp in milliseconds.",+ "createdByUser": "The user who created the page.",+ "lastUpdatedByUser": "The user who last updated the page.",+ "color": "Display color assigned to the page in Pendo.",+ "dirty": "Whether the page's processing data is stale and being recomputed.",+ },+ },+ "guides": {+ "description": "An in-app message or walkthrough shown to users, such as a tooltip, banner, or lightbox.",+ "docs_url": "https://engageapi.pendo.io/#a55c1ce4-1e9c-4e64-a78e-fc824ade8edd",+ "columns": {+ "id": "Unique identifier for the guide.",+ "name": "The guide's name.",+ "appId": "ID of the application the guide is shown in.",+ "state": "The guide's lifecycle state (e.g. draft, public, disabled).",+ "createdAt": "Time at which the guide was created, as a Unix timestamp in milliseconds.",+ "lastUpdatedAt": "Time at which the guide was last updated, as a Unix timestamp in milliseconds.",+ "createdByUser": "The user who created the guide.",+ "lastUpdatedByUser": "The user who last updated the guide.",+ "publishedAt": "Time at which the guide was published, as a Unix timestamp in milliseconds.",+ "launchMethod": "How the guide is launched (e.g. automatic, badge, dom).",+ "audienceUiHint": "Description of the segment the guide is targeted to.",+ },+ },+ "visitors": {+ "description": "An individual end user of your application, identified by a visitor ID, with their metadata.",+ "docs_url": "https://engageapi.pendo.io/#5a695fb5-3da2-4a0e-9bbd-c7b276dbc4b8",+ "columns": {+ "visitorId": "Unique identifier for the visitor.",+ "metadata": "Custom and agent-collected metadata fields attached to the visitor.",+ },+ },+ "accounts": {+ "description": "An organization or account that groups visitors together, with its metadata.",+ "docs_url": "https://engageapi.pendo.io/#5a695fb5-3da2-4a0e-9bbd-c7b276dbc4b8",+ "columns": {+ "accountId": "Unique identifier for the account.",+ "metadata": "Custom and agent-collected metadata fields attached to the account.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/pendo/source.py b/posthog/temporal/data_imports/sources/pendo/source.pyindex a08e0dcce94f..18af49418c77 100644--- a/posthog/temporal/data_imports/sources/pendo/source.py+++ b/posthog/temporal/data_imports/sources/pendo/source.py@@ -13,6 +13,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -74,6 +75,11 @@ Create an integration key in Pendo under **Settings > Integrations > Integration),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.pendo.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: PendoSourceConfig,diff --git a/posthog/temporal/data_imports/sources/personio/canonical_descriptions.py b/posthog/temporal/data_imports/sources/personio/canonical_descriptions.pynew file mode 100644index 000000000000..6d42a06be4c8--- /dev/null+++ b/posthog/temporal/data_imports/sources/personio/canonical_descriptions.py@@ -0,0 +1,52 @@+"""Canonical, documentation-sourced descriptions for Personio endpoints and columns.++Sourced from the official Personio v2 API reference (https://developer.personio.de/reference). Keyed+by the endpoint names in `settings.py` `PERSONIO_ENDPOINTS`, which match the `ExternalDataSchema.name`+of a synced Personio table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "persons": {+ "description": "An employee record in Personio, with profile attributes and employment details.",+ "docs_url": "https://developer.personio.de/reference/get_v2-persons",+ "columns": {+ "id": "Unique identifier for the person.",+ "first_name": "The employee's first name.",+ "last_name": "The employee's last name.",+ "email": "The employee's email address.",+ "status": "Employment status of the person (e.g. active, inactive, onboarding, leave).",+ "created_at": "Time at which the person record was created.",+ "updated_at": "Time at which the person record was last updated.",+ "attributes": "Whitelisted custom and standard employee attributes.",+ },+ },+ "absence_periods": {+ "description": "A period of employee absence such as vacation or sick leave, including its dates and type.",+ "docs_url": "https://developer.personio.de/reference/get_v2-absence-periods",+ "columns": {+ "id": "Unique identifier for the absence period.",+ "person": "The employee the absence belongs to.",+ "absence_type": "The type of absence (e.g. paid vacation, sick leave).",+ "start_date": "First day of the absence period.",+ "end_date": "Last day of the absence period.",+ "status": "Approval status of the absence (e.g. pending, approved, rejected).",+ "created_at": "Time at which the absence period was created.",+ "updated_at": "Time at which the absence period was last updated.",+ },+ },+ "attendance_periods": {+ "description": "A recorded period of employee working time (a shift or break), with start and end times.",+ "docs_url": "https://developer.personio.de/reference/get_v2-attendance-periods",+ "columns": {+ "id": "Unique identifier for the attendance period.",+ "person": "The employee the attendance belongs to.",+ "type": "The type of attendance period (e.g. work, break).",+ "start": "Start time of the attendance period.",+ "end": "End time of the attendance period.",+ "created_at": "Time at which the attendance period was created.",+ "updated_at": "Time at which the attendance period was last updated.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/personio/source.py b/posthog/temporal/data_imports/sources/personio/source.pyindex 407f865a05cc..97e328744e38 100644--- a/posthog/temporal/data_imports/sources/personio/source.py+++ b/posthog/temporal/data_imports/sources/personio/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -75,6 +76,11 @@ An admin can create API credentials in Personio under Settings > Integrations >),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.personio.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: PersonioSourceConfig,diff --git a/posthog/temporal/data_imports/sources/pingdom/canonical_descriptions.py b/posthog/temporal/data_imports/sources/pingdom/canonical_descriptions.pynew file mode 100644index 000000000000..3c783c815c21--- /dev/null+++ b/posthog/temporal/data_imports/sources/pingdom/canonical_descriptions.py@@ -0,0 +1,74 @@+"""Canonical, documentation-sourced descriptions for Pingdom endpoints and columns.++Sourced from the official Pingdom API 3.1 reference (https://docs.pingdom.com/api/). Keyed by the+endpoint names in `settings.py` `PINGDOM_ENDPOINTS`, which match the `ExternalDataSchema.name` of a+synced Pingdom table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "checks": {+ "description": "An uptime check that monitors the availability of a host or service from Pingdom.",+ "docs_url": "https://docs.pingdom.com/api/#tag/Checks",+ "columns": {+ "id": "Unique identifier for the check.",+ "name": "The check's display name.",+ "hostname": "Target host or URL being monitored.",+ "type": "Type of check (e.g. http, tcp, ping, dns).",+ "status": "Current status of the check (e.g. up, down, paused, unknown).",+ "resolution": "How often the check runs, in minutes.",+ "lasttesttime": "Time the check was last tested, as a Unix timestamp.",+ "lastresponsetime": "Response time of the last test, in milliseconds.",+ "lasterrortime": "Time of the last error, as a Unix timestamp.",+ "created": "Time at which the check was created, as a Unix timestamp.",+ "paused": "Whether the check is currently paused.",+ "tags": "Tags applied to the check for grouping and filtering.",+ },+ },+ "probes": {+ "description": "A Pingdom probe server that runs checks from a specific geographic location.",+ "docs_url": "https://docs.pingdom.com/api/#tag/Probes",+ "columns": {+ "id": "Unique identifier for the probe.",+ "name": "Human-readable name of the probe location.",+ "country": "Country where the probe is located.",+ "city": "City where the probe is located.",+ "region": "Geographic region the probe belongs to.",+ "active": "Whether the probe is currently active.",+ "hostname": "Hostname of the probe server.",+ "ip": "IPv4 address of the probe.",+ "ipv6": "IPv6 address of the probe.",+ "countryiso": "ISO country code of the probe's location.",+ },+ },+ "maintenance": {+ "description": "A scheduled maintenance window during which checks are paused.",+ "docs_url": "https://docs.pingdom.com/api/#tag/Maintenance",+ "columns": {+ "id": "Unique identifier for the maintenance window.",+ "description": "Description of the maintenance window.",+ "from": "Start time of the maintenance window, as a Unix timestamp.",+ "to": "End time of the maintenance window, as a Unix timestamp.",+ "recurrencetype": "How the maintenance window recurs (e.g. none, day, week, month).",+ "repeatevery": "Interval between recurrences, in units of recurrencetype.",+ "effectiveto": "Time after which the recurring maintenance no longer applies, as a Unix timestamp.",+ "checks": "The checks and uptime checks covered by this maintenance window.",+ },+ },+ "alerts": {+ "description": "An alert action triggered by a check state change, such as a notification sent to a user.",+ "docs_url": "https://docs.pingdom.com/api/#tag/Actions",+ "columns": {+ "checkid": "ID of the check that triggered the alert.",+ "checkname": "Name of the check that triggered the alert.",+ "time": "Time the alert was triggered, as a Unix timestamp.",+ "userid": "ID of the user the alert was sent to.",+ "username": "Name of the user the alert was sent to.",+ "via": "Channel the alert was sent through (e.g. email, sms, webhook).",+ "status": "Status reported by the alert (e.g. up, down, sent, delivered).",+ "messageshort": "Short description of the alert message.",+ "messagefull": "Full text of the alert message.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/pingdom/source.py b/posthog/temporal/data_imports/sources/pingdom/source.pyindex 294e5f45de8b..98ca8bc19d22 100644--- a/posthog/temporal/data_imports/sources/pingdom/source.py+++ b/posthog/temporal/data_imports/sources/pingdom/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -64,6 +65,11 @@ You can create an API token in [My Pingdom](https://my.pingdom.com/app/api-token),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.pingdom.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: PingdomSourceConfig,diff --git a/posthog/temporal/data_imports/sources/pinterest_ads/canonical_descriptions.py b/posthog/temporal/data_imports/sources/pinterest_ads/canonical_descriptions.pynew file mode 100644index 000000000000..434511d7f532--- /dev/null+++ b/posthog/temporal/data_imports/sources/pinterest_ads/canonical_descriptions.py@@ -0,0 +1,102 @@+"""Canonical, documentation-sourced descriptions for Pinterest Ads endpoints and columns.++Sourced from the official Pinterest API v5 reference (https://developers.pinterest.com/docs/api/v5/).+Keyed by the endpoint names in `settings.py` `PINTEREST_ADS_CONFIG`, which match the+`ExternalDataSchema.name` of a synced Pinterest Ads table. Columns absent here fall back to LLM+enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Metric columns shared by every analytics endpoint (campaign/ad group/ad), merged into each entry.+_ANALYTICS_COLUMNS = {+ "date": "The day the metrics are reported for.",+ "SPEND_IN_DOLLAR": "Amount spent in the advertiser's profile currency.",+ "SPEND_IN_MICRO_DOLLAR": "Amount spent in micro-units of the advertiser's profile currency.",+ "PAID_IMPRESSION": "Number of paid impressions served.",+ "TOTAL_IMPRESSION": "Total number of impressions (paid and earned).",+ "TOTAL_CLICKTHROUGH": "Total number of clickthroughs to the destination URL.",+ "OUTBOUND_CLICK_1": "Number of outbound clicks attributed in the 1-day window.",+ "TOTAL_ENGAGEMENT": "Total number of engagements (saves, clicks, closeups).",+ "ENGAGEMENT_RATE": "Engagements divided by impressions.",+ "CTR": "Clickthrough rate — clickthroughs divided by impressions.",+ "CPC_IN_MICRO_DOLLAR": "Cost per click, in micro-units of the profile currency.",+ "CPM_IN_DOLLAR": "Cost per thousand impressions, in the profile currency.",+ "TOTAL_CONVERSIONS": "Total number of attributed conversions.",+ "TOTAL_CHECKOUT": "Total number of attributed checkout conversions.",+ "CHECKOUT_ROAS": "Return on ad spend for checkout conversions.",+ "TOTAL_VIDEO_3SEC_VIEWS": "Number of 3-second video views.",+ "TOTAL_VIDEO_P100_COMPLETE": "Number of times the video was watched to completion.",+}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "campaigns": {+ "description": "A Pinterest advertising campaign that groups ad groups under a single objective and budget.",+ "docs_url": "https://developers.pinterest.com/docs/api/v5/campaigns-list/",+ "columns": {+ "id": "Unique identifier for the campaign.",+ "ad_account_id": "ID of the ad account that owns the campaign.",+ "name": "The campaign's name.",+ "status": "Status of the campaign (e.g. ACTIVE, PAUSED, ARCHIVED).",+ "objective_type": "The campaign's advertising objective (e.g. AWARENESS, CONSIDERATION, WEB_CONVERSION).",+ "daily_spend_cap": "Daily spend cap for the campaign, in micro-currency.",+ "lifetime_spend_cap": "Lifetime spend cap for the campaign, in micro-currency.",+ "created_time": "Time at which the campaign was created, as a Unix timestamp.",+ "updated_time": "Time at which the campaign was last updated, as a Unix timestamp.",+ "start_time": "Scheduled start time of the campaign, as a Unix timestamp.",+ "end_time": "Scheduled end time of the campaign, as a Unix timestamp.",+ },+ },+ "ad_groups": {+ "description": "A group of ads within a campaign, sharing targeting, budget, and bidding settings.",+ "docs_url": "https://developers.pinterest.com/docs/api/v5/ad_groups-list/",+ "columns": {+ "id": "Unique identifier for the ad group.",+ "ad_account_id": "ID of the ad account that owns the ad group.",+ "campaign_id": "ID of the campaign the ad group belongs to.",+ "name": "The ad group's name.",+ "status": "Status of the ad group (e.g. ACTIVE, PAUSED, ARCHIVED).",+ "budget_in_micro_currency": "Budget for the ad group, in micro-currency.",+ "bid_in_micro_currency": "Bid amount for the ad group, in micro-currency.",+ "billable_event": "The event the ad group is billed on (e.g. CLICKTHROUGH, IMPRESSION).",+ "targeting_spec": "Targeting specification (audiences, locations, keywords) for the ad group.",+ "created_time": "Time at which the ad group was created, as a Unix timestamp.",+ "updated_time": "Time at which the ad group was last updated, as a Unix timestamp.",+ "start_time": "Scheduled start time of the ad group, as a Unix timestamp.",+ "end_time": "Scheduled end time of the ad group, as a Unix timestamp.",+ },+ },+ "ads": {+ "description": "An individual ad (promoted Pin) belonging to an ad group.",+ "docs_url": "https://developers.pinterest.com/docs/api/v5/ads-list/",+ "columns": {+ "id": "Unique identifier for the ad.",+ "ad_account_id": "ID of the ad account that owns the ad.",+ "ad_group_id": "ID of the ad group the ad belongs to.",+ "campaign_id": "ID of the campaign the ad belongs to.",+ "pin_id": "ID of the organic Pin promoted by this ad.",+ "name": "The ad's name.",+ "status": "Status of the ad (e.g. ACTIVE, PAUSED, ARCHIVED).",+ "creative_type": "The ad's creative type (e.g. REGULAR, VIDEO, CAROUSEL, SHOPPING).",+ "destination_url": "Destination URL the ad sends users to.",+ "created_time": "Time at which the ad was created, as a Unix timestamp.",+ "updated_time": "Time at which the ad was last updated, as a Unix timestamp.",+ },+ },+ "campaign_analytics": {+ "description": "Daily performance metrics (spend, impressions, clicks, conversions) per campaign.",+ "docs_url": "https://developers.pinterest.com/docs/api/v5/campaigns-analytics/",+ "columns": {"campaign_id": "ID of the campaign the metrics are for.", **_ANALYTICS_COLUMNS},+ },+ "ad_group_analytics": {+ "description": "Daily performance metrics (spend, impressions, clicks, conversions) per ad group.",+ "docs_url": "https://developers.pinterest.com/docs/api/v5/ad_groups-analytics/",+ "columns": {"ad_group_id": "ID of the ad group the metrics are for.", **_ANALYTICS_COLUMNS},+ },+ "ad_analytics": {+ "description": "Daily performance metrics (spend, impressions, clicks, conversions) per ad.",+ "docs_url": "https://developers.pinterest.com/docs/api/v5/ads-analytics/",+ "columns": {"ad_id": "ID of the ad the metrics are for.", **_ANALYTICS_COLUMNS},+ },+}diff --git a/posthog/temporal/data_imports/sources/pinterest_ads/source.py b/posthog/temporal/data_imports/sources/pinterest_ads/source.pyindex 588ee9ba292d..95ba0fc8aa54 100644--- a/posthog/temporal/data_imports/sources/pinterest_ads/source.py+++ b/posthog/temporal/data_imports/sources/pinterest_ads/source.py@@ -18,6 +18,7 @@ from posthog.temporal.data_imports.sources.common.base import (FieldType,ResumableSource,)+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.mixins import OAuthMixinfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManager@@ -100,6 +101,11 @@ class PinterestAdsSource(ResumableSource[PinterestAdsSourceConfig, PinterestAdsRcapture_exception(e)return False, f"Failed to validate Pinterest Ads credentials: {str(e)}"+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.pinterest_ads.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: PinterestAdsSourceConfig,diff --git a/posthog/temporal/data_imports/sources/pipedrive/canonical_descriptions.py b/posthog/temporal/data_imports/sources/pipedrive/canonical_descriptions.pynew file mode 100644index 000000000000..df400b3e1aff--- /dev/null+++ b/posthog/temporal/data_imports/sources/pipedrive/canonical_descriptions.py@@ -0,0 +1,221 @@+"""Canonical, documentation-sourced descriptions for Pipedrive endpoints and columns.++Sourced from the official Pipedrive API reference (https://developers.pipedrive.com/docs/api/v1).+Keyed by the endpoint names in `settings.py` `PIPEDRIVE_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Pipedrive table. Columns absent here fall back to LLM+enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "deals": {+ "description": "A sales deal (opportunity) tracked in Pipedrive, with its value, stage, and status.",+ "docs_url": "https://developers.pipedrive.com/docs/api/v1/Deals",+ "columns": {+ "id": "Unique identifier for the deal.",+ "title": "The deal's title.",+ "value": "Monetary value of the deal.",+ "currency": "Currency of the deal's value.",+ "status": "Status of the deal (open, won, lost, or deleted).",+ "stage_id": "ID of the pipeline stage the deal is in.",+ "pipeline_id": "ID of the pipeline the deal belongs to.",+ "person_id": "ID of the person (contact) linked to the deal.",+ "org_id": "ID of the organization linked to the deal.",+ "owner_id": "ID of the user who owns the deal.",+ "add_time": "Time at which the deal was created.",+ "update_time": "Time at which the deal was last updated.",+ "won_time": "Time at which the deal was marked won.",+ "lost_time": "Time at which the deal was marked lost.",+ "close_time": "Time at which the deal was closed (won or lost).",+ "expected_close_date": "Expected close date of the deal.",+ "probability": "Win probability of the deal, as a percentage.",+ },+ },+ "persons": {+ "description": "A contact person stored in Pipedrive, with their contact details and links to deals.",+ "docs_url": "https://developers.pipedrive.com/docs/api/v1/Persons",+ "columns": {+ "id": "Unique identifier for the person.",+ "name": "The person's full name.",+ "email": "The person's email addresses.",+ "phone": "The person's phone numbers.",+ "org_id": "ID of the organization the person belongs to.",+ "owner_id": "ID of the user who owns the person.",+ "add_time": "Time at which the person was created.",+ "update_time": "Time at which the person was last updated.",+ "open_deals_count": "Number of open deals linked to the person.",+ "closed_deals_count": "Number of closed deals linked to the person.",+ "last_activity_date": "Date of the person's most recent activity.",+ },+ },+ "organizations": {+ "description": "A company or organization stored in Pipedrive, grouping its people and deals.",+ "docs_url": "https://developers.pipedrive.com/docs/api/v1/Organizations",+ "columns": {+ "id": "Unique identifier for the organization.",+ "name": "The organization's name.",+ "owner_id": "ID of the user who owns the organization.",+ "address": "The organization's address.",+ "people_count": "Number of people linked to the organization.",+ "open_deals_count": "Number of open deals linked to the organization.",+ "closed_deals_count": "Number of closed deals linked to the organization.",+ "add_time": "Time at which the organization was created.",+ "update_time": "Time at which the organization was last updated.",+ },+ },+ "products": {+ "description": "A product or service that can be attached to deals in Pipedrive.",+ "docs_url": "https://developers.pipedrive.com/docs/api/v1/Products",+ "columns": {+ "id": "Unique identifier for the product.",+ "name": "The product's name.",+ "code": "SKU or product code.",+ "unit": "Unit in which the product is sold.",+ "tax": "Tax percentage applied to the product.",+ "active_flag": "Whether the product is active.",+ "owner_id": "ID of the user who owns the product.",+ "prices": "Per-currency prices configured for the product.",+ "add_time": "Time at which the product was created.",+ "update_time": "Time at which the product was last updated.",+ },+ },+ "pipelines": {+ "description": "A sales pipeline — an ordered set of stages deals move through.",+ "docs_url": "https://developers.pipedrive.com/docs/api/v1/Pipelines",+ "columns": {+ "id": "Unique identifier for the pipeline.",+ "name": "The pipeline's name.",+ "order_nr": "Display order of the pipeline.",+ "active": "Whether the pipeline is active.",+ "deal_probability": "Whether probability is enabled for deals in this pipeline.",+ "add_time": "Time at which the pipeline was created.",+ "update_time": "Time at which the pipeline was last updated.",+ },+ },+ "stages": {+ "description": "A stage within a pipeline that deals progress through.",+ "docs_url": "https://developers.pipedrive.com/docs/api/v1/Stages",+ "columns": {+ "id": "Unique identifier for the stage.",+ "name": "The stage's name.",+ "pipeline_id": "ID of the pipeline the stage belongs to.",+ "order_nr": "Display order of the stage within its pipeline.",+ "deal_probability": "Default win probability for deals in this stage, as a percentage.",+ "rotten_flag": "Whether deals in this stage can become rotten (stale).",+ "rotten_days": "Number of days after which a deal in this stage is marked rotten.",+ "add_time": "Time at which the stage was created.",+ "update_time": "Time at which the stage was last updated.",+ },+ },+ "activities": {+ "description": "A scheduled or logged activity (call, meeting, task, email) linked to deals or contacts.",+ "docs_url": "https://developers.pipedrive.com/docs/api/v1/Activities",+ "columns": {+ "id": "Unique identifier for the activity.",+ "subject": "The activity's subject.",+ "type": "Type of activity (e.g. call, meeting, task, email).",+ "done": "Whether the activity has been completed.",+ "due_date": "Date the activity is due.",+ "due_time": "Time the activity is due.",+ "deal_id": "ID of the deal the activity is linked to.",+ "person_id": "ID of the person the activity is linked to.",+ "org_id": "ID of the organization the activity is linked to.",+ "user_id": "ID of the user assigned to the activity.",+ "add_time": "Time at which the activity was created.",+ "update_time": "Time at which the activity was last updated.",+ "marked_as_done_time": "Time at which the activity was marked done.",+ },+ },+ "notes": {+ "description": "A free-text note attached to a deal, person, or organization in Pipedrive.",+ "docs_url": "https://developers.pipedrive.com/docs/api/v1/Notes",+ "columns": {+ "id": "Unique identifier for the note.",+ "content": "The note's content.",+ "deal_id": "ID of the deal the note is attached to.",+ "person_id": "ID of the person the note is attached to.",+ "org_id": "ID of the organization the note is attached to.",+ "user_id": "ID of the user who created the note.",+ "add_time": "Time at which the note was created.",+ "update_time": "Time at which the note was last updated.",+ },+ },+ "leads": {+ "description": "An inbound lead in Pipedrive that has not yet been converted into a deal.",+ "docs_url": "https://developers.pipedrive.com/docs/api/v1/Leads",+ "columns": {+ "id": "Unique identifier for the lead.",+ "title": "The lead's title.",+ "owner_id": "ID of the user who owns the lead.",+ "person_id": "ID of the person linked to the lead.",+ "organization_id": "ID of the organization linked to the lead.",+ "value": "Estimated value of the lead.",+ "expected_close_date": "Expected close date of the lead.",+ "is_archived": "Whether the lead has been archived.",+ "was_seen": "Whether the lead has been viewed.",+ "add_time": "Time at which the lead was created.",+ "update_time": "Time at which the lead was last updated.",+ },+ },+ "users": {+ "description": "A user (team member) of the Pipedrive account.",+ "docs_url": "https://developers.pipedrive.com/docs/api/v1/Users",+ "columns": {+ "id": "Unique identifier for the user.",+ "name": "The user's full name.",+ "email": "The user's email address.",+ "active_flag": "Whether the user account is active.",+ "is_admin": "Whether the user is an account administrator.",+ "role_id": "ID of the user's permission role.",+ "created": "Time at which the user was created.",+ "modified": "Time at which the user was last modified.",+ "last_login": "Time of the user's last login.",+ },+ },+ "deal_fields": {+ "description": "A field definition (standard or custom) available on deals in Pipedrive.",+ "docs_url": "https://developers.pipedrive.com/docs/api/v1/DealFields",+ "columns": {+ "id": "Unique identifier for the field.",+ "key": "The field's API key used in deal payloads.",+ "name": "Human-readable name of the field.",+ "field_type": "Data type of the field (e.g. varchar, enum, monetary, date).",+ "options": "Available options for enum/set fields.",+ "mandatory_flag": "Whether the field is required.",+ "edit_flag": "Whether the field can be edited.",+ "add_time": "Time at which the field was created.",+ "update_time": "Time at which the field was last updated.",+ },+ },+ "person_fields": {+ "description": "A field definition (standard or custom) available on persons in Pipedrive.",+ "docs_url": "https://developers.pipedrive.com/docs/api/v1/PersonFields",+ "columns": {+ "id": "Unique identifier for the field.",+ "key": "The field's API key used in person payloads.",+ "name": "Human-readable name of the field.",+ "field_type": "Data type of the field (e.g. varchar, enum, phone, date).",+ "options": "Available options for enum/set fields.",+ "mandatory_flag": "Whether the field is required.",+ "edit_flag": "Whether the field can be edited.",+ "add_time": "Time at which the field was created.",+ "update_time": "Time at which the field was last updated.",+ },+ },+ "organization_fields": {+ "description": "A field definition (standard or custom) available on organizations in Pipedrive.",+ "docs_url": "https://developers.pipedrive.com/docs/api/v1/OrganizationFields",+ "columns": {+ "id": "Unique identifier for the field.",+ "key": "The field's API key used in organization payloads.",+ "name": "Human-readable name of the field.",+ "field_type": "Data type of the field (e.g. varchar, enum, address, date).",+ "options": "Available options for enum/set fields.",+ "mandatory_flag": "Whether the field is required.",+ "edit_flag": "Whether the field can be edited.",+ "add_time": "Time at which the field was created.",+ "update_time": "Time at which the field was last updated.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/pipedrive/source.py b/posthog/temporal/data_imports/sources/pipedrive/source.pyindex dc78efdd6acf..39f930e886d7 100644--- a/posthog/temporal/data_imports/sources/pipedrive/source.py+++ b/posthog/temporal/data_imports/sources/pipedrive/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -79,6 +80,11 @@ You can find your personal API token in Pipedrive under **Settings > Personal pr"403 Client Error": "Your Pipedrive user lacks permission for this data. Please check your access and reconnect.",}+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.pipedrive.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: PipedriveSourceConfig,diff --git a/posthog/temporal/data_imports/sources/plaid/canonical_descriptions.py b/posthog/temporal/data_imports/sources/plaid/canonical_descriptions.pynew file mode 100644index 000000000000..b89a0213e79c--- /dev/null+++ b/posthog/temporal/data_imports/sources/plaid/canonical_descriptions.py@@ -0,0 +1,45 @@+"""Canonical, documentation-sourced descriptions for Plaid endpoints and columns.++Sourced from the official Plaid API reference (https://plaid.com/docs/api/). Keyed by the endpoint+names in `settings.py` `PLAID_ENDPOINTS`, which match the `ExternalDataSchema.name` of a synced Plaid+table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "accounts": {+ "description": "A financial account (checking, savings, credit card, loan, etc.) belonging to a linked Plaid Item.",+ "docs_url": "https://plaid.com/docs/api/accounts/#accountsget",+ "columns": {+ "account_id": "Unique identifier for the account.",+ "name": "The account's name, as provided by the institution.",+ "official_name": "The official name of the account, as provided by the institution.",+ "mask": "The last 2-4 digits of the account number.",+ "type": "Account type (e.g. depository, credit, loan, investment).",+ "subtype": "Account subtype (e.g. checking, savings, credit card).",+ "balances": "Balance information for the account (available, current, limit, currency).",+ "verification_status": "Status of account/routing number verification, if applicable.",+ },+ },+ "transactions": {+ "description": "A transaction (purchase, transfer, etc.) on an account belonging to a linked Plaid Item.",+ "docs_url": "https://plaid.com/docs/api/products/transactions/#transactionsget",+ "columns": {+ "transaction_id": "Unique identifier for the transaction.",+ "account_id": "ID of the account the transaction belongs to.",+ "amount": "Settled amount of the transaction (positive = money leaving the account).",+ "iso_currency_code": "ISO-4217 currency code of the transaction amount.",+ "date": "Date the transaction posted or was authorized.",+ "datetime": "Date and time the transaction posted, when available.",+ "authorized_date": "Date the transaction was authorized.",+ "name": "Merchant name or transaction description.",+ "merchant_name": "Cleaned merchant name for the transaction.",+ "pending": "Whether the transaction is pending or has posted.",+ "pending_transaction_id": "ID of the pending transaction this posted transaction replaced, if any.",+ "payment_channel": "How the transaction took place (online, in store, or other).",+ "category": "Hierarchical category labels for the transaction (legacy taxonomy).",+ "personal_finance_category": "Detailed and primary personal finance category for the transaction.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/plaid/source.py b/posthog/temporal/data_imports/sources/plaid/source.pyindex 6f0ce734bfe3..a334fe668d11 100644--- a/posthog/temporal/data_imports/sources/plaid/source.py+++ b/posthog/temporal/data_imports/sources/plaid/source.py@@ -13,6 +13,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -94,6 +95,11 @@ You can find your client ID and secret in the [Plaid dashboard](https://dashboar),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.plaid.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: PlaidSourceConfig,diff --git a/posthog/temporal/data_imports/sources/plain/canonical_descriptions.py b/posthog/temporal/data_imports/sources/plain/canonical_descriptions.pynew file mode 100644index 000000000000..bcab68014723--- /dev/null+++ b/posthog/temporal/data_imports/sources/plain/canonical_descriptions.py@@ -0,0 +1,68 @@+"""Canonical, documentation-sourced descriptions for Plain endpoints and columns.++Sourced from the official Plain API reference (https://www.plain.com/docs/api-reference/graphql) and+the GraphQL queries in `queries.py`. Keyed by the endpoint names in `settings.py` `PLAIN_ENDPOINTS`,+which match the `ExternalDataSchema.name` of a synced Plain table. Columns absent here fall back to+LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "customers": {+ "description": "A customer in Plain — a person who contacts your support team.",+ "docs_url": "https://www.plain.com/docs/api-reference/graphql/customers/queries/customers",+ "columns": {+ "id": "Unique identifier for the customer.",+ "externalId": "Your own identifier for the customer, set when the customer was created.",+ "fullName": "The customer's full name.",+ "shortName": "The customer's short or display name.",+ "email": "The customer's email address and whether it has been verified.",+ "status": "The customer's current status.",+ "statusChangedAt": "Time at which the customer's status last changed.",+ "assignedToUser": "The user the customer is assigned to, if any.",+ "company": "The company the customer belongs to, if any.",+ "markedAsSpamAt": "Time at which the customer was marked as spam, if applicable.",+ "createdAt": "Time at which the customer was created.",+ "createdBy": "The actor (user, machine user, or system) that created the customer.",+ "updatedAt": "Time at which the customer was last updated.",+ "updatedBy": "The actor that last updated the customer.",+ },+ },+ "threads": {+ "description": "A support conversation (thread) between a customer and your team in Plain.",+ "docs_url": "https://www.plain.com/docs/api-reference/graphql/threads/queries/threads",+ "columns": {+ "id": "Unique identifier for the thread.",+ "externalId": "Your own identifier for the thread, if set.",+ "customer": "The customer the thread belongs to.",+ "title": "The thread's title.",+ "previewText": "A short preview of the latest message in the thread.",+ "priority": "Priority of the thread (0 = urgent through 3 = low).",+ "status": "Current status of the thread (e.g. todo, snoozed, done).",+ "statusChangedAt": "Time at which the thread's status last changed.",+ "statusChangedBy": "The actor that last changed the thread's status.",+ "assignedToUser": "The user or machine user the thread is assigned to.",+ "labels": "Labels applied to the thread.",+ "supportEmailAddresses": "Support email addresses associated with the thread.",+ "firstInboundMessageInfo": "Information about the first inbound message in the thread.",+ "firstOutboundMessageInfo": "Information about the first outbound message in the thread.",+ "lastInboundMessageInfo": "Information about the most recent inbound message in the thread.",+ "lastOutboundMessageInfo": "Information about the most recent outbound message in the thread.",+ "createdAt": "Time at which the thread was created.",+ "createdBy": "The actor that created the thread.",+ "updatedAt": "Time at which the thread was last updated.",+ "updatedBy": "The actor that last updated the thread.",+ },+ },+ "timeline_entries": {+ "description": "An event on a thread's timeline in Plain — a chat, email, or note entry.",+ "docs_url": "https://www.plain.com/docs/api-reference/graphql/threads/queries/thread",+ "columns": {+ "id": "Unique identifier for the timeline entry.",+ "timestamp": "Time at which the timeline entry occurred.",+ "actor": "The actor (user, machine user, customer, or system) that created the entry.",+ "entry": "The entry's content, varying by type (chat, email, note, or custom).",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/plain/source.py b/posthog/temporal/data_imports/sources/plain/source.pyindex 2ea54b5ebcb1..9a609acb25e3 100644--- a/posthog/temporal/data_imports/sources/plain/source.py+++ b/posthog/temporal/data_imports/sources/plain/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, SimpleSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.schema import SourceSchemafrom posthog.temporal.data_imports.sources.generated_configs import PlainSourceConfig@@ -62,6 +63,11 @@ Make sure to grant the following read permissions:),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.plain.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error": "Invalid Plain credentials. Please check your API key.",diff --git a/posthog/temporal/data_imports/sources/polar/canonical_descriptions.py b/posthog/temporal/data_imports/sources/polar/canonical_descriptions.pynew file mode 100644index 000000000000..5d9f7c92b357--- /dev/null+++ b/posthog/temporal/data_imports/sources/polar/canonical_descriptions.py@@ -0,0 +1,146 @@+"""Canonical, documentation-sourced descriptions for Polar endpoints and columns.++Sourced from the official Polar API reference (https://docs.polar.sh/api-reference). Keyed by the+resource names in `constants.py` / `settings.py` `ENDPOINTS`, which match the `ExternalDataSchema.name`+of a synced Polar table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions+from posthog.temporal.data_imports.sources.polar.constants import (+ BENEFIT_RESOURCE_NAME,+ CHECKOUT_RESOURCE_NAME,+ CUSTOMER_RESOURCE_NAME,+ ORDER_RESOURCE_NAME,+ ORGANIZATION_RESOURCE_NAME,+ PRODUCT_RESOURCE_NAME,+ REFUND_RESOURCE_NAME,+ SUBSCRIPTION_RESOURCE_NAME,+)++# Fields shared by most Polar objects; merged into each entry so we don't repeat them.+_COMMON_COLUMNS = {+ "id": "Unique identifier for the object.",+ "created_at": "Time at which the object was created.",+ "modified_at": "Time at which the object was last modified, if ever.",+ "metadata": "Set of key-value pairs you can attach to the object for your own bookkeeping.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ CUSTOMER_RESOURCE_NAME: {+ "description": "A customer of an organization who can purchase products and hold subscriptions.",+ "docs_url": "https://docs.polar.sh/api-reference/customers/list",+ "columns": _columns(+ email="The customer's email address.",+ email_verified="Whether the customer's email address has been verified.",+ name="The customer's name.",+ organization_id="ID of the organization the customer belongs to.",+ billing_address="The customer's billing address.",+ tax_id="The customer's tax identifier, if any.",+ ),+ },+ PRODUCT_RESOURCE_NAME: {+ "description": "A product that can be purchased or subscribed to in Polar.",+ "docs_url": "https://docs.polar.sh/api-reference/products/list",+ "columns": _columns(+ name="The product's name.",+ description="The product's description.",+ recurring_interval="Billing interval for recurring products (e.g. month, year), or null for one-time.",+ is_recurring="Whether the product is a subscription product.",+ is_archived="Whether the product has been archived.",+ organization_id="ID of the organization that owns the product.",+ prices="The list of prices configured for the product.",+ benefits="The list of benefits granted by the product.",+ ),+ },+ ORDER_RESOURCE_NAME: {+ "description": "A completed purchase of a product, including one-time and subscription orders.",+ "docs_url": "https://docs.polar.sh/api-reference/orders/list",+ "columns": _columns(+ status="Status of the order (e.g. paid, refunded, partially_refunded).",+ amount="Order amount before tax, in the smallest currency unit.",+ tax_amount="Tax charged on the order, in the smallest currency unit.",+ currency="Three-letter ISO currency code of the order.",+ billing_reason="Reason the order was created (e.g. purchase, subscription_cycle).",+ customer_id="ID of the customer who placed the order.",+ product_id="ID of the product purchased.",+ subscription_id="ID of the subscription this order belongs to, if any.",+ discount_id="ID of the discount applied to the order, if any.",+ ),+ },+ SUBSCRIPTION_RESOURCE_NAME: {+ "description": "A recurring subscription of a customer to a product.",+ "docs_url": "https://docs.polar.sh/api-reference/subscriptions/list",+ "columns": _columns(+ status="Status of the subscription (e.g. active, canceled, past_due).",+ amount="Recurring amount of the subscription, in the smallest currency unit.",+ currency="Three-letter ISO currency code of the subscription.",+ recurring_interval="Billing interval of the subscription (e.g. month, year).",+ current_period_start="Start of the current billing period.",+ current_period_end="End of the current billing period.",+ cancel_at_period_end="Whether the subscription will cancel at the end of the current period.",+ started_at="Time at which the subscription started.",+ ended_at="Time at which the subscription ended, if it has ended.",+ customer_id="ID of the customer the subscription belongs to.",+ product_id="ID of the subscribed product.",+ discount_id="ID of the discount applied to the subscription, if any.",+ ),+ },+ REFUND_RESOURCE_NAME: {+ "description": "A refund issued against an order in Polar.",+ "docs_url": "https://docs.polar.sh/api-reference/refunds/list",+ "columns": _columns(+ status="Status of the refund (e.g. succeeded, pending, failed).",+ reason="Reason the refund was issued.",+ amount="Refunded amount, in the smallest currency unit.",+ tax_amount="Refunded tax, in the smallest currency unit.",+ currency="Three-letter ISO currency code of the refund.",+ order_id="ID of the order the refund applies to.",+ subscription_id="ID of the subscription the refund relates to, if any.",+ customer_id="ID of the customer who received the refund.",+ revoke_benefits="Whether benefits were revoked as part of the refund.",+ ),+ },+ CHECKOUT_RESOURCE_NAME: {+ "description": "A checkout session for purchasing a product in Polar.",+ "docs_url": "https://docs.polar.sh/api-reference/checkouts/list",+ "columns": _columns(+ status="Status of the checkout session (e.g. open, confirmed, succeeded, expired).",+ url="URL of the hosted checkout page.",+ expires_at="Time at which the checkout session expires.",+ amount="Amount to be charged, in the smallest currency unit.",+ tax_amount="Tax to be charged, in the smallest currency unit.",+ currency="Three-letter ISO currency code of the checkout.",+ customer_id="ID of the customer associated with the checkout, if any.",+ customer_email="Email address provided for the checkout.",+ product_id="ID of the product being purchased.",+ success_url="URL the customer is redirected to after a successful checkout.",+ ),+ },+ BENEFIT_RESOURCE_NAME: {+ "description": "A benefit that can be granted to customers through products in Polar.",+ "docs_url": "https://docs.polar.sh/api-reference/benefits/list",+ "columns": _columns(+ type="The type of benefit (e.g. custom, discord, github_repository, license_keys).",+ description="The benefit's description.",+ selectable="Whether the benefit can be added to or removed from products.",+ deletable="Whether the benefit can be deleted.",+ organization_id="ID of the organization that owns the benefit.",+ ),+ },+ ORGANIZATION_RESOURCE_NAME: {+ "description": "An organization on Polar that sells products and owns customers.",+ "docs_url": "https://docs.polar.sh/api-reference/organizations/list",+ "columns": _columns(+ name="The organization's name.",+ slug="The organization's URL slug.",+ avatar_url="URL of the organization's avatar image.",+ email="The organization's contact email address.",+ website="The organization's website URL.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/polar/source.py b/posthog/temporal/data_imports/sources/polar/source.pyindex ddcd766e3196..2e1d7cf2e90c 100644--- a/posthog/temporal/data_imports/sources/polar/source.py+++ b/posthog/temporal/data_imports/sources/polar/source.py@@ -10,6 +10,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -64,6 +65,11 @@ class PolarSource(ResumableSource[PolarSourceConfig, PolarResumeConfig]):),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.polar.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized for url: https://api.polar.sh": "Your Polar Organization Access Token is invalid or expired. Please generate a new token in Polar and reconnect.",diff --git a/posthog/temporal/data_imports/sources/postmark/canonical_descriptions.py b/posthog/temporal/data_imports/sources/postmark/canonical_descriptions.pynew file mode 100644index 000000000000..e5612a81648e--- /dev/null+++ b/posthog/temporal/data_imports/sources/postmark/canonical_descriptions.py@@ -0,0 +1,97 @@+"""Canonical, documentation-sourced descriptions for Postmark endpoints and columns.++Sourced from the official Postmark API reference (https://postmarkapp.com/developer/api). Keyed by the+endpoint names in `settings.py` `POSTMARK_ENDPOINTS`, which match the `ExternalDataSchema.name` of a+synced Postmark table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "messages_outbound": {+ "description": "An outbound email message sent through Postmark.",+ "docs_url": "https://postmarkapp.com/developer/api/messages-api#outbound-messages",+ "columns": {+ "MessageID": "Unique identifier for the message.",+ "Status": "Delivery status of the message (e.g. sent, queued).",+ "From": "Sender email address.",+ "To": "Recipient email addresses.",+ "Cc": "Carbon-copy recipients.",+ "Bcc": "Blind carbon-copy recipients.",+ "Subject": "Subject line of the message.",+ "Tag": "Tag associated with the message for categorization.",+ "MessageStream": "The message stream the message was sent through.",+ "ReceivedAt": "Time at which Postmark received the message for sending.",+ "TrackOpens": "Whether open tracking is enabled for the message.",+ "TrackLinks": "Link-tracking mode for the message.",+ "Sandboxed": "Whether the message was sent in sandbox mode.",+ },+ },+ "messages_inbound": {+ "description": "An inbound email message received through Postmark.",+ "docs_url": "https://postmarkapp.com/developer/api/messages-api#inbound-messages",+ "columns": {+ "MessageID": "Unique identifier for the message.",+ "Status": "Processing status of the inbound message.",+ "From": "Sender email address.",+ "FromName": "Display name of the sender.",+ "To": "Recipient email addresses.",+ "Cc": "Carbon-copy recipients.",+ "Bcc": "Blind carbon-copy recipients.",+ "Subject": "Subject line of the message.",+ "MailboxHash": "Mailbox hash parsed from the recipient address.",+ "Tag": "Tag associated with the message.",+ "MessageStream": "The inbound message stream that received the message.",+ "ReceivedAt": "Time at which Postmark received the inbound message.",+ },+ },+ "bounces": {+ "description": "A bounce record for an email that could not be delivered.",+ "docs_url": "https://postmarkapp.com/developer/api/bounce-api",+ "columns": {+ "ID": "Unique identifier for the bounce.",+ "Type": "Type of bounce (e.g. HardBounce, SoftBounce, SpamComplaint).",+ "TypeCode": "Numeric code describing the bounce type.",+ "Name": "Human-readable name of the bounce type.",+ "Email": "Email address that bounced.",+ "From": "Sender address of the message that bounced.",+ "Tag": "Tag of the message that bounced.",+ "MessageID": "ID of the message that bounced.",+ "MessageStream": "Message stream the bounced message belonged to.",+ "ServerID": "ID of the Postmark server that recorded the bounce.",+ "Description": "Description of why the message bounced.",+ "Details": "Detailed bounce reason from the receiving server.",+ "BouncedAt": "Time at which the bounce occurred.",+ "DumpAvailable": "Whether a raw SMTP dump is available for the bounce.",+ "Inactive": "Whether the bounce caused the address to be deactivated.",+ "CanActivate": "Whether the bounced address can be reactivated.",+ "Subject": "Subject line of the message that bounced.",+ },+ },+ "templates": {+ "description": "An email template defined in Postmark.",+ "docs_url": "https://postmarkapp.com/developer/api/templates-api",+ "columns": {+ "TemplateId": "Unique identifier for the template.",+ "Name": "The template's name.",+ "Alias": "Alias used to reference the template when sending.",+ "Active": "Whether the template is active.",+ "TemplateType": "Type of template (Standard or Layout).",+ "LayoutTemplate": "Alias of the layout template this template uses, if any.",+ },+ },+ "message_streams": {+ "description": "A message stream that groups outbound or inbound messages in Postmark.",+ "docs_url": "https://postmarkapp.com/developer/api/message-streams-api",+ "columns": {+ "ID": "Unique identifier (alias) for the message stream.",+ "ServerID": "ID of the server the stream belongs to.",+ "Name": "The stream's name.",+ "Description": "Description of the stream.",+ "MessageStreamType": "Type of stream (Transactional, Broadcasts, or Inbound).",+ "CreatedAt": "Time at which the stream was created.",+ "UpdatedAt": "Time at which the stream was last updated.",+ "ArchivedAt": "Time at which the stream was archived, if applicable.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/postmark/source.py b/posthog/temporal/data_imports/sources/postmark/source.pyindex f665f6a5c494..dc4429f687f2 100644--- a/posthog/temporal/data_imports/sources/postmark/source.py+++ b/posthog/temporal/data_imports/sources/postmark/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -66,6 +67,11 @@ The token grants read access to the following server-level resources:),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.postmark.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: PostmarkSourceConfig,diff --git a/posthog/temporal/data_imports/sources/productboard/canonical_descriptions.py b/posthog/temporal/data_imports/sources/productboard/canonical_descriptions.pynew file mode 100644index 000000000000..57553fc7ab88--- /dev/null+++ b/posthog/temporal/data_imports/sources/productboard/canonical_descriptions.py@@ -0,0 +1,152 @@+"""Canonical, documentation-sourced descriptions for Productboard endpoints and columns.++Sourced from the official Productboard API reference (https://developer.productboard.com/reference).+Keyed by the endpoint names in `settings.py` `PRODUCTBOARD_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Productboard table. Most endpoints are served by the generic+`/entities` resource and share a common shape. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by Productboard entity objects (served via the `/entities` resource).+_ENTITY_COLUMNS = {+ "id": "Unique identifier for the entity.",+ "name": "The entity's name.",+ "description": "The entity's description.",+ "createdAt": "Time at which the entity was created.",+ "updatedAt": "Time at which the entity was last updated.",+}+++def _entity_columns(**overrides: str) -> dict[str, str]:+ return {**_ENTITY_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "features": {+ "description": "A feature in Productboard — a unit of product work being planned or built.",+ "docs_url": "https://developer.productboard.com/reference/get-entities",+ "columns": _entity_columns(+ status="The feature's current status (e.g. candidate, planned, in progress, done).",+ type="The feature's type.",+ owner="The user who owns the feature.",+ parent="The parent entity (component or product) the feature belongs to.",+ ),+ },+ "subfeatures": {+ "description": "A sub-feature nested under a feature in Productboard.",+ "docs_url": "https://developer.productboard.com/reference/get-entities",+ "columns": _entity_columns(+ status="The sub-feature's current status.",+ owner="The user who owns the sub-feature.",+ parent="The parent feature the sub-feature belongs to.",+ ),+ },+ "components": {+ "description": "A component in Productboard — a grouping of features within a product.",+ "docs_url": "https://developer.productboard.com/reference/get-entities",+ "columns": _entity_columns(+ owner="The user who owns the component.",+ parent="The product the component belongs to.",+ ),+ },+ "products": {+ "description": "A product in Productboard's product hierarchy.",+ "docs_url": "https://developer.productboard.com/reference/get-entities",+ "columns": _entity_columns(+ owner="The user who owns the product.",+ ),+ },+ "initiatives": {+ "description": "An initiative in Productboard — a strategic effort grouping related work.",+ "docs_url": "https://developer.productboard.com/reference/get-entities",+ "columns": _entity_columns(+ status="The initiative's current status.",+ owner="The user who owns the initiative.",+ ),+ },+ "objectives": {+ "description": "An objective in Productboard representing a measurable goal.",+ "docs_url": "https://developer.productboard.com/reference/get-entities",+ "columns": _entity_columns(+ status="The objective's current status.",+ owner="The user who owns the objective.",+ ),+ },+ "key_results": {+ "description": "A key result tracking progress toward an objective in Productboard.",+ "docs_url": "https://developer.productboard.com/reference/get-entities",+ "columns": _entity_columns(+ owner="The user who owns the key result.",+ parent="The objective the key result belongs to.",+ ),+ },+ "releases": {+ "description": "A release in Productboard grouping features to be shipped together.",+ "docs_url": "https://developer.productboard.com/reference/get-entities",+ "columns": _entity_columns(+ state="The release's state (e.g. planned, in progress, released).",+ timeframe="The release's planned timeframe.",+ parent="The release group the release belongs to.",+ ),+ },+ "release_groups": {+ "description": "A release group in Productboard organizing related releases.",+ "docs_url": "https://developer.productboard.com/reference/get-entities",+ "columns": _entity_columns(),+ },+ "companies": {+ "description": "A company in Productboard, used to attribute feedback to customer accounts.",+ "docs_url": "https://developer.productboard.com/reference/get-entities",+ "columns": _entity_columns(+ domain="The company's domain name.",+ ),+ },+ "users": {+ "description": "A user (maker) in the Productboard workspace.",+ "docs_url": "https://developer.productboard.com/reference/get-entities",+ "columns": _entity_columns(+ email="The user's email address.",+ role="The user's role in the workspace.",+ ),+ },+ "notes": {+ "description": "A piece of customer feedback (note) captured in Productboard.",+ "docs_url": "https://developer.productboard.com/reference/get-notes",+ "columns": {+ "id": "Unique identifier for the note.",+ "title": "The note's title.",+ "content": "The note's content.",+ "state": "The note's state (e.g. unprocessed, processed, archived).",+ "displayUrl": "URL to view the note in Productboard.",+ "tags": "Tags applied to the note.",+ "company": "The company the note's feedback is attributed to, if any.",+ "user": "The end user the feedback came from, if any.",+ "owner": "The user who owns the note.",+ "source": "Where the note originated from (e.g. email, integration).",+ "createdAt": "Time at which the note was created.",+ "updatedAt": "Time at which the note was last updated.",+ "createdBy": "The maker who created the note.",+ },+ },+ "members": {+ "description": "A member of the Productboard workspace.",+ "docs_url": "https://developer.productboard.com/reference/get-members",+ "columns": {+ "id": "Unique identifier for the member.",+ "name": "The member's name.",+ "email": "The member's email address.",+ "role": "The member's role in the workspace.",+ },+ },+ "teams": {+ "description": "A team in the Productboard workspace.",+ "docs_url": "https://developer.productboard.com/reference/get-teams",+ "columns": {+ "id": "Unique identifier for the team.",+ "name": "The team's name.",+ "createdAt": "Time at which the team was created.",+ "updatedAt": "Time at which the team was last updated.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/productboard/source.py b/posthog/temporal/data_imports/sources/productboard/source.pyindex 077ac3f17a9a..b1e117be9254 100644--- a/posthog/temporal/data_imports/sources/productboard/source.py+++ b/posthog/temporal/data_imports/sources/productboard/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -47,6 +48,11 @@ class ProductboardSource(ResumableSource[ProductboardSourceConfig, ProductboardRdef source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.PRODUCTBOARD+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.productboard.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized for url: https://api.productboard.com": "Your Productboard access token is invalid or expired. Please generate a new token and reconnect.",diff --git a/posthog/temporal/data_imports/sources/ramp/canonical_descriptions.py b/posthog/temporal/data_imports/sources/ramp/canonical_descriptions.pynew file mode 100644index 000000000000..8474648bae8e--- /dev/null+++ b/posthog/temporal/data_imports/sources/ramp/canonical_descriptions.py@@ -0,0 +1,89 @@+"""Canonical, documentation-sourced descriptions for Ramp endpoints and columns.++Sourced from the official Ramp Developer API reference (https://docs.ramp.com/developer-api/v1).+Keyed by the endpoint names in `settings.py` `RAMP_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Ramp table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "transactions": {+ "description": "A card transaction (purchase) made on a Ramp card.",+ "docs_url": "https://docs.ramp.com/developer-api/v1/api/transactions",+ "columns": {+ "id": "Unique identifier for the transaction.",+ "amount": "Transaction amount.",+ "currency_code": "Three-letter ISO currency code of the transaction.",+ "merchant_name": "Name of the merchant.",+ "merchant_id": "Identifier of the merchant.",+ "merchant_category_code": "Merchant category code (MCC) for the transaction.",+ "state": "State of the transaction (e.g. CLEARED, PENDING, DECLINED).",+ "card_id": "ID of the card used for the transaction.",+ "card_holder": "The cardholder who made the transaction.",+ "user_transaction_time": "Time at which the transaction was made by the user.",+ "sk_category_name": "Spend category assigned to the transaction.",+ "receipts": "Receipt IDs attached to the transaction.",+ "accounting_categories": "Accounting categories associated with the transaction.",+ "policy_violations": "Policy violations flagged on the transaction.",+ "memo": "Memo or note attached to the transaction.",+ },+ },+ "reimbursements": {+ "description": "An out-of-pocket expense reimbursement request in Ramp.",+ "docs_url": "https://docs.ramp.com/developer-api/v1/api/reimbursements",+ "columns": {+ "id": "Unique identifier for the reimbursement.",+ "amount": "Reimbursement amount.",+ "currency": "Currency code of the reimbursement.",+ "merchant": "Name of the merchant.",+ "transaction_date": "Date of the underlying expense.",+ "created_at": "Time at which the reimbursement was created.",+ "user_id": "ID of the user requesting the reimbursement.",+ "user_full_name": "Full name of the user requesting the reimbursement.",+ "direction": "Direction of the reimbursement (e.g. business owes employee).",+ "memo": "Memo or note describing the reimbursement.",+ "receipts": "Receipt IDs attached to the reimbursement.",+ "accounting_categories": "Accounting categories associated with the reimbursement.",+ },+ },+ "users": {+ "description": "A user (employee) in the Ramp organization.",+ "docs_url": "https://docs.ramp.com/developer-api/v1/api/users",+ "columns": {+ "id": "Unique identifier for the user.",+ "first_name": "The user's first name.",+ "last_name": "The user's last name.",+ "email": "The user's email address.",+ "role": "The user's role in the organization.",+ "status": "The user's account status (e.g. ACTIVE, INVITE_PENDING).",+ "department_id": "ID of the department the user belongs to.",+ "location_id": "ID of the user's location.",+ "manager_id": "ID of the user's manager.",+ "phone": "The user's phone number.",+ "is_manager": "Whether the user is a manager.",+ },+ },+ "cards": {+ "description": "A physical or virtual Ramp card issued to a user.",+ "docs_url": "https://docs.ramp.com/developer-api/v1/api/cards",+ "columns": {+ "id": "Unique identifier for the card.",+ "cardholder_id": "ID of the user the card is issued to.",+ "cardholder_name": "Name of the cardholder.",+ "display_name": "Display name of the card.",+ "last_four": "Last four digits of the card number.",+ "is_physical": "Whether the card is physical (true) or virtual (false).",+ "state": "State of the card (e.g. ACTIVE, SUSPENDED, TERMINATED).",+ "spending_restrictions": "Spending limits and restrictions configured on the card.",+ },+ },+ "departments": {+ "description": "A department defined in the Ramp organization.",+ "docs_url": "https://docs.ramp.com/developer-api/v1/api/departments",+ "columns": {+ "id": "Unique identifier for the department.",+ "name": "The department's name.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/ramp/source.py b/posthog/temporal/data_imports/sources/ramp/source.pyindex dd361a7ace5e..eec8dd38e796 100644--- a/posthog/temporal/data_imports/sources/ramp/source.py+++ b/posthog/temporal/data_imports/sources/ramp/source.py@@ -13,6 +13,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -39,6 +40,11 @@ class RampSource(ResumableSource[RampSourceConfig, RampResumeConfig]):# stored client secret is sent — require re-entering secrets when it changes.return ["environment"]+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.ramp.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized for url: https://api.ramp.com/developer/v1/token": "Ramp authentication failed. Please check your client ID and client secret.",diff --git a/posthog/temporal/data_imports/sources/recharge/canonical_descriptions.py b/posthog/temporal/data_imports/sources/recharge/canonical_descriptions.pynew file mode 100644index 000000000000..058a85688d04--- /dev/null+++ b/posthog/temporal/data_imports/sources/recharge/canonical_descriptions.py@@ -0,0 +1,173 @@+"""Canonical, documentation-sourced descriptions for Recharge endpoints and columns.++Sourced from the official Recharge API reference (2021-11) (https://developer.rechargepayments.com/).+Keyed by the endpoint names in `settings.py` `RECHARGE_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Recharge table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by most Recharge objects; merged into each entry so we don't repeat them.+_COMMON_COLUMNS = {+ "id": "Unique identifier for the object.",+ "created_at": "Time at which the object was created.",+ "updated_at": "Time at which the object was last updated.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "customers": {+ "description": "A customer who holds subscriptions and is billed by Recharge.",+ "docs_url": "https://developer.rechargepayments.com/2021-11/customers/customers_object",+ "columns": _columns(+ email="The customer's email address.",+ first_name="The customer's first name.",+ last_name="The customer's last name.",+ external_customer_id="The customer's ID in the connected ecommerce platform.",+ hash="Hash used to build the customer portal URL.",+ subscriptions_active_count="Number of active subscriptions the customer has.",+ subscriptions_total_count="Total number of subscriptions the customer has.",+ has_valid_payment_method="Whether the customer has a valid payment method on file.",+ tax_exempt="Whether the customer is exempt from tax.",+ ),+ },+ "subscriptions": {+ "description": "A recurring subscription for a product, billed on a schedule by Recharge.",+ "docs_url": "https://developer.rechargepayments.com/2021-11/subscriptions/subscriptions_object",+ "columns": _columns(+ customer_id="ID of the customer the subscription belongs to.",+ address_id="ID of the shipping address for the subscription.",+ status="Status of the subscription (e.g. active, cancelled, expired).",+ product_title="Title of the subscribed product.",+ variant_title="Title of the product variant.",+ sku="Stock keeping unit of the subscribed product.",+ price="Price charged per delivery.",+ quantity="Quantity of the product per delivery.",+ order_interval_unit="Unit of the order interval (e.g. day, week, month).",+ order_interval_frequency="Number of interval units between orders.",+ charge_interval_frequency="Number of interval units between charges.",+ next_charge_scheduled_at="Time at which the next charge is scheduled.",+ cancelled_at="Time at which the subscription was cancelled, if applicable.",+ cancellation_reason="Reason the subscription was cancelled.",+ external_product_id="ID of the product in the connected ecommerce platform.",+ external_variant_id="ID of the variant in the connected ecommerce platform.",+ ),+ },+ "orders": {+ "description": "An order generated by Recharge for a subscription charge.",+ "docs_url": "https://developer.rechargepayments.com/2021-11/orders/orders_object",+ "columns": _columns(+ customer_id="ID of the customer the order is for.",+ address_id="ID of the shipping address for the order.",+ charge_id="ID of the charge that produced the order.",+ status="Status of the order (e.g. success, queued, error, cancelled).",+ total_price="Total price of the order.",+ line_items="Line items included in the order.",+ scheduled_at="Time at which the order was scheduled.",+ processed_at="Time at which the order was processed.",+ shipped_date="Date the order was shipped.",+ external_order_id="ID of the order in the connected ecommerce platform.",+ ),+ },+ "charges": {+ "description": "A billing charge attempting to collect payment for one or more subscriptions.",+ "docs_url": "https://developer.rechargepayments.com/2021-11/charges/charge_object",+ "columns": _columns(+ customer_id="ID of the customer being charged.",+ address_id="ID of the shipping address for the charge.",+ status="Status of the charge (e.g. success, queued, error, refunded).",+ total_price="Total amount of the charge.",+ subtotal_price="Subtotal before tax and shipping.",+ total_tax="Total tax on the charge.",+ line_items="Line items included in the charge.",+ scheduled_at="Time at which the charge is scheduled.",+ processed_at="Time at which the charge was processed.",+ payment_processor="Payment processor used for the charge.",+ external_transaction_id="Transaction ID in the payment processor.",+ ),+ },+ "addresses": {+ "description": "A shipping address belonging to a Recharge customer.",+ "docs_url": "https://developer.rechargepayments.com/2021-11/addresses/addresses_object",+ "columns": _columns(+ customer_id="ID of the customer the address belongs to.",+ first_name="First name on the address.",+ last_name="Last name on the address.",+ company="Company name on the address.",+ address1="First line of the street address.",+ address2="Second line of the street address.",+ city="City of the address.",+ province="State or province of the address.",+ zip="Postal or ZIP code of the address.",+ country_code="Two-letter country code of the address.",+ phone="Phone number associated with the address.",+ ),+ },+ "discounts": {+ "description": "A discount or coupon that can be applied to charges in Recharge.",+ "docs_url": "https://developer.rechargepayments.com/2021-11/discounts/discounts_object",+ "columns": _columns(+ code="The discount code customers enter.",+ value="The discount value.",+ value_type="Type of discount value (e.g. percentage, fixed_amount).",+ status="Status of the discount (e.g. enabled, disabled, fully_disabled).",+ usage_limit="Maximum number of times the discount can be used.",+ applies_to="What the discount applies to.",+ starts_at="Time at which the discount becomes active.",+ ends_at="Time at which the discount expires.",+ ),+ },+ "onetimes": {+ "description": "A one-time product add-on attached to a customer's next charge in Recharge.",+ "docs_url": "https://developer.rechargepayments.com/2021-11/onetimes/onetimes_object",+ "columns": _columns(+ customer_id="ID of the customer the one-time belongs to.",+ address_id="ID of the shipping address for the one-time.",+ product_title="Title of the one-time product.",+ variant_title="Title of the product variant.",+ sku="Stock keeping unit of the product.",+ price="Price of the one-time product.",+ quantity="Quantity of the product.",+ next_charge_scheduled_at="Time at which the one-time will be charged.",+ external_product_id="ID of the product in the connected ecommerce platform.",+ external_variant_id="ID of the variant in the connected ecommerce platform.",+ ),+ },+ "products": {+ "description": "A product available for subscription in Recharge.",+ "docs_url": "https://developer.rechargepayments.com/2021-11/products/products_object",+ "columns": _columns(+ title="The product's title.",+ handle="URL handle of the product.",+ external_product_id="ID of the product in the connected ecommerce platform.",+ images="Images associated with the product.",+ published_at="Time at which the product was published.",+ ),+ },+ "payment_methods": {+ "description": "A stored payment method for a Recharge customer.",+ "docs_url": "https://developer.rechargepayments.com/2021-11/payment_methods/payment_methods_object",+ "columns": _columns(+ customer_id="ID of the customer the payment method belongs to.",+ payment_type="Type of payment method (e.g. CREDIT_CARD, PAYPAL).",+ processor_name="Name of the payment processor.",+ status="Status of the payment method (e.g. valid, invalid).",+ default="Whether this is the customer's default payment method.",+ billing_address="Billing address associated with the payment method.",+ ),+ },+ "collections": {+ "description": "A collection grouping products together in Recharge.",+ "docs_url": "https://developer.rechargepayments.com/2021-11/collections/collections_object",+ "columns": _columns(+ title="The collection's title.",+ description="The collection's description.",+ type="Type of collection (e.g. manual, smart).",+ sort_order="Sort order applied to products in the collection.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/recharge/source.py b/posthog/temporal/data_imports/sources/recharge/source.pyindex 6cbb39dadf74..e7b467cf2d02 100644--- a/posthog/temporal/data_imports/sources/recharge/source.py+++ b/posthog/temporal/data_imports/sources/recharge/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -70,6 +71,11 @@ Some resources (such as Payment methods) are only available on Recharge Pro or C),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.recharge.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized": "Recharge rejected the API token. Generate a new token and reconnect.",diff --git a/posthog/temporal/data_imports/sources/recurly/canonical_descriptions.py b/posthog/temporal/data_imports/sources/recurly/canonical_descriptions.pynew file mode 100644index 000000000000..a67f3ef15aac--- /dev/null+++ b/posthog/temporal/data_imports/sources/recurly/canonical_descriptions.py@@ -0,0 +1,279 @@+"""Canonical, documentation-sourced descriptions for Recurly endpoints and columns.++Sourced from the official Recurly v3 API reference (https://recurly.com/developers/api/v2021-02-25/).+Keyed by the endpoint names in `settings.py` `RECURLY_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Recurly table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by most Recurly objects; merged into each entry so we don't repeat them.+_COMMON_COLUMNS = {+ "id": "Unique identifier for the object.",+ "object": "String describing the object's Recurly type (e.g. 'account', 'invoice').",+ "created_at": "Time at which the object was created.",+ "updated_at": "Time at which the object was last updated.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "accounts": {+ "description": "A customer account that holds subscriptions, invoices, and billing information.",+ "docs_url": "https://recurly.com/developers/api/v2021-02-25/index.html#tag/account",+ "columns": _columns(+ code="Your unique, customer-supplied identifier for the account.",+ email="The account holder's email address.",+ first_name="The account holder's first name.",+ last_name="The account holder's last name.",+ company="The account holder's company name.",+ username="The account's username.",+ state="State of the account (active or inactive).",+ hosted_login_token="Token used to access the account's hosted management pages.",+ vat_number="The account's VAT number, if applicable.",+ tax_exempt="Whether the account is exempt from tax.",+ preferred_locale="The account's preferred locale for communications.",+ deleted_at="Time at which the account was deleted, if it has been.",+ ),+ },+ "acquisitions": {+ "description": "Acquisition (marketing attribution) data describing how an account was acquired.",+ "docs_url": "https://recurly.com/developers/api/v2021-02-25/index.html#tag/account_acquisition",+ "columns": _columns(+ account="The account this acquisition data belongs to.",+ cost="Cost of acquiring the account, with amount and currency.",+ channel="Channel through which the account was acquired.",+ subchannel="Subchannel through which the account was acquired.",+ campaign="Marketing campaign that acquired the account.",+ ),+ },+ "add_ons": {+ "description": "An add-on that can be attached to a subscription on top of its base plan.",+ "docs_url": "https://recurly.com/developers/api/v2021-02-25/index.html#tag/add_on",+ "columns": _columns(+ plan_id="ID of the plan this add-on belongs to.",+ code="Your unique code for the add-on.",+ name="The add-on's name.",+ state="State of the add-on (active or inactive).",+ add_on_type="Type of add-on (fixed or usage).",+ usage_type="How usage is measured for usage-based add-ons.",+ currencies="Pricing of the add-on per currency.",+ default_quantity="Default quantity applied when added to a subscription.",+ tax_code="Tax code used for this add-on.",+ deleted_at="Time at which the add-on was deleted, if it has been.",+ ),+ },+ "coupons": {+ "description": "A discount coupon that can be redeemed against subscriptions or invoices.",+ "docs_url": "https://recurly.com/developers/api/v2021-02-25/index.html#tag/coupon",+ "columns": _columns(+ code="The coupon's redemption code.",+ name="The coupon's name.",+ state="State of the coupon (redeemable, maxed_out, or expired).",+ discount="The discount the coupon applies (percentage, fixed, or free trial).",+ coupon_type="Whether the coupon is single-use or bulk.",+ duration="How long the discount applies (forever, single_use, or temporal).",+ max_redemptions="Maximum number of times the coupon can be redeemed.",+ redeem_by="Date after which the coupon can no longer be redeemed.",+ expired_at="Time at which the coupon expired.",+ ),+ },+ "credit_payments": {+ "description": "A payment made using account credit rather than an external payment method.",+ "docs_url": "https://recurly.com/developers/api/v2021-02-25/index.html#tag/credit_payment",+ "columns": _columns(+ uuid="Recurly's UUID for the credit payment.",+ account="The account the credit payment belongs to.",+ action="The action that created the credit payment (e.g. payment, refund).",+ currency="Three-letter ISO currency code of the credit payment.",+ amount="Amount of the credit payment.",+ original_invoice="The original invoice the credit payment applies to.",+ applied_to_invoice="The invoice the credit payment was applied to.",+ voided_at="Time at which the credit payment was voided.",+ ),+ },+ "dunning_campaigns": {+ "description": "A dunning campaign defining the schedule of retries and notices for failed payments.",+ "docs_url": "https://recurly.com/developers/api/v2021-02-25/index.html#tag/dunning_campaign",+ "columns": _columns(+ code="Your unique code for the dunning campaign.",+ name="The dunning campaign's name.",+ description="Description of the dunning campaign.",+ default_campaign="Whether this is the account's default dunning campaign.",+ dunning_cycles="The dunning cycles (retry schedules) configured for the campaign.",+ deleted_at="Time at which the dunning campaign was deleted, if it has been.",+ ),+ },+ "external_subscriptions": {+ "description": "A subscription managed outside Recurly (e.g. through Apple App Store or Google Play).",+ "docs_url": "https://recurly.com/developers/api/v2021-02-25/index.html#tag/external_subscription",+ "columns": _columns(+ account="The account the external subscription belongs to.",+ external_product_reference="Reference to the external product being subscribed to.",+ external_id="Identifier of the subscription in the external system.",+ last_purchased="Time of the most recent purchase on the external subscription.",+ app_identifier="Identifier of the app the external subscription was purchased through.",+ quantity="Quantity of the external subscription.",+ state="State of the external subscription.",+ activated_at="Time at which the external subscription was activated.",+ expires_at="Time at which the external subscription expires.",+ ),+ },+ "gift_cards": {+ "description": "A gift card that can be redeemed to credit an account's balance.",+ "docs_url": "https://recurly.com/developers/api/v2021-02-25/index.html#tag/gift_card",+ "columns": _columns(+ redemption_code="The code used to redeem the gift card.",+ product_code="Code of the gift card product purchased.",+ unit_amount="Value of the gift card in the smallest currency unit.",+ currency="Three-letter ISO currency code of the gift card.",+ gifter_account_id="ID of the account that purchased the gift card.",+ recipient_account_id="ID of the account the gift card was redeemed against.",+ balance="Remaining balance on the gift card.",+ delivered_at="Time at which the gift card was delivered.",+ redeemed_at="Time at which the gift card was redeemed.",+ canceled_at="Time at which the gift card was canceled.",+ ),+ },+ "invoices": {+ "description": "An invoice billing an account for subscriptions, charges, or one-time purchases.",+ "docs_url": "https://recurly.com/developers/api/v2021-02-25/index.html#tag/invoice",+ "columns": _columns(+ uuid="Recurly's UUID for the invoice.",+ number="Human-readable invoice number.",+ account="The account the invoice is billed to.",+ type="Type of invoice (charge or credit).",+ origin="What triggered the invoice's creation (e.g. purchase, renewal).",+ state="State of the invoice (open, pending, processing, past_due, paid, failed, or voided).",+ currency="Three-letter ISO currency code of the invoice.",+ subtotal="Invoice subtotal before discounts and taxes.",+ tax="Total tax on the invoice.",+ total="Invoice total after discounts and taxes.",+ balance="Outstanding balance remaining on the invoice.",+ paid="Amount paid on the invoice.",+ due_at="Date the invoice payment is due.",+ closed_at="Time at which the invoice was closed.",+ ),+ },+ "items": {+ "description": "A catalog item representing a product or service that can be sold.",+ "docs_url": "https://recurly.com/developers/api/v2021-02-25/index.html#tag/item",+ "columns": _columns(+ code="Your unique code for the item.",+ name="The item's name.",+ description="Description of the item.",+ state="State of the item (active or inactive).",+ external_sku="External stock keeping unit code for the item.",+ accounting_code="Accounting code associated with the item.",+ revenue_schedule_type="How revenue is recognized for the item.",+ currencies="Pricing of the item per currency.",+ tax_code="Tax code used for the item.",+ deleted_at="Time at which the item was deleted, if it has been.",+ ),+ },+ "line_items": {+ "description": "A single charge or credit line on an invoice.",+ "docs_url": "https://recurly.com/developers/api/v2021-02-25/index.html#tag/line_item",+ "columns": _columns(+ uuid="Recurly's UUID for the line item.",+ account="The account the line item belongs to.",+ invoice_id="ID of the invoice this line item is on.",+ subscription_id="ID of the subscription this line item is associated with, if any.",+ type="Type of line item (charge or credit).",+ state="State of the line item (pending or invoiced).",+ description="Description of the line item.",+ amount="Total amount of the line item.",+ unit_amount="Per-unit amount of the line item.",+ quantity="Quantity of the line item.",+ currency="Three-letter ISO currency code of the line item.",+ tax="Tax charged on the line item.",+ start_date="Start of the period the line item covers.",+ end_date="End of the period the line item covers.",+ ),+ },+ "measured_units": {+ "description": "A unit of measurement used for metering usage-based add-ons.",+ "docs_url": "https://recurly.com/developers/api/v2021-02-25/index.html#tag/measured_unit",+ "columns": _columns(+ name="The measured unit's name.",+ display_name="Display name shown for the measured unit.",+ description="Description of the measured unit.",+ state="State of the measured unit (active or inactive).",+ deleted_at="Time at which the measured unit was deleted, if it has been.",+ ),+ },+ "plans": {+ "description": "A subscription plan defining recurring pricing and billing cadence.",+ "docs_url": "https://recurly.com/developers/api/v2021-02-25/index.html#tag/plan",+ "columns": _columns(+ code="Your unique code for the plan.",+ name="The plan's name.",+ description="Description of the plan.",+ state="State of the plan (active or inactive).",+ interval_unit="Unit of the billing interval (days or months).",+ interval_length="Number of interval units between billings.",+ trial_unit="Unit of the trial period (days or months).",+ trial_length="Length of the trial period.",+ currencies="Pricing of the plan per currency.",+ tax_code="Tax code used for the plan.",+ total_billing_cycles="Number of billing cycles before the subscription expires, if limited.",+ deleted_at="Time at which the plan was deleted, if it has been.",+ ),+ },+ "shipping_methods": {+ "description": "A shipping method available for physical goods, with carrier and cost details.",+ "docs_url": "https://recurly.com/developers/api/v2021-02-25/index.html#tag/shipping_method",+ "columns": _columns(+ code="Your unique code for the shipping method.",+ name="The shipping method's name.",+ accounting_code="Accounting code associated with the shipping method.",+ tax_code="Tax code used for the shipping method.",+ deleted_at="Time at which the shipping method was deleted, if it has been.",+ ),+ },+ "subscriptions": {+ "description": "A recurring subscription linking an account to a plan with a billing schedule.",+ "docs_url": "https://recurly.com/developers/api/v2021-02-25/index.html#tag/subscription",+ "columns": _columns(+ uuid="Recurly's UUID for the subscription.",+ account="The account the subscription belongs to.",+ plan="The plan the subscription is on.",+ state="State of the subscription (active, canceled, expired, future, paused).",+ unit_amount="Per-unit recurring amount of the subscription.",+ quantity="Quantity of the subscription.",+ currency="Three-letter ISO currency code of the subscription.",+ current_period_started_at="Start of the current billing period.",+ current_period_ends_at="End of the current billing period.",+ trial_started_at="Time at which the subscription's trial started.",+ trial_ends_at="Time at which the subscription's trial ends.",+ activated_at="Time at which the subscription was activated.",+ canceled_at="Time at which the subscription was canceled.",+ expires_at="Time at which the subscription expires or expired.",+ total_billing_cycles="Number of billing cycles before the subscription expires, if limited.",+ ),+ },+ "transactions": {+ "description": "A payment transaction (charge, refund, or verification) against an account.",+ "docs_url": "https://recurly.com/developers/api/v2021-02-25/index.html#tag/transaction",+ "columns": _columns(+ uuid="Recurly's UUID for the transaction.",+ account="The account the transaction belongs to.",+ invoice="The invoice the transaction is for.",+ subscription_ids="IDs of subscriptions associated with the transaction.",+ type="Type of transaction (authorization, capture, purchase, refund, or verify).",+ origin="What triggered the transaction.",+ status="Status of the transaction (success, declined, error, void, or processing).",+ success="Whether the transaction succeeded.",+ amount="Amount of the transaction.",+ currency="Three-letter ISO currency code of the transaction.",+ payment_method="The payment method used for the transaction.",+ refunded="Whether the transaction has been refunded.",+ gateway_response_code="Response code returned by the payment gateway.",+ collected_at="Time at which payment was collected.",+ voided_at="Time at which the transaction was voided.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/recurly/source.py b/posthog/temporal/data_imports/sources/recurly/source.pyindex a6662583564e..08a0611496d6 100644--- a/posthog/temporal/data_imports/sources/recurly/source.py+++ b/posthog/temporal/data_imports/sources/recurly/source.py@@ -13,6 +13,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -37,6 +38,11 @@ class RecurlySource(ResumableSource[RecurlySourceConfig, RecurlyResumeConfig]):def source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.RECURLY+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.recurly.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized": "Recurly rejected the API key. Generate a new private API key in Recurly and reconnect.",diff --git a/posthog/temporal/data_imports/sources/reddit_ads/canonical_descriptions.py b/posthog/temporal/data_imports/sources/reddit_ads/canonical_descriptions.pynew file mode 100644index 000000000000..44f8ed992793--- /dev/null+++ b/posthog/temporal/data_imports/sources/reddit_ads/canonical_descriptions.py@@ -0,0 +1,114 @@+"""Canonical, documentation-sourced descriptions for Reddit Ads endpoints and columns.++Sourced from the official Reddit Ads API reference (https://ads-api.reddit.com/docs/v3/).+Keyed by the endpoint names in `settings.py` `REDDIT_ADS_CONFIG`, which match the+`ExternalDataSchema.name` of a synced Reddit Ads table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by Reddit Ads entity objects (campaigns, ad groups, ads).+_ENTITY_COLUMNS = {+ "id": "Unique identifier for the object.",+ "created_at": "Time at which the object was created.",+ "modified_at": "Time at which the object was last modified.",+ "name": "The object's name.",+ "configured_status": "The status configured by the advertiser (e.g. ACTIVE, PAUSED).",+ "effective_status": "The object's effective status after all rules are applied.",+}++# Fields shared by the report endpoints, which return aggregated metrics per breakdown.+_REPORT_COLUMNS = {+ "date": "The date the metrics are aggregated over.",+ "currency": "Three-letter ISO currency code for monetary metrics.",+ "impressions": "Number of times ads were shown.",+ "clicks": "Number of clicks on ads.",+ "spend": "Total amount spent, in the smallest currency unit.",+ "ctr": "Click-through rate (clicks divided by impressions).",+ "cpc": "Average cost per click.",+ "ecpm": "Effective cost per thousand impressions.",+ "reach": "Estimated number of unique users who saw the ads.",+ "frequency": "Average number of times each user saw the ads.",+ "conversion_roas": "Return on ad spend from conversions.",+ "conversion_purchase_total_items": "Total number of items purchased from conversions.",+ "conversion_purchase_total_value": "Total value of purchase conversions.",+ "conversion_sign_up_views": "Number of sign-up view conversions.",+ "conversion_signup_total_value": "Total value of sign-up conversions.",+ "app_install_install_count": "Number of app installs attributed to ads.",+ "app_install_purchase_count": "Number of in-app purchases attributed to ads.",+ "app_install_revenue": "Revenue from app-install-attributed purchases.",+ "app_install_roas_double": "Return on ad spend from app installs.",+ "key_conversion_rate": "Rate of the key conversion event.",+ "key_conversion_total_count": "Total count of the key conversion event.",+ "video_started": "Number of video views started.",+ "video_view_rate": "Rate at which the video was viewed.",+ "video_completion_rate": "Rate at which the video was watched to completion.",+ "video_watched_25_percent": "Number of times the video was watched to 25%.",+ "video_watched_50_percent": "Number of times the video was watched to 50%.",+ "video_watched_75_percent": "Number of times the video was watched to 75%.",+ "video_watched_100_percent": "Number of times the video was watched to 100%.",+}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "campaigns": {+ "description": "A Reddit Ads campaign grouping ad groups under a shared objective and budget.",+ "docs_url": "https://ads-api.reddit.com/docs/v3/operations/Get%20Campaigns",+ "columns": {+ **_ENTITY_COLUMNS,+ "objective": "The campaign's advertising objective (e.g. CONVERSIONS, TRAFFIC).",+ "spend_cap": "Lifetime spend cap for the campaign, if set.",+ "funding_instrument_id": "ID of the funding instrument paying for the campaign.",+ },+ },+ "ad_groups": {+ "description": "A Reddit Ads ad group within a campaign, defining targeting, bidding, and budget.",+ "docs_url": "https://ads-api.reddit.com/docs/v3/operations/Get%20Ad%20Groups",+ "columns": {+ **_ENTITY_COLUMNS,+ "campaign_id": "ID of the campaign this ad group belongs to.",+ "bid_strategy": "The bidding strategy used by the ad group.",+ "bid_value": "The bid value for the ad group.",+ "goal_type": "The optimization goal type for the ad group.",+ "goal_value": "The optimization goal value for the ad group.",+ "start_time": "Time at which the ad group is scheduled to start.",+ "end_time": "Time at which the ad group is scheduled to end.",+ },+ },+ "ads": {+ "description": "A Reddit Ads ad — the creative shown to users within an ad group.",+ "docs_url": "https://ads-api.reddit.com/docs/v3/operations/Get%20Ads",+ "columns": {+ **_ENTITY_COLUMNS,+ "ad_group_id": "ID of the ad group this ad belongs to.",+ "type": "The ad's creative type.",+ "click_url": "The destination URL users are sent to when clicking the ad.",+ "preview_url": "URL to preview the ad creative.",+ "post_id": "ID of the Reddit post backing the ad creative.",+ },+ },+ "campaign_report": {+ "description": "Daily aggregated performance metrics broken down by campaign.",+ "docs_url": "https://ads-api.reddit.com/docs/v3/operations/Generate%20Report",+ "columns": {+ **_REPORT_COLUMNS,+ "campaign_id": "ID of the campaign the metrics are aggregated for.",+ },+ },+ "ad_group_report": {+ "description": "Daily aggregated performance metrics broken down by ad group.",+ "docs_url": "https://ads-api.reddit.com/docs/v3/operations/Generate%20Report",+ "columns": {+ **_REPORT_COLUMNS,+ "ad_group_id": "ID of the ad group the metrics are aggregated for.",+ },+ },+ "ad_report": {+ "description": "Daily aggregated performance metrics broken down by ad.",+ "docs_url": "https://ads-api.reddit.com/docs/v3/operations/Generate%20Report",+ "columns": {+ **_REPORT_COLUMNS,+ "ad_id": "ID of the ad the metrics are aggregated for.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/reddit_ads/source.py b/posthog/temporal/data_imports/sources/reddit_ads/source.pyindex 9ac026adb978..52bc0a3a88ca 100644--- a/posthog/temporal/data_imports/sources/reddit_ads/source.py+++ b/posthog/temporal/data_imports/sources/reddit_ads/source.py@@ -18,6 +18,7 @@ from posthog.temporal.data_imports.sources.common.base import (FieldType,ResumableSource,)+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.mixins import OAuthMixinfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManager@@ -35,6 +36,11 @@ class RedditAdsSource(ResumableSource[RedditAdsSourceConfig, RedditAdsResumeConfdef source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.REDDITADS+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.reddit_ads.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error": None,diff --git a/posthog/temporal/data_imports/sources/resend/canonical_descriptions.py b/posthog/temporal/data_imports/sources/resend/canonical_descriptions.pynew file mode 100644index 000000000000..b2ec986db70e--- /dev/null+++ b/posthog/temporal/data_imports/sources/resend/canonical_descriptions.py@@ -0,0 +1,79 @@+"""Canonical, documentation-sourced descriptions for Resend endpoints and columns.++Sourced from the official Resend API reference (https://resend.com/docs/api-reference).+Keyed by the endpoint names in `settings.py` `RESEND_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Resend table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "audiences": {+ "description": "A list of contacts you can send broadcast emails to.",+ "docs_url": "https://resend.com/docs/api-reference/audiences/list-audiences",+ "columns": {+ "id": "Unique identifier for the audience.",+ "name": "The audience's name.",+ "created_at": "Time at which the audience was created.",+ },+ },+ "broadcasts": {+ "description": "An email campaign sent to an audience.",+ "docs_url": "https://resend.com/docs/api-reference/broadcasts/list-broadcasts",+ "columns": {+ "id": "Unique identifier for the broadcast.",+ "name": "The broadcast's name.",+ "audience_id": "ID of the audience the broadcast is sent to.",+ "from": "The sender email address for the broadcast.",+ "subject": "Subject line of the broadcast email.",+ "reply_to": "Reply-to address for the broadcast.",+ "preview_text": "Preview text shown in recipients' inboxes.",+ "status": "Status of the broadcast (e.g. draft, sent).",+ "created_at": "Time at which the broadcast was created.",+ "scheduled_at": "Time at which the broadcast is scheduled to send.",+ "sent_at": "Time at which the broadcast was sent.",+ },+ },+ "domains": {+ "description": "A sending domain configured in Resend for authenticated email delivery.",+ "docs_url": "https://resend.com/docs/api-reference/domains/list-domains",+ "columns": {+ "id": "Unique identifier for the domain.",+ "name": "The domain name.",+ "status": "Verification status of the domain (e.g. pending, verified, failed).",+ "region": "The region the domain sends from.",+ "records": "DNS records required to verify and authenticate the domain.",+ "created_at": "Time at which the domain was created.",+ },+ },+ "emails": {+ "description": "A transactional email sent through Resend.",+ "docs_url": "https://resend.com/docs/api-reference/emails/retrieve-email",+ "columns": {+ "id": "Unique identifier for the email.",+ "from": "The sender email address.",+ "to": "List of recipient email addresses.",+ "cc": "List of CC recipient email addresses.",+ "bcc": "List of BCC recipient email addresses.",+ "reply_to": "Reply-to address for the email.",+ "subject": "Subject line of the email.",+ "html": "HTML body of the email.",+ "text": "Plain-text body of the email.",+ "last_event": "The most recent delivery event for the email (e.g. delivered, bounced).",+ "created_at": "Time at which the email was created.",+ },+ },+ "contacts": {+ "description": "A contact belonging to an audience, with subscription status.",+ "docs_url": "https://resend.com/docs/api-reference/contacts/list-contacts",+ "columns": {+ "id": "Unique identifier for the contact.",+ "audience_id": "ID of the audience the contact belongs to.",+ "email": "The contact's email address.",+ "first_name": "The contact's first name.",+ "last_name": "The contact's last name.",+ "unsubscribed": "Whether the contact has unsubscribed.",+ "created_at": "Time at which the contact was created.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/resend/source.py b/posthog/temporal/data_imports/sources/resend/source.pyindex 86a74e2694a9..6e64a783727e 100644--- a/posthog/temporal/data_imports/sources/resend/source.py+++ b/posthog/temporal/data_imports/sources/resend/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -66,6 +67,11 @@ Grant the key **full access** or a read-enabled access token so the following re),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.resend.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: ResendSourceConfig,diff --git a/posthog/temporal/data_imports/sources/revenuecat/canonical_descriptions.py b/posthog/temporal/data_imports/sources/revenuecat/canonical_descriptions.pynew file mode 100644index 000000000000..e7a271c0b605--- /dev/null+++ b/posthog/temporal/data_imports/sources/revenuecat/canonical_descriptions.py@@ -0,0 +1,108 @@+"""Canonical, documentation-sourced descriptions for RevenueCat endpoints and columns.++Sourced from the official RevenueCat API v2 reference (https://www.revenuecat.com/docs/api-v2)+and the webhook event reference (https://www.revenuecat.com/docs/integrations/webhooks/event-types-and-fields).+Keyed by the resource names in `constants.py`, which match the `ExternalDataSchema.name` of a+synced RevenueCat table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions+from posthog.temporal.data_imports.sources.revenuecat.constants import (+ APP_RESOURCE_NAME,+ CUSTOMER_RESOURCE_NAME,+ ENTITLEMENT_RESOURCE_NAME,+ EVENT_RESOURCE_NAME,+ OFFERING_RESOURCE_NAME,+ PRODUCT_RESOURCE_NAME,+)++# Fields shared by most RevenueCat v2 objects.+_COMMON_COLUMNS = {+ "id": "Unique identifier for the object.",+ "object": "String describing the object's RevenueCat type (e.g. 'product', 'entitlement').",+ "project_id": "ID of the RevenueCat project the object belongs to.",+ "created_at": "Time at which the object was created (Unix seconds).",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ CUSTOMER_RESOURCE_NAME: {+ "description": "An end user of the app, identified by their RevenueCat App User ID.",+ "docs_url": "https://www.revenuecat.com/docs/api-v2#tag/Customer",+ "columns": {+ "id": "The customer's RevenueCat App User ID.",+ "object": "String describing the object's type ('customer').",+ "project_id": "ID of the RevenueCat project the customer belongs to.",+ "first_seen_at": "Time at which the customer was first seen (Unix seconds).",+ "last_seen_at": "Time at which the customer was most recently seen.",+ "active_entitlements": "The customer's currently active entitlements.",+ "experiment": "The experiment the customer is enrolled in, if any.",+ "attributes": "Custom attributes set on the customer.",+ },+ },+ PRODUCT_RESOURCE_NAME: {+ "description": "A purchasable product (subscription or one-time purchase) configured in RevenueCat.",+ "docs_url": "https://www.revenuecat.com/docs/api-v2#tag/Product",+ "columns": _columns(+ store_identifier="The product identifier in its store (e.g. App Store, Play Store).",+ type="Type of product (subscription or one_time).",+ display_name="Human-readable display name of the product.",+ app_id="ID of the app the product belongs to.",+ subscription="Subscription configuration for the product, if it is a subscription.",+ ),+ },+ ENTITLEMENT_RESOURCE_NAME: {+ "description": "A level of access (entitlement) that products can unlock for customers.",+ "docs_url": "https://www.revenuecat.com/docs/api-v2#tag/Entitlement",+ "columns": _columns(+ lookup_key="Your unique key identifying the entitlement.",+ display_name="Human-readable display name of the entitlement.",+ products="Products that grant this entitlement.",+ ),+ },+ OFFERING_RESOURCE_NAME: {+ "description": "A configured set of packages presented to customers as purchase options.",+ "docs_url": "https://www.revenuecat.com/docs/api-v2#tag/Offering",+ "columns": _columns(+ lookup_key="Your unique key identifying the offering.",+ display_name="Human-readable display name of the offering.",+ is_current="Whether this is the current default offering.",+ packages="Packages contained in the offering.",+ ),+ },+ APP_RESOURCE_NAME: {+ "description": "An app within a RevenueCat project, tied to a specific store platform.",+ "docs_url": "https://www.revenuecat.com/docs/api-v2#tag/App",+ "columns": _columns(+ name="The app's name.",+ type="The app's store platform (e.g. app_store, play_store, stripe).",+ ),+ },+ EVENT_RESOURCE_NAME: {+ "description": "A realtime webhook event capturing subscription and purchase activity.",+ "docs_url": "https://www.revenuecat.com/docs/integrations/webhooks/event-types-and-fields",+ "columns": {+ "id": "Unique identifier for the event.",+ "type": "The event type (e.g. INITIAL_PURCHASE, RENEWAL, CANCELLATION, EXPIRATION).",+ "app_user_id": "The RevenueCat App User ID the event is for.",+ "original_app_user_id": "The original App User ID before any aliasing.",+ "aliases": "All App User IDs aliased to this customer.",+ "product_id": "Identifier of the product involved in the event.",+ "entitlement_ids": "Entitlements affected by the event.",+ "store": "The store the purchase was made through (e.g. APP_STORE, PLAY_STORE).",+ "environment": "Whether the event is from PRODUCTION or SANDBOX.",+ "currency": "Three-letter ISO currency code of the transaction.",+ "price": "Price of the transaction.",+ "price_in_purchased_currency": "Price in the currency the purchase was made in.",+ "purchased_at_ms": "Time of the purchase, in milliseconds since epoch.",+ "expiration_at_ms": "Time the subscription expires, in milliseconds since epoch.",+ "event_timestamp_ms": "Time the event occurred, in milliseconds since epoch.",+ "created_at": "Time the event occurred (Unix seconds, derived from event_timestamp_ms).",+ "api_version": "RevenueCat webhook payload API version.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/revenuecat/source.py b/posthog/temporal/data_imports/sources/revenuecat/source.pyindex 6f066df46c9a..44270f409784 100644--- a/posthog/temporal/data_imports/sources/revenuecat/source.py+++ b/posthog/temporal/data_imports/sources/revenuecat/source.py@@ -24,6 +24,7 @@ from posthog.temporal.data_imports.sources.common.base import (WebhookDeletionResult,WebhookSource,)+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -186,6 +187,11 @@ class RevenueCatSource(),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.revenuecat.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized": (diff --git a/posthog/temporal/data_imports/sources/rippling/canonical_descriptions.py b/posthog/temporal/data_imports/sources/rippling/canonical_descriptions.pynew file mode 100644index 000000000000..74fb69bfa00d--- /dev/null+++ b/posthog/temporal/data_imports/sources/rippling/canonical_descriptions.py@@ -0,0 +1,128 @@+"""Canonical, documentation-sourced descriptions for Rippling endpoints and columns.++Sourced from the official Rippling REST API reference (https://developer.rippling.com/documentation/rest-api).+Keyed by the endpoint names in `settings.py` `RIPPLING_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Rippling table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by every Rippling REST object.+_COMMON_COLUMNS = {+ "id": "Unique identifier for the object.",+ "created_at": "Time at which the object was created.",+ "updated_at": "Time at which the object was last updated.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "workers": {+ "description": "A worker (employee or contractor) in the company, with employment details.",+ "docs_url": "https://developer.rippling.com/documentation/rest-api/reference/get-workers",+ "columns": _columns(+ user_id="ID of the user record associated with the worker.",+ company_id="ID of the company the worker belongs to.",+ employment_type_id="ID of the worker's employment type.",+ department_id="ID of the department the worker belongs to.",+ team_id="ID of the team the worker belongs to.",+ level_id="ID of the worker's job level.",+ work_location_id="ID of the worker's work location.",+ title="The worker's job title.",+ status="Employment status of the worker (e.g. ACTIVE, TERMINATED).",+ start_date="The worker's employment start date.",+ end_date="The worker's employment end date, if applicable.",+ employment_type="The worker's employment type (e.g. FULL_TIME, CONTRACTOR).",+ ),+ },+ "users": {+ "description": "A user account in the company directory, with contact and identity details.",+ "docs_url": "https://developer.rippling.com/documentation/rest-api/reference/get-users",+ "columns": _columns(+ company_id="ID of the company the user belongs to.",+ name="The user's full name structured into given and family names.",+ preferred_first_name="The user's preferred first name.",+ emails="The user's email addresses.",+ phone_numbers="The user's phone numbers.",+ status="Status of the user account (e.g. ACTIVE, INACTIVE).",+ username="The user's username.",+ ),+ },+ "companies": {+ "description": "A company (legal entity) in the Rippling account.",+ "docs_url": "https://developer.rippling.com/documentation/rest-api/reference/get-companies",+ "columns": _columns(+ name="The company's legal name.",+ display_name="The company's display name.",+ legal_name="The company's registered legal name.",+ phone_number="The company's phone number.",+ primary_email="The company's primary contact email.",+ ein="The company's Employer Identification Number.",+ address="The company's address.",+ ),+ },+ "departments": {+ "description": "A department within the company used to organize workers.",+ "docs_url": "https://developer.rippling.com/documentation/rest-api/reference/get-departments",+ "columns": _columns(+ company_id="ID of the company the department belongs to.",+ name="The department's name.",+ parent_id="ID of the parent department, if nested.",+ ),+ },+ "teams": {+ "description": "A team within the company used to group workers.",+ "docs_url": "https://developer.rippling.com/documentation/rest-api/reference/get-teams",+ "columns": _columns(+ company_id="ID of the company the team belongs to.",+ name="The team's name.",+ parent_id="ID of the parent team, if nested.",+ ),+ },+ "levels": {+ "description": "A job level (seniority tier) used to classify workers.",+ "docs_url": "https://developer.rippling.com/documentation/rest-api/reference/get-levels",+ "columns": _columns(+ company_id="ID of the company the level belongs to.",+ name="The level's name.",+ rank="Numeric rank ordering the level relative to others.",+ track_id="ID of the career track the level belongs to.",+ ),+ },+ "work_locations": {+ "description": "A physical work location (office or site) for the company.",+ "docs_url": "https://developer.rippling.com/documentation/rest-api/reference/get-work-locations",+ "columns": _columns(+ company_id="ID of the company the work location belongs to.",+ name="The work location's name.",+ address="The work location's address.",+ ),+ },+ "employment_types": {+ "description": "An employment type classifying how workers are employed (e.g. full-time, contractor).",+ "docs_url": "https://developer.rippling.com/documentation/rest-api/reference/get-employment-types",+ "columns": _columns(+ company_id="ID of the company the employment type belongs to.",+ name="The employment type's name.",+ label="Display label for the employment type.",+ type="The category of employment (e.g. SALARIED, HOURLY, CONTRACTOR).",+ compensation_time_period="The time period over which compensation is measured.",+ ),+ },+ "compensations": {+ "description": "A worker's compensation record, including pay rate and structure.",+ "docs_url": "https://developer.rippling.com/documentation/rest-api/reference/get-compensations",+ "columns": _columns(+ worker_id="ID of the worker this compensation applies to.",+ currency="Three-letter ISO currency code of the compensation.",+ payment_rate="The worker's pay rate.",+ payment_time_period="The time period the pay rate is measured over (e.g. HOUR, YEAR).",+ payment_type="The type of payment (e.g. SALARY, HOURLY).",+ annual_compensation="The worker's annualized compensation.",+ effective_date="Date the compensation took effect.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/rippling/source.py b/posthog/temporal/data_imports/sources/rippling/source.pyindex f810baf48619..95c20091869f 100644--- a/posthog/temporal/data_imports/sources/rippling/source.py+++ b/posthog/temporal/data_imports/sources/rippling/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -31,6 +32,11 @@ class RipplingSource(ResumableSource[RipplingSourceConfig, RipplingResumeConfig]def source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.RIPPLING+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.rippling.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized for url: https://rest.ripplingapis.com": "Rippling authentication failed. Please check your API token (tokens expire after 30 days of inactivity).",diff --git a/posthog/temporal/data_imports/sources/rollbar/canonical_descriptions.py b/posthog/temporal/data_imports/sources/rollbar/canonical_descriptions.pynew file mode 100644index 000000000000..8cd5d649e4d1--- /dev/null+++ b/posthog/temporal/data_imports/sources/rollbar/canonical_descriptions.py@@ -0,0 +1,73 @@+"""Canonical, documentation-sourced descriptions for Rollbar endpoints and columns.++Sourced from the official Rollbar API reference (https://docs.rollbar.com/reference).+Keyed by the endpoint names in `settings.py` `ROLLBAR_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Rollbar table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "items": {+ "description": "An error item grouping together occurrences of the same error in a project.",+ "docs_url": "https://docs.rollbar.com/reference/list-all-items",+ "columns": {+ "id": "Unique identifier for the item.",+ "counter": "Per-project sequential counter for the item.",+ "project_id": "ID of the project the item belongs to.",+ "environment": "Environment the item was reported in (e.g. production).",+ "title": "Title summarizing the error.",+ "level": "Severity level of the item (e.g. error, warning, critical).",+ "status": "Status of the item (e.g. active, resolved, muted).",+ "counter_total": "Total number of occurrences recorded for the item.",+ "occurrences": "Number of occurrences of the item.",+ "first_occurrence_id": "ID of the first occurrence of the item.",+ "first_occurrence_timestamp": "Time of the first occurrence (Unix seconds).",+ "last_occurrence_id": "ID of the most recent occurrence of the item.",+ "last_occurrence_timestamp": "Time of the most recent occurrence (Unix seconds).",+ "last_modified_by": "ID of the user who last modified the item.",+ "framework": "Framework the error originated in.",+ "platform": "Platform the error originated on.",+ "assigned_user_id": "ID of the user the item is assigned to.",+ "resolved_in_version": "Version in which the item was resolved.",+ },+ },+ "occurrences": {+ "description": "A single occurrence (instance) of an error item, with full event details.",+ "docs_url": "https://docs.rollbar.com/reference/list-all-instances",+ "columns": {+ "id": "Unique identifier for the occurrence.",+ "project_id": "ID of the project the occurrence belongs to.",+ "item_id": "ID of the item this occurrence belongs to.",+ "timestamp": "Time the occurrence happened (Unix seconds).",+ "version": "Schema version of the occurrence payload.",+ "billable": "Whether the occurrence counts toward billing.",+ "data": "The full occurrence payload, including the error body and request context.",+ },+ },+ "deploys": {+ "description": "A deployment recorded in Rollbar, marking a release of code to an environment.",+ "docs_url": "https://docs.rollbar.com/reference/list-all-deploys",+ "columns": {+ "id": "Unique identifier for the deploy.",+ "project_id": "ID of the project the deploy belongs to.",+ "environment": "Environment the deploy was made to.",+ "revision": "Source control revision (commit SHA) that was deployed.",+ "comment": "Comment describing the deploy.",+ "user_id": "ID of the user who recorded the deploy.",+ "local_username": "Local username of the person who triggered the deploy.",+ "start_time": "Time the deploy started (Unix seconds).",+ "finish_time": "Time the deploy finished (Unix seconds).",+ "status": "Status of the deploy (e.g. started, succeeded, failed).",+ },+ },+ "environments": {+ "description": "An environment configured in the Rollbar project (e.g. production, staging).",+ "docs_url": "https://docs.rollbar.com/reference",+ "columns": {+ "id": "Unique identifier for the environment.",+ "project_id": "ID of the project the environment belongs to.",+ "name": "The environment's name.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/rollbar/source.py b/posthog/temporal/data_imports/sources/rollbar/source.pyindex d47dde251c9a..96376877d58c 100644--- a/posthog/temporal/data_imports/sources/rollbar/source.py+++ b/posthog/temporal/data_imports/sources/rollbar/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -31,6 +32,11 @@ class RollbarSource(ResumableSource[RollbarSourceConfig, RollbarResumeConfig]):def source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.ROLLBAR+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.rollbar.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized for url: https://api.rollbar.com": "Rollbar authentication failed. Please check your project access token.",diff --git a/posthog/temporal/data_imports/sources/salesforce/canonical_descriptions.py b/posthog/temporal/data_imports/sources/salesforce/canonical_descriptions.pynew file mode 100644index 000000000000..e151b332bed5--- /dev/null+++ b/posthog/temporal/data_imports/sources/salesforce/canonical_descriptions.py@@ -0,0 +1,249 @@+"""Canonical, documentation-sourced descriptions for Salesforce standard objects and fields.++Sourced from the official Salesforce Object Reference for the Salesforce Platform+(https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/).+Keyed by the standard sObject API names in `settings.py` `ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Salesforce table. The source syncs a fixed set of standard+objects (it does not enumerate user-defined custom objects), so these are stable across teams.+Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Audit fields present on every standard Salesforce object; merged into each entry.+_COMMON_COLUMNS = {+ "Id": "Unique 18-character Salesforce record identifier.",+ "CreatedDate": "Date and time the record was created.",+ "CreatedById": "ID of the user who created the record.",+ "LastModifiedDate": "Date and time the record was last modified.",+ "LastModifiedById": "ID of the user who last modified the record.",+ "SystemModstamp": "Date and time the record was last modified by a user or automated process.",+ "IsDeleted": "Whether the record has been moved to the Recycle Bin.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "Account": {+ "description": "An organization or person involved with your business, such as a customer or partner.",+ "docs_url": "https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_account.htm",+ "columns": _columns(+ Name="Name of the account.",+ Type="Type of account (e.g. Customer, Partner, Prospect).",+ Industry="Primary business industry of the account.",+ Website="The account's website URL.",+ Phone="The account's primary phone number.",+ OwnerId="ID of the user who owns the account.",+ ParentId="ID of the parent account, if this account is part of a hierarchy.",+ AnnualRevenue="Estimated annual revenue of the account.",+ NumberOfEmployees="Number of employees at the account.",+ BillingCity="City portion of the account's billing address.",+ BillingCountry="Country portion of the account's billing address.",+ ShippingCity="City portion of the account's shipping address.",+ Description="Free-form text description of the account.",+ ),+ },+ "Contact": {+ "description": "An individual associated with an account, such as an employee of a customer.",+ "docs_url": "https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_contact.htm",+ "columns": _columns(+ FirstName="Contact's first name.",+ LastName="Contact's last name.",+ Name="Contact's full name.",+ Email="Contact's email address.",+ Phone="Contact's phone number.",+ Title="Contact's job title.",+ AccountId="ID of the account this contact is associated with.",+ OwnerId="ID of the user who owns the contact.",+ ReportsToId="ID of the contact this person reports to.",+ MailingCity="City portion of the contact's mailing address.",+ MailingCountry="Country portion of the contact's mailing address.",+ LeadSource="Source from which this contact was generated.",+ ),+ },+ "Lead": {+ "description": "A prospect or potential customer who has not yet been qualified.",+ "docs_url": "https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_lead.htm",+ "columns": _columns(+ FirstName="Lead's first name.",+ LastName="Lead's last name.",+ Name="Lead's full name.",+ Company="Company the lead is associated with.",+ Email="Lead's email address.",+ Phone="Lead's phone number.",+ Title="Lead's job title.",+ Status="Status of the lead in the qualification process.",+ LeadSource="Source from which this lead was generated.",+ Industry="Industry of the lead's company.",+ OwnerId="ID of the user who owns the lead.",+ IsConverted="Whether the lead has been converted into an account, contact, and opportunity.",+ ConvertedDate="Date the lead was converted.",+ ConvertedAccountId="ID of the account created when the lead was converted.",+ ConvertedContactId="ID of the contact created when the lead was converted.",+ ConvertedOpportunityId="ID of the opportunity created when the lead was converted.",+ Rating="Lead's rating (e.g. Hot, Warm, Cold).",+ ),+ },+ "Opportunity": {+ "description": "A potential sale or pending deal being tracked through the sales pipeline.",+ "docs_url": "https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_opportunity.htm",+ "columns": _columns(+ Name="Name of the opportunity.",+ AccountId="ID of the account this opportunity is for.",+ Amount="Estimated total sale amount of the opportunity.",+ StageName="Current stage of the opportunity in the sales process.",+ Probability="Estimated percentage likelihood of closing the opportunity.",+ CloseDate="Expected or actual close date of the opportunity.",+ Type="Type of opportunity (e.g. New Business, Existing Business).",+ LeadSource="Source from which this opportunity was generated.",+ IsClosed="Whether the opportunity has reached a closed stage.",+ IsWon="Whether the opportunity was won.",+ ForecastCategoryName="Forecast category the opportunity falls into.",+ OwnerId="ID of the user who owns the opportunity.",+ ExpectedRevenue="Amount multiplied by probability — the weighted forecast revenue.",+ ),+ },+ "OpportunityHistory": {+ "description": "A historical snapshot of an opportunity's stage, amount, and probability at a point in time.",+ "docs_url": "https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_opportunityhistory.htm",+ "columns": _columns(+ OpportunityId="ID of the opportunity this history record belongs to.",+ StageName="The opportunity's stage at the time of this snapshot.",+ Amount="The opportunity's amount at the time of this snapshot.",+ Probability="The opportunity's probability at the time of this snapshot.",+ CloseDate="The opportunity's close date at the time of this snapshot.",+ ForecastCategory="Forecast category at the time of this snapshot.",+ ),+ },+ "Campaign": {+ "description": "A marketing initiative, such as an email blast or event, used to generate leads.",+ "docs_url": "https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_campaign.htm",+ "columns": _columns(+ Name="Name of the campaign.",+ Type="Type of campaign (e.g. Email, Webinar, Advertisement).",+ Status="Status of the campaign (e.g. Planned, In Progress, Completed).",+ StartDate="Start date of the campaign.",+ EndDate="End date of the campaign.",+ IsActive="Whether the campaign is currently active.",+ BudgetedCost="Budgeted cost of the campaign.",+ ActualCost="Actual cost incurred by the campaign.",+ ExpectedRevenue="Expected revenue generated by the campaign.",+ NumberOfLeads="Number of leads associated with the campaign.",+ NumberOfContacts="Number of contacts associated with the campaign.",+ OwnerId="ID of the user who owns the campaign.",+ ),+ },+ "User": {+ "description": "A user account in the Salesforce organization.",+ "docs_url": "https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_user.htm",+ "columns": _columns(+ Username="The user's login username, in email format.",+ Name="The user's full name.",+ FirstName="The user's first name.",+ LastName="The user's last name.",+ Email="The user's email address.",+ IsActive="Whether the user account is active.",+ ProfileId="ID of the user's profile, which controls permissions.",+ UserRoleId="ID of the user's role in the role hierarchy.",+ Title="The user's job title.",+ Department="The user's department.",+ ManagerId="ID of the user's manager.",+ TimeZoneSidKey="The user's time zone.",+ ),+ },+ "UserRole": {+ "description": "A role in the organization's role hierarchy, controlling record-level data access.",+ "docs_url": "https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_userrole.htm",+ "columns": _columns(+ Name="Name of the role.",+ ParentRoleId="ID of the parent role in the hierarchy.",+ DeveloperName="Unique API name of the role.",+ RollupDescription="Description of the role used in forecasting rollups.",+ ),+ },+ "Product2": {+ "description": "A product or service your organization sells, used in price books and opportunities.",+ "docs_url": "https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_product2.htm",+ "columns": _columns(+ Name="Name of the product.",+ ProductCode="Internal product code or SKU.",+ Description="Description of the product.",+ IsActive="Whether the product is active and available for use.",+ Family="Product family the product belongs to.",+ QuantityUnitOfMeasure="Unit of measure for the product (e.g. each, kg).",+ ),+ },+ "Pricebook2": {+ "description": "A price book — a list of products and their prices for a given market or segment.",+ "docs_url": "https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_pricebook2.htm",+ "columns": _columns(+ Name="Name of the price book.",+ Description="Description of the price book.",+ IsActive="Whether the price book is active.",+ IsStandard="Whether this is the standard (default) price book.",+ ),+ },+ "PricebookEntry": {+ "description": "An entry linking a product to a price within a specific price book.",+ "docs_url": "https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_pricebookentry.htm",+ "columns": _columns(+ Name="Name of the price book entry (typically the product name).",+ Pricebook2Id="ID of the price book this entry belongs to.",+ Product2Id="ID of the product this entry prices.",+ UnitPrice="Price of the product in this price book.",+ IsActive="Whether the price book entry is active.",+ UseStandardPrice="Whether this entry uses the standard price.",+ CurrencyIsoCode="ISO currency code for the unit price.",+ ),+ },+ "Order": {+ "description": "An agreement between a company and an account to provision products or services.",+ "docs_url": "https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_order.htm",+ "columns": _columns(+ OrderNumber="Auto-generated reference number for the order.",+ AccountId="ID of the account the order is for.",+ Status="Status of the order (e.g. Draft, Activated).",+ EffectiveDate="Date the order takes effect.",+ EndDate="Date the order ends.",+ TotalAmount="Total amount of all order products.",+ Type="Type of order.",+ OwnerId="ID of the user who owns the order.",+ Pricebook2Id="ID of the price book associated with the order.",+ OpportunityId="ID of the opportunity the order originated from, if any.",+ ),+ },+ "Event": {+ "description": "A calendar event, such as a meeting or call, logged against a record.",+ "docs_url": "https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_event.htm",+ "columns": _columns(+ Subject="Subject line of the event.",+ StartDateTime="Date and time the event starts.",+ EndDateTime="Date and time the event ends.",+ ActivityDate="Due date of the event.",+ Location="Location of the event.",+ OwnerId="ID of the user who owns the event.",+ WhoId="ID of the contact or lead associated with the event.",+ WhatId="ID of the related record (e.g. account or opportunity) for the event.",+ IsAllDayEvent="Whether the event lasts all day.",+ Description="Description or notes for the event.",+ ),+ },+ "Task": {+ "description": "A to-do item, such as a call or follow-up, logged against a record.",+ "docs_url": "https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_task.htm",+ "columns": _columns(+ Subject="Subject line of the task.",+ Status="Status of the task (e.g. Not Started, In Progress, Completed).",+ Priority="Priority of the task (e.g. High, Normal, Low).",+ ActivityDate="Due date of the task.",+ OwnerId="ID of the user the task is assigned to.",+ WhoId="ID of the contact or lead associated with the task.",+ WhatId="ID of the related record (e.g. account or opportunity) for the task.",+ IsClosed="Whether the task is in a closed state.",+ Description="Description or notes for the task.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/salesforce/source.py b/posthog/temporal/data_imports/sources/salesforce/source.pyindex b98ce5266c63..4c3656c9370c 100644--- a/posthog/temporal/data_imports/sources/salesforce/source.py+++ b/posthog/temporal/data_imports/sources/salesforce/source.py@@ -9,6 +9,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.mixins import OAuthMixinfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManager@@ -27,6 +28,11 @@ class SalesforceSource(ResumableSource[SalesforceSourceConfig, SalesforceResumeCdef source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.SALESFORCE+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.salesforce.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"invalid_session_id": "Your Salesforce session has expired. Please reconnect the source.",diff --git a/posthog/temporal/data_imports/sources/salesloft/canonical_descriptions.py b/posthog/temporal/data_imports/sources/salesloft/canonical_descriptions.pynew file mode 100644index 000000000000..61150a5571b2--- /dev/null+++ b/posthog/temporal/data_imports/sources/salesloft/canonical_descriptions.py@@ -0,0 +1,339 @@+"""Canonical, documentation-sourced descriptions for Salesloft endpoints and columns.++Sourced from the official Salesloft API reference (https://developers.salesloft.com/docs/api).+Keyed by the resource names in `settings.py` `SALESLOFT_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Salesloft table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by most Salesloft resources; merged into each entry so we don't repeat them.+_COMMON_COLUMNS = {+ "id": "Unique identifier for the object.",+ "created_at": "Time at which the object was created.",+ "updated_at": "Time at which the object was last updated.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "accounts": {+ "description": "A company or organization that people in Salesloft belong to.",+ "docs_url": "https://developers.salesloft.com/docs/api/accounts-index",+ "columns": _columns(+ name="Name of the account.",+ domain="Website domain of the account.",+ phone="Primary phone number of the account.",+ industry="Industry the account operates in.",+ company_type="Type of company.",+ owner="The user who owns the account.",+ account_tier="The tier assigned to the account.",+ account_stage="The stage the account is in.",+ archived_at="Time at which the account was archived, if archived.",+ ),+ },+ "account_stages": {+ "description": "A stage that an account can be assigned to, representing its position in a workflow.",+ "docs_url": "https://developers.salesloft.com/docs/api/account-stages-index",+ "columns": _columns(+ name="Name of the account stage.",+ order="Sort order of the stage.",+ ),+ },+ "account_tiers": {+ "description": "A tier used to classify the importance of accounts.",+ "docs_url": "https://developers.salesloft.com/docs/api/account-tiers-index",+ "columns": _columns(+ name="Name of the account tier.",+ order="Sort order of the tier.",+ active="Whether the tier is active.",+ ),+ },+ "actions": {+ "description": "A pending step in a cadence that a user needs to complete for a person.",+ "docs_url": "https://developers.salesloft.com/docs/api/actions-index",+ "columns": _columns(+ type="Type of action (e.g. email, phone, integration).",+ status="Status of the action (e.g. pending_action, completed).",+ due="Whether the action is currently due.",+ due_on="Date the action is due.",+ user="The user the action is assigned to.",+ person="The person the action relates to.",+ cadence="The cadence the action belongs to.",+ step="The cadence step the action corresponds to.",+ ),+ },+ "cadences": {+ "description": "A sequence of automated and manual outreach steps run against people.",+ "docs_url": "https://developers.salesloft.com/docs/api/cadences-index",+ "columns": _columns(+ name="Name of the cadence.",+ cadence_function="The function of the cadence (e.g. outbound, inbound).",+ team_cadence="Whether the cadence is shared across the team.",+ shared="Whether the cadence is shared.",+ archived="Whether the cadence is archived.",+ owner="The user who owns the cadence.",+ creator="The user who created the cadence.",+ ),+ },+ "cadence_memberships": {+ "description": "The relationship between a person and a cadence they are enrolled in.",+ "docs_url": "https://developers.salesloft.com/docs/api/cadence-memberships-index",+ "columns": _columns(+ person="The person enrolled in the cadence.",+ cadence="The cadence the person is enrolled in.",+ user="The user who added the person to the cadence.",+ current_state="Current state of the membership in the cadence.",+ added_at="Time at which the person was added to the cadence.",+ currently_on_cadence="Whether the person is currently active on the cadence.",+ ),+ },+ "call_data_records": {+ "description": "A record of a call's metadata, including duration and recording details.",+ "docs_url": "https://developers.salesloft.com/docs/api/call-data-records-index",+ "columns": _columns(+ direction="Direction of the call (inbound or outbound).",+ duration="Duration of the call in seconds.",+ recording="Information about the call recording.",+ to="The phone number that was called.",+ from_="The phone number the call came from.",+ user="The user who made or received the call.",+ person="The person the call was with.",+ called_person="The person who was called.",+ ),+ },+ "calls": {+ "description": "A logged phone call activity made through Salesloft.",+ "docs_url": "https://developers.salesloft.com/docs/api/activities-calls-index",+ "columns": _columns(+ user="The user who made the call.",+ person="The person who was called.",+ sentiment="The recorded sentiment of the call.",+ disposition="The disposition (outcome) of the call.",+ duration="Duration of the call in seconds.",+ crm_activity="The CRM activity logged for the call.",+ called_person="The person who was called.",+ ),+ },+ "call_dispositions": {+ "description": "A possible outcome that can be recorded for a call.",+ "docs_url": "https://developers.salesloft.com/docs/api/call-dispositions-index",+ "columns": {"name": "Name of the call disposition."},+ },+ "call_sentiments": {+ "description": "A possible sentiment that can be recorded for a call.",+ "docs_url": "https://developers.salesloft.com/docs/api/call-sentiments-index",+ "columns": {"name": "Name of the call sentiment."},+ },+ "crm_activities": {+ "description": "An activity synced to the connected CRM, such as a logged call or email.",+ "docs_url": "https://developers.salesloft.com/docs/api/crm-activities-index",+ "columns": _columns(+ subject="Subject of the CRM activity.",+ description="Description of the CRM activity.",+ activity_type="Type of the CRM activity.",+ user="The user associated with the activity.",+ person="The person the activity relates to.",+ crm_id="Identifier of the activity in the connected CRM.",+ ),+ },+ "crm_users": {+ "description": "A user record synced from the connected CRM.",+ "docs_url": "https://developers.salesloft.com/docs/api/crm-users-index",+ "columns": _columns(+ crm_id="Identifier of the user in the connected CRM.",+ user="The matching Salesloft user, if linked.",+ ),+ },+ "custom_fields": {+ "description": "A custom field definition that can be applied to people, companies, or opportunities.",+ "docs_url": "https://developers.salesloft.com/docs/api/custom-fields-index",+ "columns": _columns(+ name="Name of the custom field.",+ field_type="The type of object the custom field applies to.",+ ),+ },+ "emails": {+ "description": "A logged email activity sent through Salesloft.",+ "docs_url": "https://developers.salesloft.com/docs/api/activities-emails-index",+ "columns": _columns(+ user="The user who sent the email.",+ recipient="The person the email was sent to.",+ recipient_email_address="Email address the email was sent to.",+ mailing="The mailing the email belongs to.",+ subject="Subject line of the email.",+ status="Delivery status of the email.",+ bounced="Whether the email bounced.",+ send_after="Time after which the email is scheduled to send.",+ view_tracking="Whether open tracking is enabled for the email.",+ click_tracking="Whether click tracking is enabled for the email.",+ counts="Counts of views, clicks, and replies for the email.",+ ),+ },+ "email_templates": {+ "description": "A reusable email template used in cadences and one-off sends.",+ "docs_url": "https://developers.salesloft.com/docs/api/email-templates-index",+ "columns": _columns(+ title="Title of the email template.",+ subject="Default subject line of the template.",+ body_preview="Preview text of the template body.",+ archived_at="Time at which the template was archived, if archived.",+ shared="Whether the template is shared across the team.",+ open_tracking_enabled="Whether open tracking is enabled by default.",+ click_tracking_enabled="Whether click tracking is enabled by default.",+ counts="Aggregate sent, view, click, and reply counts for the template.",+ ),+ },+ "email_template_attachments": {+ "description": "A file attached to an email template.",+ "docs_url": "https://developers.salesloft.com/docs/api/email-template-attachments-index",+ "columns": {+ "id": "Unique identifier for the attachment.",+ "attachment_id": "Identifier of the underlying attachment.",+ "name": "File name of the attachment.",+ "download_url": "URL to download the attachment.",+ "email_template": "The email template the attachment belongs to.",+ },+ },+ "groups": {+ "description": "A group of users within the Salesloft team.",+ "docs_url": "https://developers.salesloft.com/docs/api/groups-index",+ "columns": {+ "id": "Unique identifier for the group.",+ "name": "Name of the group.",+ "parent_id": "ID of the parent group, if any.",+ },+ },+ "imports": {+ "description": "A batch import of people into Salesloft.",+ "docs_url": "https://developers.salesloft.com/docs/api/imports-index",+ "columns": _columns(+ name="Name of the import.",+ current_people_count="Current number of people associated with the import.",+ imported_people_count="Number of people imported in the batch.",+ ),+ },+ "meetings": {+ "description": "A scheduled meeting booked through Salesloft.",+ "docs_url": "https://developers.salesloft.com/docs/api/meetings-index",+ "columns": _columns(+ title="Title of the meeting.",+ start_time="Start time of the meeting.",+ end_time="End time of the meeting.",+ status="Status of the meeting (e.g. booked, canceled).",+ meeting_type="Type of the meeting.",+ person="The person the meeting is with.",+ owner="The user who owns the meeting.",+ booked_by_user="The user who booked the meeting.",+ location="Location of the meeting.",+ canceled_at="Time at which the meeting was canceled, if canceled.",+ ),+ },+ "notes": {+ "description": "A note recorded against a person or account.",+ "docs_url": "https://developers.salesloft.com/docs/api/notes-index",+ "columns": _columns(+ content="Text content of the note.",+ user="The user who created the note.",+ associated_type="Type of object the note is associated with.",+ associated_id="ID of the object the note is associated with.",+ ),+ },+ "people": {+ "description": "An individual contact tracked in Salesloft.",+ "docs_url": "https://developers.salesloft.com/docs/api/people-index",+ "columns": _columns(+ first_name="Person's first name.",+ last_name="Person's last name.",+ display_name="Person's display name.",+ email_address="Person's primary email address.",+ phone="Person's phone number.",+ title="Person's job title.",+ account="The account the person belongs to.",+ owner="The user who owns the person.",+ person_stage="The stage the person is in.",+ person_company_name="Name of the person's company.",+ do_not_contact="Whether the person is marked do-not-contact.",+ contact_restrictions="Any contact restrictions on the person.",+ ),+ },+ "person_stages": {+ "description": "A stage that a person can be assigned to, representing their lifecycle position.",+ "docs_url": "https://developers.salesloft.com/docs/api/person-stages-index",+ "columns": _columns(+ name="Name of the person stage.",+ order="Sort order of the stage.",+ ),+ },+ "phone_number_assignments": {+ "description": "The assignment of a phone number to a user for calling.",+ "docs_url": "https://developers.salesloft.com/docs/api/phone-number-assignments-index",+ "columns": {+ "id": "Unique identifier for the assignment.",+ "number": "The assigned phone number.",+ "user": "The user the phone number is assigned to.",+ },+ },+ "steps": {+ "description": "A single step within a cadence (an email, call, or other action).",+ "docs_url": "https://developers.salesloft.com/docs/api/steps-index",+ "columns": _columns(+ name="Name of the step.",+ type="Type of the step (e.g. email, phone, other).",+ step_number="Position of the step within its cadence day.",+ day="The cadence day the step falls on.",+ cadence="The cadence the step belongs to.",+ disabled="Whether the step is disabled.",+ ),+ },+ "successes": {+ "description": "A recorded success outcome for a person, such as a positive reply or meeting.",+ "docs_url": "https://developers.salesloft.com/docs/api/successes-index",+ "columns": _columns(+ person="The person the success is recorded for.",+ user="The user credited with the success.",+ succeeded_at="Time at which the success occurred.",+ ),+ },+ "team_templates": {+ "description": "An email template shared and managed at the team level.",+ "docs_url": "https://developers.salesloft.com/docs/api/team-templates-index",+ "columns": _columns(+ title="Title of the team template.",+ subject="Default subject line of the template.",+ body_preview="Preview text of the template body.",+ archived_at="Time at which the template was archived, if archived.",+ counts="Aggregate sent, view, click, and reply counts for the template.",+ ),+ },+ "team_template_attachments": {+ "description": "A file attached to a team template.",+ "docs_url": "https://developers.salesloft.com/docs/api/team-template-attachments-index",+ "columns": {+ "id": "Unique identifier for the attachment.",+ "attachment_id": "Identifier of the underlying attachment.",+ "name": "File name of the attachment.",+ "download_url": "URL to download the attachment.",+ "team_template": "The team template the attachment belongs to.",+ },+ },+ "users": {+ "description": "A Salesloft user account.",+ "docs_url": "https://developers.salesloft.com/docs/api/users-index",+ "columns": _columns(+ name="The user's full name.",+ first_name="The user's first name.",+ last_name="The user's last name.",+ email="The user's email address.",+ active="Whether the user account is active.",+ guid="Globally unique identifier for the user.",+ group="The group the user belongs to.",+ role="The user's role.",+ team_admin="Whether the user is a team admin.",+ phone_number_assignment="The phone number assigned to the user.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/salesloft/source.py b/posthog/temporal/data_imports/sources/salesloft/source.pyindex 3d725ee2a155..92a8b5d650af 100644--- a/posthog/temporal/data_imports/sources/salesloft/source.py+++ b/posthog/temporal/data_imports/sources/salesloft/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -31,6 +32,11 @@ class SalesLoftSource(ResumableSource[SalesLoftSourceConfig, SalesloftResumeConfdef source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.SALESLOFT+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.salesloft.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized for url": "Your Salesloft API key is invalid or expired. Please generate a new key and reconnect.",diff --git a/posthog/temporal/data_imports/sources/sendgrid/canonical_descriptions.py b/posthog/temporal/data_imports/sources/sendgrid/canonical_descriptions.pynew file mode 100644index 000000000000..e95d63d8bf07--- /dev/null+++ b/posthog/temporal/data_imports/sources/sendgrid/canonical_descriptions.py@@ -0,0 +1,83 @@+"""Canonical, documentation-sourced descriptions for SendGrid endpoints and columns.++Sourced from the official Twilio SendGrid v3 API reference+(https://www.twilio.com/docs/sendgrid/api-reference). Keyed by the schema names in `settings.py`+`SENDGRID_ENDPOINTS`, which match the `ExternalDataSchema.name` of a synced SendGrid table.+Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Shared shape of the suppression endpoints (bounces, blocks, invalid emails, spam reports).+_SUPPRESSION_COLUMNS = {+ "email": "The email address that was suppressed.",+ "created": "Time at which the suppression record was created, as a Unix timestamp.",+ "reason": "Reason the email was suppressed.",+ "status": "Status code associated with the suppression event.",+}++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "bounces": {+ "description": "Email addresses that bounced — the receiving server rejected the message.",+ "docs_url": "https://www.twilio.com/docs/sendgrid/api-reference/bounces-api/retrieve-all-bounces",+ "columns": dict(_SUPPRESSION_COLUMNS),+ },+ "blocks": {+ "description": "Email addresses blocked due to temporary delivery issues such as a full mailbox or server outage.",+ "docs_url": "https://www.twilio.com/docs/sendgrid/api-reference/blocks-api/retrieve-all-blocks",+ "columns": dict(_SUPPRESSION_COLUMNS),+ },+ "invalid_emails": {+ "description": "Email addresses that are invalid or malformed and cannot receive mail.",+ "docs_url": "https://www.twilio.com/docs/sendgrid/api-reference/invalid-e-mails-api/retrieve-all-invalid-emails",+ "columns": dict(_SUPPRESSION_COLUMNS),+ },+ "spam_reports": {+ "description": "Email addresses of recipients who marked your mail as spam.",+ "docs_url": "https://www.twilio.com/docs/sendgrid/api-reference/spam-reports-api/retrieve-all-spam-reports",+ "columns": {+ "email": "The email address that reported the message as spam.",+ "created": "Time at which the spam report was recorded, as a Unix timestamp.",+ "ip": "IP address the message was sent from.",+ },+ },+ "global_unsubscribes": {+ "description": "Email addresses on the global unsubscribe list, suppressed from all future mail.",+ "docs_url": "https://www.twilio.com/docs/sendgrid/api-reference/suppressions-global-suppressions/retrieve-all-global-suppressions",+ "columns": {+ "email": "The globally unsubscribed email address.",+ "created": "Time at which the address was added to the global unsubscribe list, as a Unix timestamp.",+ },+ },+ "unsubscribe_groups": {+ "description": "Suppression (unsubscribe) groups used to let recipients opt out of specific categories of mail.",+ "docs_url": "https://www.twilio.com/docs/sendgrid/api-reference/suppressions-unsubscribe-groups/retrieve-all-suppression-groups-associated-with-the-user",+ "columns": {+ "id": "Unique identifier for the unsubscribe group.",+ "name": "Name of the unsubscribe group.",+ "description": "Description of the unsubscribe group.",+ "is_default": "Whether this is the default unsubscribe group.",+ "unsubscribes": "Number of unsubscribes recorded against this group.",+ },+ },+ "marketing_lists": {+ "description": "Marketing contact lists used to segment recipients for campaigns.",+ "docs_url": "https://www.twilio.com/docs/sendgrid/api-reference/lists/get-all-lists",+ "columns": {+ "id": "Unique identifier for the list.",+ "name": "Name of the list.",+ "contact_count": "Number of contacts on the list.",+ },+ },+ "templates": {+ "description": "Email templates (legacy and dynamic) used to compose messages.",+ "docs_url": "https://www.twilio.com/docs/sendgrid/api-reference/transactional-templates/retrieve-paged-transactional-templates",+ "columns": {+ "id": "Unique identifier for the template.",+ "name": "Name of the template.",+ "generation": "Template generation: legacy or dynamic.",+ "updated_at": "Time at which the template was last updated.",+ "versions": "List of versions belonging to the template.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/sendgrid/source.py b/posthog/temporal/data_imports/sources/sendgrid/source.pyindex 4a8883c8ef34..089b716a8d04 100644--- a/posthog/temporal/data_imports/sources/sendgrid/source.py+++ b/posthog/temporal/data_imports/sources/sendgrid/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -31,6 +32,11 @@ class SendGridSource(ResumableSource[SendGridSourceConfig, SendGridResumeConfig]def source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.SENDGRID+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.sendgrid.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized for url: https://api.sendgrid.com": "Your SendGrid API key is invalid or expired. Please generate a new key and reconnect.",diff --git a/posthog/temporal/data_imports/sources/sentry/canonical_descriptions.py b/posthog/temporal/data_imports/sources/sentry/canonical_descriptions.pynew file mode 100644index 000000000000..ceb9167aacf4--- /dev/null+++ b/posthog/temporal/data_imports/sources/sentry/canonical_descriptions.py@@ -0,0 +1,192 @@+"""Canonical, documentation-sourced descriptions for Sentry endpoints and columns.++Sourced from the official Sentry API reference (https://docs.sentry.io/api/). Keyed by the+endpoint names in `settings.py` `SENTRY_ENDPOINTS`, which match the `ExternalDataSchema.name`+of a synced Sentry table. Fanout endpoints add the parent's renamed key columns (e.g. `project_id`,+`issue_id`). Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "projects": {+ "description": "A Sentry project that error and performance events are reported to.",+ "docs_url": "https://docs.sentry.io/api/projects/list-your-organizations-projects/",+ "columns": {+ "id": "Unique identifier for the project.",+ "slug": "URL-friendly short name of the project.",+ "name": "Display name of the project.",+ "platform": "Platform the project monitors (e.g. python, javascript).",+ "dateCreated": "Time at which the project was created.",+ "isPublic": "Whether the project is public.",+ "status": "Status of the project (e.g. active, deleted).",+ "team": "The team that owns the project.",+ },+ },+ "teams": {+ "description": "A team within the Sentry organization that owns projects.",+ "docs_url": "https://docs.sentry.io/api/teams/list-an-organizations-teams/",+ "columns": {+ "id": "Unique identifier for the team.",+ "slug": "URL-friendly short name of the team.",+ "name": "Display name of the team.",+ "dateCreated": "Time at which the team was created.",+ "memberCount": "Number of members on the team.",+ },+ },+ "members": {+ "description": "A member of the Sentry organization.",+ "docs_url": "https://docs.sentry.io/api/organizations/list-an-organizations-members/",+ "columns": {+ "id": "Unique identifier for the member.",+ "email": "Email address of the member.",+ "name": "Name of the member.",+ "role": "Organization role of the member (e.g. owner, member).",+ "dateCreated": "Time at which the member was added to the organization.",+ "pending": "Whether the member's invitation is still pending.",+ },+ },+ "releases": {+ "description": "A release tracked in Sentry, used to associate errors with deployed code versions.",+ "docs_url": "https://docs.sentry.io/api/releases/list-an-organizations-releases/",+ "columns": {+ "version": "The release version identifier.",+ "shortVersion": "Shortened, human-readable version identifier.",+ "dateCreated": "Time at which the release was created.",+ "dateReleased": "Time at which the release was deployed.",+ "ref": "VCS reference (e.g. commit) the release points to.",+ "url": "URL associated with the release.",+ "projects": "Projects the release is associated with.",+ },+ },+ "environments": {+ "description": "An environment (e.g. production, staging) that events are tagged with.",+ "docs_url": "https://docs.sentry.io/api/environments/list-an-organizations-environments/",+ "columns": {+ "id": "Unique identifier for the environment.",+ "name": "Name of the environment.",+ },+ },+ "monitors": {+ "description": "A cron monitor that tracks the health of scheduled jobs.",+ "docs_url": "https://docs.sentry.io/api/crons/retrieve-monitors-for-an-organization/",+ "columns": {+ "id": "Unique identifier for the monitor.",+ "slug": "URL-friendly short name of the monitor.",+ "name": "Display name of the monitor.",+ "status": "Status of the monitor (e.g. active, disabled).",+ "dateCreated": "Time at which the monitor was created.",+ "config": "Schedule and check-in configuration for the monitor.",+ },+ },+ "issues": {+ "description": "A group of similar error events aggregated into a single issue.",+ "docs_url": "https://docs.sentry.io/api/events/list-a-projects-issues/",+ "columns": {+ "id": "Unique identifier for the issue.",+ "shortId": "Human-readable short identifier for the issue.",+ "title": "Title of the issue.",+ "culprit": "Code location or transaction blamed for the issue.",+ "level": "Severity level of the issue (e.g. error, warning).",+ "status": "Status of the issue (e.g. unresolved, resolved, ignored).",+ "count": "Total number of events in the issue.",+ "userCount": "Number of distinct users affected by the issue.",+ "firstSeen": "Time at which the issue was first observed.",+ "lastSeen": "Time at which the issue was most recently observed.",+ "permalink": "Permanent URL to the issue in Sentry.",+ "project": "The project the issue belongs to.",+ },+ },+ "project_events": {+ "description": "Individual error events captured for a project.",+ "docs_url": "https://docs.sentry.io/api/events/list-a-projects-events/",+ "columns": {+ "id": "Unique identifier for the event.",+ "eventID": "The event's identifier.",+ "event_id": "Renamed primary key for the event.",+ "project_id": "ID of the project the event belongs to (from the parent project).",+ "project_slug": "Slug of the project the event belongs to (from the parent project).",+ "title": "Title of the event.",+ "message": "Message associated with the event.",+ "platform": "Platform the event originated from.",+ "dateCreated": "Time at which the event was created.",+ "user": "Information about the user affected by the event.",+ "tags": "Key-value tags attached to the event.",+ },+ },+ "project_users": {+ "description": "Users seen in events for a project.",+ "docs_url": "https://docs.sentry.io/api/projects/list-a-projects-users/",+ "columns": {+ "id": "Unique identifier for the project user.",+ "project_id": "ID of the project the user was seen in (from the parent project).",+ "email": "Email address of the user.",+ "username": "Username of the user.",+ "name": "Name of the user.",+ "ipAddress": "IP address associated with the user.",+ },+ },+ "project_client_keys": {+ "description": "Client (DSN) keys that authenticate event submission to a project.",+ "docs_url": "https://docs.sentry.io/api/projects/list-a-projects-client-keys/",+ "columns": {+ "id": "Unique identifier for the client key.",+ "project_id": "ID of the project the key belongs to (from the parent project).",+ "name": "Name of the client key.",+ "public": "The public portion of the key.",+ "isActive": "Whether the key is active.",+ "dateCreated": "Time at which the key was created.",+ "dsn": "The DSN values (public, secret) for the key.",+ },+ },+ "project_service_hooks": {+ "description": "Service hooks that send a project's events to external services.",+ "docs_url": "https://docs.sentry.io/api/projects/list-a-projects-service-hooks/",+ "columns": {+ "id": "Unique identifier for the service hook.",+ "project_id": "ID of the project the hook belongs to (from the parent project).",+ "url": "URL the hook delivers events to.",+ "status": "Status of the service hook.",+ "events": "Event types the hook is subscribed to.",+ "dateCreated": "Time at which the hook was created.",+ },+ },+ "issue_events": {+ "description": "Individual error events belonging to a specific issue.",+ "docs_url": "https://docs.sentry.io/api/events/list-an-issues-events/",+ "columns": {+ "id": "Unique identifier for the event.",+ "eventID": "The event's identifier.",+ "event_id": "Renamed primary key for the event.",+ "issue_id": "ID of the issue the event belongs to (from the parent issue).",+ "title": "Title of the event.",+ "message": "Message associated with the event.",+ "platform": "Platform the event originated from.",+ "dateCreated": "Time at which the event was created.",+ "user": "Information about the user affected by the event.",+ "tags": "Key-value tags attached to the event.",+ },+ },+ "issue_hashes": {+ "description": "Grouping hashes that determine which events are bucketed into an issue.",+ "docs_url": "https://docs.sentry.io/api/events/list-an-issues-hashes/",+ "columns": {+ "id": "The grouping hash value.",+ "issue_id": "ID of the issue the hash belongs to (from the parent issue).",+ "latestEvent": "The most recent event matching this hash.",+ },+ },+ "issue_tag_values": {+ "description": "The distinct values of a tag observed across an issue's events, with counts.",+ "docs_url": "https://docs.sentry.io/api/events/list-a-tags-values-related-to-an-issue/",+ "columns": {+ "issue_id": "ID of the issue the tag value belongs to (from the parent issue).",+ "tag_key": "The tag key these values belong to.",+ "value": "The tag value.",+ "name": "Human-readable name of the tag value.",+ "count": "Number of events with this tag value.",+ "firstSeen": "Time at which this tag value was first observed.",+ "lastSeen": "Time at which this tag value was most recently observed.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/sentry/source.py b/posthog/temporal/data_imports/sources/sentry/source.pyindex 1c33be9f6568..e8cb6a1ab682 100644--- a/posthog/temporal/data_imports/sources/sentry/source.py+++ b/posthog/temporal/data_imports/sources/sentry/source.py@@ -13,6 +13,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -90,6 +91,11 @@ class SentrySource(ResumableSource[SentrySourceConfig, SentryResumeConfig]):releaseStatus=ReleaseStatus.GA,)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.sentry.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error": "Invalid Sentry auth token. Please update your token and reconnect.",diff --git a/posthog/temporal/data_imports/sources/servicenow/canonical_descriptions.py b/posthog/temporal/data_imports/sources/servicenow/canonical_descriptions.pynew file mode 100644index 000000000000..4f93a0e9059a--- /dev/null+++ b/posthog/temporal/data_imports/sources/servicenow/canonical_descriptions.py@@ -0,0 +1,210 @@+"""Canonical, documentation-sourced descriptions for ServiceNow streams and columns.++Sourced from the official ServiceNow product documentation for the ITSM tables exposed via the+Table API (https://docs.servicenow.com/). Keyed by the friendly stream names in `settings.py`+`SERVICENOW_ENDPOINTS`, which match the `ExternalDataSchema.name` of a synced ServiceNow table.+Each maps to a canonical ServiceNow table (e.g. `incidents` -> `incident`). Columns absent here+fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Audit and base-task fields present on every ServiceNow record; merged into each entry.+_COMMON_COLUMNS = {+ "sys_id": "Unique 32-character identifier for the record.",+ "sys_created_on": "Date and time the record was created.",+ "sys_created_by": "User who created the record.",+ "sys_updated_on": "Date and time the record was last updated.",+ "sys_updated_by": "User who last updated the record.",+ "sys_mod_count": "Number of times the record has been updated.",+}++# Fields common to all task-derived tables (incident, problem, change_request, sc_task, etc.).+_TASK_COLUMNS = {+ "number": "Human-readable reference number for the record (e.g. INC0010001).",+ "short_description": "Brief summary of the record.",+ "description": "Detailed description of the record.",+ "state": "Current state of the record (e.g. New, In Progress, Closed).",+ "priority": "Priority of the record.",+ "urgency": "Urgency of the record.",+ "impact": "Impact of the record.",+ "assigned_to": "User the record is assigned to.",+ "assignment_group": "Group the record is assigned to.",+ "opened_by": "User who opened the record.",+ "opened_at": "Date and time the record was opened.",+ "closed_by": "User who closed the record.",+ "closed_at": "Date and time the record was closed.",+}+++def _task_columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **_TASK_COLUMNS, **overrides}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "incidents": {+ "description": "An unplanned interruption or reduction in quality of an IT service (ServiceNow `incident` table).",+ "docs_url": "https://docs.servicenow.com/bundle/utah-it-service-management/page/product/incident-management/concept/c_IncidentManagement.html",+ "columns": _task_columns(+ caller_id="User who reported the incident.",+ category="Category of the incident.",+ subcategory="Subcategory of the incident.",+ severity="Severity of the incident.",+ resolved_at="Date and time the incident was resolved.",+ resolved_by="User who resolved the incident.",+ close_code="Resolution code applied when closing the incident.",+ close_notes="Notes recorded when the incident was closed.",+ cmdb_ci="Configuration item affected by the incident.",+ ),+ },+ "problems": {+ "description": "The underlying cause of one or more incidents (ServiceNow `problem` table).",+ "docs_url": "https://docs.servicenow.com/bundle/utah-it-service-management/page/product/problem-management/concept/c_ProblemManagement.html",+ "columns": _task_columns(+ category="Category of the problem.",+ known_error="Whether the problem is a known error.",+ workaround="Documented workaround for the problem.",+ cause_notes="Notes describing the root cause of the problem.",+ cmdb_ci="Configuration item affected by the problem.",+ ),+ },+ "change_requests": {+ "description": "A request to add, modify, or remove anything that could affect IT services (ServiceNow `change_request` table).",+ "docs_url": "https://docs.servicenow.com/bundle/utah-it-service-management/page/product/change-management/concept/c_ITILChangeManagement.html",+ "columns": _task_columns(+ type="Type of change (e.g. standard, normal, emergency).",+ risk="Assessed risk of the change.",+ category="Category of the change.",+ start_date="Planned start date of the change.",+ end_date="Planned end date of the change.",+ requested_by="User who requested the change.",+ cmdb_ci="Configuration item affected by the change.",+ approval="Approval status of the change.",+ ),+ },+ "change_tasks": {+ "description": "A task carried out as part of a change request (ServiceNow `change_task` table).",+ "docs_url": "https://docs.servicenow.com/bundle/utah-it-service-management/page/product/change-management/concept/c_ChangeTasks.html",+ "columns": _task_columns(+ change_request="The change request this task belongs to.",+ change_task_type="Type of change task.",+ planned_start_date="Planned start date of the task.",+ planned_end_date="Planned end date of the task.",+ ),+ },+ "tasks": {+ "description": "The base task record that all task-based tables extend (ServiceNow `task` table).",+ "docs_url": "https://docs.servicenow.com/bundle/utah-platform-administration/page/administer/task-tables/concept/c_TaskTables.html",+ "columns": _task_columns(),+ },+ "catalog_requests": {+ "description": "A request for one or more catalog items, submitted through the service catalog (ServiceNow `sc_request` table).",+ "docs_url": "https://docs.servicenow.com/bundle/utah-servicenow-platform/page/product/service-catalog-management/concept/c_RequestManagement.html",+ "columns": _task_columns(+ requested_for="User the request was submitted for.",+ request_state="State of the overall request.",+ approval="Approval status of the request.",+ price="Total price of the request.",+ ),+ },+ "requested_items": {+ "description": "An individual catalog item within a catalog request (ServiceNow `sc_req_item` table).",+ "docs_url": "https://docs.servicenow.com/bundle/utah-servicenow-platform/page/product/service-catalog-management/concept/c_RequestedItems.html",+ "columns": _task_columns(+ request="The parent catalog request this item belongs to.",+ cat_item="The catalog item that was requested.",+ quantity="Quantity of the item requested.",+ price="Unit price of the requested item.",+ stage="Fulfillment stage of the requested item.",+ ),+ },+ "catalog_tasks": {+ "description": "A fulfillment task for a requested catalog item (ServiceNow `sc_task` table).",+ "docs_url": "https://docs.servicenow.com/bundle/utah-servicenow-platform/page/product/service-catalog-management/concept/c_CatalogTask.html",+ "columns": _task_columns(+ request="The catalog request this task belongs to.",+ request_item="The requested item this task fulfills.",+ ),+ },+ "users": {+ "description": "A user account in the ServiceNow instance (ServiceNow `sys_user` table).",+ "docs_url": "https://docs.servicenow.com/bundle/utah-platform-administration/page/administer/users-and-groups/concept/c_UserAdministration.html",+ "columns": _columns(+ user_name="The user's login name.",+ name="The user's full name.",+ first_name="The user's first name.",+ last_name="The user's last name.",+ email="The user's email address.",+ active="Whether the user account is active.",+ title="The user's job title.",+ department="The user's department.",+ manager="The user's manager.",+ phone="The user's phone number.",+ location="The user's location.",+ ),+ },+ "user_groups": {+ "description": "A group of users, used for assignment and notifications (ServiceNow `sys_user_group` table).",+ "docs_url": "https://docs.servicenow.com/bundle/utah-platform-administration/page/administer/users-and-groups/concept/c_Groups.html",+ "columns": _columns(+ name="Name of the group.",+ description="Description of the group.",+ active="Whether the group is active.",+ manager="User who manages the group.",+ parent="Parent group, if part of a hierarchy.",+ type="Type of the group.",+ email="Email address associated with the group.",+ ),+ },+ "configuration_items": {+ "description": "A configuration item (CI) in the CMDB representing a managed asset or service (ServiceNow `cmdb_ci` table).",+ "docs_url": "https://docs.servicenow.com/bundle/utah-servicenow-platform/page/product/configuration-management/concept/c_ConfigurationManagementCMDB.html",+ "columns": _columns(+ name="Name of the configuration item.",+ asset_tag="Asset tag of the configuration item.",+ serial_number="Serial number of the configuration item.",+ model_id="Model of the configuration item.",+ manufacturer="Manufacturer of the configuration item.",+ install_status="Installation status of the configuration item.",+ assigned_to="User the configuration item is assigned to.",+ location="Location of the configuration item.",+ category="Category of the configuration item.",+ operational_status="Operational status of the configuration item.",+ ),+ },+ "knowledge_articles": {+ "description": "A knowledge base article (ServiceNow `kb_knowledge` table).",+ "docs_url": "https://docs.servicenow.com/bundle/utah-servicenow-platform/page/product/knowledge-management/concept/c_KnowledgeManagement.html",+ "columns": _columns(+ number="Reference number of the article.",+ short_description="Title or short description of the article.",+ text="Body text of the article.",+ kb_knowledge_base="The knowledge base the article belongs to.",+ kb_category="Category of the article.",+ workflow_state="Workflow state of the article (e.g. draft, published).",+ author="Author of the article.",+ published="Date the article was published.",+ valid_to="Date the article expires.",+ ),+ },+ "assets": {+ "description": "An asset tracked in asset management (ServiceNow `alm_asset` table).",+ "docs_url": "https://docs.servicenow.com/bundle/utah-it-asset-management/page/product/asset-management/concept/c_AssetManagement.html",+ "columns": _columns(+ asset_tag="Asset tag of the asset.",+ display_name="Display name of the asset.",+ serial_number="Serial number of the asset.",+ model="Model of the asset.",+ model_category="Model category of the asset.",+ install_status="Installation status of the asset.",+ assigned_to="User the asset is assigned to.",+ cost="Cost of the asset.",+ quantity="Quantity of the asset.",+ location="Location of the asset.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/servicenow/source.py b/posthog/temporal/data_imports/sources/servicenow/source.pyindex 4d2803acfbe7..c14e2d60d6ca 100644--- a/posthog/temporal/data_imports/sources/servicenow/source.py+++ b/posthog/temporal/data_imports/sources/servicenow/source.py@@ -13,6 +13,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -117,6 +118,11 @@ The account or API key needs **read** access (the `rest_api_explorer` role or eq),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.servicenow.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error": "Invalid ServiceNow credentials. Please update your credentials and reconnect.",diff --git a/posthog/temporal/data_imports/sources/shipstation/canonical_descriptions.py b/posthog/temporal/data_imports/sources/shipstation/canonical_descriptions.pynew file mode 100644index 000000000000..00a8803ea75b--- /dev/null+++ b/posthog/temporal/data_imports/sources/shipstation/canonical_descriptions.py@@ -0,0 +1,124 @@+"""Canonical, documentation-sourced descriptions for ShipStation endpoints and columns.++Sourced from the official ShipStation v1 API reference (https://www.shipstation.com/docs/api/).+Keyed by the resource names in `settings.py` `SHIPSTATION_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced ShipStation table. Note: ShipStation v1 returns all DateTime+values in US Pacific time, not UTC. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "orders": {+ "description": "A customer order imported from a connected selling channel and managed in ShipStation.",+ "docs_url": "https://www.shipstation.com/docs/api/orders/list-orders/",+ "columns": {+ "orderId": "Unique system-generated identifier for the order.",+ "orderNumber": "User-facing order number from the selling channel.",+ "orderKey": "Unique key used to reference the order across systems.",+ "orderStatus": "Status of the order (e.g. awaiting_shipment, shipped, cancelled).",+ "orderDate": "Date the order was placed.",+ "createDate": "Date the order was created in ShipStation.",+ "modifyDate": "Date the order was last modified in ShipStation.",+ "shipDate": "Date the order was shipped.",+ "customerId": "ID of the customer who placed the order.",+ "customerEmail": "Email address of the customer.",+ "orderTotal": "Total monetary value of the order.",+ "amountPaid": "Amount the customer has paid for the order.",+ "shippingAmount": "Shipping amount charged for the order.",+ "storeId": "ID of the store (selling channel) the order came from.",+ "billTo": "Billing address for the order.",+ "shipTo": "Shipping address for the order.",+ "items": "Line items included in the order.",+ },+ },+ "shipments": {+ "description": "A shipment created in ShipStation for an order, including tracking and cost details.",+ "docs_url": "https://www.shipstation.com/docs/api/shipments/list/",+ "columns": {+ "shipmentId": "Unique identifier for the shipment.",+ "orderId": "ID of the order this shipment fulfills.",+ "orderNumber": "Order number associated with the shipment.",+ "createDate": "Date the shipment was created.",+ "shipDate": "Date the shipment was shipped.",+ "trackingNumber": "Carrier tracking number for the shipment.",+ "carrierCode": "Code identifying the shipping carrier.",+ "serviceCode": "Code identifying the shipping service used.",+ "shipmentCost": "Cost of the shipment.",+ "voided": "Whether the shipment label was voided.",+ "customerEmail": "Email address of the customer.",+ "shipTo": "Destination shipping address.",+ "weight": "Weight of the shipment.",+ },+ },+ "fulfillments": {+ "description": "A fulfillment record for an order shipped outside ShipStation (e.g. by a third party).",+ "docs_url": "https://www.shipstation.com/docs/api/fulfillments/list/",+ "columns": {+ "fulfillmentId": "Unique identifier for the fulfillment.",+ "orderId": "ID of the order this fulfillment relates to.",+ "orderNumber": "Order number associated with the fulfillment.",+ "createDate": "Date the fulfillment was created.",+ "shipDate": "Date the fulfillment was shipped.",+ "trackingNumber": "Carrier tracking number for the fulfillment.",+ "carrierCode": "Code identifying the shipping carrier.",+ "fulfillmentProviderCode": "Code identifying the fulfillment provider.",+ "voided": "Whether the fulfillment was voided.",+ "customerEmail": "Email address of the customer.",+ "shipTo": "Destination shipping address.",+ },+ },+ "products": {+ "description": "A product in the ShipStation catalog, used on order line items.",+ "docs_url": "https://www.shipstation.com/docs/api/products/list/",+ "columns": {+ "productId": "Unique identifier for the product.",+ "sku": "Stock keeping unit identifying the product.",+ "name": "Name of the product.",+ "price": "Price of the product.",+ "weightOz": "Weight of the product in ounces.",+ "active": "Whether the product is active.",+ "createDate": "Date the product was created.",+ "modifyDate": "Date the product was last modified.",+ },+ },+ "customers": {+ "description": "A customer record aggregated from orders in ShipStation.",+ "docs_url": "https://www.shipstation.com/docs/api/customers/list/",+ "columns": {+ "customerId": "Unique identifier for the customer.",+ "name": "Name of the customer.",+ "email": "Email address of the customer.",+ "addressVerified": "Whether the customer's address has been verified.",+ "createDate": "Date the customer record was created.",+ "modifyDate": "Date the customer record was last modified.",+ "city": "City portion of the customer's address.",+ "countryCode": "Country code of the customer's address.",+ },+ },+ "stores": {+ "description": "A connected selling channel (store) that orders are imported from.",+ "docs_url": "https://www.shipstation.com/docs/api/stores/list/",+ "columns": {+ "storeId": "Unique identifier for the store.",+ "storeName": "Name of the store.",+ "marketplaceId": "ID of the marketplace the store belongs to.",+ "marketplaceName": "Name of the marketplace the store belongs to.",+ "active": "Whether the store is active.",+ "createDate": "Date the store connection was created.",+ "modifyDate": "Date the store connection was last modified.",+ },+ },+ "warehouses": {+ "description": "A ship-from location (warehouse) configured in ShipStation.",+ "docs_url": "https://www.shipstation.com/docs/api/warehouses/list/",+ "columns": {+ "warehouseId": "Unique identifier for the warehouse.",+ "warehouseName": "Name of the warehouse.",+ "originAddress": "Origin (ship-from) address of the warehouse.",+ "returnAddress": "Return address associated with the warehouse.",+ "isDefault": "Whether this is the default warehouse.",+ "createDate": "Date the warehouse was created.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/shipstation/source.py b/posthog/temporal/data_imports/sources/shipstation/source.pyindex 1e1881edb9b6..b01779dcdef3 100644--- a/posthog/temporal/data_imports/sources/shipstation/source.py+++ b/posthog/temporal/data_imports/sources/shipstation/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -31,6 +32,11 @@ class ShipStationSource(ResumableSource[ShipStationSourceConfig, ShipStationResudef source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.SHIPSTATION+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.shipstation.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized for url: https://ssapi.shipstation.com": "ShipStation authentication failed. Please check your API key and API secret.",diff --git a/posthog/temporal/data_imports/sources/shopify/canonical_descriptions.py b/posthog/temporal/data_imports/sources/shopify/canonical_descriptions.pynew file mode 100644index 000000000000..cb62e4c30fde--- /dev/null+++ b/posthog/temporal/data_imports/sources/shopify/canonical_descriptions.py@@ -0,0 +1,149 @@+"""Canonical, documentation-sourced descriptions for Shopify endpoints and columns.++Sourced from the official Shopify Admin GraphQL API reference (https://shopify.dev/docs/api/admin-graphql).+Keyed by the schema names that `get_schemas` returns (the GraphQL object's `display_name or name`+from `constants.py` `SHOPIFY_GRAPHQL_OBJECTS`), which match the `ExternalDataSchema.name` of a synced+Shopify table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by most Shopify GraphQL objects; merged into each entry so we don't repeat them.+_COMMON_COLUMNS = {+ "id": "Globally unique identifier for the object (a Shopify GraphQL GID).",+ "created_at": "Date and time when the object was created.",+ "updated_at": "Date and time when the object was last updated.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "abandonedCheckouts": {+ "description": "A checkout a customer started but did not complete, leaving items in their cart.",+ "docs_url": "https://shopify.dev/docs/api/admin-graphql/latest/objects/AbandonedCheckout",+ "columns": _columns(+ abandonedCheckoutUrl="URL the customer can use to recover and complete the abandoned checkout.",+ totalPriceSet="Total price of the checkout, in shop and presentment currencies.",+ subtotalPriceSet="Subtotal of the line items before taxes and shipping.",+ totalTaxSet="Total tax charged on the checkout.",+ lineItems="The products and quantities the customer added to the abandoned checkout.",+ customer="The customer associated with the abandoned checkout.",+ completedAt="Date and time when the checkout was completed, if it ever was.",+ ),+ },+ "articles": {+ "description": "A blog post (article) published to one of the shop's online store blogs.",+ "docs_url": "https://shopify.dev/docs/api/admin-graphql/latest/objects/Article",+ "columns": _columns(+ title="The article's title.",+ handle="URL-friendly unique handle for the article.",+ body="The article's content, in HTML.",+ summary="Short summary of the article.",+ author="The author of the article.",+ blog="The blog the article belongs to.",+ tags="List of tags applied to the article.",+ isPublished="Whether the article is visible on the online store.",+ publishedAt="Date and time when the article was published.",+ ),+ },+ "blogs": {+ "description": "A blog on the shop's online store that groups together articles.",+ "docs_url": "https://shopify.dev/docs/api/admin-graphql/latest/objects/Blog",+ "columns": _columns(+ title="The blog's title.",+ handle="URL-friendly unique handle for the blog.",+ tags="List of tags used across the blog's articles.",+ ),+ },+ "catalogs": {+ "description": "A catalog that maps a set of products and prices to a market, company location, or app.",+ "docs_url": "https://shopify.dev/docs/api/admin-graphql/latest/interfaces/Catalog",+ "columns": _columns(+ title="The catalog's title.",+ status="Status of the catalog (e.g. ACTIVE, ARCHIVED, DRAFT).",+ priceList="The price list associated with the catalog.",+ ),+ },+ "collections": {+ "description": "A grouping of products that can be displayed and merchandised together in the store.",+ "docs_url": "https://shopify.dev/docs/api/admin-graphql/latest/objects/Collection",+ "columns": _columns(+ title="The collection's title.",+ handle="URL-friendly unique handle for the collection.",+ description="The collection's description, as plain text.",+ descriptionHtml="The collection's description, in HTML.",+ productsCount="Number of products in the collection.",+ sortOrder="The order in which products in the collection are displayed.",+ updatedAt="Date and time when the collection was last modified.",+ ),+ },+ "customers": {+ "description": "A customer of the shop, holding contact details and order history.",+ "docs_url": "https://shopify.dev/docs/api/admin-graphql/latest/objects/Customer",+ "columns": _columns(+ firstName="The customer's first name.",+ lastName="The customer's last name.",+ displayName="The customer's full name, formatted for display.",+ email="The customer's email address.",+ phone="The customer's phone number, in E.164 format.",+ numberOfOrders="Number of orders the customer has placed.",+ amountSpent="Total amount the customer has spent across all orders.",+ state="The customer's account state (e.g. ENABLED, DISABLED, INVITED, DECLINED).",+ verifiedEmail="Whether the customer has verified their email address.",+ tags="List of tags applied to the customer.",+ defaultAddress="The customer's default mailing address.",+ note="Free-form note attached to the customer.",+ ),+ },+ "discountCodes": {+ "description": "A discount and its application rules — a code or automatic discount applied at checkout.",+ "docs_url": "https://shopify.dev/docs/api/admin-graphql/latest/objects/DiscountNode",+ "columns": _columns(+ discount="The underlying discount object, with its type, value, and eligibility rules.",+ ),+ },+ "orders": {+ "description": "A customer's completed request to purchase one or more products from the shop.",+ "docs_url": "https://shopify.dev/docs/api/admin-graphql/latest/objects/Order",+ "columns": _columns(+ name="The order's identifier, shown to the merchant and customer (e.g. #1001).",+ email="Email address associated with the order.",+ phone="Phone number associated with the order.",+ customer="The customer who placed the order.",+ displayFinancialStatus="Financial status of the order (e.g. PAID, PENDING, REFUNDED, VOIDED).",+ displayFulfillmentStatus="Fulfillment status of the order (e.g. FULFILLED, UNFULFILLED, PARTIALLY_FULFILLED).",+ currentTotalPriceSet="Current total price of the order, in shop and presentment currencies.",+ totalPriceSet="Total price of the order at the time it was placed.",+ subtotalPriceSet="Sum of line item prices before taxes, shipping, and discounts.",+ totalTaxSet="Total tax charged on the order.",+ totalDiscountsSet="Total value of discounts applied to the order.",+ lineItems="The products and quantities purchased in the order.",+ shippingAddress="The address the order is shipped to.",+ billingAddress="The address used for billing.",+ cancelledAt="Date and time when the order was cancelled, if it was.",+ cancelReason="Reason the order was cancelled, if applicable.",+ test="Whether the order is a test order.",+ tags="List of tags applied to the order.",+ ),+ },+ "products": {+ "description": "A product the shop sells, grouping its variants, media, and selling details.",+ "docs_url": "https://shopify.dev/docs/api/admin-graphql/latest/objects/Product",+ "columns": _columns(+ title="The product's title.",+ handle="URL-friendly unique handle for the product.",+ description="The product's description, as plain text.",+ descriptionHtml="The product's description, in HTML.",+ productType="The merchant-defined type of the product.",+ vendor="The product's vendor.",+ status="The product's status (ACTIVE, ARCHIVED, or DRAFT).",+ tags="List of tags applied to the product.",+ totalInventory="Total quantity of the product in stock across all variants.",+ variants="The product's variants (combinations of options like size and color).",+ publishedAt="Date and time when the product was published to the online store.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/shopify/source.py b/posthog/temporal/data_imports/sources/shopify/source.pyindex fbbc335f2b9c..39eb066ff0b6 100644--- a/posthog/temporal/data_imports/sources/shopify/source.py+++ b/posthog/temporal/data_imports/sources/shopify/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -37,6 +38,11 @@ class ShopifySource(ResumableSource[ShopifySourceConfig, ShopifyResumeConfig]):def source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.SHOPIFY+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.shopify.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {# 4xx from Shopify's OAuth token endpoint — invalid/revoked app credentials.diff --git a/posthog/temporal/data_imports/sources/shortcut/canonical_descriptions.py b/posthog/temporal/data_imports/sources/shortcut/canonical_descriptions.pynew file mode 100644index 000000000000..97b8de8def7b--- /dev/null+++ b/posthog/temporal/data_imports/sources/shortcut/canonical_descriptions.py@@ -0,0 +1,210 @@+"""Canonical, documentation-sourced descriptions for Shortcut endpoints and columns.++Sourced from the official Shortcut REST API v3 reference (https://developer.shortcut.com/api/rest/v3).+Keyed by the endpoint names in `settings.py` `SHORTCUT_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Shortcut table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by most Shortcut objects; merged into each entry so we don't repeat them.+_COMMON_COLUMNS = {+ "id": "Unique identifier for the object.",+ "entity_type": "String describing the object's Shortcut type (e.g. 'story', 'epic').",+ "created_at": "Time at which the object was created.",+ "updated_at": "Time at which the object was last updated.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "members": {+ "description": "A user account that is a member of the Shortcut workspace.",+ "docs_url": "https://developer.shortcut.com/api/rest/v3#Member",+ "columns": _columns(+ profile="The member's profile, including name, email, and Mention name.",+ role="The member's role in the workspace (e.g. member, admin, owner).",+ disabled="Whether the member account is disabled.",+ ),+ },+ "groups": {+ "description": "A team (group) in Shortcut that owns stories and epics.",+ "docs_url": "https://developer.shortcut.com/api/rest/v3#Group",+ "columns": _columns(+ name="The group's name.",+ description="Description of the group.",+ mention_name="The group's @-mention handle.",+ member_ids="IDs of the members belonging to the group.",+ archived="Whether the group has been archived.",+ ),+ },+ "projects": {+ "description": "A project that organizes a collection of related stories.",+ "docs_url": "https://developer.shortcut.com/api/rest/v3#Project",+ "columns": _columns(+ name="The project's name.",+ description="Description of the project.",+ team_id="ID of the team the project belongs to.",+ color="The project's color.",+ archived="Whether the project has been archived.",+ ),+ },+ "workflows": {+ "description": "A workflow defining the set of states a story moves through.",+ "docs_url": "https://developer.shortcut.com/api/rest/v3#Workflow",+ "columns": _columns(+ name="The workflow's name.",+ description="Description of the workflow.",+ default_state_id="ID of the workflow state new stories start in.",+ states="The ordered list of states that make up the workflow.",+ team_id="ID of the team the workflow belongs to.",+ ),+ },+ "epics": {+ "description": "An epic grouping a set of stories working toward a larger goal.",+ "docs_url": "https://developer.shortcut.com/api/rest/v3#Epic",+ "columns": _columns(+ name="The epic's name.",+ description="Description of the epic.",+ state="Current workflow state of the epic.",+ epic_state_id="ID of the epic's workflow state.",+ owner_ids="IDs of the members who own the epic.",+ requested_by_id="ID of the member who requested the epic.",+ milestone_id="ID of the milestone (objective) the epic belongs to.",+ deadline="The epic's due date, if set.",+ started_at="Time at which work on the epic started.",+ completed_at="Time at which the epic was completed.",+ archived="Whether the epic has been archived.",+ ),+ },+ "iterations": {+ "description": "A time-boxed iteration (sprint) of work with a start and end date.",+ "docs_url": "https://developer.shortcut.com/api/rest/v3#Iteration",+ "columns": _columns(+ name="The iteration's name.",+ description="Description of the iteration.",+ status="Current status of the iteration (e.g. unstarted, started, done).",+ start_date="Start date of the iteration.",+ end_date="End date of the iteration.",+ group_ids="IDs of the groups associated with the iteration.",+ ),+ },+ "labels": {+ "description": "A label that can be applied to stories and epics to categorize them.",+ "docs_url": "https://developer.shortcut.com/api/rest/v3#Label",+ "columns": _columns(+ name="The label's name.",+ description="Description of the label.",+ color="The label's color.",+ archived="Whether the label has been archived.",+ ),+ },+ "categories": {+ "description": "A category used to group objectives (milestones).",+ "docs_url": "https://developer.shortcut.com/api/rest/v3#Category",+ "columns": _columns(+ name="The category's name.",+ type="The type of entity the category applies to.",+ color="The category's color.",+ archived="Whether the category has been archived.",+ ),+ },+ "objectives": {+ "description": "An objective (milestone) representing a high-level goal spanning multiple epics.",+ "docs_url": "https://developer.shortcut.com/api/rest/v3#Milestone",+ "columns": _columns(+ name="The objective's name.",+ description="Description of the objective.",+ state="Current state of the objective (e.g. to do, in progress, done).",+ categories="Categories applied to the objective.",+ started_at="Time at which work on the objective started.",+ completed_at="Time at which the objective was completed.",+ archived="Whether the objective has been archived.",+ ),+ },+ "custom_fields": {+ "description": "A custom field definition that can hold structured values on stories.",+ "docs_url": "https://developer.shortcut.com/api/rest/v3#CustomField",+ "columns": _columns(+ name="The custom field's name.",+ field_type="The type of the custom field (e.g. enum).",+ enabled="Whether the custom field is enabled.",+ values="The allowed values for the custom field.",+ canonical_name="The canonical name of the custom field, if it maps to a built-in concept.",+ ),+ },+ "files": {+ "description": "A file uploaded to Shortcut and attached to a story.",+ "docs_url": "https://developer.shortcut.com/api/rest/v3#File",+ "columns": _columns(+ name="The file's name.",+ description="Description of the file.",+ content_type="MIME content type of the file.",+ size="Size of the file in bytes.",+ uploader_id="ID of the member who uploaded the file.",+ story_ids="IDs of the stories the file is attached to.",+ url="URL where the file can be downloaded.",+ ),+ },+ "linked_files": {+ "description": "A reference to a file hosted in an external service (e.g. Google Drive, Dropbox) linked to a story.",+ "docs_url": "https://developer.shortcut.com/api/rest/v3#LinkedFile",+ "columns": _columns(+ name="The linked file's name.",+ description="Description of the linked file.",+ type="The external service hosting the file (e.g. google, dropbox, box, url).",+ url="URL of the externally hosted file.",+ uploader_id="ID of the member who linked the file.",+ story_ids="IDs of the stories the linked file is attached to.",+ ),+ },+ "repositories": {+ "description": "A version-control repository connected to the Shortcut workspace.",+ "docs_url": "https://developer.shortcut.com/api/rest/v3#Repository",+ "columns": _columns(+ name="The repository's name.",+ full_name="The repository's full name, including its owner.",+ type="The version-control provider (e.g. github).",+ url="URL of the repository.",+ external_id="The provider's identifier for the repository.",+ ),+ },+ "entity_templates": {+ "description": "A reusable template for creating stories with predefined values.",+ "docs_url": "https://developer.shortcut.com/api/rest/v3#EntityTemplate",+ "columns": _columns(+ name="The template's name.",+ author_id="ID of the member who created the template.",+ story_contents="The default story field values applied when the template is used.",+ last_used_at="Time at which the template was last used.",+ ),+ },+ "stories": {+ "description": "A unit of work in Shortcut — a feature, bug, or chore tracked through a workflow.",+ "docs_url": "https://developer.shortcut.com/api/rest/v3#Story",+ "columns": _columns(+ name="The story's title.",+ description="The story's description.",+ story_type="Type of the story (feature, bug, or chore).",+ workflow_state_id="ID of the workflow state the story is currently in.",+ epic_id="ID of the epic the story belongs to, if any.",+ iteration_id="ID of the iteration the story is in, if any.",+ project_id="ID of the project the story belongs to, if any.",+ group_id="ID of the team (group) that owns the story.",+ owner_ids="IDs of the members who own the story.",+ requested_by_id="ID of the member who requested the story.",+ estimate="Point estimate of the story's effort.",+ deadline="The story's due date, if set.",+ labels="Labels applied to the story.",+ started="Whether work on the story has started.",+ completed="Whether the story has been completed.",+ blocked="Whether the story is blocked by another story.",+ started_at="Time at which work on the story started.",+ completed_at="Time at which the story was completed.",+ archived="Whether the story has been archived.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/shortcut/source.py b/posthog/temporal/data_imports/sources/shortcut/source.pyindex 1289d6215fbd..8693bab37d35 100644--- a/posthog/temporal/data_imports/sources/shortcut/source.py+++ b/posthog/temporal/data_imports/sources/shortcut/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, SimpleSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.schema import SourceSchemafrom posthog.temporal.data_imports.sources.generated_configs import ShortcutSourceConfig@@ -78,6 +79,11 @@ You can create an API token in your [Shortcut account settings](https://app.shorschemas = [s for s in schemas if s.name in names_set]return schemas+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.shortcut.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error": "Invalid or expired Shortcut API token. Please generate a new token and reconnect.",diff --git a/posthog/temporal/data_imports/sources/slack/canonical_descriptions.py b/posthog/temporal/data_imports/sources/slack/canonical_descriptions.pynew file mode 100644index 000000000000..177e5bb58fdb--- /dev/null+++ b/posthog/temporal/data_imports/sources/slack/canonical_descriptions.py@@ -0,0 +1,52 @@+"""Canonical, documentation-sourced descriptions for Slack endpoints and columns.++Sourced from the official Slack Web API reference (https://api.slack.com/methods). Keyed by the+fixed schema names in `settings.py` `ENDPOINTS` (`$channels` from conversations.list, `$users` from+users.list), which match the `ExternalDataSchema.name` of a synced Slack table. Per-channel message+tables are discovered dynamically (keyed by channel ID) and are not documented here. Columns absent+here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "$channels": {+ "description": "A channel (conversation) in the Slack workspace — public, private, DM, or group DM.",+ "docs_url": "https://api.slack.com/methods/conversations.list",+ "columns": {+ "id": "Unique identifier for the channel.",+ "name": "The channel's name, without the leading hash.",+ "is_channel": "Whether the conversation is a public or private channel.",+ "is_private": "Whether the channel is private.",+ "is_archived": "Whether the channel has been archived.",+ "is_general": "Whether the channel is the workspace's default 'general' channel.",+ "is_im": "Whether the conversation is a direct message.",+ "is_mpim": "Whether the conversation is a multi-person direct message.",+ "creator": "User ID of the member who created the channel.",+ "created": "Time at which the channel was created, as a Unix timestamp.",+ "num_members": "Number of members in the channel.",+ "topic": "The channel's topic.",+ "purpose": "The channel's stated purpose.",+ },+ },+ "$users": {+ "description": "A member of the Slack workspace.",+ "docs_url": "https://api.slack.com/methods/users.list",+ "columns": {+ "id": "Unique identifier for the user.",+ "team_id": "ID of the workspace (team) the user belongs to.",+ "name": "The user's username (handle).",+ "real_name": "The user's real name.",+ "profile": "The user's profile, including display name, email, and avatar.",+ "is_admin": "Whether the user is an admin of the workspace.",+ "is_owner": "Whether the user is an owner of the workspace.",+ "is_bot": "Whether the user is a bot.",+ "is_app_user": "Whether the user is an authorized app user.",+ "deleted": "Whether the user account has been deactivated.",+ "is_restricted": "Whether the user is a multi-channel guest.",+ "is_ultra_restricted": "Whether the user is a single-channel guest.",+ "tz": "The user's time zone identifier.",+ "updated": "Time at which the user's profile was last updated, as a Unix timestamp.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/slack/source.py b/posthog/temporal/data_imports/sources/slack/source.pyindex 4e2745271772..389fd13a7d23 100644--- a/posthog/temporal/data_imports/sources/slack/source.py+++ b/posthog/temporal/data_imports/sources/slack/source.py@@ -21,6 +21,7 @@ from posthog.temporal.data_imports.sources.common.base import (WebhookDeletionResult,WebhookSource,)+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.mixins import OAuthMixinfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManager@@ -150,6 +151,11 @@ class SlackSource(ResumableSource[SlackSourceConfig, SlackResumeConfig], Webhook),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.slack.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"invalid_auth": "Your Slack token is invalid. Please reconnect the source.",diff --git a/posthog/temporal/data_imports/sources/smartsheet/canonical_descriptions.py b/posthog/temporal/data_imports/sources/smartsheet/canonical_descriptions.pynew file mode 100644index 000000000000..6221116a8754--- /dev/null+++ b/posthog/temporal/data_imports/sources/smartsheet/canonical_descriptions.py@@ -0,0 +1,81 @@+"""Canonical, documentation-sourced descriptions for Smartsheet endpoints and columns.++Sourced from the official Smartsheet API reference (https://smartsheet.redoc.ly). Keyed by the+endpoint names in `settings.py` `SMARTSHEET_ENDPOINTS`, which match the `ExternalDataSchema.name`+of a synced Smartsheet table. These are the account-level list endpoints (sheet/report/workspace/+user/contact/template metadata) — not the user-defined cell data inside a sheet. Columns absent+here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "sheets": {+ "description": "Metadata for a sheet the account can access (the grid where rows and columns of data live).",+ "docs_url": "https://smartsheet.redoc.ly/tag/sheets#operation/list-sheets",+ "columns": {+ "id": "Unique identifier for the sheet.",+ "name": "The sheet's name.",+ "accessLevel": "The account's access level on the sheet (e.g. OWNER, ADMIN, EDITOR, VIEWER).",+ "permalink": "URL that opens the sheet in the Smartsheet app.",+ "createdAt": "Time at which the sheet was created.",+ "modifiedAt": "Time at which the sheet was last modified.",+ },+ },+ "reports": {+ "description": "Metadata for a report — a filtered, cross-sheet view of rows the account can access.",+ "docs_url": "https://smartsheet.redoc.ly/tag/reports#operation/list-reports",+ "columns": {+ "id": "Unique identifier for the report.",+ "name": "The report's name.",+ "accessLevel": "The account's access level on the report (e.g. OWNER, ADMIN, EDITOR, VIEWER).",+ "permalink": "URL that opens the report in the Smartsheet app.",+ "createdAt": "Time at which the report was created.",+ "modifiedAt": "Time at which the report was last modified.",+ },+ },+ "workspaces": {+ "description": "Metadata for a workspace — a container that groups sheets, reports, and dashboards.",+ "docs_url": "https://smartsheet.redoc.ly/tag/workspaces#operation/list-workspaces",+ "columns": {+ "id": "Unique identifier for the workspace.",+ "name": "The workspace's name.",+ "accessLevel": "The account's access level on the workspace (e.g. OWNER, ADMIN, EDITOR, VIEWER).",+ "permalink": "URL that opens the workspace in the Smartsheet app.",+ },+ },+ "users": {+ "description": "A user in the Smartsheet organization (requires a system administrator account).",+ "docs_url": "https://smartsheet.redoc.ly/tag/users#operation/list-users",+ "columns": {+ "id": "Unique identifier for the user.",+ "email": "The user's email address.",+ "firstName": "The user's first name.",+ "lastName": "The user's last name.",+ "name": "The user's full name.",+ "admin": "Whether the user is a system administrator.",+ "licensedSheetCreator": "Whether the user holds a license to create sheets.",+ "status": "The user's account status (e.g. ACTIVE, PENDING, DECLINED).",+ },+ },+ "contacts": {+ "description": "A contact in the account's personal contact list, usable when assigning rows.",+ "docs_url": "https://smartsheet.redoc.ly/tag/contacts#operation/list-contacts",+ "columns": {+ "id": "Unique identifier for the contact.",+ "name": "The contact's name.",+ "email": "The contact's email address.",+ },+ },+ "templates": {+ "description": "Metadata for a template the account can use to create new sheets.",+ "docs_url": "https://smartsheet.redoc.ly/tag/templates#operation/list-user-created-templates",+ "columns": {+ "id": "Unique identifier for the template.",+ "name": "The template's name.",+ "description": "Description of the template.",+ "accessLevel": "The account's access level on the template.",+ "type": "The type of object the template creates (e.g. sheet).",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/smartsheet/source.py b/posthog/temporal/data_imports/sources/smartsheet/source.pyindex ba31b9bda691..cc565d09c3be 100644--- a/posthog/temporal/data_imports/sources/smartsheet/source.py+++ b/posthog/temporal/data_imports/sources/smartsheet/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -31,6 +32,11 @@ class SmartsheetSource(ResumableSource[SmartsheetSourceConfig, SmartsheetResumeCdef source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.SMARTSHEET+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.smartsheet.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized for url: https://api.smartsheet.com": "Smartsheet authentication failed. Your access token is invalid or expired. Please generate a new token and reconnect.",diff --git a/posthog/temporal/data_imports/sources/snapchat_ads/canonical_descriptions.py b/posthog/temporal/data_imports/sources/snapchat_ads/canonical_descriptions.pynew file mode 100644index 000000000000..f6dd6517c6ec--- /dev/null+++ b/posthog/temporal/data_imports/sources/snapchat_ads/canonical_descriptions.py@@ -0,0 +1,94 @@+"""Canonical, documentation-sourced descriptions for Snapchat Ads endpoints and columns.++Sourced from the official Snapchat Marketing API reference (https://developers.snap.com/api/marketing-api).+Keyed by the resource names in `settings.py` `SNAPCHAT_ADS_CONFIG`, which match the+`ExternalDataSchema.name` of a synced Snapchat Ads table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by the entity (campaign/ad squad/ad) objects.+_ENTITY_COLUMNS = {+ "id": "Unique identifier for the object.",+ "name": "The object's name.",+ "status": "Delivery status of the object (e.g. ACTIVE, PAUSED).",+ "created_at": "Time at which the object was created.",+ "updated_at": "Time at which the object was last updated.",+}++# Fields shared by the daily stats time-series objects.+_STATS_COLUMNS = {+ "id": "ID of the campaign, ad squad, or ad these stats are broken down by.",+ "type": "The entity type the stats are broken down by (CAMPAIGN, AD_SQUAD, or AD).",+ "granularity": "Time granularity of the stats (DAY for these daily tables).",+ "start_time": "Start of the day the stats cover.",+ "end_time": "End of the day the stats cover.",+ "impressions": "Number of times the ad was rendered.",+ "swipes": "Number of swipe-ups (clicks) on the ad.",+ "spend": "Amount spent over the period, in micro-currency (millionths of the account currency).",+ "video_views": "Number of qualifying video views.",+ "frequency": "Average number of times each unique user saw the ad.",+ "uniques": "Number of unique users reached.",+ "conversion_purchases": "Number of purchase conversions attributed to the ad.",+ "conversion_purchases_value": "Total value of purchase conversions attributed to the ad.",+}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "campaigns": {+ "description": "An advertising campaign — the top-level container that holds ad squads and sets the schedule and objective.",+ "docs_url": "https://developers.snap.com/api/marketing-api/Ads-API/campaigns",+ "columns": {+ **_ENTITY_COLUMNS,+ "ad_account_id": "ID of the ad account that owns the campaign.",+ "objective": "The campaign's advertising objective (e.g. AWARENESS, APP_INSTALLS, WEB_CONVERSION).",+ "start_time": "Scheduled start time of the campaign.",+ "end_time": "Scheduled end time of the campaign, if set.",+ "daily_budget_micro": "Daily budget cap for the campaign, in micro-currency.",+ "lifetime_spend_cap_micro": "Lifetime spend cap for the campaign, in micro-currency.",+ },+ },+ "ad_squads": {+ "description": "An ad squad (ad set) within a campaign — defines targeting, budget, bid, and schedule for a group of ads.",+ "docs_url": "https://developers.snap.com/api/marketing-api/Ads-API/ad-squads",+ "columns": {+ **_ENTITY_COLUMNS,+ "campaign_id": "ID of the campaign the ad squad belongs to.",+ "type": "The ad squad's type (e.g. SNAP_ADS).",+ "targeting": "Audience targeting specification for the ad squad.",+ "optimization_goal": "The event the ad squad is optimized to drive (e.g. IMPRESSIONS, SWIPES, PIXEL_PURCHASE).",+ "bid_micro": "Bid amount, in micro-currency.",+ "daily_budget_micro": "Daily budget cap for the ad squad, in micro-currency.",+ "lifetime_budget_micro": "Lifetime budget cap for the ad squad, in micro-currency.",+ "billing_event": "The event the ad squad is billed on (e.g. IMPRESSION).",+ "start_time": "Scheduled start time of the ad squad.",+ "end_time": "Scheduled end time of the ad squad, if set.",+ },+ },+ "ads": {+ "description": "An individual ad within an ad squad — pairs creative with delivery settings.",+ "docs_url": "https://developers.snap.com/api/marketing-api/Ads-API/ads",+ "columns": {+ **_ENTITY_COLUMNS,+ "ad_squad_id": "ID of the ad squad the ad belongs to.",+ "creative_id": "ID of the creative used by the ad.",+ "type": "The ad's type (e.g. SNAP_AD, STORY_AD, COLLECTION).",+ "review_status": "Review status of the ad (e.g. PENDING, APPROVED, REJECTED).",+ },+ },+ "campaign_stats_daily": {+ "description": "Daily performance metrics (spend, impressions, swipes, conversions) broken down by campaign.",+ "docs_url": "https://developers.snap.com/api/marketing-api/Ads-API/measurement",+ "columns": dict(_STATS_COLUMNS),+ },+ "ad_squad_stats_daily": {+ "description": "Daily performance metrics (spend, impressions, swipes, conversions) broken down by ad squad.",+ "docs_url": "https://developers.snap.com/api/marketing-api/Ads-API/measurement",+ "columns": dict(_STATS_COLUMNS),+ },+ "ad_stats_daily": {+ "description": "Daily performance metrics (spend, impressions, swipes, conversions) broken down by ad.",+ "docs_url": "https://developers.snap.com/api/marketing-api/Ads-API/measurement",+ "columns": dict(_STATS_COLUMNS),+ },+}diff --git a/posthog/temporal/data_imports/sources/snapchat_ads/source.py b/posthog/temporal/data_imports/sources/snapchat_ads/source.pyindex cdfa57509d7f..ad983e54a586 100644--- a/posthog/temporal/data_imports/sources/snapchat_ads/source.py+++ b/posthog/temporal/data_imports/sources/snapchat_ads/source.py@@ -18,6 +18,7 @@ from posthog.temporal.data_imports.sources.common.base import (FieldType,ResumableSource,)+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.mixins import OAuthMixinfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManager@@ -35,6 +36,11 @@ class SnapchatAdsSource(ResumableSource[SnapchatAdsSourceConfig, SnapchatResumeCdef source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.SNAPCHATADS+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.snapchat_ads.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:# Snapchat's Marketing API surfaces these as requests HTTPError "<code> Client Error".# They're all permanent for a given config — a deleted/inaccessible ad account (404),diff --git a/posthog/temporal/data_imports/sources/square/canonical_descriptions.py b/posthog/temporal/data_imports/sources/square/canonical_descriptions.pynew file mode 100644index 000000000000..dc571581d46d--- /dev/null+++ b/posthog/temporal/data_imports/sources/square/canonical_descriptions.py@@ -0,0 +1,100 @@+"""Canonical, documentation-sourced descriptions for Square endpoints and columns.++Sourced from the official Square API reference (https://developer.squareup.com/reference/square).+Keyed by the endpoint names in `settings.py` `SQUARE_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Square table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "payments": {+ "description": "A payment taken by the seller, representing a single attempt to collect money from a customer.",+ "docs_url": "https://developer.squareup.com/reference/square/payments-api/list-payments",+ "columns": {+ "id": "Unique identifier for the payment.",+ "created_at": "Time at which the payment was created.",+ "updated_at": "Time at which the payment was last updated.",+ "amount_money": "Amount of money the payment is for (amount in the smallest currency unit and currency code).",+ "total_money": "Total money charged, including tip and any adjustments.",+ "tip_money": "Tip amount included in the payment.",+ "app_fee_money": "Application fee taken from the payment, if any.",+ "status": "Status of the payment (e.g. APPROVED, PENDING, COMPLETED, CANCELED, FAILED).",+ "source_type": "How the payment was funded (e.g. CARD, CASH, EXTERNAL, BANK_ACCOUNT).",+ "card_details": "Details of the card used, if the payment was made by card.",+ "location_id": "ID of the location where the payment was taken.",+ "order_id": "ID of the order associated with the payment, if any.",+ "customer_id": "ID of the customer associated with the payment, if any.",+ "reference_id": "Optional external reference ID set by the seller.",+ "receipt_number": "Square-generated receipt number for the payment.",+ "receipt_url": "URL of the printable receipt for the payment.",+ "refunded_money": "Total amount refunded against this payment.",+ },+ },+ "refunds": {+ "description": "A refund of all or part of a previously processed Square payment.",+ "docs_url": "https://developer.squareup.com/reference/square/refunds-api/list-payment-refunds",+ "columns": {+ "id": "Unique identifier for the refund.",+ "created_at": "Time at which the refund was created.",+ "updated_at": "Time at which the refund was last updated.",+ "amount_money": "Amount of money refunded (amount in the smallest currency unit and currency code).",+ "app_fee_money": "Application fee refunded, if any.",+ "status": "Status of the refund (e.g. PENDING, COMPLETED, REJECTED, FAILED).",+ "payment_id": "ID of the payment being refunded.",+ "order_id": "ID of the order associated with the refund, if any.",+ "location_id": "ID of the location where the refund was processed.",+ "reason": "Reason given for the refund.",+ },+ },+ "customers": {+ "description": "A customer profile in the seller's Square Customer Directory.",+ "docs_url": "https://developer.squareup.com/reference/square/customers-api/list-customers",+ "columns": {+ "id": "Unique identifier for the customer.",+ "created_at": "Time at which the customer profile was created.",+ "updated_at": "Time at which the customer profile was last updated.",+ "given_name": "The customer's given (first) name.",+ "family_name": "The customer's family (last) name.",+ "company_name": "The customer's company name.",+ "email_address": "The customer's email address.",+ "phone_number": "The customer's phone number.",+ "address": "The customer's mailing address.",+ "reference_id": "Optional external reference ID set by the seller.",+ "note": "Free-form note attached to the customer.",+ "creation_source": "How the customer profile was created (e.g. THIRD_PARTY, APPOINTMENTS, INVOICES).",+ },+ },+ "locations": {+ "description": "A business location (store) belonging to the Square seller account.",+ "docs_url": "https://developer.squareup.com/reference/square/locations-api/list-locations",+ "columns": {+ "id": "Unique identifier for the location.",+ "created_at": "Time at which the location was created.",+ "name": "The location's name.",+ "address": "The location's physical address.",+ "status": "Status of the location (ACTIVE or INACTIVE).",+ "timezone": "The location's time zone.",+ "currency": "Currency used by the location, as a three-letter ISO code.",+ "country": "Country the location is in, as a two-letter ISO code.",+ "business_name": "The seller's business name shown on receipts for this location.",+ "type": "The location's type (PHYSICAL or MOBILE).",+ "merchant_id": "ID of the merchant that owns the location.",+ },+ },+ "catalog": {+ "description": "A catalog object — an item, variation, category, tax, discount, or modifier in the seller's catalog.",+ "docs_url": "https://developer.squareup.com/reference/square/catalog-api/list-catalog",+ "columns": {+ "id": "Unique identifier for the catalog object.",+ "type": "The catalog object's type (e.g. ITEM, ITEM_VARIATION, CATEGORY, TAX, DISCOUNT, MODIFIER).",+ "updated_at": "Time at which the catalog object was last updated.",+ "version": "Version number used for optimistic concurrency.",+ "is_deleted": "Whether the catalog object has been deleted.",+ "present_at_all_locations": "Whether the object is available at all of the seller's locations.",+ "item_data": "Item details, present when type is ITEM (name, description, variations).",+ "item_variation_data": "Variation details, present when type is ITEM_VARIATION (price, SKU).",+ "category_data": "Category details, present when type is CATEGORY.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/square/source.py b/posthog/temporal/data_imports/sources/square/source.pyindex 232e182a411d..9d50e46fc473 100644--- a/posthog/temporal/data_imports/sources/square/source.py+++ b/posthog/temporal/data_imports/sources/square/source.py@@ -13,6 +13,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -81,6 +82,11 @@ Grant these read permissions to the token for the data you want to sync:releaseStatus=ReleaseStatus.ALPHA,)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.square.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized": (diff --git a/posthog/temporal/data_imports/sources/surveymonkey/canonical_descriptions.py b/posthog/temporal/data_imports/sources/surveymonkey/canonical_descriptions.pynew file mode 100644index 000000000000..8620d1f9b14d--- /dev/null+++ b/posthog/temporal/data_imports/sources/surveymonkey/canonical_descriptions.py@@ -0,0 +1,86 @@+"""Canonical, documentation-sourced descriptions for SurveyMonkey endpoints and columns.++Sourced from the official SurveyMonkey API reference (https://api.surveymonkey.com/v3/docs).+Keyed by the endpoint names in `settings.py` `SURVEYMONKEY_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced SurveyMonkey table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "surveys": {+ "description": "A survey in your SurveyMonkey account, with its title, structure, and response counts.",+ "docs_url": "https://api.surveymonkey.com/v3/docs?shell#surveys",+ "columns": {+ "id": "Unique identifier for the survey.",+ "title": "The survey's title.",+ "nickname": "Internal nickname for the survey, not shown to respondents.",+ "language": "Language the survey is written in.",+ "category": "Category the survey belongs to.",+ "question_count": "Number of questions in the survey.",+ "page_count": "Number of pages in the survey.",+ "response_count": "Number of responses collected for the survey.",+ "date_created": "Time at which the survey was created.",+ "date_modified": "Time at which the survey was last modified.",+ "preview": "URL to preview the survey.",+ "href": "API URL of the survey resource.",+ },+ },+ "survey_responses": {+ "description": "An individual respondent's submission to a survey, including their answers.",+ "docs_url": "https://api.surveymonkey.com/v3/docs?shell#survey-responses",+ "columns": {+ "id": "Unique identifier for the response.",+ "survey_id": "ID of the survey this response belongs to.",+ "collector_id": "ID of the collector that gathered this response.",+ "recipient_id": "ID of the recipient who submitted the response, if known.",+ "response_status": "Status of the response (e.g. completed, partial, overquota, disqualified).",+ "total_time": "Total time the respondent spent on the survey, in seconds.",+ "ip_address": "IP address from which the response was submitted.",+ "date_created": "Time at which the response was started.",+ "date_modified": "Time at which the response was last modified.",+ "pages": "Array of pages with the respondent's answers to each question.",+ "href": "API URL of the response resource.",+ },+ },+ "survey_pages": {+ "description": "A page within a survey that groups a set of questions.",+ "docs_url": "https://api.surveymonkey.com/v3/docs?shell#survey-pages",+ "columns": {+ "id": "Unique identifier for the page.",+ "title": "The page's title.",+ "description": "Description shown at the top of the page.",+ "position": "Position of the page within the survey.",+ "question_count": "Number of questions on the page.",+ "href": "API URL of the page resource.",+ },+ },+ "survey_questions": {+ "description": "A question on a survey, extracted from the survey's page details.",+ "docs_url": "https://api.surveymonkey.com/v3/docs?shell#survey-pages-id-questions",+ "columns": {+ "id": "Unique identifier for the question.",+ "heading": "The question's text as shown to respondents.",+ "position": "Position of the question within its page.",+ "family": "Question family (e.g. single_choice, multiple_choice, open_ended, matrix).",+ "subtype": "Question subtype that refines the family (e.g. vertical, menu, essay).",+ "required": "Whether an answer to the question is required.",+ "answers": "Available answer choices and options for the question.",+ "href": "API URL of the question resource.",+ },+ },+ "collectors": {+ "description": "A method used to distribute a survey and gather responses (e.g. a web link or email invitation).",+ "docs_url": "https://api.surveymonkey.com/v3/docs?shell#collectors",+ "columns": {+ "id": "Unique identifier for the collector.",+ "name": "The collector's name.",+ "type": "Type of collector (e.g. weblink, email).",+ "status": "Status of the collector (e.g. open, closed).",+ "response_count": "Number of responses collected by this collector.",+ "date_created": "Time at which the collector was created.",+ "date_modified": "Time at which the collector was last modified.",+ "href": "API URL of the collector resource.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/surveymonkey/source.py b/posthog/temporal/data_imports/sources/surveymonkey/source.pyindex d574eee08bb3..bdbba46f2979 100644--- a/posthog/temporal/data_imports/sources/surveymonkey/source.py+++ b/posthog/temporal/data_imports/sources/surveymonkey/source.py@@ -13,6 +13,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -87,6 +88,11 @@ Make sure to grant the following read scopes:releaseStatus=ReleaseStatus.ALPHA,)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.surveymonkey.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized for url": "Your SurveyMonkey access token is invalid or expired. Please generate a new token and reconnect.",diff --git a/posthog/temporal/data_imports/sources/taboola/canonical_descriptions.py b/posthog/temporal/data_imports/sources/taboola/canonical_descriptions.pynew file mode 100644index 000000000000..80ba41538cb8--- /dev/null+++ b/posthog/temporal/data_imports/sources/taboola/canonical_descriptions.py@@ -0,0 +1,99 @@+"""Canonical, documentation-sourced descriptions for Taboola endpoints and columns.++Sourced from the official Taboola Backstage API reference (https://developers.taboola.com/backstage-api).+Keyed by the endpoint names in `settings.py` `TABOOLA_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Taboola table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "campaigns": {+ "description": "An advertising campaign in your Taboola account, with its budget, schedule, and targeting.",+ "docs_url": "https://developers.taboola.com/backstage-api/reference/list-campaigns",+ "columns": {+ "id": "Unique identifier for the campaign.",+ "advertiser_id": "ID of the advertiser account that owns the campaign.",+ "name": "The campaign's name.",+ "status": "Status of the campaign (e.g. RUNNING, PAUSED, PENDING_APPROVAL, TERMINATED).",+ "is_active": "Whether the campaign is currently active.",+ "spending_limit": "Total spending limit configured for the campaign.",+ "spending_limit_model": "How the spending limit is applied (e.g. ENTIRE, MONTHLY).",+ "daily_cap": "Maximum amount the campaign can spend per day.",+ "cpc": "Cost-per-click bid for the campaign.",+ "bid_type": "Bidding strategy used by the campaign (e.g. FIXED, MAX_CONVERSIONS).",+ "marketing_objective": "The campaign's marketing objective (e.g. LEADS_GENERATION, BRAND_AWARENESS).",+ "start_date": "Date the campaign starts running.",+ "end_date": "Date the campaign stops running, if set.",+ "pricing_model": "Pricing model for the campaign (e.g. CPC, CPM).",+ "branding_text": "Branding text shown alongside the campaign's items.",+ },+ },+ "campaign_items": {+ "description": "A single promoted item (ad creative) within a Taboola campaign.",+ "docs_url": "https://developers.taboola.com/backstage-api/reference/list-campaign-items",+ "columns": {+ "id": "Unique identifier for the campaign item.",+ "campaign_id": "ID of the campaign this item belongs to.",+ "type": "Type of the item (e.g. ITEM, RSS_CHILD).",+ "url": "Landing page URL the item links to.",+ "thumbnail_url": "URL of the item's thumbnail image.",+ "title": "The item's headline text.",+ "status": "Status of the item (e.g. RUNNING, PAUSED, PENDING, REJECTED).",+ "is_active": "Whether the item is currently active.",+ "approval_state": "Editorial approval state of the item (e.g. APPROVED, PENDING, REJECTED).",+ "cpc": "Cost-per-click bid override for this item, if set.",+ },+ },+ "conversion_rules": {+ "description": "A conversion rule defined on your Taboola universal pixel for tracking advertiser conversions.",+ "docs_url": "https://developers.taboola.com/backstage-api/reference/list-conversion-rules",+ "columns": {+ "id": "Unique identifier for the conversion rule.",+ "display_name": "Human-readable name of the conversion rule.",+ "status": "Status of the conversion rule (e.g. ACTIVE, INACTIVE).",+ "category": "Conversion category (e.g. LEAD, PURCHASE, SIGN_UP).",+ "type": "How the conversion is counted (e.g. EVENT_BASED, URL_BASED).",+ "include_in_total_conversions": "Whether this rule contributes to total conversion reporting.",+ "look_back_window": "Click-through attribution window, in days.",+ "view_look_back_window": "View-through attribution window, in days.",+ },+ },+ "campaign_summary_by_day": {+ "description": "Daily performance metrics broken down per campaign and date.",+ "docs_url": "https://developers.taboola.com/backstage-api/reference/campaign-summary-report",+ "columns": {+ "date": "Date the metrics are reported for.",+ "campaign": "ID of the campaign the metrics belong to.",+ "campaign_name": "Name of the campaign the metrics belong to.",+ "impressions": "Number of times the campaign's items were shown.",+ "clicks": "Number of clicks on the campaign's items.",+ "spent": "Amount spent by the campaign on this date.",+ "ctr": "Click-through rate (clicks divided by impressions).",+ "cpc": "Average cost per click on this date.",+ "cpm": "Average cost per thousand impressions on this date.",+ "conversions_value": "Total monetary value of conversions attributed on this date.",+ "cpa": "Average cost per acquisition (conversion) on this date.",+ "cpa_conversion_rate": "Conversion rate for the date.",+ "currency": "Currency the monetary metrics are reported in.",+ },+ },+ "top_campaign_content": {+ "description": "Aggregate performance of the top-performing campaign items over the requested window.",+ "docs_url": "https://developers.taboola.com/backstage-api/reference/top-campaign-content-report",+ "columns": {+ "campaign": "ID of the campaign the item belongs to.",+ "item": "ID of the promoted item.",+ "item_name": "Headline text of the promoted item.",+ "content_provider_name": "Name of the content provider for the item.",+ "thumbnail_url": "URL of the item's thumbnail image.",+ "url": "Landing page URL the item links to.",+ "impressions": "Number of times the item was shown.",+ "clicks": "Number of clicks on the item.",+ "spent": "Amount spent on the item over the window.",+ "ctr": "Click-through rate for the item.",+ "cpc": "Average cost per click for the item.",+ "currency": "Currency the monetary metrics are reported in.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/taboola/source.py b/posthog/temporal/data_imports/sources/taboola/source.pyindex 146f6fab2289..b180dd4c69e5 100644--- a/posthog/temporal/data_imports/sources/taboola/source.py+++ b/posthog/temporal/data_imports/sources/taboola/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -37,6 +38,11 @@ class TaboolaSource(ResumableSource[TaboolaSourceConfig, TaboolaResumeConfig]):# changing it must force re-entry of the secret (prevents credential retargeting).return ["account_id"]+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.taboola.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"400 Client Error: Bad Request for url: https://backstage.taboola.com/backstage/oauth/token": "Taboola rejected the token request. Please check your client ID and client secret.",diff --git a/posthog/temporal/data_imports/sources/temporalio/canonical_descriptions.py b/posthog/temporal/data_imports/sources/temporalio/canonical_descriptions.pynew file mode 100644index 000000000000..f23831923e8d--- /dev/null+++ b/posthog/temporal/data_imports/sources/temporalio/canonical_descriptions.py@@ -0,0 +1,47 @@+"""Canonical, documentation-sourced descriptions for Temporal.io endpoints and columns.++Sourced from the official Temporal documentation and Python SDK (https://docs.temporal.io,+https://python.temporal.io). Keyed by the resource names in `temporalio.py` `TemporalIOResource`,+which match the `ExternalDataSchema.name` of a synced Temporal table. Columns absent here fall back+to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "workflows": {+ "description": "A workflow execution in your Temporal namespace, with its type, status, and timing.",+ "docs_url": "https://docs.temporal.io/workflow-execution",+ "columns": {+ "id": "The workflow ID assigned by the client that started the execution.",+ "run_id": "Unique identifier for this specific run of the workflow execution.",+ "workflow_type": "Name of the workflow type (function) that was executed.",+ "task_queue": "Name of the task queue the workflow was dispatched on.",+ "status": "Execution status (e.g. RUNNING, COMPLETED, FAILED, CANCELED, TERMINATED, TIMED_OUT).",+ "start_time": "Time at which the workflow execution started.",+ "close_time": "Time at which the workflow execution closed, if it has closed.",+ "execution_time": "Time at which the workflow is scheduled to start executing.",+ "history_length": "Number of events in the workflow's event history.",+ "parent_id": "Workflow ID of the parent workflow, if this is a child workflow.",+ "parent_run_id": "Run ID of the parent workflow, if this is a child workflow.",+ "search_attributes": "Indexed key-value attributes used to filter and find workflows.",+ "memo": "Non-indexed key-value metadata attached to the workflow.",+ },+ },+ "workflow_histories": {+ "description": "Individual events from the event history of each workflow execution.",+ "docs_url": "https://docs.temporal.io/workflow-execution/event",+ "columns": {+ "id": "Synthetic unique identifier combining workflow id, run id, and event task id.",+ "workflow_id": "The workflow ID this history event belongs to.",+ "run_id": "Run ID of the workflow execution this history event belongs to.",+ "workflow_start_time": "Start time of the parent workflow execution.",+ "workflow_close_time": "Close time of the parent workflow execution, if it has closed.",+ "eventId": "Sequential ID of the event within the workflow's history.",+ "eventTime": "Time at which the event occurred.",+ "eventType": "Type of the history event (e.g. WorkflowExecutionStarted, ActivityTaskCompleted).",+ "taskId": "ID of the task that generated the event.",+ "version": "Version of the event, used for failover and replication.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/temporalio/source.py b/posthog/temporal/data_imports/sources/temporalio/source.pyindex b75c26de368f..8c8243a5ee4e 100644--- a/posthog/temporal/data_imports/sources/temporalio/source.py+++ b/posthog/temporal/data_imports/sources/temporalio/source.py@@ -10,6 +10,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -31,6 +32,11 @@ class TemporalIOSource(ResumableSource[TemporalIOSourceConfig, TemporalIOResumeCdef source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.TEMPORALIO+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.temporalio.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:# rustls surfaces mTLS rejections as TLS alert names inside the tonic transport# error. These are credential problems — retrying can never recover.diff --git a/posthog/temporal/data_imports/sources/tiktok_ads/canonical_descriptions.py b/posthog/temporal/data_imports/sources/tiktok_ads/canonical_descriptions.pynew file mode 100644index 000000000000..5b80e8f13b96--- /dev/null+++ b/posthog/temporal/data_imports/sources/tiktok_ads/canonical_descriptions.py@@ -0,0 +1,109 @@+"""Canonical, documentation-sourced descriptions for TikTok Ads endpoints and columns.++Sourced from the official TikTok Marketing API reference (https://business-api.tiktok.com/portal/docs).+Keyed by the resource names in `settings.py` `TIKTOK_ADS_CONFIG`, which match the+`ExternalDataSchema.name` of a synced TikTok Ads table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Metrics shared by every integrated report endpoint; merged into each report entry.+_REPORT_METRIC_COLUMNS = {+ "stat_time_day": "Date the metrics are aggregated for.",+ "spend": "Total amount spent in the reporting period.",+ "impressions": "Number of times the ads were shown.",+ "clicks": "Number of clicks on the ads.",+ "ctr": "Click-through rate (clicks divided by impressions).",+ "cpc": "Average cost per click.",+ "cpm": "Average cost per thousand impressions.",+ "conversion": "Number of conversions attributed in the reporting period.",+ "conversion_rate": "Conversion rate for the reporting period.",+ "cost_per_conversion": "Average cost per conversion.",+ "reach": "Number of unique users who saw the ads.",+ "frequency": "Average number of times each user saw the ads.",+ "currency": "Currency the monetary metrics are reported in.",+}+++def _report_columns(**overrides: str) -> dict[str, str]:+ return {**_REPORT_METRIC_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "campaigns": {+ "description": "An advertising campaign in your TikTok Ads account, with its objective and budget.",+ "docs_url": "https://business-api.tiktok.com/portal/docs?id=1739315828649986",+ "columns": {+ "campaign_id": "Unique identifier for the campaign.",+ "advertiser_id": "ID of the advertiser account that owns the campaign.",+ "campaign_name": "The campaign's name.",+ "objective_type": "The campaign's advertising objective (e.g. TRAFFIC, CONVERSIONS, REACH).",+ "budget": "Budget allocated to the campaign.",+ "budget_mode": "How the budget is applied (e.g. BUDGET_MODE_DAY, BUDGET_MODE_TOTAL).",+ "operation_status": "Operational status of the campaign (e.g. ENABLE, DISABLE).",+ "secondary_status": "More detailed status of the campaign.",+ "create_time": "Time at which the campaign was created.",+ "modify_time": "Time at which the campaign was last modified.",+ },+ },+ "ad_groups": {+ "description": "An ad group within a campaign, defining targeting, placement, and bidding.",+ "docs_url": "https://business-api.tiktok.com/portal/docs?id=1739314558673922",+ "columns": {+ "adgroup_id": "Unique identifier for the ad group.",+ "campaign_id": "ID of the campaign this ad group belongs to.",+ "advertiser_id": "ID of the advertiser account that owns the ad group.",+ "adgroup_name": "The ad group's name.",+ "placement_type": "How placements are selected (e.g. PLACEMENT_TYPE_AUTOMATIC, PLACEMENT_TYPE_NORMAL).",+ "budget": "Budget allocated to the ad group.",+ "budget_mode": "How the ad group's budget is applied.",+ "bid_type": "Bidding strategy for the ad group.",+ "bid_price": "Bid amount for the ad group, if a fixed bid is set.",+ "optimization_goal": "What the ad group is optimized for (e.g. CLICK, CONVERT, REACH).",+ "billing_event": "Event the advertiser is charged for (e.g. CPC, CPM).",+ "operation_status": "Operational status of the ad group (e.g. ENABLE, DISABLE).",+ "create_time": "Time at which the ad group was created.",+ "modify_time": "Time at which the ad group was last modified.",+ },+ },+ "ads": {+ "description": "An individual ad creative within an ad group.",+ "docs_url": "https://business-api.tiktok.com/portal/docs?id=1735735588640770",+ "columns": {+ "ad_id": "Unique identifier for the ad.",+ "adgroup_id": "ID of the ad group this ad belongs to.",+ "campaign_id": "ID of the campaign this ad belongs to.",+ "advertiser_id": "ID of the advertiser account that owns the ad.",+ "ad_name": "The ad's name.",+ "ad_format": "Format of the ad (e.g. SINGLE_VIDEO, SINGLE_IMAGE, CAROUSEL).",+ "ad_text": "Primary text shown with the ad.",+ "call_to_action": "Call-to-action button text on the ad.",+ "landing_page_url": "URL the ad directs users to.",+ "operation_status": "Operational status of the ad (e.g. ENABLE, DISABLE).",+ "create_time": "Time at which the ad was created.",+ "modify_time": "Time at which the ad was last modified.",+ },+ },+ "campaign_report": {+ "description": "Daily performance metrics for each campaign.",+ "docs_url": "https://business-api.tiktok.com/portal/docs?id=1740302848100353",+ "columns": _report_columns(+ campaign_id="ID of the campaign the metrics belong to.",+ campaign_name="Name of the campaign the metrics belong to.",+ ),+ },+ "ad_group_report": {+ "description": "Daily performance metrics for each ad group.",+ "docs_url": "https://business-api.tiktok.com/portal/docs?id=1740302848100353",+ "columns": _report_columns(+ adgroup_id="ID of the ad group the metrics belong to.",+ ),+ },+ "ad_report": {+ "description": "Daily performance metrics for each ad.",+ "docs_url": "https://business-api.tiktok.com/portal/docs?id=1740302848100353",+ "columns": _report_columns(+ ad_id="ID of the ad the metrics belong to.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/tiktok_ads/source.py b/posthog/temporal/data_imports/sources/tiktok_ads/source.pyindex 1da571ff6271..49be06b9d5f6 100644--- a/posthog/temporal/data_imports/sources/tiktok_ads/source.py+++ b/posthog/temporal/data_imports/sources/tiktok_ads/source.py@@ -18,6 +18,7 @@ from posthog.temporal.data_imports.sources.common.base import (FieldType,ResumableSource,)+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.mixins import OAuthMixinfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManager@@ -36,6 +37,11 @@ class TikTokAdsSource(ResumableSource[TikTokAdsSourceConfig, TikTokAdsResumeConfdef source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.TIKTOKADS+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.tiktok_ads.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {# TikTok client errors not in the retryable code set (e.g. 40001 — the advertiserdiff --git a/posthog/temporal/data_imports/sources/trello/canonical_descriptions.py b/posthog/temporal/data_imports/sources/trello/canonical_descriptions.pynew file mode 100644index 000000000000..247a0ed131f9--- /dev/null+++ b/posthog/temporal/data_imports/sources/trello/canonical_descriptions.py@@ -0,0 +1,124 @@+"""Canonical, documentation-sourced descriptions for Trello endpoints and columns.++Sourced from the official Trello REST API reference (https://developer.atlassian.com/cloud/trello/rest).+Keyed by the endpoint names in `settings.py` `TRELLO_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Trello table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "boards": {+ "description": "A Trello board that organizes lists and cards for a project.",+ "docs_url": "https://developer.atlassian.com/cloud/trello/rest/api-group-boards/",+ "columns": {+ "id": "Unique identifier for the board.",+ "name": "The board's name.",+ "desc": "Description of the board.",+ "closed": "Whether the board is archived (closed).",+ "idOrganization": "ID of the workspace (organization) the board belongs to.",+ "url": "URL of the board.",+ "shortUrl": "Shortened URL of the board.",+ "starred": "Whether the board is starred by the authenticated member.",+ "dateLastActivity": "Time of the most recent activity on the board.",+ "created_at": "Time at which the board was created (derived from its ID).",+ },+ },+ "organizations": {+ "description": "A Trello workspace (organization) that groups boards and members.",+ "docs_url": "https://developer.atlassian.com/cloud/trello/rest/api-group-organizations/",+ "columns": {+ "id": "Unique identifier for the workspace.",+ "name": "The workspace's short name (unique identifier slug).",+ "displayName": "The workspace's display name.",+ "desc": "Description of the workspace.",+ "url": "URL of the workspace.",+ "website": "Website associated with the workspace.",+ "created_at": "Time at which the workspace was created (derived from its ID).",+ },+ },+ "lists": {+ "description": "A list (column) on a board that holds an ordered set of cards.",+ "docs_url": "https://developer.atlassian.com/cloud/trello/rest/api-group-lists/",+ "columns": {+ "id": "Unique identifier for the list.",+ "name": "The list's name.",+ "idBoard": "ID of the board the list belongs to.",+ "closed": "Whether the list is archived (closed).",+ "pos": "Position of the list on the board.",+ "subscribed": "Whether the authenticated member is subscribed to the list.",+ "created_at": "Time at which the list was created (derived from its ID).",+ },+ },+ "cards": {+ "description": "A card on a board, representing a task or item that moves through lists.",+ "docs_url": "https://developer.atlassian.com/cloud/trello/rest/api-group-cards/",+ "columns": {+ "id": "Unique identifier for the card.",+ "name": "The card's name (title).",+ "desc": "Description of the card.",+ "idBoard": "ID of the board the card belongs to.",+ "idList": "ID of the list the card currently sits in.",+ "idMembers": "IDs of the members assigned to the card.",+ "idLabels": "IDs of the labels applied to the card.",+ "closed": "Whether the card is archived (closed).",+ "due": "Due date set on the card, if any.",+ "dueComplete": "Whether the card's due date has been marked complete.",+ "pos": "Position of the card within its list.",+ "url": "URL of the card.",+ "shortUrl": "Shortened URL of the card.",+ "dateLastActivity": "Time of the most recent activity on the card.",+ "created_at": "Time at which the card was created (derived from its ID).",+ },+ },+ "checklists": {+ "description": "A checklist attached to a card, containing a set of check items.",+ "docs_url": "https://developer.atlassian.com/cloud/trello/rest/api-group-checklists/",+ "columns": {+ "id": "Unique identifier for the checklist.",+ "name": "The checklist's name.",+ "idBoard": "ID of the board the checklist belongs to.",+ "idCard": "ID of the card the checklist is attached to.",+ "pos": "Position of the checklist on the card.",+ "checkItems": "Array of check items in the checklist.",+ "created_at": "Time at which the checklist was created (derived from its ID).",+ },+ },+ "labels": {+ "description": "A label that can be applied to cards on a board for categorization.",+ "docs_url": "https://developer.atlassian.com/cloud/trello/rest/api-group-labels/",+ "columns": {+ "id": "Unique identifier for the label.",+ "name": "The label's name.",+ "color": "The label's color.",+ "idBoard": "ID of the board the label belongs to.",+ "created_at": "Time at which the label was created (derived from its ID).",+ },+ },+ "members": {+ "description": "A Trello member who belongs to a board.",+ "docs_url": "https://developer.atlassian.com/cloud/trello/rest/api-group-members/",+ "columns": {+ "id": "Unique identifier for the member.",+ "fullName": "The member's full name.",+ "username": "The member's username.",+ "initials": "The member's initials.",+ "email": "The member's email address, if visible.",+ "url": "URL of the member's profile.",+ "created_at": "Time at which the member was created (derived from its ID).",+ },+ },+ "actions": {+ "description": "An action recording an event that happened on a board (e.g. a card moved or comment added).",+ "docs_url": "https://developer.atlassian.com/cloud/trello/rest/api-group-actions/",+ "columns": {+ "id": "Unique identifier for the action.",+ "type": "Type of the action (e.g. createCard, updateCard, commentCard, moveCardToBoard).",+ "date": "Time at which the action occurred.",+ "idMemberCreator": "ID of the member who performed the action.",+ "memberCreator": "Details of the member who performed the action.",+ "data": "Payload describing what the action did (board, list, card references, etc.).",+ "created_at": "Time at which the action was created (derived from its ID).",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/trello/source.py b/posthog/temporal/data_imports/sources/trello/source.pyindex 221e436ab2c5..85045cdc72e6 100644--- a/posthog/temporal/data_imports/sources/trello/source.py+++ b/posthog/temporal/data_imports/sources/trello/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -65,6 +66,11 @@ Get your API key from [trello.com/power-ups/admin](https://trello.com/power-ups/),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.trello.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error": "Invalid Trello API key or token. Please check your credentials and reconnect.",diff --git a/posthog/temporal/data_imports/sources/twilio/canonical_descriptions.py b/posthog/temporal/data_imports/sources/twilio/canonical_descriptions.pynew file mode 100644index 000000000000..9a1d48ad370c--- /dev/null+++ b/posthog/temporal/data_imports/sources/twilio/canonical_descriptions.py@@ -0,0 +1,164 @@+"""Canonical, documentation-sourced descriptions for Twilio endpoints and columns.++Sourced from the official Twilio API reference (https://www.twilio.com/docs/usage/api). Keyed by the+endpoint names in `settings.py` `TWILIO_ENDPOINTS`, which match the `ExternalDataSchema.name` of a+synced Twilio table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by most Twilio resources; merged into each entry so we don't repeat them.+_COMMON_COLUMNS = {+ "sid": "Unique 34-character identifier for the resource.",+ "account_sid": "SID of the account that owns the resource.",+ "date_created": "Time at which the resource was created (RFC 2822 format).",+ "date_updated": "Time at which the resource was last updated (RFC 2822 format).",+ "uri": "URI of the resource relative to the API base.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "messages": {+ "description": "An SMS, MMS, or WhatsApp message sent or received through Twilio.",+ "docs_url": "https://www.twilio.com/docs/sms/api/message-resource",+ "columns": _columns(+ **{"from": "Phone number or sender ID the message was sent from."},+ to="Phone number the message was sent to.",+ body="Text content of the message.",+ status="Status of the message (e.g. queued, sent, delivered, failed, received).",+ direction="Direction of the message (inbound, outbound-api, outbound-call, outbound-reply).",+ num_segments="Number of message segments used to deliver the message.",+ num_media="Number of media files attached to the message.",+ price="Amount charged for the message.",+ price_unit="Currency of the price, as an ISO 4217 code.",+ error_code="Error code if the message failed to send.",+ error_message="Human-readable description of the error, if any.",+ messaging_service_sid="SID of the messaging service used, if any.",+ date_sent="Time at which the message was sent (RFC 2822 format).",+ ),+ },+ "calls": {+ "description": "A phone call made or received through Twilio.",+ "docs_url": "https://www.twilio.com/docs/voice/api/call-resource",+ "columns": _columns(+ **{"from": "Phone number or client identifier that made the call."},+ to="Phone number or client identifier that received the call.",+ status="Status of the call (e.g. queued, ringing, in-progress, completed, busy, failed, no-answer).",+ direction="Direction of the call (inbound, outbound-api, outbound-dial).",+ duration="Length of the call in seconds.",+ price="Amount charged for the call.",+ price_unit="Currency of the price, as an ISO 4217 code.",+ start_time="Time at which the call started (RFC 2822 format).",+ end_time="Time at which the call ended (RFC 2822 format).",+ forwarded_from="Phone number the call was forwarded from, if applicable.",+ parent_call_sid="SID of the parent call, if this call was created by another call.",+ ),+ },+ "recordings": {+ "description": "An audio recording of a Twilio call or conference.",+ "docs_url": "https://www.twilio.com/docs/voice/api/recording",+ "columns": _columns(+ call_sid="SID of the call this recording was made from.",+ conference_sid="SID of the conference this recording was made from, if applicable.",+ status="Status of the recording (e.g. in-progress, completed, absent).",+ duration="Length of the recording in seconds.",+ channels="Number of channels in the recording (1 = mono, 2 = dual).",+ source="How the recording was created (e.g. DialVerb, Conference, StartCallRecordingAPI).",+ price="Amount charged for the recording.",+ price_unit="Currency of the price, as an ISO 4217 code.",+ start_time="Time at which the recording started (RFC 2822 format).",+ ),+ },+ "conferences": {+ "description": "A conference call hosting multiple Twilio call participants.",+ "docs_url": "https://www.twilio.com/docs/voice/api/conference-resource",+ "columns": _columns(+ friendly_name="User-provided name identifying the conference.",+ status="Status of the conference (e.g. init, in-progress, completed).",+ region="Region in which the conference is hosted.",+ reason_conference_ended="Reason the conference ended, if it has ended.",+ call_sid_ending_conference="SID of the call that ended the conference, if any.",+ ),+ },+ "addresses": {+ "description": "A geographic address registered on a Twilio account for regulatory compliance.",+ "docs_url": "https://www.twilio.com/docs/usage/api/address",+ "columns": _columns(+ friendly_name="User-provided name identifying the address.",+ customer_name="Name of the person or business associated with the address.",+ street="Street portion of the address.",+ city="City of the address.",+ region="State or region of the address.",+ postal_code="Postal code of the address.",+ iso_country="ISO 3166-1 alpha-2 country code of the address.",+ validated="Whether the address has been validated by Twilio.",+ verified="Whether the address has been verified for regulatory use.",+ ),+ },+ "applications": {+ "description": "A TwiML application that bundles a set of URLs for handling Twilio voice and messaging.",+ "docs_url": "https://www.twilio.com/docs/usage/api/applications",+ "columns": _columns(+ friendly_name="User-provided name identifying the application.",+ voice_url="URL Twilio requests when a call uses this application.",+ voice_method="HTTP method used to request the voice URL.",+ sms_url="URL Twilio requests when a message uses this application.",+ sms_method="HTTP method used to request the SMS URL.",+ status_callback="URL Twilio requests with status updates.",+ ),+ },+ "incoming_phone_numbers": {+ "description": "A phone number owned by your Twilio account and the handlers configured for it.",+ "docs_url": "https://www.twilio.com/docs/phone-numbers/api/incomingphonenumber-resource",+ "columns": _columns(+ friendly_name="User-provided name identifying the phone number.",+ phone_number="The phone number in E.164 format.",+ status="Status of the phone number.",+ voice_url="URL Twilio requests when this number receives a call.",+ sms_url="URL Twilio requests when this number receives a message.",+ capabilities="Capabilities of the number (voice, SMS, MMS, fax).",+ origin="How the number was provisioned (e.g. twilio, hosted).",+ ),+ },+ "keys": {+ "description": "An API key (SID and secret) used to authenticate requests to the Twilio API.",+ "docs_url": "https://www.twilio.com/docs/usage/api/keys",+ "columns": _columns(+ friendly_name="User-provided name identifying the API key.",+ ),+ },+ "outgoing_caller_ids": {+ "description": "A phone number verified for use as an outbound caller ID on the account.",+ "docs_url": "https://www.twilio.com/docs/voice/api/outgoing-caller-ids",+ "columns": _columns(+ friendly_name="User-provided name identifying the caller ID.",+ phone_number="The verified phone number in E.164 format.",+ ),+ },+ "queues": {+ "description": "A queue holding callers waiting to be connected to an agent.",+ "docs_url": "https://www.twilio.com/docs/voice/api/queue-resource",+ "columns": _columns(+ friendly_name="User-provided name identifying the queue.",+ current_size="Number of calls currently waiting in the queue.",+ max_size="Maximum number of calls the queue can hold.",+ average_wait_time="Average wait time of callers in the queue, in seconds.",+ ),+ },+ "transcriptions": {+ "description": "A text transcription of a Twilio call recording.",+ "docs_url": "https://www.twilio.com/docs/voice/api/recording-transcription",+ "columns": _columns(+ recording_sid="SID of the recording this transcription was generated from.",+ status="Status of the transcription (e.g. in-progress, completed, failed).",+ transcription_text="The transcribed text of the recording.",+ duration="Duration of the transcribed recording, in seconds.",+ price="Amount charged for the transcription.",+ price_unit="Currency of the price, as an ISO 4217 code.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/twilio/source.py b/posthog/temporal/data_imports/sources/twilio/source.pyindex 1c4b62184d61..dc083d5fe06f 100644--- a/posthog/temporal/data_imports/sources/twilio/source.py+++ b/posthog/temporal/data_imports/sources/twilio/source.py@@ -13,6 +13,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -111,6 +112,11 @@ Your **Account SID** is on the [Twilio Console dashboard](https://console.twilio),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.twilio.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error: Unauthorized for url: https://api.twilio.com": "Invalid Twilio credentials. Please check your Account SID and Auth Token (or API key SID and secret) and reconnect.",diff --git a/posthog/temporal/data_imports/sources/typeform/canonical_descriptions.py b/posthog/temporal/data_imports/sources/typeform/canonical_descriptions.pynew file mode 100644index 000000000000..8a8b871cbac8--- /dev/null+++ b/posthog/temporal/data_imports/sources/typeform/canonical_descriptions.py@@ -0,0 +1,46 @@+"""Canonical, documentation-sourced descriptions for Typeform endpoints and columns.++Sourced from the official Typeform Create/Responses API reference+(https://www.typeform.com/developers/). Keyed by the endpoint names in `settings.py`+`TYPEFORM_ENDPOINTS`, which match the `ExternalDataSchema.name` of a synced Typeform table.+Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "forms": {+ "description": "A Typeform form (survey/quiz) with its questions, theme, and settings.",+ "docs_url": "https://www.typeform.com/developers/create/reference/retrieve-forms/",+ "columns": {+ "id": "Unique identifier for the form.",+ "title": "The form's title.",+ "type": "The type of form (e.g. quiz or form).",+ "language": "The form's language code.",+ "fields": "List of questions/fields that make up the form.",+ "workspace": "Reference to the workspace the form belongs to.",+ "theme": "Reference to the theme applied to the form.",+ "settings": "The form's settings (e.g. progress bar, language, public visibility).",+ "created_at": "Time at which the form was created.",+ "last_updated_at": "Time at which the form was last updated.",+ "published_at": "Time at which the form was published.",+ "_links": "Links related to the form, including its display (fill-out) URL.",+ },+ },+ "responses": {+ "description": "A single submission to a Typeform form, including the answers given.",+ "docs_url": "https://www.typeform.com/developers/responses/reference/retrieve-responses/",+ "columns": {+ "form_id": "ID of the form this response was submitted to.",+ "token": "Unique token identifying the response within its form.",+ "response_id": "Unique identifier for the response.",+ "landed_at": "Time at which the respondent landed on the form.",+ "submitted_at": "Time at which the response was submitted.",+ "answers": "List of answers given by the respondent, one per answered field.",+ "metadata": "Metadata about the response (browser, platform, referer, user agent).",+ "hidden": "Values of any hidden fields passed in the form URL.",+ "calculated": "Calculated values for the response, such as the quiz score.",+ "variables": "Variables defined on the form and their values for this response.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/typeform/source.py b/posthog/temporal/data_imports/sources/typeform/source.pyindex 1fa128e0e747..0055023fd101 100644--- a/posthog/temporal/data_imports/sources/typeform/source.py+++ b/posthog/temporal/data_imports/sources/typeform/source.py@@ -13,6 +13,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, SimpleSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.schema import SourceSchemafrom posthog.temporal.data_imports.sources.generated_configs import TypeformSourceConfig@@ -88,6 +89,11 @@ You can generate a personal access token in your [Typeform account settings](httreleaseStatus=ReleaseStatus.GA,)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.typeform.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error": "Invalid Typeform personal access token. Please update your token and reconnect.",diff --git a/posthog/temporal/data_imports/sources/vitally/canonical_descriptions.py b/posthog/temporal/data_imports/sources/vitally/canonical_descriptions.pynew file mode 100644index 000000000000..e08f1eef7ca1--- /dev/null+++ b/posthog/temporal/data_imports/sources/vitally/canonical_descriptions.py@@ -0,0 +1,135 @@+"""Canonical, documentation-sourced descriptions for Vitally endpoints and columns.++Sourced from the official Vitally REST API reference (https://docs.vitally.io/). Keyed by the+static endpoint names in `settings.py` `ENDPOINTS`, which match the `ExternalDataSchema.name` of a+synced Vitally table. The per-team `Custom_Object_<name>` schemas are user-defined and discovered at+sync time, so they intentionally have no canonical entry and fall back to LLM enrichment.+Columns absent here also fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by most Vitally objects; merged into each entry so we don't repeat them.+_COMMON_COLUMNS = {+ "id": "Unique identifier for the object in Vitally.",+ "externalId": "Identifier for the object in your own system, used to match Vitally records.",+ "createdAt": "Time at which the object was created in Vitally.",+ "updatedAt": "Time at which the object was last updated in Vitally.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "Organizations": {+ "description": "A customer organization (company) tracked in Vitally.",+ "docs_url": "https://docs.vitally.io/pushing-data-to-vitally/rest-api#organizations",+ "columns": _columns(+ name="The organization's name.",+ traits="Custom traits/attributes set on the organization.",+ accountOwnerId="ID of the Vitally user who owns this organization's account.",+ mrr="Monthly recurring revenue attributed to the organization.",+ churnedAt="Time at which the organization churned, if applicable.",+ healthScore="Current health score for the organization.",+ ),+ },+ "Accounts": {+ "description": "A customer account in Vitally, the primary unit customer success is managed against.",+ "docs_url": "https://docs.vitally.io/pushing-data-to-vitally/rest-api#accounts",+ "columns": _columns(+ name="The account's name.",+ traits="Custom traits/attributes set on the account.",+ accountOwnerId="ID of the Vitally user who owns this account.",+ organizationId="ID of the organization this account belongs to.",+ mrr="Monthly recurring revenue attributed to the account.",+ churnedAt="Time at which the account churned, if applicable.",+ healthScore="Current health score for the account.",+ nextRenewalDate="Date of the account's next contract renewal.",+ ),+ },+ "Users": {+ "description": "An end user (a person at a customer account) tracked in Vitally.",+ "docs_url": "https://docs.vitally.io/pushing-data-to-vitally/rest-api#users",+ "columns": _columns(+ name="The user's full name.",+ email="The user's email address.",+ traits="Custom traits/attributes set on the user.",+ avatar="URL of the user's avatar image.",+ lastSeenTimestamp="Time the user was last seen active.",+ ),+ },+ "Conversations": {+ "description": "A support or success conversation logged against a Vitally account or user.",+ "docs_url": "https://docs.vitally.io/pushing-data-to-vitally/rest-api#conversations",+ "columns": _columns(+ subject="The conversation's subject line.",+ accountId="ID of the account the conversation relates to.",+ externalUrl="Link to the conversation in the source system.",+ messages="The messages that make up the conversation.",+ ),+ },+ "Notes": {+ "description": "A note recorded against a Vitally account, user, or other object.",+ "docs_url": "https://docs.vitally.io/pushing-data-to-vitally/rest-api#notes",+ "columns": _columns(+ note="The note's body text.",+ accountId="ID of the account the note is attached to.",+ authorId="ID of the Vitally user who wrote the note.",+ category="Category assigned to the note.",+ ),+ },+ "Projects": {+ "description": "A project (e.g. onboarding or a success plan) tracked against a Vitally account.",+ "docs_url": "https://docs.vitally.io/pushing-data-to-vitally/rest-api#projects",+ "columns": _columns(+ name="The project's name.",+ accountId="ID of the account the project belongs to.",+ status="Current status of the project.",+ ownerId="ID of the Vitally user who owns the project.",+ completedAt="Time at which the project was completed, if applicable.",+ ),+ },+ "Tasks": {+ "description": "A task assigned to a team member in Vitally, often part of a project or playbook.",+ "docs_url": "https://docs.vitally.io/pushing-data-to-vitally/rest-api#tasks",+ "columns": _columns(+ name="The task's name.",+ accountId="ID of the account the task relates to.",+ assignedToId="ID of the Vitally user the task is assigned to.",+ status="Current status of the task.",+ dueDate="Date by which the task is due.",+ completedAt="Time at which the task was completed, if applicable.",+ ),+ },+ "NPS_Responses": {+ "description": "An NPS (Net Promoter Score) survey response collected in Vitally.",+ "docs_url": "https://docs.vitally.io/pushing-data-to-vitally/rest-api#nps-responses",+ "columns": _columns(+ score="The NPS score the respondent gave (0-10).",+ feedback="Free-text feedback provided with the score.",+ userId="ID of the user who submitted the response.",+ accountId="ID of the account the respondent belongs to.",+ npsType="Classification of the score: detractor, passive, or promoter.",+ ),+ },+ "Custom_Objects": {+ "description": "A definition of a custom object type configured in Vitally.",+ "docs_url": "https://docs.vitally.io/pushing-data-to-vitally/rest-api#custom-objects",+ "columns": _columns(+ name="Machine name of the custom object type.",+ label="Human-readable label for the custom object type.",+ ),+ },+ "Messages": {+ "description": "An individual message within a Vitally conversation.",+ "docs_url": "https://docs.vitally.io/pushing-data-to-vitally/rest-api#conversations",+ "columns": _columns(+ conversationId="ID of the conversation this message belongs to.",+ body="The message body text.",+ authorId="ID of the author who sent the message.",+ conversation_updated_at="Time at which the parent conversation was last updated.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/vitally/source.py b/posthog/temporal/data_imports/sources/vitally/source.pyindex 03f86b46efd4..44166bfe64da 100644--- a/posthog/temporal/data_imports/sources/vitally/source.py+++ b/posthog/temporal/data_imports/sources/vitally/source.py@@ -14,6 +14,7 @@ from posthog.schema import (from posthog.exceptions_capture import capture_exceptionfrom posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, SimpleSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.schema import SourceSchemafrom posthog.temporal.data_imports.sources.generated_configs import VitallySourceConfig@@ -38,6 +39,11 @@ class VitallySource(SimpleSource[VitallySourceConfig]):def source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.VITALLY+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.vitally.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: VitallySourceConfig,diff --git a/posthog/temporal/data_imports/sources/webflow/canonical_descriptions.py b/posthog/temporal/data_imports/sources/webflow/canonical_descriptions.pynew file mode 100644index 000000000000..1ff4569eae70--- /dev/null+++ b/posthog/temporal/data_imports/sources/webflow/canonical_descriptions.py@@ -0,0 +1,115 @@+"""Canonical, documentation-sourced descriptions for Webflow endpoints and columns.++Sourced from the official Webflow Data API v2 reference (https://developers.webflow.com/data/reference).+Keyed by the static endpoint names in `settings.py` `WEBFLOW_ENDPOINTS`, which match the+`ExternalDataSchema.name` of a synced Webflow table. The per-site `collection_<slug>` schemas are+user-defined CMS collections discovered at sync time, so they intentionally have no canonical entry+and fall back to LLM enrichment. Columns absent here also fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "sites": {+ "description": "A Webflow site, including its metadata and publishing details.",+ "docs_url": "https://developers.webflow.com/data/reference/sites/get",+ "columns": {+ "id": "Unique identifier for the site.",+ "displayName": "Human-readable name of the site.",+ "shortName": "Short, slug-like name of the site.",+ "previewUrl": "URL of the site's preview image.",+ "timeZone": "The site's configured time zone.",+ "createdOn": "Time at which the site was created.",+ "lastPublished": "Time at which the site was last published.",+ "lastUpdated": "Time at which the site was last updated.",+ "customDomains": "Custom domains attached to the site.",+ },+ },+ "collections": {+ "description": "A Webflow CMS collection (a content type) defined on the site.",+ "docs_url": "https://developers.webflow.com/data/reference/cms/collections/list",+ "columns": {+ "id": "Unique identifier for the collection.",+ "displayName": "Human-readable name of the collection.",+ "singularName": "Singular name for a single item in the collection.",+ "slug": "URL-friendly slug for the collection.",+ "createdOn": "Time at which the collection was created.",+ "lastUpdated": "Time at which the collection was last updated.",+ },+ },+ "pages": {+ "description": "A static page within a Webflow site.",+ "docs_url": "https://developers.webflow.com/data/reference/pages/list",+ "columns": {+ "id": "Unique identifier for the page.",+ "siteId": "ID of the site the page belongs to.",+ "title": "The page's title.",+ "slug": "URL slug of the page.",+ "parentId": "ID of the parent page, if the page is nested.",+ "createdOn": "Time at which the page was created.",+ "lastUpdated": "Time at which the page was last updated.",+ "archived": "Whether the page is archived.",+ "draft": "Whether the page is a draft.",+ "seo": "SEO metadata (title, description) for the page.",+ },+ },+ "products": {+ "description": "An ecommerce product in a Webflow site, with its associated SKUs.",+ "docs_url": "https://developers.webflow.com/data/reference/ecommerce/products/list",+ "columns": {+ "id": "Unique identifier for the product.",+ "fieldData": "The product's content fields (name, slug, description, etc.).",+ "skus": "The SKUs (variants) available for this product.",+ "createdOn": "Time at which the product was created.",+ "lastUpdated": "Time at which the product was last updated.",+ "isArchived": "Whether the product is archived.",+ "isDraft": "Whether the product is a draft.",+ },+ },+ "orders": {+ "description": "A customer order placed through a Webflow ecommerce site.",+ "docs_url": "https://developers.webflow.com/data/reference/ecommerce/orders/list",+ "columns": {+ "orderId": "Unique identifier for the order.",+ "status": "Status of the order (e.g. pending, fulfilled, refunded).",+ "customerInfo": "Customer contact information for the order.",+ "purchasedItems": "Line items purchased in the order.",+ "netAmount": "Net amount of the order after discounts and refunds.",+ "totals": "Breakdown of order totals (subtotal, tax, shipping, total).",+ "customerPaid": "Total amount the customer paid for the order.",+ "shippingProvider": "Name of the shipping provider for the order.",+ "shippingTracking": "Tracking number for the order's shipment.",+ "acceptedOn": "Time at which the order was accepted.",+ "fulfilledOn": "Time at which the order was fulfilled.",+ "refundedOn": "Time at which the order was refunded, if applicable.",+ },+ },+ "users": {+ "description": "A registered user (site member) of a Webflow site.",+ "docs_url": "https://developers.webflow.com/data/reference/users/list",+ "columns": {+ "id": "Unique identifier for the user.",+ "isEmailVerified": "Whether the user's email address has been verified.",+ "status": "Account status of the user (e.g. verified, invited, unverified).",+ "accessGroups": "Access groups the user belongs to.",+ "data": "Custom user data fields (name, email, accept-privacy, etc.).",+ "createdOn": "Time at which the user account was created.",+ "lastUpdated": "Time at which the user account was last updated.",+ "lastLogin": "Time at which the user last logged in.",+ },+ },+ "forms": {+ "description": "A form definition configured on a Webflow site.",+ "docs_url": "https://developers.webflow.com/data/reference/forms/list-forms",+ "columns": {+ "id": "Unique identifier for the form.",+ "displayName": "Human-readable name of the form.",+ "siteId": "ID of the site the form belongs to.",+ "pageId": "ID of the page the form appears on.",+ "fields": "The fields that make up the form.",+ "responseSettings": "Settings controlling how form responses are handled.",+ "createdOn": "Time at which the form was created.",+ "lastUpdated": "Time at which the form was last updated.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/webflow/source.py b/posthog/temporal/data_imports/sources/webflow/source.pyindex a8915d7f79b4..5a286e735664 100644--- a/posthog/temporal/data_imports/sources/webflow/source.py+++ b/posthog/temporal/data_imports/sources/webflow/source.py@@ -13,6 +13,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -36,6 +37,11 @@ class WebflowSource(ResumableSource[WebflowSourceConfig, WebflowResumeConfig]):def source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.WEBFLOW+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.webflow.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error": "Your Webflow API token is invalid or expired. Please generate a new token and reconnect.",diff --git a/posthog/temporal/data_imports/sources/woocommerce/canonical_descriptions.py b/posthog/temporal/data_imports/sources/woocommerce/canonical_descriptions.pynew file mode 100644index 000000000000..cd8c8132b622--- /dev/null+++ b/posthog/temporal/data_imports/sources/woocommerce/canonical_descriptions.py@@ -0,0 +1,162 @@+"""Canonical, documentation-sourced descriptions for WooCommerce endpoints and columns.++Sourced from the official WooCommerce REST API v3 reference (https://woocommerce.github.io/woocommerce-rest-api-docs/).+Keyed by the endpoint names in `settings.py` `ENDPOINTS`, which match the `ExternalDataSchema.name`+of a synced WooCommerce table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "products": {+ "description": "A product sold in the WooCommerce store.",+ "docs_url": "https://woocommerce.github.io/woocommerce-rest-api-docs/#products",+ "columns": {+ "id": "Unique identifier for the product.",+ "name": "The product's name.",+ "slug": "URL-friendly slug for the product.",+ "type": "Product type (e.g. simple, variable, grouped, external).",+ "status": "Publication status (e.g. draft, pending, private, publish).",+ "sku": "Stock keeping unit (SKU) for the product.",+ "price": "Current price of the product.",+ "regular_price": "Regular (non-sale) price of the product.",+ "sale_price": "Sale price of the product, if on sale.",+ "stock_quantity": "Number of units in stock.",+ "stock_status": "Stock status (instock, outofstock, or onbackorder).",+ "categories": "Categories the product belongs to.",+ "tags": "Tags applied to the product.",+ "total_sales": "Total number of units sold.",+ "date_created_gmt": "Time the product was created, in GMT.",+ "date_modified_gmt": "Time the product was last modified, in GMT.",+ },+ },+ "orders": {+ "description": "A customer order placed in the WooCommerce store.",+ "docs_url": "https://woocommerce.github.io/woocommerce-rest-api-docs/#orders",+ "columns": {+ "id": "Unique identifier for the order.",+ "number": "Order number shown to the customer.",+ "status": "Status of the order (e.g. pending, processing, completed, refunded).",+ "currency": "Currency the order was placed in, as an ISO code.",+ "total": "Grand total for the order.",+ "total_tax": "Total tax charged on the order.",+ "discount_total": "Total discount applied to the order.",+ "shipping_total": "Total shipping cost for the order.",+ "customer_id": "ID of the customer who placed the order (0 for guests).",+ "billing": "Billing address and contact details for the order.",+ "shipping": "Shipping address for the order.",+ "payment_method": "Payment method identifier used for the order.",+ "line_items": "The products and quantities included in the order.",+ "date_created_gmt": "Time the order was created, in GMT.",+ "date_modified_gmt": "Time the order was last modified, in GMT.",+ "date_paid_gmt": "Time the order was paid, in GMT.",+ "date_completed_gmt": "Time the order was completed, in GMT.",+ },+ },+ "coupons": {+ "description": "A discount coupon configured in the WooCommerce store.",+ "docs_url": "https://woocommerce.github.io/woocommerce-rest-api-docs/#coupons",+ "columns": {+ "id": "Unique identifier for the coupon.",+ "code": "The coupon code customers enter at checkout.",+ "discount_type": "Type of discount (percent, fixed_cart, or fixed_product).",+ "amount": "Discount amount applied by the coupon.",+ "usage_count": "Number of times the coupon has been used.",+ "usage_limit": "Maximum number of times the coupon can be used in total.",+ "date_expires": "Date the coupon expires.",+ "date_created_gmt": "Time the coupon was created, in GMT.",+ "date_modified_gmt": "Time the coupon was last modified, in GMT.",+ },+ },+ "customers": {+ "description": "A registered customer of the WooCommerce store.",+ "docs_url": "https://woocommerce.github.io/woocommerce-rest-api-docs/#customers",+ "columns": {+ "id": "Unique identifier for the customer.",+ "email": "The customer's email address.",+ "first_name": "The customer's first name.",+ "last_name": "The customer's last name.",+ "username": "The customer's account username.",+ "role": "The customer's user role.",+ "billing": "The customer's billing address and contact details.",+ "shipping": "The customer's shipping address.",+ "is_paying_customer": "Whether the customer has placed a paid order.",+ "date_created_gmt": "Time the customer account was created, in GMT.",+ "date_modified_gmt": "Time the customer account was last modified, in GMT.",+ },+ },+ "product_categories": {+ "description": "A category used to organize products in the WooCommerce store.",+ "docs_url": "https://woocommerce.github.io/woocommerce-rest-api-docs/#product-categories",+ "columns": {+ "id": "Unique identifier for the category.",+ "name": "The category's name.",+ "slug": "URL-friendly slug for the category.",+ "parent": "ID of the parent category, if nested.",+ "description": "Description of the category.",+ "count": "Number of products in the category.",+ },+ },+ "product_tags": {+ "description": "A tag used to label products in the WooCommerce store.",+ "docs_url": "https://woocommerce.github.io/woocommerce-rest-api-docs/#product-tags",+ "columns": {+ "id": "Unique identifier for the tag.",+ "name": "The tag's name.",+ "slug": "URL-friendly slug for the tag.",+ "description": "Description of the tag.",+ "count": "Number of products with this tag.",+ },+ },+ "product_reviews": {+ "description": "A customer review left on a product in the WooCommerce store.",+ "docs_url": "https://woocommerce.github.io/woocommerce-rest-api-docs/#product-reviews",+ "columns": {+ "id": "Unique identifier for the review.",+ "product_id": "ID of the product being reviewed.",+ "status": "Moderation status of the review (e.g. approved, hold, spam).",+ "reviewer": "Name of the person who left the review.",+ "reviewer_email": "Email address of the reviewer.",+ "review": "The review's text content.",+ "rating": "Star rating given in the review.",+ "verified": "Whether the reviewer is a verified purchaser.",+ "date_created_gmt": "Time the review was created, in GMT.",+ },+ },+ "product_attributes": {+ "description": "A global product attribute (e.g. color, size) defined in the WooCommerce store.",+ "docs_url": "https://woocommerce.github.io/woocommerce-rest-api-docs/#product-attributes",+ "columns": {+ "id": "Unique identifier for the attribute.",+ "name": "The attribute's name.",+ "slug": "URL-friendly slug for the attribute.",+ "type": "The attribute's type (e.g. select).",+ "order_by": "Default sort order for the attribute's terms.",+ "has_archives": "Whether the attribute has product archive pages enabled.",+ },+ },+ "tax_rates": {+ "description": "A tax rate configured in the WooCommerce store.",+ "docs_url": "https://woocommerce.github.io/woocommerce-rest-api-docs/#tax-rates",+ "columns": {+ "id": "Unique identifier for the tax rate.",+ "country": "Country code the tax rate applies to.",+ "state": "State the tax rate applies to.",+ "rate": "The tax rate as a percentage.",+ "name": "Display name of the tax rate.",+ "priority": "Priority of the tax rate (used to apply multiple rates).",+ "compound": "Whether the rate is compounded on top of other rates.",+ "shipping": "Whether the rate applies to shipping.",+ "class": "Tax class the rate belongs to.",+ },+ },+ "shipping_zones": {+ "description": "A shipping zone that groups regions for shipping method configuration.",+ "docs_url": "https://woocommerce.github.io/woocommerce-rest-api-docs/#shipping-zones",+ "columns": {+ "id": "Unique identifier for the shipping zone.",+ "name": "The shipping zone's name.",+ "order": "Display order of the shipping zone.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/woocommerce/source.py b/posthog/temporal/data_imports/sources/woocommerce/source.pyindex fbcd1e7396c9..038f408bed96 100644--- a/posthog/temporal/data_imports/sources/woocommerce/source.py+++ b/posthog/temporal/data_imports/sources/woocommerce/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -31,6 +32,11 @@ class WooCommerceSource(ResumableSource[WooCommerceSourceConfig, WooCommerceResudef source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.WOOCOMMERCE+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.woocommerce.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error": "WooCommerce authentication failed. Please check your consumer key and secret.",diff --git a/posthog/temporal/data_imports/sources/workos/canonical_descriptions.py b/posthog/temporal/data_imports/sources/workos/canonical_descriptions.pynew file mode 100644index 000000000000..17ac01d0ed92--- /dev/null+++ b/posthog/temporal/data_imports/sources/workos/canonical_descriptions.py@@ -0,0 +1,89 @@+"""Canonical, documentation-sourced descriptions for WorkOS endpoints and columns.++Sourced from the official WorkOS API reference (https://workos.com/docs/reference). Keyed by the+endpoint names in `settings.py` `WORKOS_ENDPOINTS`, which match the `ExternalDataSchema.name` of a+synced WorkOS table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by most WorkOS objects; merged into each entry so we don't repeat them.+_COMMON_COLUMNS = {+ "id": "Unique identifier for the object.",+ "object": "String describing the object's WorkOS type.",+ "created_at": "Time at which the object was created.",+ "updated_at": "Time at which the object was last updated.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "organizations": {+ "description": "An organization (a tenant/company) in WorkOS that users and connections belong to.",+ "docs_url": "https://workos.com/docs/reference/organization",+ "columns": _columns(+ name="The organization's display name.",+ domains="Verified domains associated with the organization.",+ allow_profiles_outside_organization="Whether users outside the organization's domains may sign in.",+ ),+ },+ "users": {+ "description": "A user managed by WorkOS User Management (AuthKit).",+ "docs_url": "https://workos.com/docs/reference/user-management/user",+ "columns": _columns(+ email="The user's email address.",+ first_name="The user's first name.",+ last_name="The user's last name.",+ email_verified="Whether the user's email address has been verified.",+ profile_picture_url="URL of the user's profile picture.",+ last_sign_in_at="Time at which the user last signed in.",+ ),+ },+ "connections": {+ "description": "An SSO connection between an organization and an identity provider.",+ "docs_url": "https://workos.com/docs/reference/sso/connection",+ "columns": _columns(+ name="Name of the connection.",+ organization_id="ID of the organization the connection belongs to.",+ connection_type="Type of identity provider for the connection (e.g. OktaSAML, GoogleOAuth).",+ state="State of the connection (e.g. active, inactive).",+ ),+ },+ "directories": {+ "description": "A directory connection used for Directory Sync (SCIM) with an organization.",+ "docs_url": "https://workos.com/docs/reference/directory-sync/directory",+ "columns": _columns(+ name="Name of the directory.",+ organization_id="ID of the organization the directory belongs to.",+ domain="Primary domain associated with the directory.",+ type="Type of the directory provider (e.g. okta scim v2.0, azure scim v2.0).",+ state="State of the directory (e.g. linked, unlinked).",+ ),+ },+ "directory_users": {+ "description": "A user synced from an organization's directory via Directory Sync.",+ "docs_url": "https://workos.com/docs/reference/directory-sync/directory-user",+ "columns": _columns(+ directory_id="ID of the directory the user was synced from.",+ organization_id="ID of the organization the directory belongs to.",+ email="The user's primary email address.",+ first_name="The user's first name.",+ last_name="The user's last name.",+ username="The user's username in the directory.",+ state="State of the user in the directory (active or inactive).",+ groups="Directory groups the user is a member of.",+ ),+ },+ "directory_groups": {+ "description": "A group synced from an organization's directory via Directory Sync.",+ "docs_url": "https://workos.com/docs/reference/directory-sync/directory-group",+ "columns": _columns(+ directory_id="ID of the directory the group was synced from.",+ organization_id="ID of the organization the directory belongs to.",+ name="The group's name.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/workos/source.py b/posthog/temporal/data_imports/sources/workos/source.pyindex 791cf36cd426..b4bcb2201c0c 100644--- a/posthog/temporal/data_imports/sources/workos/source.py+++ b/posthog/temporal/data_imports/sources/workos/source.py@@ -10,6 +10,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -59,6 +60,11 @@ The key starts with `sk_`.),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.workos.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_schemas(self,config: WorkOSSourceConfig,diff --git a/posthog/temporal/data_imports/sources/wrike/canonical_descriptions.py b/posthog/temporal/data_imports/sources/wrike/canonical_descriptions.pynew file mode 100644index 000000000000..b1bc63bdca63--- /dev/null+++ b/posthog/temporal/data_imports/sources/wrike/canonical_descriptions.py@@ -0,0 +1,94 @@+"""Canonical, documentation-sourced descriptions for Wrike endpoints and columns.++Sourced from the official Wrike REST API v4 reference (https://developers.wrike.com/). Keyed by the+endpoint names in `settings.py` `WRIKE_ENDPOINTS`, which match the `ExternalDataSchema.name` of a+synced Wrike table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "tasks": {+ "description": "A task in Wrike — a unit of work with an assignee, status, and dates.",+ "docs_url": "https://developers.wrike.com/api/v4/tasks/",+ "columns": {+ "id": "Unique identifier for the task.",+ "title": "The task's title.",+ "description": "The task's description.",+ "status": "Workflow status of the task (e.g. Active, Completed, Deferred, Cancelled).",+ "importance": "Priority of the task (High, Normal, or Low).",+ "createdDate": "Time at which the task was created.",+ "updatedDate": "Time at which the task was last updated.",+ "completedDate": "Time at which the task was completed, if applicable.",+ "dates": "The task's scheduling dates (start, due, duration).",+ "responsibleIds": "IDs of the contacts responsible for the task.",+ "authorIds": "IDs of the contacts who created the task.",+ "parentIds": "IDs of the parent folders/projects containing the task.",+ "permalink": "Link to open the task in the Wrike web app.",+ },+ },+ "folders": {+ "description": "A folder or project in Wrike that organizes tasks and other folders.",+ "docs_url": "https://developers.wrike.com/api/v4/folders-projects/",+ "columns": {+ "id": "Unique identifier for the folder.",+ "title": "The folder's title.",+ "description": "The folder's description.",+ "scope": "Scope of the folder (e.g. WsFolder, RbFolder).",+ "childIds": "IDs of child folders contained within this folder.",+ "parentIds": "IDs of the parent folders containing this folder.",+ "project": "Project details if the folder is a project (status, owners, dates).",+ "color": "Color assigned to the folder.",+ "permalink": "Link to open the folder in the Wrike web app.",+ },+ },+ "contacts": {+ "description": "A contact in Wrike — a user or group within the account.",+ "docs_url": "https://developers.wrike.com/api/v4/contacts/",+ "columns": {+ "id": "Unique identifier for the contact.",+ "firstName": "The contact's first name.",+ "lastName": "The contact's last name.",+ "type": "Type of contact (Person or Group).",+ "profiles": "Profiles describing the contact's email and account roles.",+ "avatarUrl": "URL of the contact's avatar image.",+ "timezone": "The contact's time zone.",+ "locale": "The contact's locale.",+ "deleted": "Whether the contact has been deleted.",+ },+ },+ "workflows": {+ "description": "A workflow in Wrike defining the set of statuses tasks can move through.",+ "docs_url": "https://developers.wrike.com/api/v4/workflows/",+ "columns": {+ "id": "Unique identifier for the workflow.",+ "name": "The workflow's name.",+ "standard": "Whether this is the account's standard (default) workflow.",+ "hidden": "Whether the workflow is hidden.",+ "customStatuses": "The custom statuses defined within the workflow.",+ },+ },+ "custom_fields": {+ "description": "A custom field definition that can be applied to tasks and folders in Wrike.",+ "docs_url": "https://developers.wrike.com/api/v4/custom-fields/",+ "columns": {+ "id": "Unique identifier for the custom field.",+ "title": "The custom field's title.",+ "type": "Data type of the custom field (e.g. Text, Numeric, DropDown, Date).",+ "spaceId": "ID of the space the custom field belongs to, if space-scoped.",+ "settings": "Type-specific settings for the custom field (e.g. dropdown options).",+ },+ },+ "spaces": {+ "description": "A space in Wrike — a top-level container grouping related projects and folders.",+ "docs_url": "https://developers.wrike.com/api/v4/spaces/",+ "columns": {+ "id": "Unique identifier for the space.",+ "title": "The space's title.",+ "description": "The space's description.",+ "access": "Access level of the space (e.g. Public, Private).",+ "archived": "Whether the space is archived.",+ "avatarUrl": "URL of the space's avatar image.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/wrike/source.py b/posthog/temporal/data_imports/sources/wrike/source.pyindex c6a7178b0abe..cf988b670303 100644--- a/posthog/temporal/data_imports/sources/wrike/source.py+++ b/posthog/temporal/data_imports/sources/wrike/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -68,6 +69,11 @@ Set **Host** to the domain shown in your browser when you're logged into Wrike (),)+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.wrike.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error": "Invalid or expired Wrike access token. Please generate a new token and reconnect.",diff --git a/posthog/temporal/data_imports/sources/zendesk/canonical_descriptions.py b/posthog/temporal/data_imports/sources/zendesk/canonical_descriptions.pynew file mode 100644index 000000000000..7a67069760fc--- /dev/null+++ b/posthog/temporal/data_imports/sources/zendesk/canonical_descriptions.py@@ -0,0 +1,156 @@+"""Canonical, documentation-sourced descriptions for Zendesk endpoints and columns.++Sourced from the official Zendesk Support API reference (https://developer.zendesk.com/api-reference/).+Keyed by the resource names in `settings.py` (`BASE_ENDPOINTS` + `SUPPORT_ENDPOINTS`), which match the+`ExternalDataSchema.name` of a synced Zendesk table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by most Zendesk objects; merged into each entry so we don't repeat them.+_COMMON_COLUMNS = {+ "id": "Automatically assigned unique identifier for the object.",+ "url": "API URL of the object.",+ "created_at": "Time the object was created.",+ "updated_at": "Time the object was last updated.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "tickets": {+ "description": "A support request submitted by a customer and tracked through to resolution.",+ "docs_url": "https://developer.zendesk.com/api-reference/ticketing/tickets/tickets/",+ "columns": _columns(+ subject="The value of the subject field for this ticket.",+ raw_subject="The dynamic content placeholder, if present, or the subject value.",+ description="Read-only first comment on the ticket.",+ status="State of the ticket: new, open, pending, hold, solved, or closed.",+ priority="Urgency of the ticket: urgent, high, normal, or low.",+ type="Type of the ticket: problem, incident, question, or task.",+ requester_id="ID of the user who requested this ticket.",+ submitter_id="ID of the user who submitted the ticket.",+ assignee_id="ID of the agent currently assigned to the ticket.",+ organization_id="ID of the organization the ticket's requester belongs to.",+ group_id="ID of the group the ticket is assigned to.",+ brand_id="ID of the brand this ticket is associated with.",+ tags="Array of tags applied to the ticket.",+ satisfaction_rating="The customer satisfaction rating of the ticket, if offered.",+ via="How and where the ticket was created (channel and source).",+ due_at="For tickets of type task, the date the task is due.",+ generated_timestamp="Incremental cursor: timestamp the ticket was last modified.",+ custom_fields="Custom fields for the ticket.",+ ),+ },+ "ticket_fields": {+ "description": "A field that appears on tickets, system or custom, with its type and configuration.",+ "docs_url": "https://developer.zendesk.com/api-reference/ticketing/tickets/ticket_fields/",+ "columns": _columns(+ type="System or custom field type (e.g. subject, text, checkbox, tagger).",+ title="Title of the ticket field shown to agents.",+ title_in_portal="Title shown to end users in the help center.",+ description="Description of the purpose of this ticket field.",+ active="Whether this field is currently available.",+ required="Whether agents must enter a value before solving the ticket.",+ position="Relative position of the field on a ticket.",+ custom_field_options="List of selectable options for dropdown-type fields.",+ ),+ },+ "ticket_events": {+ "description": "A record of changes to ticket properties over time, from the incremental ticket events export.",+ "docs_url": "https://developer.zendesk.com/api-reference/ticketing/ticket-management/incremental_exports/#incremental-ticket-event-export",+ "columns": _columns(+ ticket_id="ID of the ticket the event applies to.",+ timestamp="Time the event occurred, as a Unix timestamp.",+ updater_id="ID of the user who made the change.",+ via="How and where the change was made.",+ child_events="Individual property changes that make up this event.",+ event_type="Type of the event.",+ ),+ },+ "ticket_metric_events": {+ "description": "Time-series events for ticket metrics such as reply time and resolution time.",+ "docs_url": "https://developer.zendesk.com/api-reference/ticketing/ticket-management/ticket_metric_events/",+ "columns": _columns(+ ticket_id="ID of the ticket the metric event applies to.",+ metric="The metric measured (e.g. agent_work_time, reply_time, resolution_time).",+ instance_id="Identifier grouping events belonging to one metric instance.",+ type="Type of the metric event: activate, fulfill, pause, breach, update_status, or measure.",+ time="Time the metric event occurred.",+ deleted="Whether the metric event has been deleted.",+ status="For update_status events, the calculated status of the metric.",+ ),+ },+ "users": {+ "description": "A person who interacts with Zendesk Support: an end user, agent, or administrator.",+ "docs_url": "https://developer.zendesk.com/api-reference/ticketing/users/users/",+ "columns": _columns(+ name="The user's name.",+ email="The user's primary email address.",+ role="The user's role: end-user, agent, or admin.",+ active="Whether the user is active (false if deleted).",+ verified="Whether any of the user's identities is verified.",+ suspended="Whether the user is suspended (cannot sign in or submit tickets).",+ organization_id="ID of the user's default organization.",+ phone="The user's primary phone number.",+ time_zone="The user's time zone.",+ locale="The user's locale (e.g. en-US).",+ tags="Array of tags applied to the user.",+ last_login_at="Time the user last signed in.",+ external_id="A unique identifier for the user set from another system.",+ ),+ },+ "organizations": {+ "description": "A collection of users grouped into a single account, often a company.",+ "docs_url": "https://developer.zendesk.com/api-reference/ticketing/organizations/organizations/",+ "columns": _columns(+ name="A unique name for the organization.",+ domain_names="An array of domain names associated with this organization.",+ details="Any details about the organization, such as the address.",+ notes="Any notes about the organization.",+ group_id="ID of the group new tickets from this organization are assigned to.",+ shared_tickets="Whether end users in this organization can see each other's tickets.",+ shared_comments="Whether end users in this organization can see each other's comments.",+ tags="Array of tags applied to the organization.",+ external_id="A unique external identifier set from another system.",+ ),+ },+ "groups": {+ "description": "A collection of agents who can be assigned tickets together.",+ "docs_url": "https://developer.zendesk.com/api-reference/ticketing/groups/groups/",+ "columns": _columns(+ name="The name of the group.",+ description="The description of the group.",+ default="Whether this is the default group for the account.",+ is_public="Whether the group is public; if false it is a private group.",+ deleted="Whether the group has been deleted.",+ ),+ },+ "brands": {+ "description": "A customer-facing identity — branding, support address, and help center — within one account.",+ "docs_url": "https://developer.zendesk.com/api-reference/ticketing/account-configuration/brands/",+ "columns": _columns(+ name="The name of the brand.",+ brand_url="The URL of the brand.",+ subdomain="The subdomain of the brand.",+ active="Whether the brand is set as active.",+ default="Whether the brand is the default brand for this account.",+ has_help_center="Whether the brand has a help center.",+ host_mapping="The hostmapping to this brand, if any (only admins can update).",+ ),+ },+ "sla_policies": {+ "description": "A service level agreement policy defining target response and resolution times for tickets.",+ "docs_url": "https://developer.zendesk.com/api-reference/ticketing/business-rules/sla_policies/",+ "columns": _columns(+ title="The title of the SLA policy.",+ description="The description of the SLA policy.",+ position="Position of the policy, determining the order it is matched in.",+ filter="The conditions used to match tickets to this policy.",+ policy_metrics="The metric targets (e.g. first reply time) for each priority level.",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/zendesk/source.py b/posthog/temporal/data_imports/sources/zendesk/source.pyindex c4889956da9a..a6d90071a011 100644--- a/posthog/temporal/data_imports/sources/zendesk/source.py+++ b/posthog/temporal/data_imports/sources/zendesk/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, SimpleSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.schema import SourceSchemafrom posthog.temporal.data_imports.sources.generated_configs import ZendeskSourceConfig@@ -35,6 +36,11 @@ class ZendeskSource(SimpleSource[ZendeskSourceConfig]):def source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.ZENDESK+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.zendesk.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"404 Client Error: Not Found for url": "Zendesk authentication failed. Please check your API token and subdomain.",diff --git a/posthog/temporal/data_imports/sources/zoom/canonical_descriptions.py b/posthog/temporal/data_imports/sources/zoom/canonical_descriptions.pynew file mode 100644index 000000000000..21f6aae1e3b9--- /dev/null+++ b/posthog/temporal/data_imports/sources/zoom/canonical_descriptions.py@@ -0,0 +1,65 @@+"""Canonical, documentation-sourced descriptions for Zoom endpoints and columns.++Sourced from the official Zoom API reference (https://developers.zoom.us/docs/api/). Keyed by the+endpoint names in `settings.py` `ZOOM_ENDPOINTS`, which match the `ExternalDataSchema.name` of a+synced Zoom table. Columns absent here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "users": {+ "description": "A user in the Zoom account.",+ "docs_url": "https://developers.zoom.us/docs/api/users/#tag/users/GET/users",+ "columns": {+ "id": "Unique identifier of the user.",+ "email": "The user's email address.",+ "first_name": "The user's first name.",+ "last_name": "The user's last name.",+ "display_name": "The user's display name.",+ "type": "The user's plan type (1 = Basic, 2 = Licensed, 4 = No meetings host).",+ "status": "The user's status: active, inactive, or pending.",+ "role_id": "Unique identifier of the role assigned to the user.",+ "pmi": "The user's personal meeting ID.",+ "timezone": "The user's time zone.",+ "dept": "The department the user belongs to.",+ "created_at": "Time the user's account was created.",+ "last_login_time": "Time the user last logged in.",+ "verified": "Whether the user's email address is verified (1) or not (0).",+ },+ },+ "meetings": {+ "description": "A scheduled meeting hosted by a user in the Zoom account.",+ "docs_url": "https://developers.zoom.us/docs/api/meetings/#tag/meetings/GET/users/{userId}/meetings",+ "columns": {+ "id": "Unique numeric identifier of the meeting.",+ "uuid": "Universally unique identifier of the meeting instance.",+ "host_id": "Unique identifier of the user hosting the meeting.",+ "topic": "The meeting's topic.",+ "type": "Meeting type (1 = instant, 2 = scheduled, 3 = recurring no fixed time, 8 = recurring fixed time).",+ "start_time": "The meeting's scheduled start time.",+ "duration": "The meeting's scheduled duration, in minutes.",+ "timezone": "Time zone of the meeting's start time.",+ "agenda": "The meeting's agenda.",+ "join_url": "URL participants use to join the meeting.",+ "created_at": "Time the meeting was created.",+ },+ },+ "webinars": {+ "description": "A scheduled webinar hosted by a user in the Zoom account.",+ "docs_url": "https://developers.zoom.us/docs/api/webinars/#tag/webinars/GET/users/{userId}/webinars",+ "columns": {+ "id": "Unique numeric identifier of the webinar.",+ "uuid": "Universally unique identifier of the webinar instance.",+ "host_id": "Unique identifier of the user hosting the webinar.",+ "topic": "The webinar's topic.",+ "type": "Webinar type (5 = scheduled, 6 = recurring no fixed time, 9 = recurring fixed time).",+ "start_time": "The webinar's scheduled start time.",+ "duration": "The webinar's scheduled duration, in minutes.",+ "timezone": "Time zone of the webinar's start time.",+ "agenda": "The webinar's agenda.",+ "join_url": "URL participants use to join the webinar.",+ "created_at": "Time the webinar was created.",+ },+ },+}diff --git a/posthog/temporal/data_imports/sources/zoom/source.py b/posthog/temporal/data_imports/sources/zoom/source.pyindex 0e55ecf60df5..a97318743762 100644--- a/posthog/temporal/data_imports/sources/zoom/source.py+++ b/posthog/temporal/data_imports/sources/zoom/source.py@@ -11,6 +11,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -31,6 +32,11 @@ class ZoomSource(ResumableSource[ZoomSourceConfig, ZoomResumeConfig]):def source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.ZOOM+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.zoom.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"401 Client Error": "Zoom authentication failed. Please check your account ID, client ID, and client secret.",diff --git a/posthog/temporal/data_imports/sources/zuora/canonical_descriptions.py b/posthog/temporal/data_imports/sources/zuora/canonical_descriptions.pynew file mode 100644index 000000000000..fe878caac4a3--- /dev/null+++ b/posthog/temporal/data_imports/sources/zuora/canonical_descriptions.py@@ -0,0 +1,152 @@+"""Canonical, documentation-sourced descriptions for Zuora endpoints and columns.++Sourced from the official Zuora Billing API / Object Query reference+(https://www.zuora.com/developer/api-references/api/). Keyed by the stream names in `settings.py`+`ZUORA_ENDPOINTS`, which match the `ExternalDataSchema.name` of a synced Zuora table. Columns absent+here fall back to LLM enrichment.+"""++from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptions++# Fields shared by most Zuora Object Query objects; merged into each entry so we don't repeat them.+_COMMON_COLUMNS = {+ "id": "Unique identifier of the object.",+ "createdDate": "Time the object was created.",+ "updatedDate": "Time the object was last updated (the incremental sync cursor).",+ "createdById": "ID of the Zuora user who created the object.",+ "updatedById": "ID of the Zuora user who last updated the object.",+}+++def _columns(**overrides: str) -> dict[str, str]:+ return {**_COMMON_COLUMNS, **overrides}+++CANONICAL_DESCRIPTIONS: CanonicalDescriptions = {+ "accounts": {+ "description": "A customer account holding billing, payment, and contact information.",+ "docs_url": "https://www.zuora.com/developer/api-references/api/tag/Accounts",+ "columns": _columns(+ accountNumber="Unique, human-readable account number.",+ name="Name of the account.",+ status="Status of the account: Draft, Active, or Canceled.",+ currency="Default currency for the account, as a three-letter ISO code.",+ balance="Current outstanding balance on the account.",+ billToContactId="ID of the contact billed for this account.",+ soldToContactId="ID of the contact the product or service was sold to.",+ billCycleDay="Day of the month on which the account is billed.",+ paymentTerm="Payment terms for the account (e.g. Net 30).",+ autoPay="Whether automatic payment is enabled for the account.",+ parentId="ID of the parent account, for account hierarchies.",+ ),+ },+ "subscriptions": {+ "description": "A customer's agreement to be billed for products over a period of time.",+ "docs_url": "https://www.zuora.com/developer/api-references/api/tag/Subscriptions",+ "columns": _columns(+ subscriptionNumber="Unique, human-readable subscription number.",+ accountId="ID of the account that owns the subscription.",+ status="Status of the subscription: Draft, Active, Cancelled, Expired, or Suspended.",+ version="Version number of the subscription (increments on amendment).",+ termType="Whether the subscription term is TERMED or EVERGREEN.",+ contractEffectiveDate="Date the contract takes effect.",+ serviceActivationDate="Date the service is activated.",+ subscriptionStartDate="Start date of the subscription.",+ termStartDate="Start date of the current subscription term.",+ termEndDate="End date of the current subscription term.",+ autoRenew="Whether the subscription renews automatically at term end.",+ currency="Currency of the subscription, as a three-letter ISO code.",+ ),+ },+ "invoices": {+ "description": "A bill issued to a customer account for amounts owed.",+ "docs_url": "https://www.zuora.com/developer/api-references/api/tag/Invoices",+ "columns": _columns(+ invoiceNumber="Unique, human-readable invoice number.",+ accountId="ID of the account the invoice is billed to.",+ status="Status of the invoice: Draft, Posted, Canceled, or Error.",+ amount="Total amount of the invoice.",+ balance="Remaining unpaid balance on the invoice.",+ taxAmount="Total tax charged on the invoice.",+ invoiceDate="Date the invoice was issued.",+ dueDate="Date payment for the invoice is due.",+ postedDate="Date the invoice was posted.",+ paymentAmount="Amount already paid against the invoice.",+ currency="Currency of the invoice, as a three-letter ISO code.",+ ),+ },+ "payments": {+ "description": "A payment applied against one or more invoices on a customer account.",+ "docs_url": "https://www.zuora.com/developer/api-references/api/tag/Payments",+ "columns": _columns(+ paymentNumber="Unique, human-readable payment number.",+ accountId="ID of the account the payment belongs to.",+ status="Status of the payment: Draft, Processing, Processed, Error, or Canceled.",+ type="Type of the payment: External or Electronic.",+ amount="Total amount of the payment.",+ appliedAmount="Amount of the payment applied to invoices or debit memos.",+ unappliedAmount="Amount of the payment not yet applied.",+ refundAmount="Amount of the payment that has been refunded.",+ effectiveDate="Date the payment took effect.",+ currency="Currency of the payment, as a three-letter ISO code.",+ paymentMethodId="ID of the payment method used.",+ ),+ },+ "credit_memos": {+ "description": "A document crediting a customer account, reducing the amount they owe.",+ "docs_url": "https://www.zuora.com/developer/api-references/api/tag/Credit-Memos",+ "columns": _columns(+ memoNumber="Unique, human-readable credit memo number.",+ accountId="ID of the account the credit memo is for.",+ status="Status of the credit memo: Draft, Posted, Canceled, or Error.",+ totalAmount="Total amount of the credit memo.",+ balance="Remaining unapplied balance of the credit memo.",+ appliedAmount="Amount of the credit memo applied to invoices.",+ refundAmount="Amount of the credit memo that has been refunded.",+ memoDate="Date of the credit memo.",+ reasonCode="Reason the credit memo was created.",+ currency="Currency of the credit memo, as a three-letter ISO code.",+ ),+ },+ "refunds": {+ "description": "A return of funds to a customer against a payment or credit memo.",+ "docs_url": "https://www.zuora.com/developer/api-references/api/tag/Refunds",+ "columns": _columns(+ refundNumber="Unique, human-readable refund number.",+ accountId="ID of the account the refund is for.",+ status="Status of the refund: Processing, Processed, Error, or Canceled.",+ type="Type of the refund: External or Electronic.",+ amount="Total amount of the refund.",+ refundDate="Date the refund took effect.",+ reasonCode="Reason the refund was issued.",+ paymentId="ID of the payment being refunded, if any.",+ paymentMethodId="ID of the payment method the refund was issued to.",+ methodType="Method used to issue the refund (e.g. CreditCard, ACH, Check).",+ ),+ },+ "products": {+ "description": "A product in the Zuora product catalog that can be sold to customers.",+ "docs_url": "https://www.zuora.com/developer/api-references/api/tag/Catalog",+ "columns": _columns(+ name="Name of the product.",+ sku="Unique stock keeping unit identifier for the product.",+ description="Description of the product.",+ category="Category the product belongs to.",+ effectiveStartDate="Date the product becomes available in the catalog.",+ effectiveEndDate="Date the product is no longer available in the catalog.",+ ),+ },+ "orders": {+ "description": "An order capturing one or more subscription changes for a customer account.",+ "docs_url": "https://www.zuora.com/developer/api-references/api/tag/Orders",+ "columns": _columns(+ orderNumber="Unique, human-readable order number.",+ accountId="ID of the account the order is associated with.",+ status="Status of the order: Draft, Pending, Completed, Cancelled, or Executing.",+ state="Processing state of the order.",+ orderDate="Date the order was placed.",+ description="Description of the order.",+ category="Category of the order (e.g. NewSale, Upsell).",+ ),+ },+}diff --git a/posthog/temporal/data_imports/sources/zuora/source.py b/posthog/temporal/data_imports/sources/zuora/source.pyindex 795ed4b0e904..315aaae481d3 100644--- a/posthog/temporal/data_imports/sources/zuora/source.py+++ b/posthog/temporal/data_imports/sources/zuora/source.py@@ -13,6 +13,7 @@ from posthog.schema import (from posthog.temporal.data_imports.pipelines.pipeline.typings import SourceInputs, SourceResponsefrom posthog.temporal.data_imports.sources.common.base import FieldType, ResumableSource+from posthog.temporal.data_imports.sources.common.canonical_descriptions import CanonicalDescriptionsfrom posthog.temporal.data_imports.sources.common.registry import SourceRegistryfrom posthog.temporal.data_imports.sources.common.resumable import ResumableSourceManagerfrom posthog.temporal.data_imports.sources.common.schema import SourceSchema@@ -33,6 +34,11 @@ class ZuoraSource(ResumableSource[ZuoraSourceConfig, ZuoraResumeConfig]):def source_type(self) -> ExternalDataSourceType:return ExternalDataSourceType.ZUORA+ def get_canonical_descriptions(self) -> CanonicalDescriptions:+ from posthog.temporal.data_imports.sources.zuora.canonical_descriptions import CANONICAL_DESCRIPTIONS++ return CANONICAL_DESCRIPTIONS+def get_non_retryable_errors(self) -> dict[str, str | None]:return {"400 Client Error: Bad Request for url: https://rest.": "Zuora rejected the request. If this occurs while connecting, check your client ID and client secret (and that they match the selected environment).",