Langsung ke konten
Skillpedia
Database41k Β· #6968

setting-up-a-custom-rest-source

Fungsinya

Skill ini menunjukkan cara agent mengimpor data dari API web ke data warehouse PostHog dengan menulis file konfigurasi. Skill ini untuk orang yang ingin data dari alat internal atau layanan khusus yang belum didukung langsung oleh PostHog.

Kapan dipakai

  • βœ“Saat Anda ingin mengimpor data dari API yang belum punya konektor bawaan PostHog.
  • βœ“Saat Anda punya tautan dokumentasi API dan ingin datanya ada di warehouse Anda.
  • βœ“Saat Anda ingin menghubungkan layanan internal ke PostHog sebagai sumber kustom.

Link skill

https://github.com/PostHog/posthog/blob/master/products/warehouse_sources/skills/setting-up-a-custom-rest-source/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/PostHog/posthog/blob/master/products/warehouse_sources/skills/setting-up-a-custom-rest-source/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œIni tautan dokumentasi API internal kami. Bisakah Anda mengaturnya agar datanya muncul di warehouse PostHog?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent lebih dulu memeriksa apakah konektor bawaan sudah tersedia. Jika belum, agent menulis file konfigurasi singkat yang menjelaskan endpoint API, lalu mengujinya pada data langsung sebelum membuat sumbernya.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Setting up a Custom REST source

A Custom source imports any HTTP REST API into queryable warehouse tables from a JSON manifest β€” no per-source Python. The manifest is a RESTAPIConfig: the same shape that powers PostHog's built-in REST connectors (Intercom, Attio, Sentry, …), so the generic REST engine handles auth, pagination, JSONPath record extraction, and incremental cursors for you. Your job is to author a correct manifest and prove it against live data before creating the source.

This is a beta capability. Caps: at most 50 resources per manifest, and at most 5 Custom sources per project.

When to use this skill

  • The user wants to import an API that has no built-in connector β€” an internal service, a niche SaaS, a public API β€” and can give you its docs URL or describe its endpoints.
  • The user explicitly asks for a "custom REST source", "custom source manifest", or to "build a connector from docs".

A Custom source is the fallback β€” only correct when no native connector fits. PostHog ships hundreds of native connectors, far more than could be listed here, so never assume an API has no built-in β€” most well-known SaaS apps and databases do, and guessing wrong misroutes them into a hand-authored manifest that duplicates a battle-tested connector. Step 0 below makes you check the registry before drafting anything; if a native connector matches, hand off to setting-up-a-data-warehouse-source instead.

The grammar

Read references/manifest-reference.md before drafting β€” it is the full RESTAPIConfig field reference (auth types, the six paginators, incremental cursors, parent/child fan-out) with worked examples for each. Draft the manifest from that grammar; don't guess field names.

The skeleton:

{
  "client": {
    "base_url": "https://api.example.com/v1",
    "auth": { "type": "bearer" }
  },
  "resources": [
    {
      "name": "users",
      "primary_key": "id",
      "endpoint": {
        "path": "/users",
        "data_selector": "data",
        "paginator": { "type": "json_response", "next_url_path": "next" },
        "incremental": { "cursor_path": "updated_at", "start_param": "since" }
      }
    }
  ]
}

Secrets never go inline in the manifest. manifest_json holds only the non-secret structure. The credential travels in a separate payload key chosen by the manifest's client.auth.type: auth_token (bearer), auth_api_key (api_key), auth_password (http_basic), or auth_oauth2_client_secret for oauth2 (plus auth_oauth2_refresh_token for the refresh-token grant only). The engine injects it at run time, and PostHog redacts it from every response. Putting a token inline is rejected at validation.

Available tools

Tool Purpose
external-data-sources-wizard List every native source type PostHog supports. Run this first (Step 0) to check whether the target API already has a built-in connector before drafting a manifest.
external-data-sources-db-schema Validate the manifest + credential and list the resources (tables) it exposes, with detected primary keys and incremental cursors. This is the validate-and-list step.
external-data-sources-preview-resource Read a small live sample of rows for one resource β€” verify data_selector / primary_key / cursor_path against real data before creating anything.
data-warehouse-source-setup Create the source. Enables all manifest resources with sync defaults in one call.
external-data-sources-create Advanced create β€” lets the user hand-pick which resources sync via a schemas array.
external-data-schemas-list After creation, watch per-table sync status.
Pertanyaan umum

Haruskah saya memakai ini untuk aplikasi yang sudah terkenal?

Biasanya tidak. Agent memeriksa konektor bawaan lebih dulu, karena sebagian besar alat populer sudah memilikinya.

Apakah ada batasannya?

Ya. Sumber kustom dapat memiliki hingga 50 resource, dan satu proyek dapat memiliki hingga 5 sumber kustom. Fitur ini masih beta.

Apakah agent perlu menulis kode untuk setiap sumber?

Tidak. Sumber didefinisikan dalam file konfigurasi JSON, bukan dalam kode kustom.

Detail

Deskripsi asli dari pembuat

Connect an arbitrary REST API to the PostHog data warehouse as a Custom source by authoring a JSON manifest, with no per-source code. Use when the user points at an API that has no built-in PostHog connector β€” "import data from this REST API", "sync my internal API", "connect this API from its docs", "build a custom data warehouse source" β€” and gives a docs URL or a natural-language description of the endpoints. Walks through drafting the RESTAPIConfig manifest (auth β€” bearer, API key, HTTP basic, or OAuth2 client credentials / refresh token β€” pagination, record path, incremental cursor, paren

repo: PostHog/posthog

Popularitas

Bintang GitHub
41k
Peringkat
#6968
Lisensi
β€”
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa