Code

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

Endpoints

GET
POST

Retrieve code invites check access

Check whether the authenticated user has access to PostHog Code.

Example request

GET /api/code/invites/check-access
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/code/invites/check-access/

Example response

Status 200 Access check result

Create code invites redeem

Redeem a PostHog Code invite code to enable access.

Request parameters

  • code
    string

Example request

POST /api/code/invites/redeem
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl
-H 'Content-Type: application/json'\
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/code/invites/redeem/\
-d code="string"

Example response

Status 200 Invite code redeemed successfully
Status 400 Invalid or expired invite code
RESPONSE
{
"error": "string"
}

Community questions

Questions about this page? or post a community question.