Retrieve data from your endpoint with cURL
Contents
Call PostHog endpoints directly using HTTP requests.
Basic request
Terminal
With variables
Pass variables in the request body:
Terminal
Call PostHog endpoints directly using HTTP requests.
curl \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \"<ph_app_host>/api/environments/{project_id}/endpoints/{endpoint_name}/run"
Pass variables in the request body:
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"
Questions about this page? or post a community question.