Skip to content

: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.

feat(settings): show copyable organization ID in org settings (#71013)

Alex Lebedevc4c603876565
diff --git a/frontend/snapshots.yml b/frontend/snapshots.yml
index 5ee07756beec..6bb33c25489e 100644
--- a/frontend/snapshots.yml
+++ b/frontend/snapshots.yml
@@ -6843,9 +6843,9 @@ snapshots:
scenes-app-settings-organization--settings-organization-danger-zone--light:
hash: v1.k794b7964.19386d6d09b047ca2d49fd8582eb35e3938b7af6ce93d404800c3792a29c1920.1lKFcp1iYxB0ZFGEv-VVd4kp2SzOR2pNFXvGi5h3ht4
scenes-app-settings-organization--settings-organization-details--dark:
- hash: v1.k794b7964.42bb07ba29e5727f687fd3792eff1df7c8cb4b536343c95d9e51658a89677e3e.cGfJpWmm01Oxd5JLWEfkzexgdZI7AGiVVPdWvziNzPI
+ hash: v1.k794b7964.b162874d0b1c69dcb37837e786127388e8eae3d6b523cc023605992fc89f2822.GNFpxq8yCl0g3Y5fbAZFCAchQ__hBF15fYH6c6mE1Ag
scenes-app-settings-organization--settings-organization-details--light:
- hash: v1.k794b7964.8fb286c28744ca80f51f72362172f0b70aa3fdb3838b33ad055120b01a62bf1f.CnP5Pn0LMHq6Q9dOjpRqADDUqfXUqgUJ_2Zw8zhkeh0
+ hash: v1.k794b7964.d397638284af882dee279fc5882cc94abd581a17b219915641ba6d021a1a031d.d0eZufEc5iiVpUEQ5j7F8TsQvh6yX9F77bBNqqy6RQA
scenes-app-settings-organization--settings-organization-members--dark:
hash: v1.k794b7964.9b7c856187e6b01c2abe4dfcfcba4593258de828b3a289d2924cfcf1fb5497dc.n-Z_pbWeZvSzYjKOkvb-ajQi97HcZHzhXCPKhN6M1g0
scenes-app-settings-organization--settings-organization-members--light:
diff --git a/frontend/src/scenes/settings/SettingsMap.tsx b/frontend/src/scenes/settings/SettingsMap.tsx
index 8d674b54f53c..d906ff104bdf 100644
--- a/frontend/src/scenes/settings/SettingsMap.tsx
+++ b/frontend/src/scenes/settings/SettingsMap.tsx
@@ -147,6 +147,7 @@ import { OrganizationPersonalAPIKeys } from './organization/OrganizationPersonal
import { OrganizationSecuritySettings } from './organization/OrganizationSecuritySettings'
import { OrganizationDisplayName } from './organization/OrgDisplayName'
import { OrgIPAnonymizationDefault } from './organization/OrgIPAnonymizationDefault'
+import { OrganizationVariables } from './organization/OrgVariables'
import { VerifiedDomains } from './organization/VerifiedDomains/VerifiedDomains'
import { ProjectDangerZone } from './project/ProjectDangerZone'
import { ProjectMove } from './project/ProjectMove'
@@ -1602,6 +1603,13 @@ export const SETTINGS_MAP: SettingSection[] = [
component: <OrganizationDisplayName />,
keywords: ['name', 'rename', 'label', 'organization', 'logo', 'image', 'brand', 'icon', 'avatar'],
},
+ {
+ id: 'organization-id',
+ title: 'Organization ID',
+ description: "Your organization's unique identifier, used in the PostHog API.",
+ component: <OrganizationVariables />,
+ keywords: ['organization', 'id', 'uuid', 'identifier', 'copy'],
+ },
{
id: 'organization-ai-consent',
title: 'AI service providers',
diff --git a/frontend/src/scenes/settings/organization/OrgVariables.tsx b/frontend/src/scenes/settings/organization/OrgVariables.tsx
new file mode 100644
index 000000000000..a6ab82f7299d
--- /dev/null
+++ b/frontend/src/scenes/settings/organization/OrgVariables.tsx
@@ -0,0 +1,27 @@
+import { useValues } from 'kea'
+
+import { LemonSkeleton } from '@posthog/lemon-ui'
+
+import { CodeSnippet } from 'lib/components/CodeSnippet'
+import { Link } from 'lib/lemon-ui/Link'
+import { organizationLogic } from 'scenes/organizationLogic'
+
+export function OrganizationVariables(): JSX.Element {
+ const { currentOrganization } = useValues(organizationLogic)
+
+ return (
+ <div className="border rounded p-4 space-y-3 bg-bg-light max-w-160">
+ {currentOrganization ? (
+ <CodeSnippet compact thing="organization ID">
+ {String(currentOrganization.id)}
+ </CodeSnippet>
+ ) : (
+ <LemonSkeleton className="h-9" />
+ )}
+ <p className="text-muted text-xs mb-0">
+ Use this ID to identify your organization in the{' '}
+ <Link to="https://posthog.com/docs/api">PostHog API</Link>.
+ </p>
+ </div>
+ )
+}
diff --git a/frontend/src/scenes/settings/types.ts b/frontend/src/scenes/settings/types.ts
index 96f1d203cd2f..f539cb7b2497 100644
--- a/frontend/src/scenes/settings/types.ts
+++ b/frontend/src/scenes/settings/types.ts
@@ -197,6 +197,7 @@ export type SettingId =
| 'organization-delete'
| 'organization-display-name'
| 'organization-experiment-stats-method'
+ | 'organization-id'
| 'organization-integrations-list'
| 'organization-ip-anonymization-default'
| 'organization-oauth-apps-list'