Property Access

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

Endpoints

GET
POST
DELETE
GET
POST
DELETE

Retrieve environments property access controls

Get all property access control rules for a property definition.

Required API key scopes

access_control:read

Query parameters

  • property_definition_id
    string

Response


Example request

GET /api/environments/:environment_id/property_access_controls
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:environment_id/property_access_controls/

Example response

Status 200
RESPONSE
{
"access_controls": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"access_level": "read_write",
"organization_member": "fd58f6af-7002-456d-901c-1e977af28563",
"role": "543e2fa5-dae3-497f-aa96-e06da8fcb379",
"created_by": 0,
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
],
"available_access_levels": [
"string"
],
"default_access_level": "string"
}

Create environments property access controls

Create or update a property access control rule.

Required API key scopes

access_control:write

Request parameters

  • property_definition_id
    string
  • access_level
  • organization_member
    stringnull
  • role
    stringnull

Response


Example request

POST /api/environments/:environment_id/property_access_controls
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/environments/:environment_id/property_access_controls/\
-d property_definition_id="string",\
-d access_level=undefined

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"access_level": "read_write",
"organization_member": "fd58f6af-7002-456d-901c-1e977af28563",
"role": "543e2fa5-dae3-497f-aa96-e06da8fcb379",
"created_by": 0,
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}

Delete environments property access controls

Delete a property access control rule. The rule is identified by property_definition_id plus an optional organization_member or role query parameter. Omitting both targets deletes the default rule.

Required API key scopes

access_control:write

Query parameters

  • organization_member
    string
  • property_definition_id
    string
  • role
    string

Example request

DELETE /api/environments/:environment_id/property_access_controls
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X DELETE \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:environment_id/property_access_controls/

Example response

Status 204 No response body

Retrieve property access controls

Get all property access control rules for a property definition.

Required API key scopes

access_control:read

Query parameters

  • property_definition_id
    string

Response


Example request

GET /api/projects/:project_id/property_access_controls
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/property_access_controls/

Example response

Status 200
RESPONSE
{
"access_controls": [
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"access_level": "read_write",
"organization_member": "fd58f6af-7002-456d-901c-1e977af28563",
"role": "543e2fa5-dae3-497f-aa96-e06da8fcb379",
"created_by": 0,
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}
],
"available_access_levels": [
"string"
],
"default_access_level": "string"
}

Create property access controls

Create or update a property access control rule.

Required API key scopes

access_control:write

Request parameters

  • property_definition_id
    string
  • access_level
  • organization_member
    stringnull
  • role
    stringnull

Response


Example request

POST /api/projects/:project_id/property_access_controls
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/projects/:project_id/property_access_controls/\
-d property_definition_id="string",\
-d access_level=undefined

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"access_level": "read_write",
"organization_member": "fd58f6af-7002-456d-901c-1e977af28563",
"role": "543e2fa5-dae3-497f-aa96-e06da8fcb379",
"created_by": 0,
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z"
}

Delete property access controls

Delete a property access control rule. The rule is identified by property_definition_id plus an optional organization_member or role query parameter. Omitting both targets deletes the default rule.

Required API key scopes

access_control:write

Query parameters

  • organization_member
    string
  • property_definition_id
    string
  • role
    string

Example request

DELETE /api/projects/:project_id/property_access_controls
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X DELETE \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/property_access_controls/

Example response

Status 204 No response body

Community questions

Questions about this page? or post a community question.