Skip to content

Save the dashboard layout, the theme, or both.

PUT
/api/dashboard/layout
curl --request PUT \
--url https://api.tradr.cloud/api/dashboard/layout \
--header 'Content-Type: application/json' \
--data '{ "theme": "light", "widgets": [ { "config": "example", "h": 1, "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "type": "stats-summary", "w": 1, "x": 1, "y": 1 } ] }'

Authed. Send widgets, theme, or both — a body with neither is a 400. widgets replaces the whole layout; it is not a patch. Placements are validated as a set: at most one widget of each type, no two overlapping, none extending past the 12-column grid, and none below its type’s minimum size. When theme is sent the response also sets the tradr_theme cookie so the next page load paints without a flash.

Media typeapplication/json
object
theme
string
Allowed values: light dark system
widgets
Array<object>
<= 6 items

One widget on the dashboard grid. The grid is 12 columns wide and rows are a fixed height, so x/w are columns and y/h are rows.

object
config

Optional per-widget settings. Serialises to at most 2048 bytes.

h
required
integer
>= 1 <= 24
id
required
string format: uuid
type
required
string
Allowed values: stats-summary open-positions performance-chart account-balances position-sizing equity-curve
w
required

X + w must not exceed 12.

integer
>= 1 <= 12
x
required
integer
<= 11
y
required
integer

The saved layout.

Validation error

PAYLOAD_TOO_LARGE — the request body exceeds the limit.