setting-up-a-custom-rest-source
यह क्या करती है
यह स्किल एजेंट को कॉन्फ़िगरेशन फ़ाइल लिखकर वेब API से डेटा PostHog वेयरहाउस में लाना सिखाती है। यह उन लोगों के लिए है जिन्हें किसी आंतरिक टूल या खास सेवा का डेटा चाहिए।
कब इस्तेमाल करें
- ✓जब आपको ऐसे API से डेटा इंपोर्ट करना हो जिसका PostHog में बना कनेक्टर नहीं है।
- ✓जब आपके पास किसी API का डॉक्यूमेंटेशन लिंक हो और आप उसका डेटा वेयरहाउस में चाहते हों।
- ✓जब आप अपनी आंतरिक सेवा को PostHog से कस्टम सोर्स के रूप में जोड़ना चाहें।
Skill का लिंक
https://github.com/PostHog/posthog/blob/master/products/warehouse_sources/skills/setting-up-a-custom-rest-source/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“यह हमारे आंतरिक API का डॉक्स लिंक है। कृपया इसे ऐसे सेट कीजिए कि इसका डेटा PostHog वेयरहाउस में दिखे।”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
एजेंट पहले जाँचता है कि कोई बना-बनाया कनेक्टर है या नहीं। न होने पर वह API के एंडपॉइंट बताने वाली छोटी कॉन्फ़िगरेशन फ़ाइल लिखता है और सोर्स बनाने से पहले लाइव डेटा पर उसकी जाँच करता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे 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. |
अक्सर पूछे जाने वाले सवाल
क्या मुझे इसे मशहूर ऐप्स के लिए इस्तेमाल करना चाहिए?
आमतौर पर नहीं। एजेंट पहले बने-बनाए कनेक्टर देखता है, क्योंकि ज़्यादातर लोकप्रिय टूल के लिए वह पहले से मौजूद होता है।
क्या इसकी कोई सीमा है?
हाँ। एक कस्टम सोर्स में अधिकतम 50 रिसोर्स हो सकते हैं और एक प्रोजेक्ट में अधिकतम 5 कस्टम सोर्स। यह फ़ीचर बीटा में है।
क्या एजेंट को हर सोर्स के लिए कोड लिखना पड़ता है?
नहीं। सोर्स एक JSON कॉन्फ़िगरेशन फ़ाइल में तय होता है, कस्टम कोड में नहीं।
जानकारी
लेखक का मूल विवरण
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
लोकप्रियता
- GitHub स्टार
- 41k
- रैंकिंग में स्थान
- #6968
- लाइसेंस
- —
- अपडेट की गई
- 2/11/2026
कमेंट
- …
इस repository की और skills
depot-ci
41kयह आपके एजेंट को Depot CI वर्कफ़्लो सेट अप करने, चलाने और माइग्रेट करने में मदद करती है, साथ ही रन के लॉग पढ़ने में।
depot-container-builds
41kयह आपके एजेंट को Depot के रिमोट बिल्डर पर Docker इमेज बनाने में मदद करती है, जिसमें मल्टी-प्लेटफ़ॉर्म इमेज और बिल्ड सुधार शामिल हैं।
depot-github-runners
41kयह आपके एजेंट को GitHub Actions जॉब Depot के मैनेज्ड रनर पर ले जाने, रनर का साइज़ और लेबल चुनने, और रनर सेटअप की समस्याएँ ठीक करने में मदद करती है।
editing-agents-md
41kयह आपके एजेंट को तय करने में मदद करती है कि कोई नियम AGENTS.md या CLAUDE.md में जाए या नहीं, और उसे ऐसे लिखे कि फ़ाइल भारी न हो।
मिलती-जुलती skills
discrawl
394kयह आपके एजेंट को Discord संदेशों के सेव किए गए स्थानीय आर्काइव में खोजने, उसका सारांश बनाने और उसकी ताज़गी जांचने में मदद करती है।
clickhouse-io
280kआपके एजेंट को ClickHouse databases में queries और schemas optimize करने में मदद करता है। high-performance analytical workloads के लिए best practices लागू करता है। जब analytical queries बहुत धीमी हों, तब इसका उपयोग करें।
scientific-db-pubmed-database
280kआपके एजेंट को बायोमेडिकल क्षेत्र के वैज्ञानिक लेख खोजने में मदद करता है। जिस रिसर्च में खास मेडिकल जानकारी चाहिए, उसके लिए यह काम का है।