Get insights about templates
GET
CoderSessionTokenheader
Coder-Session-Token<token>start_time*stringStart time
Format
date-timeend_time*stringEnd time
Format
date-timeinterval*stringInterval
Value in
"week""day"template_ids?array<string>Template IDs
OK
application/json- 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 }}