setting-up-a-custom-rest-source

Connect arbitrary REST APIs to the PostHog data warehouse via JSON manifests.

713|118|Updated Aug 11, 2020
One-click install
npx skills add https://github.com/PostHog/posthog-foss --skill setting-up-a-custom-rest-source
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: setting-up-a-custom-rest-source
Source: https://github.com/PostHog/posthog-foss/tree/main/products/warehouse_sources/skills/setting-up-a-custom-rest-source
Command: npx skills add https://github.com/PostHog/posthog-foss --skill setting-up-a-custom-rest-source

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Importing data from an API that has no built-in PostHog connector normally requires writing custom integration code. This Skill lets you connect any REST API to the PostHog data warehouse as a Custom source by authoring a JSON manifest, with no per-source code.

Core Features & Use Cases

  • Manifest-based connector authoring: Draft a RESTAPIConfig JSON manifest covering auth (bearer, API key, HTTP basic, OAuth2), pagination, record paths, incremental cursors, and parent/child fan-out.
  • Validate and preview before creating: Validate the manifest and credential against the live API, then test-read real rows to verify field mappings before creating the source.
  • Native connector check first: Checks the connector registry so you only build a custom manifest when no native PostHog connector exists.
  • Use Case: You want to sync data from an internal service or niche SaaS API into PostHog. Provide the API docs URL, and the Skill drafts the manifest, validates it, previews live rows, and creates the source so you can query the tables with HogQL.

Quick Start

Ask the assistant to import data from your REST API into the PostHog data warehouse by providing the API documentation URL and your credential.

Frequently Asked Questions about setting-up-a-custom-rest-source

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I connect a REST API to the PostHog data warehouse?

Author a JSON RESTAPIConfig manifest describing the API's base URL, auth scheme, endpoints, pagination, and record paths, then validate it and create a Custom source. The generic REST engine handles auth, pagination, and incremental sync without per-source code.

When should I use a Custom REST source instead of a native connector?

Use a Custom source only when the target API has no built-in PostHog connector. Check the connector registry first, since PostHog ships hundreds of native connectors that handle auth, pagination, schema, and incremental sync automatically.

What authentication methods does the Custom REST source support?

It supports bearer tokens, API keys in headers or query params, HTTP basic auth, and OAuth2 with client credentials or a pre-obtained refresh token. The interactive authorization_code flow is not supported, and secrets travel in separate auth_* payload keys, never inline in the manifest.

Why is my Custom source syncing zero or malformed rows?

This usually happens when the data_selector points at the response envelope instead of the record array, or the primary key or cursor field is missing. Always preview live rows before creating the source to verify data_selector, primary_key, and cursor_path against real data.

What are the limits of Custom REST sources in PostHog?

Custom sources are an alpha capability limited to 50 resources per manifest and 5 Custom sources per project. Only GET and POST methods are allowed, parent/child fan-out supports one level of nesting, and base URLs must be public HTTPS endpoints.