Skip to main content

list-labels

dci list-labels [flags]

Returns a list of labels that your account has access to. Labels are listed in reverse chronological order by default.

CLI default view

dci list-labels presents a curated table by default:

  • Columns: name, type, color, and updated (UTC) (from updateTime).
  • In interactive tables, updated (UTC) renders in your local timezone and is titled updated (local); machine formats, agent mode, and --utc keep UTC — see Timestamps and timezones.
  • --output json and explicit -C/--fields selections return the raw fields documented below.

Flags

--max-results: (integer format:int64 default:50)

--page-token: (string)

--filter: (string)

--name-contains: (string)

--sort-by: (string enum:"id","name","type","createTime","updateTime")

--sort-order: (string enum:"asc","desc")

Output

OK - The request succeeded.

By default dci renders the result as a table. Use --output json to get the full structure described below — see Output formats.

FieldTypeDescription
pageTokenstringPage token, returned by a previous call, to request the next page of results.
rowCountintegerTotal number of labels in the result set.
labelsarray of object
labels[].idstringThe unique identifier of the label.
labels[].namestringThe name of the label.
labels[].colorstringThe color of the label. One of: "blue", "skyBlue", "teal", "mint", "lime", "softYellow", "apricot", "lavender", "purple", "rosePink", "slateGrey".
labels[].typestringThe type of the label (custom or preset). One of: "custom", "preset".
labels[].createTimestring (date-time)The time when the label was created.
labels[].updateTimestring (date-time)The time when the label was last updated.
Raw JSON schema
{
"type": "object",
"description": "Paged list of labels.",
"properties": {
"pageToken": {
"type": "string",
"description": "Page token, returned by a previous call, to request the next page of results."
},
"rowCount": {
"type": "integer",
"description": "Total number of labels in the result set."
},
"labels": {
"type": "array",
"items": {
"required": [
"id",
"name",
"color"
],
"type": "object",
"description": "Label metadata.",
"properties": {
"id": {
"type": "string",
"description": "The unique identifier of the label."
},
"name": {
"type": "string",
"description": "The name of the label."
},
"color": {
"type": "string",
"enum": [
"blue",
"skyBlue",
"teal",
"mint",
"lime",
"softYellow",
"apricot",
"lavender",
"purple",
"rosePink",
"slateGrey"
],
"description": "The color of the label."
},
"type": {
"type": "string",
"enum": [
"custom",
"preset"
],
"description": "The type of the label (custom or preset)."
},
"createTime": {
"type": "string",
"format": "date-time",
"description": "The time when the label was created."
},
"updateTime": {
"type": "string",
"format": "date-time",
"description": "The time when the label 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 statusExit codeError codeMeaning
40030VALIDATION_ERRORThe arguments or request body were rejected. Review the command's flags and payload.
40110AUTHENTICATION_FAILEDNot signed in, or the API token is invalid. Run dci login or check DCI_API_KEY.
40311PERMISSION_DENIEDThe DoiT user or the active customer context does not have access.
40420RESOURCE_NOT_FOUNDThe requested resource does not exist. Check the identifier argument.

Aliases: listlabels