Js-snippet

For instructions on how to authenticate to use this endpoint, see API overview.

Endpoints

GET
GET
PATCH

Retrieve js snippet resolve

Preview what a given pin would resolve to, without saving it.

Example request

GET /api/projects/:project_id/js-snippet/resolve
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/js-snippet/resolve/

Example response

Status 200

Retrieve js snippet version

Return the team's current version pin and resolved version.

Example request

GET /api/projects/:project_id/js-snippet/version
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/js-snippet/version/

Example response

Status 200

Update js snippet version

Update the team's version pin.

Request parameters

  • js_snippet_version
    string

Example request

PATCH /api/projects/:project_id/js-snippet/version
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X PATCH \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/js-snippet/version/\
-d js_snippet_version="string"

Example response

Status 200

Community questions

Questions about this page? or post a community question.