Accounts Table

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

Endpoints

POST

Create customer analytics accounts table query

Run a Customer Analytics accounts table query.

Required API key scopes

account:read

Request parameters

  • async
  • query
  • client_query_id
  • filters_override
  • limit_context
  • name
  • refresh
    Default: blocking
  • variables_override

Response


Example request

POST /api/projects/:project_id/accounts_table_query
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_table_query/\
-d query=undefined

Example response

Status 200
RESPONSE
{
"error": null,
"hasMore": true,
"hogql": null,
"kind": "AccountsTableQuery",
"limit": 0,
"metricsResults": null,
"modifiers": null,
"offset": 0,
"query_status": null,
"resolved_compare_date_range": null,
"resolved_date_range": null,
"results": [
{
"accountFields": {
"property1": "string",
"property2": "string"
},
"customProperties": {
"property1": "string",
"property2": "string"
},
"customPropertyHistory": {
"property1": [
{
"timestamp": "2019-08-24T14:15:22Z",
"value": 0
}
],
"property2": [
{
"timestamp": "2019-08-24T14:15:22Z",
"value": 0
}
]
},
"externalId": null,
"id": "string",
"logoDomain": null,
"name": "string",
"noteCount": null,
"relationships": {
"property1": [
0
],
"property2": [
0
]
},
"tags": null
}
],
"timings": null,
"used_data_warehouse_sources": null,
"warnings": null
}
Status 202
RESPONSE
{
"query_status": {
"budget_remaining_bytes": null,
"bytes_read": null,
"cache_key": null,
"complete": false,
"dashboard_id": null,
"end_time": null,
"error": false,
"error_code": null,
"error_message": null,
"expiration_time": null,
"id": "string",
"insight_id": null,
"labels": null,
"pickup_time": null,
"query_async": true,
"query_progress": null,
"query_scan": null,
"results": null,
"start_time": null,
"task_id": null,
"team_id": 0
}
}