Account

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

Endpoints

GET
POST
GET
PATCH
DELETE

List all account views

Required API key scopes

account:read

Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"visibility": "private",
"content": {
"type": "doc",
"content": [
{
"type": "ph-markdown-notebook",
"attrs": {
"nodeId": "string",
"markdown": "string"
}
}
]
},
"text_content": "string",
"version": 0,
"created_by": 0,
"last_modified_by": 0,
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"can_edit": true,
"can_delete": true,
"can_change_visibility": true
}

Create account views

Required API key scopes

account:write

Request parameters

  • name
    string
  • content

Response


Example request

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

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"visibility": "private",
"content": {
"type": "doc",
"content": [
{
"type": "ph-markdown-notebook",
"attrs": {
"nodeId": "string",
"markdown": "string"
}
}
]
},
"text_content": "string",
"version": 0,
"created_by": 0,
"last_modified_by": 0,
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"can_edit": true,
"can_delete": true,
"can_change_visibility": true
}
Status 400 The content is invalid.

Retrieve account views

Required API key scopes

account:read

Path parameters

  • id
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"visibility": "private",
"content": {
"type": "doc",
"content": [
{
"type": "ph-markdown-notebook",
"attrs": {
"nodeId": "string",
"markdown": "string"
}
}
]
},
"text_content": "string",
"version": 0,
"created_by": 0,
"last_modified_by": 0,
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"can_edit": true,
"can_delete": true,
"can_change_visibility": true
}

Update account views

Required API key scopes

account:write

Path parameters

  • id
    string

Request parameters

  • name
    string
  • content
  • visibility
  • version
    integer

Response


Example request

PATCH /api/projects/:project_id/account_views/: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/account_views/:id/\
-d version="integer"

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"name": "string",
"visibility": "private",
"content": {
"type": "doc",
"content": [
{
"type": "ph-markdown-notebook",
"attrs": {
"nodeId": "string",
"markdown": "string"
}
}
]
},
"text_content": "string",
"version": 0,
"created_by": 0,
"last_modified_by": 0,
"created_at": "2019-08-24T14:15:22Z",
"updated_at": "2019-08-24T14:15:22Z",
"can_edit": true,
"can_delete": true,
"can_change_visibility": true
}
Status 400 The request is invalid.
Status 403 The view cannot be changed by this user.
Status 404 The view was not found.
Status 409 The view changed since the supplied version.

Delete account views

Required API key scopes

account:write

Path parameters

  • id
    string

Query parameters

  • version
    integer

Example request

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

Example response

Status 204 No response body
Status 403 No response body
Status 404 No response body
Status 409 No response body