Accounts

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

Endpoints

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

List all accounts

Required API key scopes

account:read

Query parameters

  • all_roles_unassigned
    boolean
  • inactive_last
    boolean
    Default: false
  • include_churned
    boolean
    Default: false
  • include_ignored
    boolean
    Default: false
  • limit
    integer
  • offset
    integer
  • ordering
    string
    One of: "-created_at""-name""-updated_at""created_at""name""updated_at"
  • search
    string
  • tags
    string

Response


Example request

GET /api/projects/:project_id/accounts
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/

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",
"name": "string",
"external_id": "string",
"properties": {
"website_domain": "string",
"email_domains": [
"string"
],
"known_emails": [
"string"
],
"stripe_customer_id": "string",
"hubspot_deal_id": "string",
"billing_id": "string",
"sfdc_id": "string",
"zendesk_id": "string",
"slack_channel_id": "string",
"usage_dashboard_link": "string",
"metabase_link": "string"
},
"tags": [
"string"
],
"notebooks": [
"string"
],
"slack_summary_cadence": "daily",
"churned_at": "2019-08-24T14:15:22Z",
"ignored_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"created_by": 0,
"updated_at": "2019-08-24T14:15:22Z"
}
]
}

Create accounts

Required API key scopes

account:write

Request parameters

  • name
    string
  • external_id
    string | null
  • properties
    object | null
  • tags
    array
  • slack_summary_cadence
  • churned_at
    string | null
  • ignored_at
    string | null

Response


Example request

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

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"external_id": "string",
"properties": {
"website_domain": "string",
"email_domains": [
"string"
],
"known_emails": [
"string"
],
"stripe_customer_id": "string",
"hubspot_deal_id": "string",
"billing_id": "string",
"sfdc_id": "string",
"zendesk_id": "string",
"slack_channel_id": "string",
"usage_dashboard_link": "string",
"metabase_link": "string"
},
"tags": [
"string"
],
"notebooks": [
"string"
],
"slack_summary_cadence": "daily",
"churned_at": "2019-08-24T14:15:22Z",
"ignored_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"created_by": 0,
"updated_at": "2019-08-24T14:15:22Z"
}

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"
}

Retrieve accounts

Required API key scopes

account:read

Path parameters

  • id
    string

Response


Example request

GET /api/projects/:project_id/accounts/: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/:id/

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"external_id": "string",
"properties": {
"website_domain": "string",
"email_domains": [
"string"
],
"known_emails": [
"string"
],
"stripe_customer_id": "string",
"hubspot_deal_id": "string",
"billing_id": "string",
"sfdc_id": "string",
"zendesk_id": "string",
"slack_channel_id": "string",
"usage_dashboard_link": "string",
"metabase_link": "string"
},
"tags": [
"string"
],
"notebooks": [
"string"
],
"slack_summary_cadence": "daily",
"churned_at": "2019-08-24T14:15:22Z",
"ignored_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"created_by": 0,
"updated_at": "2019-08-24T14:15:22Z"
}

Update accounts

Required API key scopes

account:write

Path parameters

  • id
    string

Request parameters

  • name
    string
  • external_id
    string | null
  • properties
    object | null
  • tags
    array
  • slack_summary_cadence
  • churned_at
    string | null
  • ignored_at
    string | null

Response


Example request

PATCH /api/projects/:project_id/accounts/: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/accounts/:id/\
-d name="string"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"external_id": "string",
"properties": {
"website_domain": "string",
"email_domains": [
"string"
],
"known_emails": [
"string"
],
"stripe_customer_id": "string",
"hubspot_deal_id": "string",
"billing_id": "string",
"sfdc_id": "string",
"zendesk_id": "string",
"slack_channel_id": "string",
"usage_dashboard_link": "string",
"metabase_link": "string"
},
"tags": [
"string"
],
"notebooks": [
"string"
],
"slack_summary_cadence": "daily",
"churned_at": "2019-08-24T14:15:22Z",
"ignored_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"created_by": 0,
"updated_at": "2019-08-24T14:15:22Z"
}

Delete accounts

Required API key scopes

account:write

Path parameters

  • id
    string

Example request

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

Example response

Status 204 No response body

List all accounts email threads

Required API key scopes

account:readticket:read

Path parameters

  • id
    string

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

GET /api/projects/:project_id/accounts/:id/email_threads
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/:id/email_threads/

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",
"subject": "string",
"preview": "string",
"first_message_at": "2019-08-24T14:15:22Z",
"first_message": {
"sender": {
"name": "string",
"email": "user@example.com",
"person_id": "087e858e-473c-4f50-b5b0-c1df6c021550",
"distinct_id": "string"
},
"sent_at": "2019-08-24T14:15:22Z",
"direction": "inbound"
},
"last_message_at": "2019-08-24T14:15:22Z",
"last_message": {
"sender": {
"name": "string",
"email": "user@example.com",
"person_id": "087e858e-473c-4f50-b5b0-c1df6c021550",
"distinct_id": "string"
},
"sent_at": "2019-08-24T14:15:22Z",
"direction": "inbound"
},
"message_count": 0,
"participants": [
{
"email": "user@example.com",
"display_name": "string",
"kind": "internal",
"person_id": "087e858e-473c-4f50-b5b0-c1df6c021550"
}
]
}
]
}

List all accounts email thread messages

Required API key scopes

account:readticket:read

Path parameters

  • id
    string
  • thread_id
    string

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

GET /api/projects/:project_id/accounts/:id/email_threads/:thread_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/:id/email_threads/:thread_id/

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",
"sent_at": "2019-08-24T14:15:22Z",
"sender": {
"name": "string",
"email": "user@example.com"
},
"to_recipients": [
{
"name": "string",
"email": "user@example.com"
}
],
"cc_recipients": [
{
"name": "string",
"email": "user@example.com"
}
],
"sender_authenticated": true,
"direction": "inbound",
"content": "string"
}
]
}

List all accounts meetings

Path parameters

  • id
    string

Query parameters

  • limit
    integer
  • offset
    integer
  • search
    string

Response


Example request

GET /api/projects/:project_id/accounts/:id/meetings
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/:id/meetings/

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",
"title": "string",
"is_recurring": true,
"gong_url": "http://example.com",
"start_time": "2019-08-24T14:15:22Z",
"end_time": "2019-08-24T14:15:22Z",
"organizer_email": "string",
"status": "string",
"participants": [
{
"email": "string",
"display_name": "string",
"response_status": "string",
"is_organizer": true,
"person_id": "087e858e-473c-4f50-b5b0-c1df6c021550"
}
]
}
]
}

Create accounts presence

Required API key scopes

account:read

Path parameters

  • id
    string

Example request

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

Example response

Status 200
RESPONSE
{
"user_id": 0,
"display_name": "string"
}