Retrieve data from your endpoint with cURL

Call PostHog endpoints directly using HTTP requests.

Basic request

Terminal
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
"<ph_app_host>/api/environments/{project_id}/endpoints/{endpoint_name}/run"

With variables

Pass variables in the request body:

Terminal
curl -X POST \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"variables": {"customer_id": "cust_123"}}' \
"<ph_app_host>/api/environments/{project_id}/endpoints/{endpoint_name}/run"

Community questions

Was this page useful?

Questions about this page? or post a community question.