{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://adcontextprotocol.org/schemas/3.2.0-beta.0/account/list-accounts-response.json",
  "title": "List Accounts Response",
  "description": "Response payload for list_accounts task",
  "type": "object",
  "allOf": [
    {
      "$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.0/core/version-envelope.json"
    },
    {
      "$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.0/core/protocol-envelope.json"
    }
  ],
  "properties": {
    "accounts": {
      "type": "array",
      "description": "Array of accounts accessible to the authenticated agent. Each entry is the full Account object plus optional authorization. Buyer-declared entries include brand, operator, and any operator_unit, fixed currency, buyer-selected account timezone, and sandbox qualifiers so the natural AccountRef round-trips after a cold start.",
      "items": {
        "$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.0/core/account-with-authorization.json"
      }
    },
    "errors": {
      "type": "array",
      "description": "Task-specific errors and warnings",
      "items": {
        "$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.0/core/error.json"
      }
    },
    "pagination": {
      "$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.0/core/pagination-response.json"
    },
    "context": {
      "$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.0/core/context.json"
    },
    "ext": {
      "$ref": "https://adcontextprotocol.org/schemas/3.2.0-beta.0/core/ext.json"
    }
  },
  "required": [
    "accounts"
  ],
  "additionalProperties": true,
  "examples": [
    {
      "description": "Agency with multiple client accounts",
      "data": {
        "status": "completed",
        "accounts": [
          {
            "account_id": "acc_acme_pinnacle",
            "name": "Acme c/o Pinnacle",
            "advertiser": "Acme Corp",
            "billing_proxy": "Pinnacle Media",
            "brand": {
              "domain": "acme-corp.com",
              "countries": [
                "CA",
                "US"
              ]
            },
            "operator": "pinnacle-media.com",
            "operator_unit": {
              "id": "seat_north_america_01",
              "name": "North America"
            },
            "currency": "USD",
            "billing": "operator",
            "account_scope": "operator_brand",
            "status": "active"
          },
          {
            "account_id": "acc_nova_pinnacle",
            "name": "Nova c/o Pinnacle",
            "advertiser": "Nova Brands",
            "billing_proxy": "Pinnacle Media",
            "brand": {
              "domain": "nova-brands.com",
              "brand_id": "spark"
            },
            "operator": "pinnacle-media.com",
            "billing": "operator",
            "account_scope": "operator_brand",
            "status": "active"
          },
          {
            "account_id": "acc_pinnacle",
            "name": "Pinnacle",
            "advertiser": "Pinnacle Media",
            "brand": {
              "domain": "pinnacle-media.com"
            },
            "operator": "pinnacle-media.com",
            "billing": "operator",
            "account_scope": "operator",
            "status": "active"
          }
        ],
        "pagination": {
          "has_more": false,
          "total_count": 3
        }
      }
    },
    {
      "description": "Direct advertiser with single account",
      "data": {
        "status": "completed",
        "accounts": [
          {
            "account_id": "acc_acme_direct",
            "name": "Acme",
            "advertiser": "Acme Corp",
            "brand": {
              "domain": "acme-corp.com"
            },
            "operator": "acme-corp.com",
            "billing": "operator",
            "account_scope": "brand",
            "status": "active",
            "rate_card": "acme_vip_2024"
          }
        ]
      }
    }
  ]
}
