Customer

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

Endpoints

GET
GET
POST
GET
POST
GET
DELETE
GET
POST
DELETE
POST
GET
POST
PATCH
DELETE
POST
POST
POST

List all account notes

Required API key scopes

account:read

Query parameters

  • account_id
    string
  • assigned_to
    array
  • created_by
    array
  • limit
    integer
  • offset
    integer
  • search
    string

Response


Example request

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

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": [
{
"short_id": "string",
"title": "string",
"created_at": "2019-08-24T14:15:22Z",
"last_modified_at": "2019-08-24T14:15:22Z",
"account_id": "449e7a5c-69d3-4b8a-aaaf-5c9b713ebc65",
"account_name": "string",
"created_by": {
"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": {},
"role_at_organization": "engineering"
}
}
]
}

List all accounts custom property values

Required API key scopes

account:read

Path parameters

  • account_id
    string

Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"account_id": "449e7a5c-69d3-4b8a-aaaf-5c9b713ebc65",
"definition_id": "91c1994f-b1db-4fef-840d-7d3ab2984871",
"value": "string",
"created_at": "2019-08-24T14:15:22Z",
"created_by_id": 0
}

Create accounts custom property values

Required API key scopes

account:write

Path parameters

  • account_id
    string

Request parameters

  • definition
    string
  • value

Response


Example request

POST /api/projects/:project_id/accounts/:account_id/custom_property_values
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/accounts/:account_id/custom_property_values/\
-d definition="string",\
-d value=undefined

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"account_id": "449e7a5c-69d3-4b8a-aaaf-5c9b713ebc65",
"definition_id": "91c1994f-b1db-4fef-840d-7d3ab2984871",
"value": "string",
"created_at": "2019-08-24T14:15:22Z",
"created_by_id": 0
}
Status 204 No response body

List all accounts notebooks

Required API key scopes

account:read

Path parameters

  • account_id
    string

Query parameters

  • limit
    integer
  • offset
    integer
  • ordering
    string
    One of: "-created_at""-created_by""created_at""created_by"
  • search
    string

Response


Example request

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

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",
"short_id": "string",
"title": "string",
"content": null,
"text_content": "string",
"created_at": "2019-08-24T14:15:22Z",
"created_by": {
"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": {},
"role_at_organization": "engineering"
},
"last_modified_at": "2019-08-24T14:15:22Z",
"last_modified_by": {
"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": {},
"role_at_organization": "engineering"
}
}
]
}

Create accounts notebooks

Required API key scopes

account:write

Path parameters

  • account_id
    string

Request parameters

  • title
    string | null
  • content
  • text_content
    string | null

Response


Example request

POST /api/projects/:project_id/accounts/:account_id/notebooks
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/accounts/:account_id/notebooks/\
-d title="string"

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"short_id": "string",
"title": "string",
"content": null,
"text_content": "string",
"created_at": "2019-08-24T14:15:22Z",
"created_by": {
"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": {},
"role_at_organization": "engineering"
},
"last_modified_at": "2019-08-24T14:15:22Z",
"last_modified_by": {
"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": {},
"role_at_organization": "engineering"
}
}

Retrieve accounts notebooks

Required API key scopes

account:read

Path parameters

  • account_id
    string
  • short_id
    string

Response


Example request

GET /api/projects/:project_id/accounts/:account_id/notebooks/:short_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/accounts/:account_id/notebooks/:short_id/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"short_id": "string",
"title": "string",
"content": null,
"text_content": "string",
"created_at": "2019-08-24T14:15:22Z",
"created_by": {
"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": {},
"role_at_organization": "engineering"
},
"last_modified_at": "2019-08-24T14:15:22Z",
"last_modified_by": {
"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": {},
"role_at_organization": "engineering"
}
}

Delete accounts notebooks

Required API key scopes

account:write

Path parameters

  • account_id
    string
  • short_id
    string

Example request

DELETE /api/projects/:project_id/accounts/:account_id/notebooks/:short_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/accounts/:account_id/notebooks/:short_id/

Example response

Status 204 No response body

List all accounts relationships

Required API key scopes

account:read

Path parameters

  • account_id
    string

Query parameters

  • include_history
    boolean

Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"definition": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"description": "string",
"is_single_holder": true,
"is_controlled": true
},
"user": {
"id": 0,
"email": "user@example.com"
},
"started_at": "2019-08-24T14:15:22Z",
"ended_at": "2019-08-24T14:15:22Z",
"source": "human"
}

Create accounts relationships

Required API key scopes

account:write

Path parameters

  • account_id
    string

Request parameters

  • definition
    string
  • user
    integer

Response


Example request

POST /api/projects/:project_id/accounts/:account_id/relationships
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/accounts/:account_id/relationships/\
-d definition="string",\
-d user="integer"

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"definition": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"description": "string",
"is_single_holder": true,
"is_controlled": true
},
"user": {
"id": 0,
"email": "user@example.com"
},
"started_at": "2019-08-24T14:15:22Z",
"ended_at": "2019-08-24T14:15:22Z",
"source": "human"
}

Delete accounts relationships

Required API key scopes

account:write

Path parameters

  • account_id
    string
  • id
    string

Example request

DELETE /api/projects/:project_id/accounts/:account_id/relationships/: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/accounts/:account_id/relationships/:id/

Example response

Status 204 No response body

Create accounts relationships end

Path parameters

  • account_id
    string
  • id
    string

Response


Example request

