Linking Flagsmith as a source

Alpha release

This source is currently in alpha. The interface and available tables may change.

Sync your Flagsmith projects, environments, feature flags, flag states, segments, organization members, and audit log into the PostHog data warehouse, so you can correlate rollouts with product metrics and track who changed what, when.

Prerequisites

You need an organization API key for your Flagsmith organization. Organization API keys grant admin access to every project in the organization, so store them carefully.

Adding a data source

  1. In PostHog, go to the Sources tab of the data pipeline section.
  2. Click + New source and click Link next to this source.
  3. Enter your credentials (see Configuration below) and click Next.
  4. Select the tables you want to sync, choose a sync method and frequency, then click Import.

Once the syncs are complete, you can start querying this data in PostHog.

  1. In Flagsmith, go to Organisation Settings (as labeled in the Flagsmith dashboard) and open the API Keys tab, then create an organization API key and copy it.
  2. Back in PostHog, enter the API key.
  3. If you self-host Flagsmith, set the API URL to your API host (for example https://flagsmith.example.com). Leave it blank to use Flagsmith SaaS.
  4. Click Next, select the tables you want to sync, set the sync method and frequency, then click Import.

Sync modes

Each table can be synced in one of several modes, depending on what the source supports:

  • Webhook (when available) – the source pushes changes to PostHog in real time. Fastest freshness, lowest ongoing cost, and the only mode that reliably captures updates and deletes.
  • Incremental – only new or updated rows are synced on each run, using a cursor field (such as an updated_at timestamp). Cheaper than a full refresh, but deletes aren't captured.
  • Append only – new rows are appended using a cursor field; existing rows are never updated. Ideal for immutable, append-only tables like event logs.
  • Full refresh – the whole table is reloaded on every sync. Use it when a table has no reliable cursor or when you need deletions reflected.

See sync methods for a full explanation of how each mode works and how to choose between them.

Flagsmith's Admin API exposes no server-side timestamp filter on these resources, so every table is full refresh only and reloads all records on each sync.

Configuration

OptionTypeRequired
Organisation API keypasswordYes
API URL (self-hosted only)textNo

Supported tables

TableDescriptionSync methodIncremental fieldPrimary key
organisations

The Flagsmith organisation(s) the connected API key can administer, including subscription and seat details.

Full refreshid
projects

Projects in the organisation. A project groups feature flags and segments shared across its environments.

Full refreshid
environments

Environments within each project (for example development, staging, production). Feature values are set per environment.

Full refreshid
features

Feature flags and remote config entries defined per project, including default values, owners, tags, and multivariate options.

Full refreshid
feature_states

The current state of every feature per environment: enabled/disabled plus the effective value, including segment overrides.

Full refreshid
segments

User segments per project — rule-based groups of identities used to target feature overrides.

Full refreshid
audit_logs

Append-only audit history of changes across the organisation: who changed what, when. Retention on Flagsmith SaaS depends on your plan.

Full refreshid
users

Members of the organisation and their basic profile details.

Full refreshid, _organisation_id

Troubleshooting

If a sync fails with an authentication error, the organization API key was likely revoked or entered incorrectly. Create a new key under Organisation Settings > API Keys and reconnect the source.

Retention of the audit_logs table on Flagsmith SaaS depends on your plan, so it reflects the history Flagsmith currently retains for your organization.

If your sync is failing or data looks wrong, see the Data warehouse troubleshooting guide. If that doesn't help, contact support – we're happy to help.

Community questions

Was this page useful?