{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/engrate/json-schema/engrate-get-parties-response-schema.json",
  "title": "GetPartiesResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/engrate-core-api-openapi.yml#/components/schemas/GetPartiesResponse",
  "properties": {
    "parties": {
      "items": {
        "$ref": "#/$defs/Party"
      },
      "title": "Parties",
      "type": "array"
    }
  },
  "required": [
    "parties"
  ],
  "type": "object",
  "$defs": {
    "ExtraIdentifier": {
      "description": "Extra identifiers are used to attach things like EIC ids, VAT numbers, jurisdiction-specific identifiers, etc.\n\nFor example, Metering Grid Area's in parts of Europe are assigned an local jurisdiction EIC code; for those MGAs, the Engrate system will store the EIC as an extra identifier. However some jurisdictions have not yet switched to EIC codes, instead they rely on older local identification schemes. Swedish MGAs, as an example, use a local code assigned by the Swedish TSO.\n\nBecause the local schemes are subject to collisions - two TSOs assigning the same numerical code to different things, as they do not coordinate id assignment - we also track an identifier \"kind\".",
      "properties": {
        "kind": {
          "$ref": "#/$defs/IdentifierKind",
          "description": "The kind of identifier"
        },
        "value": {
          "description": "The identifier value",
          "title": "Value",
          "type": "string"
        }
      },
      "required": [
        "kind",
        "value"
      ],
      "title": "ExtraIdentifier",
      "type": "object"
    },
    "IdentifierKind": {
      "enum": [
        "eic",
        "vat",
        "gln",
        "se.ediel",
        "se.mga_code",
        "no.mga_code",
        "esett.mga_type"
      ],
      "title": "IdentifierKind",
      "type": "string"
    },
    "Party": {
      "description": "Represents a \"Market Party\" of some kind. Normally this is some legal person - a corporation, government entity, NGO etc - that serves some role in the electrical system.\n\nParties may be DSOs, TSOs, Energy Retailers and so on.",
      "properties": {
        "countries": {
          "description": "ISO 3166-1 alpha-2 country codes, this indicates countries where this party is active in some way, not only their legal home country",
          "items": {
            "type": "string"
          },
          "title": "Countries",
          "type": "array"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "Brief description of the party, if available",
          "title": "Description"
        },
        "extra_ids": {
          "description": "[Extra Identifiers](/api-reference/core/models/extra-identifier) for this Party, like EIC identifiers where those exist",
          "items": {
            "$ref": "#/$defs/ExtraIdentifier"
          },
          "title": "Extra Ids",
          "type": "array"
        },
        "id": {
          "description": "Unique identifier for the party",
          "format": "uuid",
          "title": "Id",
          "type": "string"
        },
        "logo_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "URL to the logo of the party, if available",
          "title": "Logo Url"
        },
        "name": {
          "description": "Legal name of the party",
          "title": "Name",
          "type": "string"
        },
        "website_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "description": "URL to the website of the party, if available",
          "title": "Website Url"
        }
      },
      "required": [
        "countries",
        "description",
        "extra_ids",
        "id",
        "logo_url",
        "name",
        "website_url"
      ],
      "title": "Party",
      "type": "object"
    }
  }
}