UpdateDashboardLayout

POST/analytics/v1/dashboards/{dashboard_id}/layout

Path Parameters

dashboard_id*dashboard_id

The dashboard_id path parameter.

Request Body

required
application/json
{
  "type": "object",
  "properties": {
    "expected_revision": {
      "type": "integer",
      "title": "expected_revision",
      "format": "int32"
    },
    "positions": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/analytics.v1.WidgetPosition",
        "$ref-value": {
          "type": "object",
          "properties": {
            "widget_id": {
              "type": "string",
              "title": "widget_id"
            },
            "pos_x": {
              "type": "integer",
              "title": "pos_x",
              "format": "int32"
            },
            "pos_y": {
              "type": "integer",
              "title": "pos_y",
              "format": "int32"
            },
            "width": {
              "type": "integer",
              "title": "width",
              "format": "int32"
            },
            "height": {
              "type": "integer",
              "title": "height",
              "format": "int32"
            },
            "sort_order": {
              "type": "integer",
              "title": "sort_order",
              "format": "int32"
            }
          },
          "title": "WidgetPosition",
          "required": [
            "widget_id"
          ],
          "additionalProperties": false,
          "description": "WidgetPosition is expressed in grid units, never pixels."
        }
      },
      "title": "positions",
      "maxItems": 200,
      "minItems": 1
    }
  },
  "title": "UpdateDashboardLayoutRequest",
  "required": [
    "expected_revision"
  ],
  "additionalProperties": false
}
expected_revision*integer
positions?array<unknown>

Response Body

200application/json

Success

type: unknown

{
  "$ref": "#/components/schemas/analytics.v1.Dashboard",
  "$ref-value": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "title": "id"
      },
      "org_id": {
        "type": "string",
        "title": "org_id"
      },
      "owner_user_id": {
        "type": "string",
        "title": "owner_user_id"
      },
      "visibility": {
        "type": "string",
        "title": "visibility"
      },
      "revision": {
        "type": "integer",
        "title": "revision",
        "format": "int32"
      },
      "updated_by": {
        "type": "string",
        "title": "updated_by"
      },
      "name": {
        "type": "string",
        "examples": [
          "Traffic overview"
        ],
        "title": "name"
      },
      "is_default": {
        "type": "boolean",
        "title": "is_default"
      },
      "widgets": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/analytics.v1.Widget",
          "$ref-value": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "title": "id"
              },
              "dashboard_id": {
                "type": "string",
                "title": "dashboard_id"
              },
              "title": {
                "type": "string",
                "examples": [
                  "Requests over time"
                ],
                "title": "title"
              },
              "chart_type": {
                "type": "string",
                "examples": [
                  "timeseries"
                ],
                "title": "chart_type"
              },
              "dataset": {
                "type": "string",
                "examples": [
                  "content_views"
                ],
                "title": "dataset"
              },
              "metric": {
                "type": "string",
                "examples": [
                  "views"
                ],
                "title": "metric"
              },
              "group_by": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "title": "group_by"
              },
              "filters": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/analytics.v1.ChartFilter",
                  "$ref-value": {
                    "type": "object",
                    "properties": {
                      "field": {
                        "type": "string",
                        "examples": [
                          "country"
                        ],
                        "title": "field"
                      },
                      "operator": {
                        "type": "string",
                        "examples": [
                          "eq"
                        ],
                        "title": "operator",
                        "enum": [
                          "eq",
                          "neq",
                          "gt",
                          "gte",
                          "lt",
                          "lte",
                          "in",
                          "not_in",
                          "contains",
                          "not_contains",
                          "starts_with",
                          "ends_with",
                          "between",
                          "is_empty",
                          "is_not_empty"
                        ]
                      },
                      "values": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "title": "values"
                      }
                    },
                    "title": "ChartFilter",
                    "required": [
                      "field"
                    ],
                    "additionalProperties": false
                  }
                },
                "title": "filters"
              },
              "interval": {
                "type": "string",
                "examples": [
                  "1h"
                ],
                "title": "interval"
              },
              "limit": {
                "type": "integer",
                "title": "limit",
                "format": "int32"
              },
              "pos_x": {
                "type": "integer",
                "title": "pos_x",
                "format": "int32"
              },
              "pos_y": {
                "type": "integer",
                "title": "pos_y",
                "format": "int32"
              },
              "width": {
                "type": "integer",
                "examples": [
                  "4"
                ],
                "title": "width",
                "format": "int32"
              },
              "height": {
                "type": "integer",
                "examples": [
                  "3"
                ],
                "title": "height",
                "format": "int32"
              },
              "sort_order": {
                "type": "integer",
                "title": "sort_order",
                "format": "int32"
              },
              "created_at": {
                "type": "string",
                "title": "created_at"
              },
              "updated_at": {
                "type": "string",
                "title": "updated_at"
              },
              "spec_version": {
                "type": "integer",
                "title": "spec_version",
                "format": "int32"
              },
              "dashboard_revision": {
                "type": "integer",
                "title": "dashboard_revision",
                "format": "int32"
              }
            },
            "title": "Widget",
            "additionalProperties": false
          }
        },
        "title": "widgets"
      },
      "created_at": {
        "type": "string",
        "title": "created_at"
      },
      "updated_at": {
        "type": "string",
        "title": "updated_at"
      }
    },
    "title": "Dashboard",
    "additionalProperties": false
  }
}
curl -X POST "https://api.rixl.com/analytics/v1/dashboards/string/layout" \
  -H "Content-Type: application/json" \
  -d '{
    "expected_revision": 0
  }'

