Members
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
List all members
Required API key scopes
organization_member:read
Path parameters
- organization_idstring
Query parameters
- limitinteger
Number of results to return per page.
- offsetinteger
The initial index from which to return the results.
Response
Request
GET
/api/organizations/:organization_id/members
export POSTHOG_PERSONAL_API_KEY=[your personal api key]curl \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/organizations/:organization_id/members/
Response
Status 200
{"count": 123,"next": "http://api.example.org/accounts/?offset=400&limit=100","previous": "http://api.example.org/accounts/?offset=200&limit=100","results": [{"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08","user": {"id": 0,"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f","distinct_id": "string","first_name": "string","last_name": "string","email": "user@example.com","is_email_verified": true,"hedgehog_config": {"property1": null,"property2": null}},"level": 1,"joined_at": "2019-08-24T14:15:22Z","updated_at": "2019-08-24T14:15:22Z","is_2fa_enabled": true,"has_social_auth": true,"last_login": "2019-08-24T14:15:22Z"}]}
Update members
Required API key scopes
organization_member:write
Path parameters
- organization_idstring
- user__uuidstring
Request parameters
- level
Response
Request
PATCH
/api/organizations/:organization_id/members/:user__uuid
export POSTHOG_PERSONAL_API_KEY=[your personal api key]curl -X PATCH \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/organizations/:organization_id/members/:user__uuid/\-d user=undefined
Response
Status 200
{"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08","user": {"id": 0,"uuid": "095be615-a8ad-4c33-8e9c-c7612fbf6c9f","distinct_id": "string","first_name": "string","last_name": "string","email": "user@example.com","is_email_verified": true,"hedgehog_config": {"property1": null,"property2": null}},"level": 1,"joined_at": "2019-08-24T14:15:22Z","updated_at": "2019-08-24T14:15:22Z","is_2fa_enabled": true,"has_social_auth": true,"last_login": "2019-08-24T14:15:22Z"}
Delete members
Required API key scopes
organization_member:write
Path parameters
- organization_idstring
- user__uuidstring
Request
DELETE
/api/organizations/:organization_id/members/:user__uuid
export POSTHOG_PERSONAL_API_KEY=[your personal api key]curl -X DELETE \-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \<ph_app_host>/api/organizations/:organization_id/members/:user__uuid/
Response
Status 204 No response body
Questions?
Country code of the user
Hi there,
Can this api be used to fetch the country code of the current user or a specific user?
Thank you.
:parent_lookup_organization_id
Where can I find this organization ID?
I figured it out with some help from a teammate - thanks Paul.
There is an undocumented API for organizations, and calling it like:
/api/organizations/@current
returns the current organization.Then with that in hand, it's easy to extract the org ID and then use that in the call to
/api/organizations/:parent_lookup_organization_id/members/