Users
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
GET | |
PATCH | |
GET | |
GET | |
POST | |
DELETE | |
DELETE | |
GET | |
GET | |
POST |
Retrieve users hedgehog config
Required API key scopes
user:readPath parameters
- uuidstring
Example request
GET /api /users /:uuid /hedgehog_configExample response
Status 200 No response body
Retrieve users hedgehog config
Required API key scopes
user:readPath parameters
- uuidstring
Example request
GET /api /users /:uuid /hedgehog_configExample response
Status 200 No response body
Update users hedgehog config
Required API key scopes
user:writePath parameters
- uuidstring
Request parameters
- first_namestring
- last_namestring
- emailstring
- notification_settingsobject
- anonymize_databoolean | null
- allow_impersonationboolean | null
- toolbar_mode
- is_staffboolean
- set_current_organizationstring
- set_current_teamstring
- passwordstring
- current_passwordstring
- events_column_config
- has_seen_product_intro_for
- theme_mode
- hedgehog_config
- allow_sidebar_suggestionsboolean | null
- shortcut_position
- role_at_organization
- passkeys_enabled_for_2faboolean | null
- hide_mcp_hintsboolean
- ui_configuration
Example request
PATCH /api /users /:uuid /hedgehog_configExample response
Status 200 No response body
Update users hedgehog config
Required API key scopes
user:writePath parameters
- uuidstring
Request parameters
- first_namestring
- last_namestring
- emailstring
- notification_settingsobject
- anonymize_databoolean | null
- allow_impersonationboolean | null
- toolbar_mode
- is_staffboolean
- set_current_organizationstring
- set_current_teamstring
- passwordstring
- current_passwordstring
- events_column_config
- has_seen_product_intro_for
- theme_mode
- hedgehog_config
- allow_sidebar_suggestionsboolean | null
- shortcut_position
- role_at_organization
- passkeys_enabled_for_2faboolean | null
- hide_mcp_hintsboolean
- ui_configuration
Example request
PATCH /api /users /:uuid /hedgehog_configExample response
Status 200 No response body
List all users integrations
Return the authenticated user's personal integrations of a given
kind (github or slack).
The response shape varies per kind because the underlying UserIntegration
rows carry different identity fields — GitHub rows expose
installation_id / account / uses_shared_installation; Slack
rows expose slack_user_id / slack_team_id / slack_team_name.
Kind-specific destroy and start actions remain split so their distinct
semantics (e.g. Slack's lack of "uninstall on last reference") stay
explicit at the URL layer.
Default of kind=github is load-bearing: mobile (apps/mobile/...)
and the Code SDK (packages/api-client/...) both call this endpoint
without a query param today and rely on receiving GitHub rows.
Required API key scopes
user:readPath parameters
- uuidstring
Query parameters
- kindstringOne of:
"github""slack" - limitinteger
- offsetinteger
Response
Example request
GET /api /users /:uuid /integrationsExample response
Status 200
List all users integrations
Return the authenticated user's personal integrations of a given
kind (github or slack).
The response shape varies per kind because the underlying UserIntegration
rows carry different identity fields — GitHub rows expose
installation_id / account / uses_shared_installation; Slack
rows expose slack_user_id / slack_team_id / slack_team_name.
Kind-specific destroy and start actions remain split so their distinct
semantics (e.g. Slack's lack of "uninstall on last reference") stay
explicit at the URL layer.
Default of kind=github is load-bearing: mobile (apps/mobile/...)
and the Code SDK (packages/api-client/...) both call this endpoint
without a query param today and rely on receiving GitHub rows.
Required API key scopes
user:readPath parameters
- uuidstring
Query parameters
- kindstringOne of:
"github""slack" - limitinteger
- offsetinteger
Response
Example request
GET /api /users /:uuid /integrationsExample response
Status 200
Retrieve users integrations codex
/api/users/@me/integrations/ — manage the user's personal GitHub integrations.
Required API key scopes
user:readPath parameters
- uuidstring
Response
Example request
GET /api /users /:uuid /integrations /codexExample response
Status 200
Retrieve users integrations codex
/api/users/@me/integrations/ — manage the user's personal GitHub integrations.
Required API key scopes
user:readPath parameters
- uuidstring
Response
Example request
GET /api /users /:uuid /integrations /codexExample response
Status 200
Create users integrations codex
Submit the tokens object of the auth.json that codex login wrote on the user's machine. PostHog refreshes the chain once to prove it works, stores the rotated tokens encrypted, and from then on refreshes them for the user's Codex cloud runs. Only the owning user can connect. No response carries a token.
Required API key scopes
user:writePath parameters
- uuidstring
Request parameters
- tokens
Response
Example request
POST /api /users /:uuid /integrations /codexExample response
Status 200 The account is connected.
Status 400 The tokens are not usable, or OpenAI rejected the refresh token.
Status 403 A cloud task sandbox token cannot connect an account.
Status 404 ChatGPT plans for cloud tasks are not available to this user.
Status 502 OpenAI could not be reached.
Create users integrations codex
Submit the tokens object of the auth.json that codex login wrote on the user's machine. PostHog refreshes the chain once to prove it works, stores the rotated tokens encrypted, and from then on refreshes them for the user's Codex cloud runs. Only the owning user can connect. No response carries a token.
Required API key scopes
user:writePath parameters
- uuidstring
Request parameters
- tokens
Response
Example request
POST /api /users /:uuid /integrations /codexExample response
Status 200 The account is connected.
Status 400 The tokens are not usable, or OpenAI rejected the refresh token.
Status 403 A cloud task sandbox token cannot connect an account.
Status 404 ChatGPT plans for cloud tasks are not available to this user.
Status 502 OpenAI could not be reached.
Delete users integrations codex
Revokes the refresh token at OpenAI and deletes the stored tokens. Idempotent.
Required API key scopes
user:writePath parameters
- uuidstring
Example request
DELETE /api /users /:uuid /integrations /codexExample response
Status 204 No account is connected any more.
Status 403 A cloud task sandbox token cannot disconnect an account.
Delete users integrations codex
Revokes the refresh token at OpenAI and deletes the stored tokens. Idempotent.
Required API key scopes
user:writePath parameters
- uuidstring
Example request
DELETE /api /users /:uuid /integrations /codexExample response
Status 204 No account is connected any more.
Status 403 A cloud task sandbox token cannot disconnect an account.
Delete users integrations github
Remove a specific GitHub installation by its installation_id.
Required API key scopes
user:writePath parameters
- installation_idstring
- uuidstring
Example request
DELETE /api /users /:uuid /integrations /github /:installation_idExample response
Status 204 Integration removed.
Delete users integrations github
Remove a specific GitHub installation by its installation_id.
Required API key scopes
user:writePath parameters
- installation_idstring
- uuidstring
Example request
DELETE /api /users /:uuid /integrations /github /:installation_idExample response
Status 204 Integration removed.
Retrieve users integrations github branches
List branches for a repository accessible to a personal GitHub installation.
Required API key scopes
user:readPath parameters
- installation_idstring
- uuidstring
Query parameters
- limitintegerDefault:
100 - offsetintegerDefault:
0 - repostring
- searchstringDefault:
Response
Example request
GET /api /users /:uuid /integrations /github /:installation_id /branchesExample response
Status 200
Retrieve users integrations github branches
List branches for a repository accessible to a personal GitHub installation.
Required API key scopes
user:readPath parameters
- installation_idstring
- uuidstring
Query parameters
- limitintegerDefault:
100 - offsetintegerDefault:
0 - repostring
- searchstringDefault:
Response
Example request
GET /api /users /:uuid /integrations /github /:installation_id /branchesExample response
Status 200
Retrieve users integrations github repos
List repositories accessible to a specific GitHub installation (paginated, cached).
Required API key scopes
user:readPath parameters
- installation_idstring
- uuidstring
Query parameters
- compactbooleanDefault:
false - limitintegerDefault:
100 - offsetintegerDefault:
0 - searchstringDefault:
Response
Example request
GET /api /users /:uuid /integrations /github /:installation_id /reposExample response
Status 200
Retrieve users integrations github repos
List repositories accessible to a specific GitHub installation (paginated, cached).
Required API key scopes
user:readPath parameters
- installation_idstring
- uuidstring
Query parameters
- compactbooleanDefault:
false - limitintegerDefault:
100 - offsetintegerDefault:
0 - searchstringDefault:
Response
Example request
GET /api /users /:uuid /integrations /github /:installation_id /reposExample response
Status 200
Create users integrations github repos refresh
Refresh repositories accessible to a specific GitHub installation.
Required API key scopes
user:writePath parameters
- installation_idstring
- uuidstring
Response
Example request
POST /api /users /:uuid /integrations /github /:installation_id /repos /refreshExample response
Status 200
Create users integrations github repos refresh
Refresh repositories accessible to a specific GitHub installation.
Required API key scopes
user:writePath parameters
- installation_idstring
- uuidstring
Response
Example request
POST /api /users /:uuid /integrations /github /:installation_id /repos /refresh