Accounts

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

Endpoints

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

List all environments accounts

Required API key scopes

account:read

Query parameters

  • account_executive
    string
  • account_owner
    string
  • all_roles_unassigned
    boolean
  • csm
    string
  • 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/environments/:environment_id/accounts
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/environments/:environment_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": {
"csm": {
"id": 0,
"email": "string"
},
"account_executive": {
"id": 0,
"email": "string"
},
"account_owner": {
"id": 0,
"email": "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"
},
"tags": [
"string"
],
"notebooks": [
"string"
],
"created_at": "2019-08-24T14:15:22Z",
"created_by": 0,
"updated_at": "2019-08-24T14:15:22Z"
}
]
}

Create environments accounts

Required API key scopes

account:write

Request parameters

  • name
    string
  • external_id
    stringnull
  • properties
    objectnull
  • tags
    array

Response


Example request

POST /api/environments/:environment_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/environments/:environment_id/accounts/\
-d name="string"

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"external_id": "string",
"properties": {
"csm": {
"id": 0,
"email": "string"
},
"account_executive": {
"id": 0,
"email": "string"
},
"account_owner": {
"id": 0,
"email": "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"
},
"tags": [
"string"
],
"notebooks": [
"string"
],
"created_at": "2019-08-24T14:15:22Z",
"created_by": 0,
"updated_at": "2019-08-24T14:15:22Z"
}

List all environments 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/environments/:environment_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/environments/:environment_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 environments accounts notebooks

Required API key scopes

account:write

Path parameters

  • account_id
    string

Request parameters

  • title
    stringnull
  • content
  • text_content
    stringnull

Response


Example request

POST /api/environments/:environment_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/environments/:environment_id/accounts/:account_id/notebooks/\
-d title=["string","null"]

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 environments accounts notebooks

Required API key scopes

account:read

Path parameters

  • account_id
    string
  • short_id
    string

Response


Example request

GET /api/environments/:environment_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/environments/:environment_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 environments accounts notebooks

Required API key scopes

account:write

Path parameters

  • account_id
    string
  • short_id
    string

Example request

DELETE /api/environments/:environment_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/environments/:environment_id/accounts/:account_id/notebooks/:short_id/

Example response

Status 204 No response body

Retrieve environments accounts

Required API key scopes

account:read

Path parameters

  • id
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"external_id": "string",
"properties": {
"csm": {
"id": 0,
"email": "string"
},
"account_executive": {
"id": 0,
"email": "string"
},
"account_owner": {
"id": 0,
"email": "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"
},
"tags": [
"string"
],
"notebooks": [
"string"
],
"created_at": "2019-08-24T14:15:22Z",
"created_by": 0,
"updated_at": "2019-08-24T14:15:22Z"
}

Update environments accounts

Required API key scopes

account:write

Path parameters

  • id
    string

Request parameters

  • name
    string
  • external_id
    stringnull
  • properties
    objectnull
  • tags
    array

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"external_id": "string",
"properties": {
"csm": {
"id": 0,
"email": "string"
},
"account_executive": {
"id": 0,
"email": "string"
},
"account_owner": {
"id": 0,
"email": "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"
},
"tags": [
"string"
],
"notebooks": [
"string"
],
"created_at": "2019-08-24T14:15:22Z",
"created_by": 0,
"updated_at": "2019-08-24T14:15:22Z"
}

Delete environments accounts

Required API key scopes

account:write

Path parameters

  • id
    string

Example request

DELETE /api/environments/:environment_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/environments/:environment_id/accounts/:id/

Example response

Status 204 No response body

List all accounts

Required API key scopes

account:read

Query parameters

  • account_executive
    string
  • account_owner
    string
  • all_roles_unassigned
    boolean
  • csm
    string
  • 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": {
"csm": {
"id": 0,
"email": "string"
},
"account_executive": {
"id": 0,
"email": "string"
},
"account_owner": {
"id": 0,
"email": "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"
},
"tags": [
"string"
],
"notebooks": [
"string"
],
"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
    stringnull
  • properties
    objectnull
  • tags
    array

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": {
"csm": {
"id": 0,
"email": "string"
},
"account_executive": {
"id": 0,
"email": "string"
},
"account_owner": {
"id": 0,
"email": "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"
},
"tags": [
"string"
],
"notebooks": [
"string"
],
"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
}

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
    stringnull
  • content
  • text_content
    stringnull

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","null"]

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

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": {
"csm": {
"id": 0,
"email": "string"
},
"account_executive": {
"id": 0,
"email": "string"
},
"account_owner": {
"id": 0,
"email": "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"
},
"tags": [
"string"
],
"notebooks": [
"string"
],
"created_at": "2019-08-24T14:15:22Z",
"created_by": 0,
"updated_at": "2019-08-24T14:15:22Z"
}

Community questions

Questions about this page? or post a community question.