LayoutService
Upsert Layout
Create or update a layout, including layout editor state and widget configuration.
Method
POST
Path
/v1/layouts
Visibility
Authentication
Session token or API key
MFA Requirement
Not required
POST
/v1/layouts Request
Testnet
curl --request POST \ \
--url 'https://api.testnet.polyester.com/v1/layouts' \
--header 'Accept: */*' \
--header 'X-API-KEY-ID: YOUR_API_KEY_ID' \
--header 'X-API-TIMESTAMP: YOUR_API_TIMESTAMP' \
--header 'X-API-SIGNATURE: YOUR_API_SIGNATURE' \
--header 'Content-Type: application/json' \
--data '{
"layout": {
"dockviewState": "AA==",
"isDefault": false,
"layoutId": "1",
"name": "BTC Trading",
"updatedAtMs": "1",
"viewerId": "1",
"widgets": [
{
"widgetConfig": "AA==",
"widgetId": "chart-main",
"widgetType": "CHART"
}
]
}
}'Responses
{
"layout": {
"dockviewState": "AA==",
"isDefault": false,
"layoutId": "1",
"name": "BTC Trading",
"updatedAtMs": "1",
"viewerId": "1",
"widgets": [
{
"widgetConfig": "AA==",
"widgetId": "chart-main",
"widgetType": "CHART"
}
]
}
} layout string
Layout payload to save.
7 fields
viewerId string (fixed64)
Viewer that owns the saved layout.
Example
1 layoutId string (fixed64)
Layout identifier unique within the viewer's saved layouts.
Example
1 name string
Human-readable layout name.
Example
BTC Trading isDefault boolean
True when this is the viewer's default layout.
Example
false dockviewState string (byte)
Serialized editor panel arrangement snapshot.
Example
AA== 3 fields
widgetId string
Stable widget identifier within the layout, such as "chart-1".
Example
chart-main widgetType enum
Widget kind that determines how widget_config is decoded.
CHART ORDERBOOK TRADES POSITIONS ORDERS
Example
CHART widgetConfig string (byte)
Serialized widget configuration bytes for the selected widget_type.
Example
AA== updatedAtMs string (fixed64)
Last update time in milliseconds since epoch (UTC).
Example
1| Key | Status | Error | When |
|---|---|---|---|
| unauthenticated | 401 | Unauthenticated | Authentication required. |
| permission-denied | 403 | Permission Denied | Permission denied. |
| invalid-argument | 400 | Invalid Argument | Invalid argument. |
| not-found | 404 | Not Found | Not found. |
| unavailable | 503 | Unavailable | Service unavailable. |