POST /api/projects/:project_id/accounts/:account_id/relationships/:id/end
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/accounts/:account_id/relationships/:id/end/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"definition": {
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"description": "string",
"is_single_holder": true,
"is_controlled": true
},
"user": {
"id": 0,
"email": "user@example.com"
},
"started_at": "2019-08-24T14:15:22Z",
"ended_at": "2019-08-24T14:15:22Z",
"source": "human"
}

List all event streams

The caller's event stream: a live feed of selected accounts' events posted to a Slack channel of their choice. Per-user — each team member owns at most one stream, and every endpoint is scoped to the caller's own. Delivery runs through a managed CDP destination that is re-provisioned inside the same transaction as every write, so config and delivery can't drift apart.

Required API key scopes

account:read

Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"enabled": false,
"event_names": [
"string"
],
"slack_integration": 0,
"slack_channel_id": "",
"slack_channel_name": "",
"account_ids": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
],
"created_at": "2019-08-24T14:15:22Z",
"created_by": 0,
"updated_at": "2019-08-24T14:15:22Z"
}

Create event streams

The caller's event stream: a live feed of selected accounts' events posted to a Slack channel of their choice. Per-user — each team member owns at most one stream, and every endpoint is scoped to the caller's own. Delivery runs through a managed CDP destination that is re-provisioned inside the same transaction as every write, so config and delivery can't drift apart.

Required API key scopes

account:write

Request parameters

  • enabled
    boolean
    Default: false
  • event_names
    array
  • slack_integration
    integer | null
  • slack_channel_id
    string
    Default:
  • slack_channel_name
    string
    Default:

Response


Example request

POST /api/projects/:project_id/event_streams
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/event_streams/\
-d enabled="boolean"

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"enabled": false,
"event_names": [
"string"
],
"slack_integration": 0,
"slack_channel_id": "",
"slack_channel_name": "",
"account_ids": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
],
"created_at": "2019-08-24T14:15:22Z",
"created_by": 0,
"updated_at": "2019-08-24T14:15:22Z"
}

Update event streams

The caller's event stream: a live feed of selected accounts' events posted to a Slack channel of their choice. Per-user — each team member owns at most one stream, and every endpoint is scoped to the caller's own. Delivery runs through a managed CDP destination that is re-provisioned inside the same transaction as every write, so config and delivery can't drift apart.

Required API key scopes

account:write

Path parameters

  • id
    string

Request parameters

  • enabled
    boolean
    Default: false
  • event_names
    array
  • slack_integration
    integer | null
  • slack_channel_id
    string
    Default:
  • slack_channel_name
    string
    Default:

Response


Example request

PATCH /api/projects/:project_id/event_streams/: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/event_streams/:id/\
-d enabled="boolean"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"enabled": false,
"event_names": [
"string"
],
"slack_integration": 0,
"slack_channel_id": "",
"slack_channel_name": "",
"account_ids": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
],
"created_at": "2019-08-24T14:15:22Z",
"created_by": 0,
"updated_at": "2019-08-24T14:15:22Z"
}

Delete event streams

The caller's event stream: a live feed of selected accounts' events posted to a Slack channel of their choice. Per-user — each team member owns at most one stream, and every endpoint is scoped to the caller's own. Delivery runs through a managed CDP destination that is re-provisioned inside the same transaction as every write, so config and delivery can't drift apart.

Required API key scopes

account:write

Path parameters

  • id
    string

Example request

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

Example response

Status 204 No response body

Create event streams add account

The caller's event stream: a live feed of selected accounts' events posted to a Slack channel of their choice. Per-user — each team member owns at most one stream, and every endpoint is scoped to the caller's own. Delivery runs through a managed CDP destination that is re-provisioned inside the same transaction as every write, so config and delivery can't drift apart.

Path parameters

  • id
    string

Request parameters

  • account_id
    string

Response


Example request

POST /api/projects/:project_id/event_streams/:id/add_account
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/event_streams/:id/add_account/\
-d account_id="string"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"enabled": false,
"event_names": [
"string"
],
"slack_integration": 0,
"slack_channel_id": "",
"slack_channel_name": "",
"account_ids": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
],
"created_at": "2019-08-24T14:15:22Z",
"created_by": 0,
"updated_at": "2019-08-24T14:15:22Z"
}

Create event streams remove account

The caller's event stream: a live feed of selected accounts' events posted to a Slack channel of their choice. Per-user — each team member owns at most one stream, and every endpoint is scoped to the caller's own. Delivery runs through a managed CDP destination that is re-provisioned inside the same transaction as every write, so config and delivery can't drift apart.

Path parameters

  • id
    string

Request parameters

  • account_id
    string

Response


Example request

POST /api/projects/:project_id/event_streams/:id/remove_account
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/event_streams/:id/remove_account/\
-d account_id="string"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"enabled": false,
"event_names": [
"string"
],
"slack_integration": 0,
"slack_channel_id": "",
"slack_channel_name": "",
"account_ids": [
"497f6eca-6276-4993-bfeb-53cbbbba6f08"
],
"created_at": "2019-08-24T14:15:22Z",
"created_by": 0,
"updated_at": "2019-08-24T14:15:22Z"
}

Create event streams send test message

The caller's event stream: a live feed of selected accounts' events posted to a Slack channel of their choice. Per-user — each team member owns at most one stream, and every endpoint is scoped to the caller's own. Delivery runs through a managed CDP destination that is re-provisioned inside the same transaction as every write, so config and delivery can't drift apart.

Path parameters

  • id
    string

Response


Example request

POST /api/projects/:project_id/event_streams/:id/send_test_message
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/event_streams/:id/send_test_message/

Example response

Status 200
RESPONSE
{
"channel_id": "string"
}