Success

application/json

{
  "$ref": "#/components/schemas/analytics.v1.Dashboard",
  "$ref-value": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "title": "id"
      },
      "org_id": {
        "type": "string",
        "title": "org_id"
      },
      "owner_user_id": {
        "type": "string",
        "title": "owner_user_id"
      },
      "visibility": {
        "type": "string",
        "title": "visibility"
      },
      "revision": {
        "type": "integer",
        "title": "revision",
        "format": "int32"
      },
      "updated_by": {
        "type": "string",
        "title": "updated_by"
      },
      "name": {
        "type": "string",
        "examples": [
          "Traffic overview"
        ],
        "title": "name"
      },
      "is_default": {
        "type": "boolean",
        "title": "is_default"
      },
      "widgets": {
        "type": "array",
        "items": {
          "$ref": "#/components/schemas/analytics.v1.Widget",
          "$ref-value": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "title": "id"
              },
              "dashboard_id": {
                "type": "string",
                "title": "dashboard_id"
              },
              "title": {
                "type": "string",
                "examples": [
                  "Requests over time"
                ],
                "title": "title"
              },
              "chart_type": {
                "type": "string",
                "examples": [
                  "timeseries"
                ],
                "title": "chart_type"
              },
              "dataset": {
                "type": "string",
                "examples": [
                  "content_views"
                ],
                "title": "dataset"
              },
              "metric": {
                "type": "string",
                "examples": [
                  "views"
                ],
                "title": "metric"
              },
              "group_by": {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "title": "group_by"
              },
              "filters": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/analytics.v1.ChartFilter",
                  "$ref-value": {
                    "type": "object",
                    "properties": {
                      "field": {
                        "type": "string",
                        "examples": [
                          "country"
                        ],
                        "title": "field"
                      },
                      "operator": {
                        "type": "string",
                        "examples": [
                          "eq"
                        ],
                        "title": "operator",
                        "enum": [
                          "eq",
                          "neq",
                          "gt",
                          "gte",
                          "lt",
                          "lte",
                          "in",
                          "not_in",
                          "contains",
                          "not_contains",
                          "starts_with",
                          "ends_with",
                          "between",
                          "is_empty",
                          "is_not_empty"
                        ]
                      },
                      "values": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        },
                        "title": "values"
                      }
                    },
                    "title": "ChartFilter",
                    "required": [
                      "field"
                    ],
                    "additionalProperties": false
                  }
                },
                "title": "filters"
              },
              "interval": {
                "type": "string",
                "examples": [
                  "1h"
                ],
                "title": "interval"
              },
              "limit": {
                "type": "integer",
                "title": "limit",
                "format": "int32"
              },
              "pos_x": {
                "type": "integer",
                "title": "pos_x",
                "format": "int32"
              },
              "pos_y": {
                "type": "integer",
                "title": "pos_y",
                "format": "int32"
              },
              "width": {
                "type": "integer",
                "examples": [
                  "4"
                ],
                "title": "width",
                "format": "int32"
              },
              "height": {
                "type": "integer",
                "examples": [
                  "3"
                ],
                "title": "height",
                "format": "int32"
              },
              "sort_order": {
                "type": "integer",
                "title": "sort_order",
                "format": "int32"
              },
              "created_at": {
                "type": "string",
                "title": "created_at"
              },
              "updated_at": {
                "type": "string",
                "title": "updated_at"
              },
              "spec_version": {
                "type": "integer",
                "title": "spec_version",
                "format": "int32"
              },
              "dashboard_revision": {
                "type": "integer",
                "title": "dashboard_revision",
                "format": "int32"
              }
            },
            "title": "Widget",
            "additionalProperties": false
          }
        },
        "title": "widgets"
      },
      "created_at": {
        "type": "string",
        "title": "created_at"
      },
      "updated_at": {
        "type": "string",
        "title": "updated_at"
      }
    },
    "title": "Dashboard",
    "additionalProperties": false
  }
}