Users-3

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

Endpoints

POST
POST
GET
POST
POST
GET
GET
POST
POST
PATCH

Create users push tokens unregister

Delete the row matching (user, token). Returns 204 even if no row matches so the mobile client can call this unconditionally when the user opts out.

Required API key scopes

user:write

Path parameters

  • uuid
    string

Request parameters

  • token
    string

Example request

POST /api/users/:uuid/push_tokens/unregister
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/users/:uuid/push_tokens/unregister/\
-d token="string"

Example response

Status 204 Token removed (or never existed).

Create users push tokens unregister

Delete the row matching (user, token). Returns 204 even if no row matches so the mobile client can call this unconditionally when the user opts out.

Required API key scopes

user:write

Path parameters

  • uuid
    string

Request parameters

  • token
    string

Example request

POST /api/users/:uuid/push_tokens/unregister
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/users/:uuid/push_tokens/unregister/\
-d token="string"

Example response

Status 204 Token removed (or never existed).

Create users scene personalisation

Path parameters

  • uuid
    string

Request parameters

  • first_name
    string
  • last_name
    string
  • email
    string
  • notification_settings
    object
  • anonymize_data
    booleannull
  • allow_impersonation
    booleannull
  • toolbar_mode
  • is_staff
    boolean
  • set_current_organization
    string
  • set_current_team
    string
  • password
    string
  • current_password
    string
  • events_column_config
  • has_seen_product_intro_for
  • theme_mode
  • hedgehog_config
  • allow_sidebar_suggestions
    booleannull
  • shortcut_position
  • role_at_organization
  • passkeys_enabled_for_2fa
    booleannull
  • hide_mcp_hints
    boolean

Example request

POST /api/users/:uuid/scene_personalisation
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/users/:uuid/scene_personalisation/\
-d email="string",\
-d password="string"

Example response

Status 200 No response body

Create users scene personalisation

Path parameters

  • uuid
    string

Request parameters

  • first_name
    string
  • last_name
    string
  • email
    string
  • notification_settings
    object
  • anonymize_data
    booleannull
  • allow_impersonation
    booleannull
  • toolbar_mode
  • is_staff
    boolean
  • set_current_organization
    string
  • set_current_team
    string
  • password
    string
  • current_password
    string
  • events_column_config
  • has_seen_product_intro_for
  • theme_mode
  • hedgehog_config
  • allow_sidebar_suggestions
    booleannull
  • shortcut_position
  • role_at_organization
  • passkeys_enabled_for_2fa
    booleannull
  • hide_mcp_hints
    boolean

Example request

POST /api/users/:uuid/scene_personalisation
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/users/:uuid/scene_personalisation/\
-d email="string",\
-d password="string"

Example response

Status 200 No response body

Retrieve users start 2fa setup

Path parameters

  • uuid
    string

Example request

GET /api/users/:uuid/start_2fa_setup
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/users/:uuid/start_2fa_setup/

Example response

Status 200 No response body

Retrieve users start 2fa setup

Path parameters

  • uuid
    string

Example request

GET /api/users/:uuid/start_2fa_setup
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/users/:uuid/start_2fa_setup/

Example response

Status 200 No response body

Create users two factor backup codes

Generate new backup codes, invalidating any existing ones

Path parameters

  • uuid
    string

Request parameters

  • first_name
    string
  • last_name
    string
  • email
    string
  • notification_settings
    object
  • anonymize_data
    booleannull
  • allow_impersonation
    booleannull
  • toolbar_mode
  • is_staff
    boolean
  • set_current_organization
    string
  • set_current_team
    string
  • password
    string
  • current_password
    string
  • events_column_config
  • has_seen_product_intro_for
  • theme_mode
  • hedgehog_config
  • allow_sidebar_suggestions
    booleannull
  • shortcut_position
  • role_at_organization
  • passkeys_enabled_for_2fa
    booleannull
  • hide_mcp_hints
    boolean

Example request

POST /api/users/:uuid/two_factor_backup_codes
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/users/:uuid/two_factor_backup_codes/\
-d email="string",\
-d password="string"

Example response

Status 200 No response body

Create users two factor backup codes

Generate new backup codes, invalidating any existing ones

Path parameters

  • uuid
    string

