{
  "swagger": "2.0",
  "info": {
    "title": "Themes service",
    "version": "0.1507.0",
    "description": "Send your API key as a bearer token: `Authorization: Bearer <api key>`."
  },
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "securityDefinitions": {
    "ApiKey": {
      "type": "apiKey",
      "in": "header",
      "name": "Authorization",
      "description": "Your API key as a bearer token: `Authorization: Bearer <api key>`."
    }
  },
  "security": [
    {
      "ApiKey": []
    }
  ],
  "paths": {
    "/themes/v1/chart-themes": {
      "get": {
        "operationId": "ThemesService_listChartThemes",
        "summary": "List chart themes",
        "tags": [
          "Themes Service"
        ],
        "description": "Get all chart themes saved to the requested workspaces.",
        "parameters": [
          {
            "name": "workspaces",
            "in": "query",
            "type": "array",
            "items": {
              "type": "string",
              "format": "rid",
              "x-alias": "WorkspaceRid"
            },
            "collectionFormat": "multi",
            "required": false,
            "description": "If supplied, will return only results within the supplied workspaces. If empty will return all results within workspaces that the user is permitted to see."
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/ChartTheme"
              }
            },
            "x-example": [
              {
                "rid": "<chart theme rid>",
                "name": "<name>",
                "createdBy": "<created by>",
                "createdAt": "2026-01-01T00:00:00Z",
                "updatedBy": "<updated by>",
                "updatedAt": "2026-01-01T00:00:00Z",
                "content": {
                  "type": "v1",
                  "v1": {
                    "titleEnabled": true,
                    "titleAlignment": "START",
                    "titleFontSize": 1,
                    "titleFontColor": "<hex color>",
                    "captionEnabled": true,
                    "captionAlignment": "START",
                    "captionFontSize": 1,
                    "captionFontColor": "<hex color>",
                    "backgroundEnabled": true,
                    "legendEnabled": true,
                    "legendPosition": "TOP",
                    "legendFontSize": 1,
                    "legendFontColor": "<hex color>",
                    "legendPlacement": "OUTSIDE",
                    "rowGapEnabled": true,
                    "rowGapSize": 1,
                    "aspectRatioWidth": 1,
                    "aspectRatioHeight": 1,
                    "chartTypeThemes": {
                      "timeSeries": {
                        "type": "v1",
                        "v1": {
                          "xAxisTickFontSize": 1,
                          "xAxisTickFontColor": "<hex color>",
                          "yAxisTitleFontSize": 1,
                          "yAxisTickFontSize": 1,
                          "thresholdLineWidth": 1
                        }
                      }
                    }
                  }
                }
              }
            ]
          }
        }
      },
      "post": {
        "operationId": "ThemesService_createChartTheme",
        "summary": "Create chart theme",
        "tags": [
          "Themes Service"
        ],
        "description": "Create a new chart theme.",
        "parameters": [
          {
            "name": "request",
            "in": "body",
            "schema": {
              "$ref": "#/definitions/CreateChartThemeRequest"
            },
            "required": true,
            "x-example": {
              "name": "<name>",
              "content": {
                "type": "v1",
                "v1": {
                  "titleEnabled": true,
                  "titleAlignment": "START",
                  "titleFontSize": 1,
                  "titleFontColor": "<hex color>",
                  "captionEnabled": true,
                  "captionAlignment": "START",
                  "captionFontSize": 1,
                  "captionFontColor": "<hex color>",
                  "backgroundEnabled": true,
                  "legendEnabled": true,
                  "legendPosition": "TOP",
                  "legendFontSize": 1,
                  "legendFontColor": "<hex color>",
                  "legendPlacement": "OUTSIDE",
                  "rowGapEnabled": true,
                  "aspectRatioWidth": 1,
                  "aspectRatioHeight": 1,
                  "chartTypeThemes": {
                    "timeSeries": {
                      "type": "v1",
                      "v1": {
                        "xAxisTickFontSize": 1,
                        "xAxisTickFontColor": "<hex color>",
                        "yAxisTitleFontSize": 1,
                        "yAxisTickFontSize": 1
                      }
                    }
                  }
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/ChartTheme"
            },
            "x-example": {
              "rid": "<chart theme rid>",
              "name": "<name>",
              "createdBy": "<created by>",
              "createdAt": "2026-01-01T00:00:00Z",
              "updatedBy": "<updated by>",
              "updatedAt": "2026-01-01T00:00:00Z",
              "content": {
                "type": "v1",
                "v1": {
                  "titleEnabled": true,
                  "titleAlignment": "START",
                  "titleFontSize": 1,
                  "titleFontColor": "<hex color>",
                  "captionEnabled": true,
                  "captionAlignment": "START",
                  "captionFontSize": 1,
                  "captionFontColor": "<hex color>",
                  "backgroundEnabled": true,
                  "legendEnabled": true,
                  "legendPosition": "TOP",
                  "legendFontSize": 1,
                  "legendFontColor": "<hex color>",
                  "legendPlacement": "OUTSIDE",
                  "rowGapEnabled": true,
                  "rowGapSize": 1,
                  "aspectRatioWidth": 1,
                  "aspectRatioHeight": 1,
                  "chartTypeThemes": {
                    "timeSeries": {
                      "type": "v1",
                      "v1": {
                        "xAxisTickFontSize": 1,
                        "xAxisTickFontColor": "<hex color>",
                        "yAxisTitleFontSize": 1,
                        "yAxisTickFontSize": 1,
                        "thresholdLineWidth": 1
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/themes/v1/chart-themes/{chartThemeRid}": {
      "get": {
        "operationId": "ThemesService_getChartTheme",
        "summary": "Get chart theme",
        "tags": [
          "Themes Service"
        ],
        "description": "Get a specific chart theme by RID.",
        "parameters": [
          {
            "name": "chartThemeRid",
            "in": "path",
            "type": "string",
            "format": "rid",
            "x-alias": "ChartThemeRid",
            "required": true,
            "description": "The RID of chart theme."
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/ChartTheme"
            },
            "x-example": {
              "rid": "<chart theme rid>",
              "name": "<name>",
              "createdBy": "<created by>",
              "createdAt": "2026-01-01T00:00:00Z",
              "updatedBy": "<updated by>",
              "updatedAt": "2026-01-01T00:00:00Z",
              "content": {
                "type": "v1",
                "v1": {
                  "titleEnabled": true,
                  "titleAlignment": "START",
                  "titleFontSize": 1,
                  "titleFontColor": "<hex color>",
                  "captionEnabled": true,
                  "captionAlignment": "START",
                  "captionFontSize": 1,
                  "captionFontColor": "<hex color>",
                  "backgroundEnabled": true,
                  "legendEnabled": true,
                  "legendPosition": "TOP",
                  "legendFontSize": 1,
                  "legendFontColor": "<hex color>",
                  "legendPlacement": "OUTSIDE",
                  "rowGapEnabled": true,
                  "rowGapSize": 1,
                  "aspectRatioWidth": 1,
                  "aspectRatioHeight": 1,
                  "chartTypeThemes": {
                    "timeSeries": {
                      "type": "v1",
                      "v1": {
                        "xAxisTickFontSize": 1,
                        "xAxisTickFontColor": "<hex color>",
                        "yAxisTitleFontSize": 1,
                        "yAxisTickFontSize": 1,
                        "thresholdLineWidth": 1
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "put": {
        "operationId": "ThemesService_updateChartTheme",
        "summary": "Update chart theme",
        "tags": [
          "Themes Service"
        ],
        "description": "Update an existing chart theme.",
        "parameters": [
          {
            "name": "chartThemeRid",
            "in": "path",
            "type": "string",
            "format": "rid",
            "x-alias": "ChartThemeRid",
            "required": true,
            "description": "The RID of chart theme to update."
          },
          {
            "name": "request",
            "in": "body",
            "schema": {
              "$ref": "#/definitions/UpdateChartThemeRequest"
            },
            "required": true,
            "x-example": {
              "name": "<name>",
              "content": {
                "type": "v1",
                "v1": {
                  "titleEnabled": true,
                  "titleAlignment": "START",
                  "titleFontSize": 1,
                  "titleFontColor": "<hex color>",
                  "captionEnabled": true,
                  "captionAlignment": "START",
                  "captionFontSize": 1,
                  "captionFontColor": "<hex color>",
                  "backgroundEnabled": true,
                  "legendEnabled": true,
                  "legendPosition": "TOP",
                  "legendFontSize": 1,
                  "legendFontColor": "<hex color>",
                  "legendPlacement": "OUTSIDE",
                  "rowGapEnabled": true,
                  "aspectRatioWidth": 1,
                  "aspectRatioHeight": 1,
                  "chartTypeThemes": {
                    "timeSeries": {
                      "type": "v1",
                      "v1": {
                        "xAxisTickFontSize": 1,
                        "xAxisTickFontColor": "<hex color>",
                        "yAxisTitleFontSize": 1,
                        "yAxisTickFontSize": 1
                      }
                    }
                  }
                }
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/ChartTheme"
            },
            "x-example": {
              "rid": "<chart theme rid>",
              "name": "<name>",
              "createdBy": "<created by>",
              "createdAt": "2026-01-01T00:00:00Z",
              "updatedBy": "<updated by>",
              "updatedAt": "2026-01-01T00:00:00Z",
              "content": {
                "type": "v1",
                "v1": {
                  "titleEnabled": true,
                  "titleAlignment": "START",
                  "titleFontSize": 1,
                  "titleFontColor": "<hex color>",
                  "captionEnabled": true,
                  "captionAlignment": "START",
                  "captionFontSize": 1,
                  "captionFontColor": "<hex color>",
                  "backgroundEnabled": true,
                  "legendEnabled": true,
                  "legendPosition": "TOP",
                  "legendFontSize": 1,
                  "legendFontColor": "<hex color>",
                  "legendPlacement": "OUTSIDE",
                  "rowGapEnabled": true,
                  "rowGapSize": 1,
                  "aspectRatioWidth": 1,
                  "aspectRatioHeight": 1,
                  "chartTypeThemes": {
                    "timeSeries": {
                      "type": "v1",
                      "v1": {
                        "xAxisTickFontSize": 1,
                        "xAxisTickFontColor": "<hex color>",
                        "yAxisTitleFontSize": 1,
                        "yAxisTickFontSize": 1,
                        "thresholdLineWidth": 1
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "ThemesService_deleteChartTheme",
        "summary": "Delete chart theme",
        "tags": [
          "Themes Service"
        ],
        "description": "Delete an existing comment.",
        "parameters": [
          {
            "name": "chartThemeRid",
            "in": "path",
            "type": "string",
            "format": "rid",
            "x-alias": "ChartThemeRid",
            "required": true,
            "description": "The RID of chart theme to delete."
          }
        ],
        "responses": {
          "204": {
            "description": "No content."
          }
        }
      }
    }
  },
  "definitions": {
    "ChartTheme": {
      "type": "object",
      "properties": {
        "rid": {
          "type": "string",
          "format": "rid",
          "x-alias": "ChartThemeRid",
          "description": "Unique resource identifier for the theme."
        },
        "name": {
          "type": "string",
          "description": "The name of the theme as defined by the user."
        },
        "createdBy": {
          "type": "string",
          "format": "rid",
          "description": "The rid of the user who first created the theme."
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "description": "The time the theme was created."
        },
        "updatedBy": {
          "type": "string",
          "format": "rid",
          "description": "The rid of the user who last updated the theme."
        },
        "updatedAt": {
          "type": "string",
          "format": "date-time",
          "description": "The rid of the user who last updated the theme."
        },
        "content": {
          "allOf": [
            {
              "$ref": "#/definitions/ChartThemeContent"
            }
          ],
          "description": "Specifies the chart theme styling (e.g. font, legends, axes)"
        }
      },
      "required": [
        "rid",
        "name",
        "createdBy",
        "createdAt",
        "content"
      ]
    },
    "ChartThemeContent": {
      "type": "object",
      "x-union": true,
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "v1"
          ]
        },
        "v1": {
          "$ref": "#/definitions/ChartThemeContentV1"
        }
      },
      "required": [
        "type"
      ],
      "description": "Set `type` to the name of one of the other fields, and set only that field.",
      "example": {
        "type": "v1",
        "v1": {
          "titleEnabled": true,
          "titleAlignment": "START",
          "titleFontSize": 1,
          "titleFontColor": "string",
          "captionEnabled": true,
          "captionAlignment": "START",
          "captionFontSize": 1,
          "captionFontColor": "string",
          "backgroundEnabled": true,
          "legendEnabled": true,
          "legendPosition": "TOP",
          "legendFontSize": 1,
          "legendFontColor": "string",
          "legendPlacement": "OUTSIDE",
          "rowGapEnabled": true,
          "rowGapSize": 1,
          "aspectRatioWidth": 1,
          "aspectRatioHeight": 1,
          "chartTypeThemes": {
            "timeSeries": {
              "type": "v1",
              "v1": {
                "xAxisTickFontSize": 1,
                "xAxisTickFontColor": "string",
                "yAxisTitleFontSize": 1,
                "yAxisTickFontSize": 1,
                "thresholdLineWidth": 1
              }
            }
          }
        }
      }
    },
    "ChartThemeContentV1": {
      "type": "object",
      "properties": {
        "titleEnabled": {
          "type": "boolean",
          "description": "Whether to show a title in the export."
        },
        "titleAlignment": {
          "allOf": [
            {
              "$ref": "#/definitions/TextAlignment"
            }
          ],
          "description": "How to align the text of the title."
        },
        "titleFontSize": {
          "type": "integer",
          "format": "int32",
          "description": "Font size of the title."
        },
        "titleFontColor": {
          "type": "string",
          "x-alias": "HexColor",
          "description": "Font color of the title."
        },
        "captionEnabled": {
          "type": "boolean",
          "description": "Whether to show a caption in the export."
        },
        "captionAlignment": {
          "allOf": [
            {
              "$ref": "#/definitions/TextAlignment"
            }
          ],
          "description": "How to align the text of the caption."
        },
        "captionFontSize": {
          "type": "integer",
          "format": "int32",
          "description": "Font size of the caption."
        },
        "captionFontColor": {
          "type": "string",
          "x-alias": "HexColor",
          "description": "Font color of the caption."
        },
        "backgroundEnabled": {
          "type": "boolean",
          "description": "Whether to include a default background with the export. (`false` indicates that the background should be transparent)"
        },
        "legendEnabled": {
          "type": "boolean",
          "description": "Whether to include a legend in the export."
        },
        "legendPosition": {
          "allOf": [
            {
              "$ref": "#/definitions/LegendPosition"
            }
          ],
          "description": "Which side the legend should appear on."
        },
        "legendFontSize": {
          "type": "integer",
          "format": "int32",
          "description": "Font size of the legend."
        },
        "legendFontColor": {
          "type": "string",
          "x-alias": "HexColor",
          "description": "Font color of the legend."
        },
        "legendPlacement": {
          "allOf": [
            {
              "$ref": "#/definitions/LegendPlacement"
            }
          ],
          "description": "Where on the chart the legend should be placed."
        },
        "rowGapEnabled": {
          "type": "boolean",
          "description": "Whether rows will be separated."
        },
        "rowGapSize": {
          "type": "integer",
          "format": "int32",
          "description": "The size of the row gap."
        },
        "aspectRatioWidth": {
          "type": "integer",
          "format": "int32",
          "description": "The relative width of the chart export."
        },
        "aspectRatioHeight": {
          "type": "integer",
          "format": "int32",
          "description": "The relative height of the chart export."
        },
        "chartTypeThemes": {
          "allOf": [
            {
              "$ref": "#/definitions/ChartTypeThemes"
            }
          ],
          "description": "Theme parameters specific to chart types."
        }
      },
      "required": [
        "titleEnabled",
        "titleAlignment",
        "titleFontSize",
        "titleFontColor",
        "captionEnabled",
        "captionAlignment",
        "captionFontSize",
        "captionFontColor",
        "backgroundEnabled",
        "legendEnabled",
        "legendPosition",
        "legendFontSize",
        "legendFontColor",
        "legendPlacement",
        "rowGapEnabled",
        "aspectRatioWidth",
        "aspectRatioHeight",
        "chartTypeThemes"
      ]
    },
    "ChartTypeThemes": {
      "description": "Theme parameters specific to chart types.",
      "type": "object",
      "properties": {
        "timeSeries": {
          "allOf": [
            {
              "$ref": "#/definitions/TimeSeriesChartTheme"
            }
          ],
          "description": "The theme specific to parameters of the time series chart."
        }
      },
      "required": [
        "timeSeries"
      ]
    },
    "CreateChartThemeRequest": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the theme."
        },
        "content": {
          "allOf": [
            {
              "$ref": "#/definitions/ChartThemeContent"
            }
          ],
          "description": "The theme fields."
        },
        "workspace": {
          "type": "string",
          "format": "rid",
          "x-alias": "WorkspaceRid",
          "description": "The workspace in which to create the theme. If not provided, the theme will be created in the default workspace for the user's organization, if the default workspace for the organization is configured."
        }
      },
      "required": [
        "name",
        "content"
      ],
      "example": {
        "name": "<name>",
        "content": {
          "type": "v1",
          "v1": {
            "titleEnabled": true,
            "titleAlignment": "START",
            "titleFontSize": 1,
            "titleFontColor": "<hex color>",
            "captionEnabled": true,
            "captionAlignment": "START",
            "captionFontSize": 1,
            "captionFontColor": "<hex color>",
            "backgroundEnabled": true,
            "legendEnabled": true,
            "legendPosition": "TOP",
            "legendFontSize": 1,
            "legendFontColor": "<hex color>",
            "legendPlacement": "OUTSIDE",
            "rowGapEnabled": true,
            "aspectRatioWidth": 1,
            "aspectRatioHeight": 1,
            "chartTypeThemes": {
              "timeSeries": {
                "type": "v1",
                "v1": {
                  "xAxisTickFontSize": 1,
                  "xAxisTickFontColor": "<hex color>",
                  "yAxisTitleFontSize": 1,
                  "yAxisTickFontSize": 1
                }
              }
            }
          }
        }
      }
    },
    "LegendPlacement": {
      "type": "string",
      "enum": [
        "OUTSIDE",
        "INSIDE"
      ]
    },
    "LegendPosition": {
      "type": "string",
      "enum": [
        "TOP",
        "BOTTOM",
        "LEFT",
        "RIGHT"
      ]
    },
    "TextAlignment": {
      "type": "string",
      "enum": [
        "START",
        "END",
        "CENTER",
        "JUSTIFY"
      ]
    },
    "TimeSeriesChartTheme": {
      "type": "object",
      "x-union": true,
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "v1"
          ]
        },
        "v1": {
          "$ref": "#/definitions/TimeSeriesChartThemeV1"
        }
      },
      "required": [
        "type"
      ],
      "description": "Set `type` to the name of one of the other fields, and set only that field.",
      "example": {
        "type": "v1",
        "v1": {
          "xAxisTickFontSize": 1,
          "xAxisTickFontColor": "string",
          "yAxisTitleFontSize": 1,
          "yAxisTickFontSize": 1,
          "thresholdLineWidth": 1
        }
      }
    },
    "TimeSeriesChartThemeV1": {
      "description": "Theme parameters specific to the time series chart.",
      "type": "object",
      "properties": {
        "xAxisTickFontSize": {
          "type": "integer",
          "format": "int32",
          "description": "The font size of the x-axis ticks."
        },
        "xAxisTickFontColor": {
          "type": "string",
          "x-alias": "HexColor",
          "description": "The font color of the x-axis ticks."
        },
        "yAxisTitleFontSize": {
          "type": "integer",
          "format": "int32",
          "description": "The font size of the y-axis labels."
        },
        "yAxisTickFontSize": {
          "type": "integer",
          "format": "int32",
          "description": "The font size of the y-axis ticks."
        },
        "thresholdLineWidth": {
          "type": "integer",
          "format": "int32",
          "description": "The line thickness in px of the threshold line."
        }
      },
      "required": [
        "xAxisTickFontSize",
        "xAxisTickFontColor",
        "yAxisTitleFontSize",
        "yAxisTickFontSize"
      ]
    },
    "UpdateChartThemeRequest": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the theme."
        },
        "content": {
          "allOf": [
            {
              "$ref": "#/definitions/ChartThemeContent"
            }
          ],
          "description": "The theme fields."
        }
      },
      "required": [
        "name",
        "content"
      ],
      "example": {
        "name": "<name>",
        "content": {
          "type": "v1",
          "v1": {
            "titleEnabled": true,
            "titleAlignment": "START",
            "titleFontSize": 1,
            "titleFontColor": "<hex color>",
            "captionEnabled": true,
            "captionAlignment": "START",
            "captionFontSize": 1,
            "captionFontColor": "<hex color>",
            "backgroundEnabled": true,
            "legendEnabled": true,
            "legendPosition": "TOP",
            "legendFontSize": 1,
            "legendFontColor": "<hex color>",
            "legendPlacement": "OUTSIDE",
            "rowGapEnabled": true,
            "aspectRatioWidth": 1,
            "aspectRatioHeight": 1,
            "chartTypeThemes": {
              "timeSeries": {
                "type": "v1",
                "v1": {
                  "xAxisTickFontSize": 1,
                  "xAxisTickFontColor": "<hex color>",
                  "yAxisTitleFontSize": 1,
                  "yAxisTickFontSize": 1
                }
              }
            }
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "Themes Service",
      "x-displayName": "Themes service",
      "description": "Themes service manages themes for exporting charts.",
      "x-errors": [
        {
          "status": 400,
          "errorCode": "INVALID_ARGUMENT",
          "errorName": "Themes:InvalidChartTheme"
        },
        {
          "status": 404,
          "errorCode": "NOT_FOUND",
          "errorName": "Themes:ChartThemeNotFound"
        },
        {
          "status": 409,
          "errorCode": "CONFLICT",
          "errorName": "Themes:ChartThemeNameConflict"
        }
      ]
    }
  ]
}
