curl --request POST \
--url https://apiweb.mile.app/api/v3/dynamic-dashboard \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Jakarta Hub - Daily",
"description": "Morning stand-up view",
"sharedRoleIds": [
"6650c2a1f3b9e4001c7d2b20"
],
"hubScope": {
"mode": "selected",
"hubIds": [
"6650c2a1f3b9e4001c7d2c30"
]
},
"timeRange": {
"preset": "last_7d"
},
"grid": {
"columns": 12
},
"widgets": [
{
"widgetName": "Total Tasks",
"layout": {
"w": 3,
"h": null
}
},
{
"widgetId": "66e0b3f1c9a8d7e6f5a4b202",
"layout": {
"w": 6,
"h": 6,
"x": 3,
"y": 0
}
},
{
"widget": {
"name": "Shift notes",
"viz": "text",
"category": "utility",
"spec": null,
"content": {
"body": "Check the Bekasi backlog first."
},
"defaultLayout": {
"w": 3,
"h": null
}
},
"layout": {
"w": 3,
"h": 3
}
}
]
}
'import requests
url = "https://apiweb.mile.app/api/v3/dynamic-dashboard"
payload = {
"name": "Jakarta Hub - Daily",
"description": "Morning stand-up view",
"sharedRoleIds": ["6650c2a1f3b9e4001c7d2b20"],
"hubScope": {
"mode": "selected",
"hubIds": ["6650c2a1f3b9e4001c7d2c30"]
},
"timeRange": { "preset": "last_7d" },
"grid": { "columns": 12 },
"widgets": [
{
"widgetName": "Total Tasks",
"layout": {
"w": 3,
"h": None
}
},
{
"widgetId": "66e0b3f1c9a8d7e6f5a4b202",
"layout": {
"w": 6,
"h": 6,
"x": 3,
"y": 0
}
},
{
"widget": {
"name": "Shift notes",
"viz": "text",
"category": "utility",
"spec": None,
"content": { "body": "Check the Bekasi backlog first." },
"defaultLayout": {
"w": 3,
"h": None
}
},
"layout": {
"w": 3,
"h": 3
}
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Jakarta Hub - Daily',
description: 'Morning stand-up view',
sharedRoleIds: ['6650c2a1f3b9e4001c7d2b20'],
hubScope: {mode: 'selected', hubIds: ['6650c2a1f3b9e4001c7d2c30']},
timeRange: {preset: 'last_7d'},
grid: {columns: 12},
widgets: [
{widgetName: 'Total Tasks', layout: {w: 3, h: null}},
{widgetId: '66e0b3f1c9a8d7e6f5a4b202', layout: {w: 6, h: 6, x: 3, y: 0}},
{
widget: {
name: 'Shift notes',
viz: 'text',
category: 'utility',
spec: null,
content: {body: JSON.stringify('Check the Bekasi backlog first.')},
defaultLayout: {w: 3, h: null}
},
layout: {w: 3, h: 3}
}
]
})
};
fetch('https://apiweb.mile.app/api/v3/dynamic-dashboard', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apiweb.mile.app/api/v3/dynamic-dashboard",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Jakarta Hub - Daily',
'description' => 'Morning stand-up view',
'sharedRoleIds' => [
'6650c2a1f3b9e4001c7d2b20'
],
'hubScope' => [
'mode' => 'selected',
'hubIds' => [
'6650c2a1f3b9e4001c7d2c30'
]
],
'timeRange' => [
'preset' => 'last_7d'
],
'grid' => [
'columns' => 12
],
'widgets' => [
[
'widgetName' => 'Total Tasks',
'layout' => [
'w' => 3,
'h' => null
]
],
[
'widgetId' => '66e0b3f1c9a8d7e6f5a4b202',
'layout' => [
'w' => 6,
'h' => 6,
'x' => 3,
'y' => 0
]
],
[
'widget' => [
'name' => 'Shift notes',
'viz' => 'text',
'category' => 'utility',
'spec' => null,
'content' => [
'body' => 'Check the Bekasi backlog first.'
],
'defaultLayout' => [
'w' => 3,
'h' => null
]
],
'layout' => [
'w' => 3,
'h' => 3
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apiweb.mile.app/api/v3/dynamic-dashboard"
payload := strings.NewReader("{\n \"name\": \"Jakarta Hub - Daily\",\n \"description\": \"Morning stand-up view\",\n \"sharedRoleIds\": [\n \"6650c2a1f3b9e4001c7d2b20\"\n ],\n \"hubScope\": {\n \"mode\": \"selected\",\n \"hubIds\": [\n \"6650c2a1f3b9e4001c7d2c30\"\n ]\n },\n \"timeRange\": {\n \"preset\": \"last_7d\"\n },\n \"grid\": {\n \"columns\": 12\n },\n \"widgets\": [\n {\n \"widgetName\": \"Total Tasks\",\n \"layout\": {\n \"w\": 3,\n \"h\": null\n }\n },\n {\n \"widgetId\": \"66e0b3f1c9a8d7e6f5a4b202\",\n \"layout\": {\n \"w\": 6,\n \"h\": 6,\n \"x\": 3,\n \"y\": 0\n }\n },\n {\n \"widget\": {\n \"name\": \"Shift notes\",\n \"viz\": \"text\",\n \"category\": \"utility\",\n \"spec\": null,\n \"content\": {\n \"body\": \"Check the Bekasi backlog first.\"\n },\n \"defaultLayout\": {\n \"w\": 3,\n \"h\": null\n }\n },\n \"layout\": {\n \"w\": 3,\n \"h\": 3\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apiweb.mile.app/api/v3/dynamic-dashboard")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Jakarta Hub - Daily\",\n \"description\": \"Morning stand-up view\",\n \"sharedRoleIds\": [\n \"6650c2a1f3b9e4001c7d2b20\"\n ],\n \"hubScope\": {\n \"mode\": \"selected\",\n \"hubIds\": [\n \"6650c2a1f3b9e4001c7d2c30\"\n ]\n },\n \"timeRange\": {\n \"preset\": \"last_7d\"\n },\n \"grid\": {\n \"columns\": 12\n },\n \"widgets\": [\n {\n \"widgetName\": \"Total Tasks\",\n \"layout\": {\n \"w\": 3,\n \"h\": null\n }\n },\n {\n \"widgetId\": \"66e0b3f1c9a8d7e6f5a4b202\",\n \"layout\": {\n \"w\": 6,\n \"h\": 6,\n \"x\": 3,\n \"y\": 0\n }\n },\n {\n \"widget\": {\n \"name\": \"Shift notes\",\n \"viz\": \"text\",\n \"category\": \"utility\",\n \"spec\": null,\n \"content\": {\n \"body\": \"Check the Bekasi backlog first.\"\n },\n \"defaultLayout\": {\n \"w\": 3,\n \"h\": null\n }\n },\n \"layout\": {\n \"w\": 3,\n \"h\": 3\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/dynamic-dashboard")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Jakarta Hub - Daily\",\n \"description\": \"Morning stand-up view\",\n \"sharedRoleIds\": [\n \"6650c2a1f3b9e4001c7d2b20\"\n ],\n \"hubScope\": {\n \"mode\": \"selected\",\n \"hubIds\": [\n \"6650c2a1f3b9e4001c7d2c30\"\n ]\n },\n \"timeRange\": {\n \"preset\": \"last_7d\"\n },\n \"grid\": {\n \"columns\": 12\n },\n \"widgets\": [\n {\n \"widgetName\": \"Total Tasks\",\n \"layout\": {\n \"w\": 3,\n \"h\": null\n }\n },\n {\n \"widgetId\": \"66e0b3f1c9a8d7e6f5a4b202\",\n \"layout\": {\n \"w\": 6,\n \"h\": 6,\n \"x\": 3,\n \"y\": 0\n }\n },\n {\n \"widget\": {\n \"name\": \"Shift notes\",\n \"viz\": \"text\",\n \"category\": \"utility\",\n \"spec\": null,\n \"content\": {\n \"body\": \"Check the Bekasi backlog first.\"\n },\n \"defaultLayout\": {\n \"w\": 3,\n \"h\": null\n }\n },\n \"layout\": {\n \"w\": 3,\n \"h\": 3\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"code": 201,
"message": "Dashboard has been added successfully.",
"data": {
"_id": "66f9a1c2e4b0a7d3c1f20a11",
"organizationId": "6650c2a1f3b9e4001c7d2a10",
"schemaVersion": 1,
"name": "Jakarta Hub - Daily",
"description": "Morning stand-up view",
"sharedRoleIds": [
"6650c2a1f3b9e4001c7d2b20"
],
"hubScope": {
"mode": "selected",
"hubIds": [
"6650c2a1f3b9e4001c7d2c30"
]
},
"timeRange": {
"preset": "last_7d"
},
"grid": {
"columns": 12
},
"widgets": [
{
"cardId": "crd_01J8ZQ4R5W6X7Y8Z9A0B1C2D3E",
"widgetId": "66f9a1c2e4b0a7d3c1f20b01",
"widgetName": "Total Tasks",
"layout": {
"w": 3,
"h": null
},
"widget": {
"schemaVersion": 1,
"name": "Total Tasks",
"description": "Tasks whose start time falls in the selected range, across every status.",
"category": "overview",
"viz": "kpi",
"spec": {
"specVersion": 1,
"dataSourceId": "task",
"timeField": "startTime",
"measures": [
{
"id": "m1",
"fn": "count"
}
],
"dimensions": [],
"filters": []
},
"composite": null,
"content": null,
"defaultLayout": {
"w": 3,
"h": null
}
}
},
{
"cardId": "crd_01J8ZQ4R5W6X7Y8Z9A0B1C2D3F",
"widgetId": "66f9a1c2e4b0a7d3c1f20b02",
"widgetName": "Tasks by Status",
"layout": {
"w": 6,
"h": 6,
"x": 3,
"y": 0
},
"widget": {
"schemaVersion": 1,
"name": "Tasks by Status",
"description": "Task count per status in the selected range.",
"category": "taskStatus",
"viz": "donut",
"spec": {
"specVersion": 1,
"dataSourceId": "task",
"timeField": "startTime",
"measures": [
{
"id": "m1",
"fn": "count"
}
],
"dimensions": [
{
"id": "d1",
"kind": "terms",
"field": "status",
"limit": 3
}
],
"filters": []
},
"composite": null,
"content": null,
"defaultLayout": {
"w": 6,
"h": 6
}
}
},
{
"cardId": "crd_01J8ZQ4R5W6X7Y8Z9A0B1C2D3G",
"widgetId": "66f9a1c2e4b0a7d3c1f20b03",
"widgetName": "Shift notes",
"layout": {
"w": 3,
"h": 3
},
"widget": {
"schemaVersion": 1,
"name": "Shift notes",
"description": null,
"category": "utility",
"viz": "text",
"spec": null,
"composite": null,
"content": {
"body": "Check the Bekasi backlog first."
},
"defaultLayout": {
"w": 3,
"h": null
}
}
}
],
"origin": {
"kind": "blank",
"sourceId": null,
"sourceSchemaVersion": null,
"copiedAt": "2026-09-30T08:10:44+07:00"
},
"createdBy": "[email protected]",
"updatedBy": "[email protected]",
"createdTime": "2026-09-30T01:10:44.512000Z",
"updatedTime": "2026-09-30T01:10:44.512000Z"
}
}{
"status": false,
"message": "No widget definition is named Daily Volume.",
"failedCode": "dydsh-037"
}{
"status": false,
"message": "Unauthenticated.",
"failedCode": "auth-034"
}{
"status": false,
"message": "Access denied. You do not have permission for add dashboard. Please contact your admin to request access.",
"failedCode": "sys-035"
}{
"status": false,
"code": 404,
"message": "Dashboard template not found.",
"failedCode": "dydsh-038"
}{
"status": false,
"code": 422,
"message": "This dashboard was saved by a newer version of MileApp and cannot be opened here. Please refresh the page and try again.",
"data": [],
"failedCode": "dydsh-040"
}{
"status": false,
"code": 500,
"message": "something_wrong",
"failedCode": "dydsh-045"
}Create dashboard
Creates a dashboard owned by the caller, either from the cards in the request body or as a copy of a template (templateId). Every card gets its own widget row, so editing a card never changes the widget catalogue or another dashboard. See the Dashboard overview for the card and layout rules.
curl --request POST \
--url https://apiweb.mile.app/api/v3/dynamic-dashboard \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "Jakarta Hub - Daily",
"description": "Morning stand-up view",
"sharedRoleIds": [
"6650c2a1f3b9e4001c7d2b20"
],
"hubScope": {
"mode": "selected",
"hubIds": [
"6650c2a1f3b9e4001c7d2c30"
]
},
"timeRange": {
"preset": "last_7d"
},
"grid": {
"columns": 12
},
"widgets": [
{
"widgetName": "Total Tasks",
"layout": {
"w": 3,
"h": null
}
},
{
"widgetId": "66e0b3f1c9a8d7e6f5a4b202",
"layout": {
"w": 6,
"h": 6,
"x": 3,
"y": 0
}
},
{
"widget": {
"name": "Shift notes",
"viz": "text",
"category": "utility",
"spec": null,
"content": {
"body": "Check the Bekasi backlog first."
},
"defaultLayout": {
"w": 3,
"h": null
}
},
"layout": {
"w": 3,
"h": 3
}
}
]
}
'import requests
url = "https://apiweb.mile.app/api/v3/dynamic-dashboard"
payload = {
"name": "Jakarta Hub - Daily",
"description": "Morning stand-up view",
"sharedRoleIds": ["6650c2a1f3b9e4001c7d2b20"],
"hubScope": {
"mode": "selected",
"hubIds": ["6650c2a1f3b9e4001c7d2c30"]
},
"timeRange": { "preset": "last_7d" },
"grid": { "columns": 12 },
"widgets": [
{
"widgetName": "Total Tasks",
"layout": {
"w": 3,
"h": None
}
},
{
"widgetId": "66e0b3f1c9a8d7e6f5a4b202",
"layout": {
"w": 6,
"h": 6,
"x": 3,
"y": 0
}
},
{
"widget": {
"name": "Shift notes",
"viz": "text",
"category": "utility",
"spec": None,
"content": { "body": "Check the Bekasi backlog first." },
"defaultLayout": {
"w": 3,
"h": None
}
},
"layout": {
"w": 3,
"h": 3
}
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Jakarta Hub - Daily',
description: 'Morning stand-up view',
sharedRoleIds: ['6650c2a1f3b9e4001c7d2b20'],
hubScope: {mode: 'selected', hubIds: ['6650c2a1f3b9e4001c7d2c30']},
timeRange: {preset: 'last_7d'},
grid: {columns: 12},
widgets: [
{widgetName: 'Total Tasks', layout: {w: 3, h: null}},
{widgetId: '66e0b3f1c9a8d7e6f5a4b202', layout: {w: 6, h: 6, x: 3, y: 0}},
{
widget: {
name: 'Shift notes',
viz: 'text',
category: 'utility',
spec: null,
content: {body: JSON.stringify('Check the Bekasi backlog first.')},
defaultLayout: {w: 3, h: null}
},
layout: {w: 3, h: 3}
}
]
})
};
fetch('https://apiweb.mile.app/api/v3/dynamic-dashboard', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apiweb.mile.app/api/v3/dynamic-dashboard",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Jakarta Hub - Daily',
'description' => 'Morning stand-up view',
'sharedRoleIds' => [
'6650c2a1f3b9e4001c7d2b20'
],
'hubScope' => [
'mode' => 'selected',
'hubIds' => [
'6650c2a1f3b9e4001c7d2c30'
]
],
'timeRange' => [
'preset' => 'last_7d'
],
'grid' => [
'columns' => 12
],
'widgets' => [
[
'widgetName' => 'Total Tasks',
'layout' => [
'w' => 3,
'h' => null
]
],
[
'widgetId' => '66e0b3f1c9a8d7e6f5a4b202',
'layout' => [
'w' => 6,
'h' => 6,
'x' => 3,
'y' => 0
]
],
[
'widget' => [
'name' => 'Shift notes',
'viz' => 'text',
'category' => 'utility',
'spec' => null,
'content' => [
'body' => 'Check the Bekasi backlog first.'
],
'defaultLayout' => [
'w' => 3,
'h' => null
]
],
'layout' => [
'w' => 3,
'h' => 3
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://apiweb.mile.app/api/v3/dynamic-dashboard"
payload := strings.NewReader("{\n \"name\": \"Jakarta Hub - Daily\",\n \"description\": \"Morning stand-up view\",\n \"sharedRoleIds\": [\n \"6650c2a1f3b9e4001c7d2b20\"\n ],\n \"hubScope\": {\n \"mode\": \"selected\",\n \"hubIds\": [\n \"6650c2a1f3b9e4001c7d2c30\"\n ]\n },\n \"timeRange\": {\n \"preset\": \"last_7d\"\n },\n \"grid\": {\n \"columns\": 12\n },\n \"widgets\": [\n {\n \"widgetName\": \"Total Tasks\",\n \"layout\": {\n \"w\": 3,\n \"h\": null\n }\n },\n {\n \"widgetId\": \"66e0b3f1c9a8d7e6f5a4b202\",\n \"layout\": {\n \"w\": 6,\n \"h\": 6,\n \"x\": 3,\n \"y\": 0\n }\n },\n {\n \"widget\": {\n \"name\": \"Shift notes\",\n \"viz\": \"text\",\n \"category\": \"utility\",\n \"spec\": null,\n \"content\": {\n \"body\": \"Check the Bekasi backlog first.\"\n },\n \"defaultLayout\": {\n \"w\": 3,\n \"h\": null\n }\n },\n \"layout\": {\n \"w\": 3,\n \"h\": 3\n }\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://apiweb.mile.app/api/v3/dynamic-dashboard")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Jakarta Hub - Daily\",\n \"description\": \"Morning stand-up view\",\n \"sharedRoleIds\": [\n \"6650c2a1f3b9e4001c7d2b20\"\n ],\n \"hubScope\": {\n \"mode\": \"selected\",\n \"hubIds\": [\n \"6650c2a1f3b9e4001c7d2c30\"\n ]\n },\n \"timeRange\": {\n \"preset\": \"last_7d\"\n },\n \"grid\": {\n \"columns\": 12\n },\n \"widgets\": [\n {\n \"widgetName\": \"Total Tasks\",\n \"layout\": {\n \"w\": 3,\n \"h\": null\n }\n },\n {\n \"widgetId\": \"66e0b3f1c9a8d7e6f5a4b202\",\n \"layout\": {\n \"w\": 6,\n \"h\": 6,\n \"x\": 3,\n \"y\": 0\n }\n },\n {\n \"widget\": {\n \"name\": \"Shift notes\",\n \"viz\": \"text\",\n \"category\": \"utility\",\n \"spec\": null,\n \"content\": {\n \"body\": \"Check the Bekasi backlog first.\"\n },\n \"defaultLayout\": {\n \"w\": 3,\n \"h\": null\n }\n },\n \"layout\": {\n \"w\": 3,\n \"h\": 3\n }\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://apiweb.mile.app/api/v3/dynamic-dashboard")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"Jakarta Hub - Daily\",\n \"description\": \"Morning stand-up view\",\n \"sharedRoleIds\": [\n \"6650c2a1f3b9e4001c7d2b20\"\n ],\n \"hubScope\": {\n \"mode\": \"selected\",\n \"hubIds\": [\n \"6650c2a1f3b9e4001c7d2c30\"\n ]\n },\n \"timeRange\": {\n \"preset\": \"last_7d\"\n },\n \"grid\": {\n \"columns\": 12\n },\n \"widgets\": [\n {\n \"widgetName\": \"Total Tasks\",\n \"layout\": {\n \"w\": 3,\n \"h\": null\n }\n },\n {\n \"widgetId\": \"66e0b3f1c9a8d7e6f5a4b202\",\n \"layout\": {\n \"w\": 6,\n \"h\": 6,\n \"x\": 3,\n \"y\": 0\n }\n },\n {\n \"widget\": {\n \"name\": \"Shift notes\",\n \"viz\": \"text\",\n \"category\": \"utility\",\n \"spec\": null,\n \"content\": {\n \"body\": \"Check the Bekasi backlog first.\"\n },\n \"defaultLayout\": {\n \"w\": 3,\n \"h\": null\n }\n },\n \"layout\": {\n \"w\": 3,\n \"h\": 3\n }\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"status": true,
"code": 201,
"message": "Dashboard has been added successfully.",
"data": {
"_id": "66f9a1c2e4b0a7d3c1f20a11",
"organizationId": "6650c2a1f3b9e4001c7d2a10",
"schemaVersion": 1,
"name": "Jakarta Hub - Daily",
"description": "Morning stand-up view",
"sharedRoleIds": [
"6650c2a1f3b9e4001c7d2b20"
],
"hubScope": {
"mode": "selected",
"hubIds": [
"6650c2a1f3b9e4001c7d2c30"
]
},
"timeRange": {
"preset": "last_7d"
},
"grid": {
"columns": 12
},
"widgets": [
{
"cardId": "crd_01J8ZQ4R5W6X7Y8Z9A0B1C2D3E",
"widgetId": "66f9a1c2e4b0a7d3c1f20b01",
"widgetName": "Total Tasks",
"layout": {
"w": 3,
"h": null
},
"widget": {
"schemaVersion": 1,
"name": "Total Tasks",
"description": "Tasks whose start time falls in the selected range, across every status.",
"category": "overview",
"viz": "kpi",
"spec": {
"specVersion": 1,
"dataSourceId": "task",
"timeField": "startTime",
"measures": [
{
"id": "m1",
"fn": "count"
}
],
"dimensions": [],
"filters": []
},
"composite": null,
"content": null,
"defaultLayout": {
"w": 3,
"h": null
}
}
},
{
"cardId": "crd_01J8ZQ4R5W6X7Y8Z9A0B1C2D3F",
"widgetId": "66f9a1c2e4b0a7d3c1f20b02",
"widgetName": "Tasks by Status",
"layout": {
"w": 6,
"h": 6,
"x": 3,
"y": 0
},
"widget": {
"schemaVersion": 1,
"name": "Tasks by Status",
"description": "Task count per status in the selected range.",
"category": "taskStatus",
"viz": "donut",
"spec": {
"specVersion": 1,
"dataSourceId": "task",
"timeField": "startTime",
"measures": [
{
"id": "m1",
"fn": "count"
}
],
"dimensions": [
{
"id": "d1",
"kind": "terms",
"field": "status",
"limit": 3
}
],
"filters": []
},
"composite": null,
"content": null,
"defaultLayout": {
"w": 6,
"h": 6
}
}
},
{
"cardId": "crd_01J8ZQ4R5W6X7Y8Z9A0B1C2D3G",
"widgetId": "66f9a1c2e4b0a7d3c1f20b03",
"widgetName": "Shift notes",
"layout": {
"w": 3,
"h": 3
},
"widget": {
"schemaVersion": 1,
"name": "Shift notes",
"description": null,
"category": "utility",
"viz": "text",
"spec": null,
"composite": null,
"content": {
"body": "Check the Bekasi backlog first."
},
"defaultLayout": {
"w": 3,
"h": null
}
}
}
],
"origin": {
"kind": "blank",
"sourceId": null,
"sourceSchemaVersion": null,
"copiedAt": "2026-09-30T08:10:44+07:00"
},
"createdBy": "[email protected]",
"updatedBy": "[email protected]",
"createdTime": "2026-09-30T01:10:44.512000Z",
"updatedTime": "2026-09-30T01:10:44.512000Z"
}
}{
"status": false,
"message": "No widget definition is named Daily Volume.",
"failedCode": "dydsh-037"
}{
"status": false,
"message": "Unauthenticated.",
"failedCode": "auth-034"
}{
"status": false,
"message": "Access denied. You do not have permission for add dashboard. Please contact your admin to request access.",
"failedCode": "sys-035"
}{
"status": false,
"code": 404,
"message": "Dashboard template not found.",
"failedCode": "dydsh-038"
}{
"status": false,
"code": 422,
"message": "This dashboard was saved by a newer version of MileApp and cannot be opened here. Please refresh the page and try again.",
"data": [],
"failedCode": "dydsh-040"
}{
"status": false,
"code": 500,
"message": "something_wrong",
"failedCode": "dydsh-045"
}Authorizations
Use a valid Bearer token to authenticate.
Body
Dashboard to create
200Template name (for example dailyOperations), not its _id. Names are stable across environments; ObjectIds are not.
200Role ids, each distinct. Absent = shared with the creator's own role; explicit [] = private.
50Show child attributes
Show child attributes
Default time window for the dashboard, or null. Not interpreted by the CRUD layer; the analytics endpoint accepts today, yesterday, last_7d, last_30d.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes