{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/logo-dev/json-schema/logo-dev-v2-metadata-schema.json",
  "title": "V2Metadata",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/logo-dev-openapi.json#/components/schemas/V2Metadata",
  "type": "object",
  "properties": {
    "request_id": {
      "type": "string",
      "description": "Unique id for this request. Also sent as the `Request-Id` header."
    },
    "resolution": {
      "allOf": [
        {
          "$ref": "#/$defs/V2Resolution"
        }
      ],
      "description": "Brand and image lookups only."
    },
    "pending": {
      "allOf": [
        {
          "$ref": "#/$defs/V2Pending"
        }
      ],
      "description": "`202` responses only."
    },
    "subscription": {
      "type": "object",
      "description": "Present when a brand lookup (`GET /v2/brands` or `GET /v2/brands/{id}`) ran the automatic subscribe: webhooks are on for the account, and `nosubscribe` is not `true`. See [automatic subscriptions](/brand/introduction#automatic-subscriptions).",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "subscribed",
            "quota_exceeded"
          ],
          "description": "`subscribed`: the account is subscribed to the brand. `quota_exceeded`: the account is at its plan's subscription limit, so the brand was not subscribed. The lookup is answered and billed either way."
        },
        "message": {
          "type": "string",
          "description": "Why the subscribe was refused. Only with `quota_exceeded`."
        }
      },
      "required": [
        "status"
      ]
    }
  },
  "required": [
    "request_id"
  ],
  "$defs": {
    "V2Pending": {
      "type": "object",
      "description": "Present only on a `202`. Tells you when to retry.",
      "properties": {
        "reason": {
          "type": "string",
          "enum": [
            "indexing",
            "resolving"
          ],
          "description": "`indexing` is a brand's first crawl; `resolving` means the identifier is still being matched to a brand."
        },
        "message": {
          "type": "string"
        },
        "retry_after_seconds": {
          "type": "integer",
          "description": "Wait this long before retrying. Matches the `Retry-After` header."
        },
        "expires_in_seconds": {
          "type": "integer",
          "description": "Stop polling after this long."
        },
        "webhook": {
          "type": "boolean",
          "description": "Whether a `brand.indexed` webhook event carrying this request's `request_id` will be sent when the lookup settles."
        },
        "doc_url": {
          "type": "string",
          "format": "uri"
        }
      },
      "required": [
        "reason",
        "message",
        "retry_after_seconds",
        "expires_in_seconds",
        "webhook",
        "doc_url"
      ]
    },
    "V2Resolution": {
      "type": "object",
      "description": "How the request identified the brand.",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "domain",
            "ticker",
            "isin",
            "crypto",
            "name",
            "brand_id"
          ],
          "description": "Which identifier the request used."
        },
        "value": {
          "type": "string",
          "description": "The identifier after normalization: the registrable domain, an upper-cased ticker, and so on."
        },
        "method": {
          "type": "string",
          "enum": [
            "direct",
            "domain",
            "security",
            "crypto",
            "search",
            ""
          ],
          "description": "How the identifier reached the brand. `direct` is a brand id or a domain that is its own brand; `domain` went through an alias or redirect; `security` is a ticker or ISIN; `crypto` is a crypto token symbol; `search` is a name lookup. Empty on a cached miss."
        },
        "context": {
          "type": "object",
          "description": "Reserved for brands involved in a merchant lookup. Always `{}` today."
        }
      },
      "required": [
        "type",
        "value",
        "method",
        "context"
      ]
    }
  }
}