Skip to content
Skip to Content
Coder Docs

Get insights about templates

GET
/api/v2/insights/templates

Authorization

CoderSessionToken
headerCoder-Session-Token<token>

Query Parameters

start_time*string

Start time

Formatdate-time
end_time*string

End time

Formatdate-time
interval*string

Interval

Value in"week""day"
template_ids?array<string>

Template IDs

Response Body

OK

application/json
  1. response
interval_reports?array<>
report?

The samples read CODER_URL and CODER_SESSION_TOKEN: set up your environment.

curl -X GET \	"$CODER_URL/api/v2/insights/templates?start_time={start_time}&end_time={end_time}&interval={interval}" \	-H "Coder-Session-Token: $CODER_SESSION_TOKEN"
Example Response200
{  "interval_reports": [    {      "active_users": 14,      "end_time": "2019-08-24T14:15:22Z",      "interval": "week",      "start_time": "2019-08-24T14:15:22Z",      "template_ids": [        "711c30a3-6011-4cbe-a63a-23cdf9bb9ce1"      ]    }  ],  "report": {    "active_users": 22,    "apps_usage": [      {        "display_name": "VS Code",        "icon": "string",        "method": "ssh",        "seconds": 80500,        "seconds_is_upper_bound": false,        "slug": "vscode",        "template_ids": [          "711c30a3-6011-4cbe-a63a-23cdf9bb9ce1"        ],        "times_used": 2      }    ],    "end_time": "2019-08-24T14:15:22Z",    "parameters_usage": [      {        "description": "string",        "display_name": "string",        "name": "string",        "options": [          {            "description": "string",            "icon": "string",            "name": "string",            "value": "string"          }        ],        "template_ids": [          "711c30a3-6011-4cbe-a63a-23cdf9bb9ce1"        ],        "type": "string",        "values": [          {            "count": 0,            "value": "string"          }        ]      }    ],    "start_time": "2019-08-24T14:15:22Z",    "template_ids": [      "711c30a3-6011-4cbe-a63a-23cdf9bb9ce1"    ],    "usage_total_seconds": 120000  }}