Add a dashboard widget to a dashboard
import requests
url = "https://app.langwatch.ai/api/v1/projects/{projectId}/analytics/dashboard-widgets/{widgetId}/dashboard"
payload = { "dashboardId": "<string>" }
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({dashboardId: '<string>'})
};
fetch('https://app.langwatch.ai/api/v1/projects/{projectId}/analytics/dashboard-widgets/{widgetId}/dashboard', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/v1/projects/{projectId}/analytics/dashboard-widgets/{widgetId}/dashboard \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"dashboardId": "<string>"
}
'{
"id": "<string>",
"name": "<string>",
"definition": {
"version": 123,
"code": "<string>",
"queries": [
{
"name": "<string>",
"sql": "<string>",
"parameters": [
{
"name": "<string>",
"type": "string",
"default": "<string>"
}
]
}
],
"description": "<string>",
"prompt": "<string>",
"source": {
"kind": "catalogue",
"catalogueId": "<string>"
}
},
"createdAt": "<string>",
"updatedAt": "<string>",
"platformUrl": "<string>",
"dashboardId": "<string>",
"gridColumn": 0,
"gridRow": 0,
"colSpan": 0,
"rowSpan": 0
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"meta": {},
"trace_id": "<string>",
"span_id": "<string>",
"trace": {
"traceId": "<string>",
"spanId": "<string>",
"traceUrl": "<string>",
"logsUrl": "<string>"
},
"tips": [
"<string>"
],
"docs_url": "<string>",
"fault": "customer",
"reasons": [
"<unknown>"
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"meta": {},
"trace_id": "<string>",
"span_id": "<string>",
"trace": {
"traceId": "<string>",
"spanId": "<string>",
"traceUrl": "<string>",
"logsUrl": "<string>"
},
"tips": [
"<string>"
],
"docs_url": "<string>",
"fault": "customer",
"reasons": [
"<unknown>"
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"meta": {},
"trace_id": "<string>",
"span_id": "<string>",
"trace": {
"traceId": "<string>",
"spanId": "<string>",
"traceUrl": "<string>",
"logsUrl": "<string>"
},
"tips": [
"<string>"
],
"docs_url": "<string>",
"fault": "customer",
"reasons": [
"<unknown>"
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"meta": {},
"trace_id": "<string>",
"span_id": "<string>",
"trace": {
"traceId": "<string>",
"spanId": "<string>",
"traceUrl": "<string>",
"logsUrl": "<string>"
},
"tips": [
"<string>"
],
"docs_url": "<string>",
"fault": "customer",
"reasons": [
"<unknown>"
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"meta": {},
"trace_id": "<string>",
"span_id": "<string>",
"trace": {
"traceId": "<string>",
"spanId": "<string>",
"traceUrl": "<string>",
"logsUrl": "<string>"
},
"tips": [
"<string>"
],
"docs_url": "<string>",
"fault": "customer",
"reasons": [
"<unknown>"
]
}Projects
Add a dashboard widget to a dashboard
Assigns a dashboard widget to a dashboard. The widget is repositioned to the next free row on that dashboard; its size (colSpan/rowSpan) is preserved.
POST
/
api
/
v1
/
projects
/
{projectId}
/
analytics
/
dashboard-widgets
/
{widgetId}
/
dashboard
Add a dashboard widget to a dashboard
import requests
url = "https://app.langwatch.ai/api/v1/projects/{projectId}/analytics/dashboard-widgets/{widgetId}/dashboard"
payload = { "dashboardId": "<string>" }
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({dashboardId: '<string>'})
};
fetch('https://app.langwatch.ai/api/v1/projects/{projectId}/analytics/dashboard-widgets/{widgetId}/dashboard', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/v1/projects/{projectId}/analytics/dashboard-widgets/{widgetId}/dashboard \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"dashboardId": "<string>"
}
'{
"id": "<string>",
"name": "<string>",
"definition": {
"version": 123,
"code": "<string>",
"queries": [
{
"name": "<string>",
"sql": "<string>",
"parameters": [
{
"name": "<string>",
"type": "string",
"default": "<string>"
}
]
}
],
"description": "<string>",
"prompt": "<string>",
"source": {
"kind": "catalogue",
"catalogueId": "<string>"
}
},
"createdAt": "<string>",
"updatedAt": "<string>",
"platformUrl": "<string>",
"dashboardId": "<string>",
"gridColumn": 0,
"gridRow": 0,
"colSpan": 0,
"rowSpan": 0
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"meta": {},
"trace_id": "<string>",
"span_id": "<string>",
"trace": {
"traceId": "<string>",
"spanId": "<string>",
"traceUrl": "<string>",
"logsUrl": "<string>"
},
"tips": [
"<string>"
],
"docs_url": "<string>",
"fault": "customer",
"reasons": [
"<unknown>"
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"meta": {},
"trace_id": "<string>",
"span_id": "<string>",
"trace": {
"traceId": "<string>",
"spanId": "<string>",
"traceUrl": "<string>",
"logsUrl": "<string>"
},
"tips": [
"<string>"
],
"docs_url": "<string>",
"fault": "customer",
"reasons": [
"<unknown>"
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"meta": {},
"trace_id": "<string>",
"span_id": "<string>",
"trace": {
"traceId": "<string>",
"spanId": "<string>",
"traceUrl": "<string>",
"logsUrl": "<string>"
},
"tips": [
"<string>"
],
"docs_url": "<string>",
"fault": "customer",
"reasons": [
"<unknown>"
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"meta": {},
"trace_id": "<string>",
"span_id": "<string>",
"trace": {
"traceId": "<string>",
"spanId": "<string>",
"traceUrl": "<string>",
"logsUrl": "<string>"
},
"tips": [
"<string>"
],
"docs_url": "<string>",
"fault": "customer",
"reasons": [
"<unknown>"
]
}{
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"meta": {},
"trace_id": "<string>",
"span_id": "<string>",
"trace": {
"traceId": "<string>",
"spanId": "<string>",
"traceUrl": "<string>",
"logsUrl": "<string>"
},
"tips": [
"<string>"
],
"docs_url": "<string>",
"fault": "customer",
"reasons": [
"<unknown>"
]
}Authorizations
Project API key for sending traces and accessing project-scoped resources. Format: sk-lw-... (no underscore). Obtain one by creating a project via the Admin API or the LangWatch UI.
Path Parameters
Minimum string length:
1Minimum string length:
1Body
application/json
Minimum string length:
1Response
The widget was added to the dashboard
Show child attributes
Show child attributes
Required range:
-9007199254740991 <= x <= 9007199254740991Required range:
-9007199254740991 <= x <= 9007199254740991Required range:
-9007199254740991 <= x <= 9007199254740991Required range:
-9007199254740991 <= x <= 9007199254740991Last modified on October 27, 2026
Was this page helpful?