Request parameters

  • first_name
    string
  • last_name
    string
  • email
    string
  • notification_settings
    object
  • anonymize_data
    booleannull
  • allow_impersonation
    booleannull
  • toolbar_mode
  • is_staff
    boolean
  • set_current_organization
    string
  • set_current_team
    string
  • password
    string
  • current_password
    string
  • events_column_config
  • has_seen_product_intro_for
  • theme_mode
  • hedgehog_config
  • allow_sidebar_suggestions
    booleannull
  • shortcut_position
  • role_at_organization
  • passkeys_enabled_for_2fa
    booleannull
  • hide_mcp_hints
    boolean

Example request

POST /api/users/:uuid/two_factor_backup_codes
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/users/:uuid/two_factor_backup_codes/\
-d email="string",\
-d password="string"

Example response

Status 200 No response body

Create users two factor disable

Disable 2FA and remove all related devices

Path parameters

  • uuid
    string

Request parameters

  • first_name
    string
  • last_name
    string
  • email
    string
  • notification_settings
    object
  • anonymize_data
    booleannull
  • allow_impersonation
    booleannull
  • toolbar_mode
  • is_staff
    boolean
  • set_current_organization
    string
  • set_current_team
    string
  • password
    string
  • current_password
    string
  • events_column_config
  • has_seen_product_intro_for
  • theme_mode
  • hedgehog_config
  • allow_sidebar_suggestions
    booleannull
  • shortcut_position
  • role_at_organization
  • passkeys_enabled_for_2fa
    booleannull
  • hide_mcp_hints
    boolean

Example request

POST /api/users/:uuid/two_factor_disable
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/users/:uuid/two_factor_disable/\
-d email="string",\
-d password="string"

Example response

Status 200 No response body

Create users two factor disable

Disable 2FA and remove all related devices

Path parameters

  • uuid
    string

Request parameters

  • first_name
    string
  • last_name
    string
  • email
    string
  • notification_settings
    object
  • anonymize_data
    booleannull
  • allow_impersonation
    booleannull
  • toolbar_mode
  • is_staff
    boolean
  • set_current_organization
    string
  • set_current_team
    string
  • password
    string
  • current_password
    string
  • events_column_config
  • has_seen_product_intro_for
  • theme_mode
  • hedgehog_config
  • allow_sidebar_suggestions
    booleannull
  • shortcut_position
  • role_at_organization
  • passkeys_enabled_for_2fa
    booleannull
  • hide_mcp_hints
    boolean

Example request

POST /api/users/:uuid/two_factor_disable
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/users/:uuid/two_factor_disable/\
-d email="string",\
-d password="string"

Example response

Status 200 No response body

Retrieve users two factor start setup

Path parameters

  • uuid
    string

Example request

GET /api/users/:uuid/two_factor_start_setup
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/users/:uuid/two_factor_start_setup/

Example response

Status 200 No response body

Retrieve users two factor start setup

Path parameters

  • uuid
    string

Example request

GET /api/users/:uuid/two_factor_start_setup
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/users/:uuid/two_factor_start_setup/

Example response

Status 200 No response body

Retrieve users two factor status

Get current 2FA status including backup codes if enabled

Path parameters

  • uuid
    string

Example request

GET /api/users/:uuid/two_factor_status
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/users/:uuid/two_factor_status/

Example response

Status 200 No response body

Retrieve users two factor status

Get current 2FA status including backup codes if enabled

Path parameters

  • uuid
    string

Example request

GET /api/users/:uuid/two_factor_status
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/users/:uuid/two_factor_status/

Example response

Status 200 No response body

Create users two factor validate

Path parameters

  • uuid
    string

Request parameters

  • first_name
    string
  • last_name
    string
  • email
    string
  • notification_settings
    object
  • anonymize_data
    booleannull
  • allow_impersonation
    booleannull
  • toolbar_mode
  • is_staff
    boolean
  • set_current_organization
    string
  • set_current_team
    string
  • password
    string
  • current_password
    string
  • events_column_config
  • has_seen_product_intro_for
  • theme_mode
  • hedgehog_config
  • allow_sidebar_suggestions
    booleannull
  • shortcut_position
  • role_at_organization
  • passkeys_enabled_for_2fa
    booleannull
  • hide_mcp_hints
    boolean

Example request

POST /api/users/:uuid/two_factor_validate
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/users/:uuid/two_factor_validate/\
-d email="string",\
-d password="string"

Example response

Status 200 No response body

Create users two factor validate

Path parameters

  • uuid
    string

Request parameters

  • first_name
    string
  • last_name
    string
  • email
    string
  • notification_settings
    object
  • anonymize_data
    booleannull
  • allow_impersonation
    booleannull
  • toolbar_mode
  • is_staff
    boolean
  • set_current_organization
    string
  • set_current_team
    string
  • password
    string
  • current_password
    string
  • events_column_config
  • has_seen_product_intro_for
  • theme_mode
  • hedgehog_config
  • allow_sidebar_suggestions
    booleannull
  • shortcut_position
  • role_at_organization
  • passkeys_enabled_for_2fa
    booleannull
  • hide_mcp_hints
    boolean

Example request

POST /api/users/:uuid/two_factor_validate
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/users/:uuid/two_factor_validate/\
-d email="string",\
-d password="string"

Example response

Status 200 No response body

Create users validate 2fa

Path parameters

  • uuid
    string

Request parameters

  • first_name
    string
  • last_name
    string
  • email
    string
  • notification_settings
    object
  • anonymize_data
    booleannull
  • allow_impersonation
    booleannull
  • toolbar_mode
  • is_staff
    boolean
  • set_current_organization
    string
  • set_current_team
    string
  • password
    string
  • current_password
    string
  • events_column_config
  • has_seen_product_intro_for
  • theme_mode
  • hedgehog_config
  • allow_sidebar_suggestions
    booleannull
  • shortcut_position
  • role_at_organization
  • passkeys_enabled_for_2fa
    booleannull
  • hide_mcp_hints
    boolean

Example request

POST /api/users/:uuid/validate_2fa
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/users/:uuid/validate_2fa/\
-d email="string",\
-d password="string"

Example response

Status 200 No response body

Create users validate 2fa

Path parameters

  • uuid
    string

Request parameters

  • first_name
    string
  • last_name
    string
  • email
    string
  • notification_settings
    object
  • anonymize_data
    booleannull
  • allow_impersonation
    booleannull
  • toolbar_mode
  • is_staff
    boolean
  • set_current_organization
    string
  • set_current_team
    string
  • password
    string
  • current_password
    string
  • events_column_config
  • has_seen_product_intro_for
  • theme_mode
  • hedgehog_config
  • allow_sidebar_suggestions
    booleannull
  • shortcut_position
  • role_at_organization
  • passkeys_enabled_for_2fa
    booleannull
  • hide_mcp_hints
    boolean

Example request

POST /api/users/:uuid/validate_2fa
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/users/:uuid/validate_2fa/\
-d email="string",\
-d password="string"

Example response

Status 200 No response body

Update users cancel email change request

Request parameters

  • first_name
    string
  • last_name
    string
  • email
    string
  • notification_settings
    object
  • anonymize_data
    booleannull
  • allow_impersonation
    booleannull
  • toolbar_mode
  • is_staff
    boolean
  • set_current_organization
    string
  • set_current_team
    string
  • password
    string
  • current_password
    string
  • events_column_config
  • has_seen_product_intro_for
  • theme_mode
  • hedgehog_config
  • allow_sidebar_suggestions
    booleannull
  • shortcut_position
  • role_at_organization
  • passkeys_enabled_for_2fa
    booleannull
  • hide_mcp_hints
    boolean

Example request

PATCH /api/users/cancel_email_change_request
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X PATCH \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/users/cancel_email_change_request/\
-d date_joined="string"

Example response

Status 200 No response body

Update users cancel email change request

Request parameters

  • first_name
    string
  • last_name
    string
  • email
    string
  • notification_settings
    object
  • anonymize_data
    booleannull
  • allow_impersonation
    booleannull
  • toolbar_mode
  • is_staff
    boolean
  • set_current_organization
    string
  • set_current_team
    string
  • password
    string
  • current_password
    string
  • events_column_config
  • has_seen_product_intro_for
  • theme_mode
  • hedgehog_config
  • allow_sidebar_suggestions
    booleannull
  • shortcut_position
  • role_at_organization
  • passkeys_enabled_for_2fa
    booleannull
  • hide_mcp_hints
    boolean

Example request

PATCH /api/users/cancel_email_change_request
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X PATCH \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/users/cancel_email_change_request/\
-d date_joined="string"

Example response

Status 200 No response body

Community questions

Questions about this page? or post a community question.