Custom Property

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

Endpoints

GET
POST
GET
PATCH
DELETE

List all custom property sources

Required API key scopes

account:read

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

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

Example response

Status 200
RESPONSE
{
"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",
"definition": "c35d856b-b1ee-4229-bde7-cabd2df03b58",
"saved_query": "e3652b9e-1a82-4fa6-9330-52b013787fcc",
"external_data_schema": "ba92a32d-bbb9-4eb7-b909-202e1efb6c98",
"source_column": "string",
"column_property_map": null,
"key_column": "string",
"is_enabled": true,
"consecutive_failures": 0,
"last_synced_at": "2019-08-24T14:15:22Z",
"last_sync_error": "string",
"created_at": "2019-08-24T14:15:22Z",
"created_by": 0,
"updated_at": "2019-08-24T14:15:22Z"
}
]
}

Create custom property sources

Required API key scopes

account:write

Request parameters

  • definition
    string
  • saved_query
    stringnull
  • external_data_schema
    stringnull
  • source_column
    stringnull
  • column_property_map
  • key_column
    string
  • is_enabled
    boolean
    Default: true

Response


Example request

POST /api/projects/:project_id/custom_property_sources
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/custom_property_sources/\
-d definition="string",\
-d key_column="string"

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"definition": "c35d856b-b1ee-4229-bde7-cabd2df03b58",
"saved_query": "e3652b9e-1a82-4fa6-9330-52b013787fcc",
"external_data_schema": "ba92a32d-bbb9-4eb7-b909-202e1efb6c98",
"source_column": "string",
"column_property_map": null,
"key_column": "string",
"is_enabled": true,
"consecutive_failures": 0,
"last_synced_at": "2019-08-24T14:15:22Z",
"last_sync_error": "string",
"created_at": "2019-08-24T14:15:22Z",
"created_by": 0,
"updated_at": "2019-08-24T14:15:22Z"
}

Retrieve custom property sources

Required API key scopes

account:read

Path parameters

  • id
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"definition": "c35d856b-b1ee-4229-bde7-cabd2df03b58",
"saved_query": "e3652b9e-1a82-4fa6-9330-52b013787fcc",
"external_data_schema": "ba92a32d-bbb9-4eb7-b909-202e1efb6c98",
"source_column": "string",
"column_property_map": null,
"key_column": "string",
"is_enabled": true,
"consecutive_failures": 0,
"last_synced_at": "2019-08-24T14:15:22Z",
"last_sync_error": "string",
"created_at": "2019-08-24T14:15:22Z",
"created_by": 0,
"updated_at": "2019-08-24T14:15:22Z"
}

Update custom property sources

Required API key scopes

account:write

Path parameters

  • id
    string

Request parameters

  • source_column
    string
  • key_column
    string
  • is_enabled
    boolean

Response


Example request

PATCH /api/projects/:project_id/custom_property_sources/:id
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl -X PATCH \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/custom_property_sources/:id/\
-d source_column="string"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"definition": "c35d856b-b1ee-4229-bde7-cabd2df03b58",
"saved_query": "e3652b9e-1a82-4fa6-9330-52b013787fcc",
"external_data_schema": "ba92a32d-bbb9-4eb7-b909-202e1efb6c98",
"source_column": "string",
"column_property_map": null,
"key_column": "string",
"is_enabled": true,
"consecutive_failures": 0,
"last_synced_at": "2019-08-24T14:15:22Z",
"last_sync_error": "string",
"created_at": "2019-08-24T14:15:22Z",
"created_by": 0,
"updated_at": "2019-08-24T14:15:22Z"
}

Delete custom property sources

Required API key scopes

account:write

Path parameters

  • id
    string

Example request

DELETE /api/projects/:project_id/custom_property_sources/:id
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/custom_property_sources/:id/

Example response

Status 204 No response body

Community questions