Dashboard templates

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

Endpoints

GET
POST
GET
PATCH
DELETE
GET

List all dashboard templates

Required API key scopes

dashboard_template:read

Path parameters

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Query parameters

  • limit
    integer

    Number of results to return per page.

  • offset
    integer

    The initial index from which to return the results.


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": 0,
"image_url": "string",
"team_id": 0,
"scope": "team",
"availability_contexts": [
"string"
]
}
]
}

Create dashboard templates

Required API key scopes

dashboard_template:write

Path parameters

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Request parameters

  • template_name
    string
  • dashboard_description
    string
  • dashboard_filters
  • tags
    array
  • tiles
  • variables
  • deleted
    boolean
  • created_by
    integer
  • image_url
    string
  • scope
  • availability_contexts
    array

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"

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": 0,
"image_url": "string",
"team_id": 0,
"scope": "team",
"availability_contexts": [
"string"
]
}

Retrieve dashboard templates

Required API key scopes

dashboard_template:read

Path parameters

  • id
    string

    A UUID string identifying this dashboard template.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


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": 0,
"image_url": "string",
"team_id": 0,
"scope": "team",
"availability_contexts": [
"string"
]
}

Update dashboard templates

Required API key scopes

dashboard_template:write

Path parameters

  • id
    string

    A UUID string identifying this dashboard template.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


Request parameters

  • template_name
    string
  • dashboard_description
    string
  • dashboard_filters
  • tags
    array
  • tiles
  • variables
  • deleted
    boolean
  • created_by
    integer
  • image_url
    string
  • scope
  • availability_contexts
    array

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"

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": 0,
"image_url": "string",
"team_id": 0,
"scope": "team",
"availability_contexts": [
"string"
]
}

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

    A UUID string identifying this dashboard template.

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


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

Retrieve dashboard templates json schema

Path parameters

  • project_id
    string

    Project ID of the project you're trying to access. To find the ID of the project, make a call to /api/projects/.


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.