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/templatesAuthorization
This endpoint requires OAuth 2.0 authentication. Include your access token in the Authorization header:
Authorization: Bearer your_access_tokenQuery Parameters
| Parameter | Required | Description |
|---|---|---|
workspaceId | No | Your workspace’s ID. Without it, only the built-in default template is returned; your saved templates require this parameter. |
Response
Success Response (200)
{ "templates": [ { "templateId": "template_000", "name": "", "title": "", "type": "stackedBar" }, { "id": "template_abc123", "templateId": "template_abc123", "name": "Monthly Sales Dashboard", "title": "Jan 2025 Sales", "type": "line" }, { "id": "template_xyz789", "templateId": "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
curl -X GET "https://api.instacharts.io/v1/templates?workspaceId=your_workspace_id" \ -H "Authorization: Bearer your_access_token"Template Object Properties
| Property | Type | Description |
|---|---|---|
templateId | string | Unique identifier for the template |
id | string | Same value as templateId. Not present on the built-in default template |
title | string | Chart title of the template |
name | string | Name of the template |
type | string | Chart type (“line”, “bar”, “pie”, “scatter”, etc.) Chart Types |