Skip to Content

UpdateWidget

PATCH
/analytics/v1/dashboards/widgets/{id}

Authorization

headerX-API-Key<token>

API key for protected endpoints, supplied in the X-API-Key header.

Path Parameters

id*id

Request Body

required
application/json
{
  "type": "object",
  "properties": {
    "expected_revision": {
      "type": "integer",
      "title": "expected_revision",
      "format": "int32"
    },
    "patch": {
      "title": "patch",
      "$ref": "#/components/schemas/analytics.v1.WidgetPatch",
      "$ref-value": {
        "type": "object",
        "properties": {
          "title": {
            "type": [
              "string",
              "null"
            ],
            "title": "title"
          },
          "chart_type": {
            "type": [
              "string",
              "null"
            ],
            "title": "chart_type"
          },
          "dataset": {
            "type": [
              "string",
              "null"
            ],
            "title": "dataset"
          },
          "metric": {
            "type": [
              "string",
              "null"
            ],
            "title": "metric"
          },
          "group_by": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/analytics.v1.GroupBy",
                "$ref-value": {
                  "type": "object",
                  "properties": {
                    "values": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "title": "values"
                    }
                  },
                  "title": "GroupBy",
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ],
            "title": "group_by"
          },
          "filters": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/analytics.v1.Filters",
                "$ref-value": {
                  "type": "object",
                  "properties": {
                    "values": {
                      "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": "values"
                    }
                  },
                  "title": "Filters",
                  "additionalProperties": false
                }
              },
              {
                "type": "null"
              }
            ],
            "title": "filters"
          },
          "interval": {
            "type": [
              "string",
              "null"
            ],
            "title": "interval"
          },
          "limit": {
            "type": [
              "integer",
              "null"
            ],
            "title": "limit",
            "format": "int32"
          }
        },
        "title": "WidgetPatch",
        "additionalProperties": false
      }
    }
  },
  "title": "UpdateWidgetRequest",
  "required": [
    "expected_revision",
    "patch"
  ],
  "additionalProperties": false
}
expected_revision*integer
patch*unknown

Response Body

200application/json

Success

type: unknown

{
  "$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
  }
}
default
curl -X PATCH 'https://api.rixl.com/analytics/v1/dashboards/widgets/string'

Success

application/json

{
  "$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
  }
}