Skip to content

Templates

List Templates API

Retrieve a list of templates owned by the authenticated user. In addition to any templates the user has created, every user has a default template, which contains the default chart settings for a new stacked bar chart.

Endpoint

GET https://api.instacharts.io/v1/templates

Authorization

This endpoint requires OAuth 2.0 authentication. Include your access token in the Authorization header:

Authorization: Bearer your_access_token

Response

Success Response (200)

{
"data": [
{
"id": "template_000",
"name": "Default Template",
"title": "",
"type": "stackedBar"
},
{
"id": "template_abc123",
"name": "Monthly Sales Dashboard",
"title": "Jan 2025 Sales",
"type": "line"
},
{
"id": "template_xyz789",
"name": "Product Distribution Pie Chart",
"title": "Product Distribution",
"type": "pie"
}
]
}

Error Responses

Authentication Error (401)

{
"error": "unauthorized",
"message": "Invalid or expired access token",
"code": "INVALID_TOKEN"
}

Example Requests

Basic Request

Terminal window
curl -X GET "https://api.instacharts.io/v1/templates" \
-H "Authorization: Bearer your_access_token"

Template Object Properties

PropertyTypeDescription
idstringUnique identifier for the template
titlestringChart title of the template
namestringName of the template
chartTypestringChart type (“line”, “bar”, “pie”, “scatter”, etc.) Chart Types