Accounts

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

Endpoints

GET
GET
GET
GET
POST

List all accounts summaries

Path parameters

  • id
    string

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

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

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",
"slack_channel_id": "string",
"cadence": "daily",
"period_start": "2019-08-24T14:15:22Z",
"period_end": "2019-08-24T14:15:22Z",
"content": "string",
"message_count": 0,
"messages": [
{
"author": "string",
"sent_at": "2019-08-24T14:15:22Z",
"permalink": "string"
}
],
"generated_at": "2019-08-24T14:15:22Z"
}
]
}

List all accounts support tickets

Required API key scopes

account:readticket:read

Path parameters

  • id
    string

Example request

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

Example response

Status 200
RESPONSE
{
"id": "string",
"ticket_number": 0,
"status": "string",
"last_message_at": "2019-08-24T14:15:22Z",
"last_message_text": "string",
"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"
},
"deep_link": "string",
"created_at": "2019-08-24T14:15:22Z",
"started_by": "string",
"distinct_id": "string"
}

List all accounts support ticket messages

Required API key scopes

account:readticket:read

Path parameters

  • id
    string
  • ticket_id
    string

Query parameters

  • limit
    integer
  • offset
    integer

Response


Example request

GET /api/projects/:project_id/accounts/:id/support_tickets/:ticket_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/support_tickets/:ticket_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",
"content": "string",
"author_name": "string",
"direction": "inbound",
"is_private": true,
"created_at": "2019-08-24T14:15:22Z"
}
]
}

Retrieve accounts by external id

Required API key scopes

account:read

Query parameters

  • external_id
    string

Response


Example request

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

List all accounts presence

Required API key scopes

account:read

Request parameters

  • account_ids
    array

Example request

POST /api/projects/:project_id/accounts/presence_list
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/presence_list/\
-d account_ids="array"

Example response

Status 200
RESPONSE
{
"account_id": "449e7a5c-69d3-4b8a-aaaf-5c9b713ebc65",
"viewers": [
{
"user_id": 0,
"display_name": "string"
}
]
}