create-custom-theme
dci create-custom-theme [body]
Creates a new custom color theme. Requires Cloud Analytics Admin permission.
Pass the request body as name: value arguments or pipe JSON on stdin — see Command structure.
Examples
# Create a theme with a primary color and matching dark and light palettes (hex colors, quoted so the shell does not read `#` as a comment).
dci create-custom-theme name: "Team Backyard", primaryColor: "#0B57D0", colors{dark: ["#8AB4F8", "#81C995", "#FDD663"], light: ["#0B57D0", "#188038", "#E37400"]}
# Create it from a JSON file.
dci create-custom-theme < theme.json
# theme.json
{"name": "Team Backyard", "primaryColor": "#0B57D0",
"colors": {"dark": ["#8AB4F8", "#81C995", "#FDD663"],
"light": ["#0B57D0", "#188038", "#E37400"]}}
# Capture the new theme's ID to activate it next.
dci create-custom-theme < theme.json --output json | jq -r .id
Request
Content-Type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
name | string | yes | The display name of the custom theme. |
primaryColor | string | yes | A color in hex notation. Accepts #RGB, #RRGGBB, or #RRGGBBAA. |
colors | object | yes | Palettes for light and dark display modes. Each palette must contain between 1 and 32 hex colors. |
colors.light | array of string | yes | Colors used when the report is displayed in light mode. |
colors.dark | array of string | yes | Colors used when the report is displayed in dark mode. |
Raw JSON schema
{
"required": [
"name",
"primaryColor",
"colors"
],
"type": "object",
"description": "Request body for creating a custom theme.",
"properties": {
"name": {
"type": "string",
"description": "The display name of the custom theme.",
"maxLength": 200
},
"primaryColor": {
"type": "string",
"description": "A color in hex notation. Accepts `#RGB`, `#RRGGBB`, or `#RRGGBBAA`.",
"pattern": "^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$",
"example": "#1A73E8"
},
"colors": {
"type": "object",
"required": [
"light",
"dark"
],
"description": "Palettes for light and dark display modes. Each palette must contain between 1 and 32 hex colors.",
"properties": {
"light": {
"type": "array",
"minItems": 1,
"maxItems": 32,
"items": {
"type": "string",
"description": "A color in hex notation. Accepts `#RGB`, `#RRGGBB`, or `#RRGGBBAA`.",
"pattern": "^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$",
"example": "#1A73E8"
},
"description": "Colors used when the report is displayed in light mode."
},
"dark": {
"type": "array",
"minItems": 1,
"maxItems": 32,
"items": {
"type": "string",
"description": "A color in hex notation. Accepts `#RGB`, `#RRGGBB`, or `#RRGGBBAA`.",
"pattern": "^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$",
"example": "#1A73E8"
},
"description": "Colors used when the report is displayed in dark mode."
}
}
}
}
}
Output
Created - Custom theme created successfully.
By default dci renders the result as a table. Use --output json to get the full structure described below — see Output formats.
| Field | Type | Description |
|---|---|---|
id | string | The unique identifier of the custom theme. |
name | string | The display name of the custom theme. |
primaryColor | string | A color in hex notation. Accepts #RGB, #RRGGBB, or #RRGGBBAA. |
colors | object | Palettes for light and dark display modes. Each palette must contain between 1 and 32 hex colors. |
colors.light | array of string | Colors used when the report is displayed in light mode. |
colors.dark | array of string | Colors used when the report is displayed in dark mode. |
createTime | string (date-time) | The creation time of the custom theme. |
updateTime | string (date-time) | The time when the custom theme was last updated. |
Raw JSON schema
{
"required": [
"id",
"name",
"primaryColor",
"colors"
],
"type": "object",
"description": "A custom color theme applied to Cloud Analytics reports.",
"properties": {
"id": {
"type": "string",
"description": "The unique identifier of the custom theme."
},
"name": {
"type": "string",
"description": "The display name of the custom theme.",
"maxLength": 200
},
"primaryColor": {
"type": "string",
"description": "A color in hex notation. Accepts `#RGB`, `#RRGGBB`, or `#RRGGBBAA`.",
"pattern": "^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$",
"example": "#1A73E8"
},
"colors": {
"type": "object",
"required": [
"light",
"dark"
],
"description": "Palettes for light and dark display modes. Each palette must contain between 1 and 32 hex colors.",
"properties": {
"light": {
"type": "array",
"minItems": 1,
"maxItems": 32,
"items": {
"type": "string",
"description": "A color in hex notation. Accepts `#RGB`, `#RRGGBB`, or `#RRGGBBAA`.",
"pattern": "^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$",
"example": "#1A73E8"
},
"description": "Colors used when the report is displayed in light mode."
},
"dark": {
"type": "array",
"minItems": 1,
"maxItems": 32,
"items": {
"type": "string",
"description": "A color in hex notation. Accepts `#RGB`, `#RRGGBB`, or `#RRGGBBAA`.",
"pattern": "^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$",
"example": "#1A73E8"
},
"description": "Colors used when the report is displayed in dark mode."
}
}
},
"createTime": {
"type": "string",
"format": "date-time",
"description": "The creation time of the custom theme."
},
"updateTime": {
"type": "string",
"format": "date-time",
"description": "The time when the custom theme was last updated."
}
}
}
Errors
On failure, dci prints a single error message — with a hint when one is available — and exits with a typed code your scripts can branch on. See Errors and exit codes for the full contract.
HTTP status to exit code mapping
| HTTP status | Exit code | Error code | Meaning |
|---|---|---|---|
| 400 | 30 | VALIDATION_ERROR | The arguments or request body were rejected. Review the command's flags and payload. |
| 401 | 10 | AUTHENTICATION_FAILED | Not signed in, or the API token is invalid. Run dci login or check DCI_API_KEY. |
| 403 | 11 | PERMISSION_DENIED | The DoiT user or the active customer context does not have access. |
| 404 | 20 | RESOURCE_NOT_FOUND | The requested resource does not exist. Check the identifier argument. |
Related
- list-custom-themes — List custom themes
- get-custom-theme — Retrieve a custom theme
- update-custom-theme — Update a custom theme
- delete-custom-theme — Delete a custom theme
- set-active-theme — Set the active theme
- API reference: POST /analytics/v1/settings/themes
Aliases: createcustomtheme