{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "imports-v2/tags.json",
  "title": "Tags",
  "description": "A tag that can be put on cards, such as Revenue. Create each tag once and put it on cards with `tag_refs` of `cards`. Tags are matched by name, so a tag that already exists in the target is reused. Without `color` the tag gets a color of the palette.",
  "type": "object",
  "properties": {
    "external_id": {
      "type": "string",
      "minLength": 1,
      "maxLength": 512,
      "description": "Your own identifier of the record, for example `k-mrr`, unique within the resource across all of its files and case sensitive. Other records refer to this one by it."
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255,
      "description": "Name of the tag, for example `Revenue`. Up to 255 characters; names are distinct without regard to case."
    },
    "color": {
      "type": [
        "string",
        "null"
      ],
      "pattern": "^#[0-9A-Fa-f]{6}$",
      "x-palette": "option_colors",
      "description": "Tag color. It is replaced with the nearest color of the option palette; an omitted color gets a default one."
    }
  },
  "required": [
    "external_id",
    "name"
  ],
  "additionalProperties": false
}
