Dashboard templates

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

Endpoints

GET
POST
GET
PATCH
DELETE
POST
GET

List all dashboard templates

Required API key scopes

dashboard_template:read

Query parameters

  • is_featured
    boolean
  • limit
    integer
  • offset
    integer
  • ordering
    string
    One of: "-created_at""-template_name""created_at""template_name"
  • scope
    string
    One of: "feature_flag""global""team"

Response


Example request

GET /api/projects/:project_id/dashboard_templates
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/dashboard_templates/

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",
"template_name": "string",
"dashboard_description": "string",
"dashboard_filters": null,
"tags": [
"string"
],
"tiles": null,
"variables": null,
"deleted": true,
"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"
},
"image_url": "string",
"team_id": 0,
"scope": "team",
"availability_contexts": [
"string"
],
"is_featured": true
}
]
}

Create dashboard templates

Required API key scopes

dashboard_template:write

Request parameters

  • template_name
    stringnull
  • dashboard_description
    stringnull
  • dashboard_filters
  • tags
    arraynull
  • tiles
  • variables
  • deleted
    booleannull
  • image_url
    stringnull
  • scope
  • availability_contexts
    arraynull
  • is_featured
    boolean

Response


Example request

POST /api/projects/:project_id/dashboard_templates
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/dashboard_templates/\
-d template_name=["string","null"]

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"template_name": "string",
"dashboard_description": "string",
"dashboard_filters": null,
"tags": [
"string"
],
"tiles": null,
"variables": null,
"deleted": true,
"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"
},
"image_url": "string",
"team_id": 0,
"scope": "team",
"availability_contexts": [
"string"
],
"is_featured": true
}

Retrieve dashboard templates

Required API key scopes

dashboard_template:read

Path parameters

  • id
    string

Response


Example request

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

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"template_name": "string",
"dashboard_description": "string",
"dashboard_filters": null,
"tags": [
"string"
],
"tiles": null,
"variables": null,
"deleted": true,
"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"
},
"image_url": "string",
"team_id": 0,
"scope": "team",
"availability_contexts": [
"string"
],
"is_featured": true
}

Update dashboard templates

Required API key scopes

dashboard_template:write

Path parameters

  • id
    string

Request parameters

  • template_name
    stringnull
  • dashboard_description
    stringnull
  • dashboard_filters
  • tags
    arraynull
  • tiles
  • variables
  • deleted
    booleannull
  • image_url
    stringnull
  • scope
  • availability_contexts
    arraynull
  • is_featured
    boolean

Response


Example request

PATCH /api/projects/:project_id/dashboard_templates/: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/dashboard_templates/:id/\
-d template_name=["string","null"]

Example response

Status 200
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"template_name": "string",
"dashboard_description": "string",
"dashboard_filters": null,
"tags": [
"string"
],
"tiles": null,
"variables": null,
"deleted": true,
"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"
},
"image_url": "string",
"team_id": 0,
"scope": "team",
"availability_contexts": [
"string"
],
"is_featured": true
}

Delete dashboard templates

Hard delete of this model is not allowed. Use a patch API call to set "deleted" to true

Required API key scopes

dashboard_template:write

Path parameters

  • id
    string

Example request

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

Example response

Status 405 No response body

Create dashboard templates copy between projects

Creates a new team-scoped template in the target project (URL) from a team-scoped source template in the same organization. Global and feature-flag templates return 400. Cross-organization or inaccessible sources return 404. Source and destination projects must differ (400 if equal). Conflicting template_name values on the destination are auto-suffixed with (copy), (copy 2), …

Request parameters

  • source_template_id
    string

Response


Example request

POST /api/projects/:project_id/dashboard_templates/copy_between_projects
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/dashboard_templates/copy_between_projects/\
-d source_template_id="string"

Example response

Status 201
RESPONSE
{
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"template_name": "string",
"dashboard_description": "string",
"dashboard_filters": null,
"tags": [
"string"
],
"tiles": null,
"variables": null,
"deleted": true,
"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"
},
"image_url": "string",
"team_id": 0,
"scope": "team",
"availability_contexts": [
"string"
],
"is_featured": true
}

Retrieve dashboard templates json schema

Example request

GET /api/projects/:project_id/dashboard_templates/json_schema
export POSTHOG_PERSONAL_API_KEY=[your personal api key]
curl \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
<ph_app_host>/api/projects/:project_id/dashboard_templates/json_schema/

Example response

Status 200 No response body

Community questions

Questions about this page? or post a community question.