Roles
For instructions on how to authenticate to use this endpoint, see API overview.
Endpoints
GET | |
POST | |
GET | |
PATCH | |
DELETE | |
GET | |
POST | |
GET | |
DELETE |
List all roles
Also available via the PostHog MCP server:
roles-list— List organization roles.
Role endpoints disclose member records, so they scope them the same way the members list does when the org restricts member list visibility.
Required API key scopes
organization:readQuery parameters
- limitinteger
- offsetinteger
Response
Example request
GET /api /organizations /:organization_id /rolesExample response
Status 200
Create roles
Role endpoints disclose member records, so they scope them the same way the members list does when the org restricts member list visibility.
Required API key scopes
organization:writeRequest parameters
- namestring
Response
Example request
POST /api /organizations /:organization_id /rolesExample response
Status 201
Retrieve roles
Role endpoints disclose member records, so they scope them the same way the members list does when the org restricts member list visibility.
Required API key scopes
organization:readPath parameters
- idstring
Response
Example request
GET /api /organizations /:organization_id /roles /:idExample response
Status 200
Update roles
Role endpoints disclose member records, so they scope them the same way the members list does when the org restricts member list visibility.
Required API key scopes
organization:writePath parameters
- idstring
Request parameters
- namestring
Response
Example request
PATCH /api /organizations /:organization_id /roles /:idExample response
Status 200
Delete roles
Role endpoints disclose member records, so they scope them the same way the members list does when the org restricts member list visibility.
Required API key scopes
organization:writePath parameters
- idstring
Example request
DELETE /api /organizations /:organization_id /roles /:idExample response
Status 204 No response body
List all roles role memberships
Role endpoints disclose member records, so they scope them the same way the members list does when the org restricts member list visibility.
Required API key scopes
organization:readPath parameters
- role_idstring
Query parameters
- limitinteger
- offsetinteger
Response
Example request
GET /api /organizations /:organization_id /roles /:role_id /role_membershipsExample response
Status 200
Create roles role memberships
Role endpoints disclose member records, so they scope them the same way the members list does when the org restricts member list visibility.
Required API key scopes
organization:writePath parameters
- role_idstring
Request parameters
- user_uuidstring
Response
Example request
POST /api /organizations /:organization_id /roles /:role_id /role_membershipsExample response
Status 201
Retrieve roles role memberships
Role endpoints disclose member records, so they scope them the same way the members list does when the org restricts member list visibility.
Required API key scopes
organization:readPath parameters
- idstring
- role_idstring
Response
Example request
GET /api /organizations /:organization_id /roles /:role_id /role_memberships /:idExample response
Status 200
Delete roles role memberships
Role endpoints disclose member records, so they scope them the same way the members list does when the org restricts member list visibility.
Required API key scopes
organization:writePath parameters
- idstring
- role_idstring
Example request
DELETE /api /organizations /:organization_id /roles /:role_id /role_memberships /:id