{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "/schemas/3.0.1/brand/get-brand-identity-response.json",
  "title": "Get Brand Identity Response",
  "description": "Brand identity data from a brand agent. Core identity (house, names, description, logos) is always public. Authorized callers receive richer data (high-res assets, voice synthesis, tone guidelines, rights availability). Includes available_fields to signal what the caller could unlock by linking their account.",
  "type": "object",
  "oneOf": [
    {
      "title": "GetBrandIdentitySuccess",
      "properties": {
        "brand_id": {
          "type": "string",
          "description": "Brand identifier",
          "x-entity": "advertiser_brand"
        },
        "house": {
          "type": "object",
          "description": "The house (corporate entity) this brand belongs to. Always returned regardless of authorization level.",
          "properties": {
            "domain": {
              "type": "string",
              "description": "House domain (e.g., nikeinc.com)"
            },
            "name": {
              "type": "string",
              "description": "House display name"
            }
          },
          "required": ["domain", "name"],
          "additionalProperties": true
        },
        "names": {
          "type": "array",
          "description": "Localized brand names with BCP 47 locale code keys (e.g., 'en_US', 'fr_CA'). Bare language codes ('en') are accepted as wildcards for backwards compatibility.",
          "items": {
            "type": "object",
            "minProperties": 1,
            "additionalProperties": {
              "type": "string"
            }
          }
        },
        "description": {
          "type": "string",
          "description": "Brand description"
        },
        "industries": {
          "type": "array",
          "items": { "type": "string" },
          "minItems": 1,
          "description": "Brand industries."
        },
        "keller_type": {
          "type": "string",
          "enum": ["master", "sub_brand", "endorsed", "independent"],
          "description": "Brand architecture type: master (primary brand of house), sub_brand (carries parent name), endorsed (independent identity backed by parent), independent (operates separately)"
        },
        "logos": {
          "type": "array",
          "description": "Brand logos. Public callers get standard logos; authorized callers also receive high-res variants. Shape matches brand.json logo definition.",
          "items": {
            "type": "object",
            "properties": {
              "url": { "type": "string", "format": "uri", "description": "URL to the logo asset" },
              "orientation": {
                "type": "string",
                "enum": ["square", "horizontal", "vertical", "stacked"],
                "description": "Logo aspect ratio orientation"
              },
              "background": {
                "type": "string",
                "enum": ["dark-bg", "light-bg", "transparent-bg"],
                "description": "Background compatibility"
              },
              "variant": {
                "type": "string",
                "enum": ["primary", "secondary", "icon", "wordmark", "full-lockup"],
                "description": "Logo variant type"
              },
              "tags": {
                "type": "array",
                "items": { "type": "string" },
                "description": "Additional semantic tags"
              },
              "usage": { "type": "string", "description": "When to use this logo variant" },
              "width": { "type": "integer", "description": "Width in pixels" },
              "height": { "type": "integer", "description": "Height in pixels" }
            },
            "required": ["url"],
            "additionalProperties": true
          }
        },
        "colors": {
          "type": "object",
          "description": "Brand color palette. Each role accepts a single hex color or an array of hex colors. Shape matches brand.json colors definition.",
          "properties": {
            "primary": { "oneOf": [{ "type": "string", "pattern": "^#[0-9A-Fa-f]{6}$" }, { "type": "array", "items": { "type": "string", "pattern": "^#[0-9A-Fa-f]{6}$" }, "minItems": 1 }] },
            "secondary": { "oneOf": [{ "type": "string", "pattern": "^#[0-9A-Fa-f]{6}$" }, { "type": "array", "items": { "type": "string", "pattern": "^#[0-9A-Fa-f]{6}$" }, "minItems": 1 }] },
            "accent": { "oneOf": [{ "type": "string", "pattern": "^#[0-9A-Fa-f]{6}$" }, { "type": "array", "items": { "type": "string", "pattern": "^#[0-9A-Fa-f]{6}$" }, "minItems": 1 }] },
            "background": { "oneOf": [{ "type": "string", "pattern": "^#[0-9A-Fa-f]{6}$" }, { "type": "array", "items": { "type": "string", "pattern": "^#[0-9A-Fa-f]{6}$" }, "minItems": 1 }] },
            "text": { "oneOf": [{ "type": "string", "pattern": "^#[0-9A-Fa-f]{6}$" }, { "type": "array", "items": { "type": "string", "pattern": "^#[0-9A-Fa-f]{6}$" }, "minItems": 1 }] }
          },
          "additionalProperties": true
        },
        "fonts": {
          "type": "object",
          "description": "Brand typography. Each key is a role name (e.g., 'primary', 'secondary') referenced by type_scale entries. Values are either a CSS font-family string or a structured object with family name and font files. Shape matches brand.json fonts definition.",
          "maxProperties": 20,
          "definitions": {
            "font_role": {
              "oneOf": [
                { "type": "string" },
                {
                  "type": "object",
                  "properties": {
                    "family": { "type": "string", "description": "CSS font-family name" },
                    "files": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "url": { "type": "string", "format": "uri", "pattern": "^https://", "description": "HTTPS URL to the font file" },
                          "weight": { "type": "integer", "minimum": 100, "maximum": 900, "description": "CSS numeric font-weight" },
                          "weight_range": {
                            "type": "array",
                            "items": { "type": "integer", "minimum": 100, "maximum": 900 },
                            "minItems": 2,
                            "maxItems": 2,
                            "description": "Variable font weight axis range as [min, max]"
                          },
                          "style": { "type": "string", "enum": ["normal", "italic", "oblique"], "description": "CSS font-style" }
                        },
                        "required": ["url"],
                        "additionalProperties": true
                      },
                      "maxItems": 36
                    },
                    "opentype_features": {
                      "type": "array",
                      "items": { "type": "string", "pattern": "^[a-z0-9]{4}$" },
                      "maxItems": 20,
                      "description": "OpenType feature tags to enable (e.g., ['ss01', 'tnum'])"
                    },
                    "fallbacks": {
                      "type": "array",
                      "items": { "type": "string", "maxLength": 100 },
                      "maxItems": 10,
                      "description": "Ordered fallback font-family names for script coverage"
                    }
                  },
                  "required": ["family"],
                  "additionalProperties": true
                }
              ]
            }
          },
          "properties": {
            "primary": { "$ref": "#/oneOf/0/properties/fonts/definitions/font_role", "description": "Primary font family" },
            "secondary": { "$ref": "#/oneOf/0/properties/fonts/definitions/font_role", "description": "Secondary font family" }
          },
          "additionalProperties": { "$ref": "#/oneOf/0/properties/fonts/definitions/font_role" }
        },
        "visual_guidelines": {
          "type": "object",
          "additionalProperties": true,
          "description": "Structured visual rules for generative creative systems (photography, graphic_style, colorways, type_scale, motion). Matches brand.json visual_guidelines definition. Authorized callers only."
        },
        "tone": {
          "type": "object",
          "description": "Brand voice and messaging guidelines",
          "properties": {
            "voice": { "type": "string", "description": "Brand personality described as comma-separated adjectives (e.g., 'enthusiastic, warm, competitive')" },
            "attributes": {
              "type": "array",
              "items": { "type": "string" },
              "description": "Personality traits that characterize the brand voice, used as prompt guidance"
            },
            "dos": {
              "type": "array",
              "items": { "type": "string" },
              "description": "Approved messaging approaches, content themes, and reference points"
            },
            "donts": {
              "type": "array",
              "items": { "type": "string" },
              "description": "Prohibited topics, competitor references, and phrasings to avoid"
            }
          },
          "additionalProperties": true
        },
        "tagline": {
          "oneOf": [
            {
              "type": "string",
              "description": "Plain tagline string for backwards compatibility"
            },
            {
              "type": "array",
              "description": "Localized taglines with BCP 47 locale codes",
              "items": {
                "type": "object",
                "minProperties": 1,
                "maxProperties": 1,
                "additionalProperties": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "minItems": 1
            }
          ],
          "description": "Brand tagline or slogan. Accepts a plain string or a localized array matching the names pattern."
        },
        "voice_synthesis": {
          "type": "object",
          "description": "Voice synthesis configuration for AI-generated audio",
          "properties": {
            "provider": { "type": "string" },
            "voice_id": { "type": "string" },
            "settings": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "additionalProperties": true
        },
        "assets": {
          "type": "array",
          "description": "Available brand assets (images, audio, video). Authorized callers only. Shape matches brand.json asset definition.",
          "items": {
            "type": "object",
            "properties": {
              "asset_id": { "type": "string", "description": "Unique identifier" },
              "asset_type": {
                "$ref": "/schemas/3.0.1/enums/asset-content-type.json",
                "description": "Type of asset content"
              },
              "url": { "type": "string", "format": "uri", "description": "URL to CDN-hosted asset file" },
              "tags": {
                "type": "array",
                "items": { "type": "string" },
                "description": "Tags for discovery"
              },
              "name": { "type": "string", "description": "Human-readable name" },
              "description": { "type": "string", "description": "Asset description or usage notes" },
              "width": { "type": "integer", "description": "Image/video width in pixels" },
              "height": { "type": "integer", "description": "Image/video height in pixels" },
              "duration_seconds": { "type": "number", "description": "Video/audio duration in seconds" },
              "file_size_bytes": { "type": "integer", "description": "File size in bytes" },
              "format": { "type": "string", "description": "File format (e.g., 'jpg', 'mp4')" }
            },
            "required": ["asset_id", "asset_type", "url"],
            "additionalProperties": true
          }
        },
        "rights": {
          "type": "object",
          "description": "Rights availability summary. For detailed pricing, use get_rights.",
          "properties": {
            "available_uses": {
              "type": "array",
              "items": { "$ref": "/schemas/3.0.1/enums/right-use.json" }
            },
            "countries": {
              "type": "array",
              "description": "Countries where rights are available (ISO 3166-1 alpha-2). If omitted, rights are available worldwide.",
              "items": {
                "type": "string",
                "pattern": "^[A-Z]{2}$"
              }
            },
            "excluded_countries": {
              "type": "array",
              "description": "Countries excluded from availability (ISO 3166-1 alpha-2)",
              "items": {
                "type": "string",
                "pattern": "^[A-Z]{2}$"
              }
            },
            "exclusivity_model": { "type": "string" },
            "content_restrictions": {
              "type": "array",
              "items": { "type": "string" }
            }
          },
          "additionalProperties": true
        },
        "available_fields": {
          "type": "array",
          "description": "Fields available but not returned in this response due to authorization level. Tells the caller what they would gain by linking their account via sync_accounts. Values match the request fields enum.",
          "items": {
            "type": "string",
            "enum": [
              "description",
              "industries",
              "keller_type",
              "logos",
              "colors",
              "fonts",
              "visual_guidelines",
              "tone",
              "tagline",
              "voice_synthesis",
              "assets",
              "rights"
            ]
          }
        },
        "context": {
          "$ref": "/schemas/3.0.1/core/context.json"
        },
        "ext": {
          "$ref": "/schemas/3.0.1/core/ext.json"
        }
      },
      "required": ["brand_id", "house", "names"],
      "additionalProperties": true,
      "not": { "required": ["errors"] }
    },
    {
      "title": "GetBrandIdentityError",
      "properties": {
        "errors": {
          "type": "array",
          "items": { "$ref": "/schemas/3.0.1/core/error.json" },
          "minItems": 1
        },
        "context": {
          "$ref": "/schemas/3.0.1/core/context.json"
        },
        "ext": {
          "$ref": "/schemas/3.0.1/core/ext.json"
        }
      },
      "required": ["errors"],
      "additionalProperties": true,
      "not": {
        "anyOf": [
          { "required": ["brand_id"] },
          { "required": ["house"] },
          { "required": ["names"] }
        ]
      }
    }
  ]
}
