{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/elhub/json-schema/elhub-party-create-request-schema.json",
  "title": "party_create_request",
  "description": "Request schema for create operations - The body that interacts with the Flexibility Information System\n\nA party is the thing that is authorized to access or modify data in the Flexiblity Information System.\n\nExample party types:\n\n* Service Provider\n* System Operator\n* End User",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/elhub-party-api-openapi.yml#/components/schemas/party_create_request",
  "summary": "Create - Party",
  "type": "object",
  "properties": {
    "business_id": {
      "description": "The business identifier of the party. Format depends on `business_id_type`.",
      "format": "text",
      "type": "string"
    },
    "business_id_type": {
      "$ref": "#/$defs/party_business_id_type",
      "default": "uuid"
    },
    "entity_id": {
      "description": "Reference to the entity that is the parent of the party.",
      "format": "bigint",
      "type": "integer"
    },
    "name": {
      "description": "Name of the party. Maximum 128 characters.",
      "format": "text",
      "type": "string"
    },
    "role": {
      "$ref": "#/$defs/party_role"
    },
    "type": {
      "$ref": "#/$defs/party_type"
    },
    "status": {
      "$ref": "#/$defs/party_status",
      "default": "new"
    }
  },
  "required": [
    "entity_id",
    "name",
    "role",
    "type"
  ],
  "$defs": {
    "party_business_id_type": {
      "description": "The type of the business identifier.",
      "format": "text",
      "type": "string",
      "default": "uuid",
      "enum": [
        "gln",
        "uuid",
        "eic_x",
        "org"
      ]
    },
    "party_role": {
      "description": "The role of the party. Currently maps to 1:1 to `type`. E.g. system_operator, service_provider.",
      "format": "text",
      "type": "string",
      "enum": [
        "flex_balance_responsible_party",
        "flex_end_user",
        "flex_energy_supplier",
        "flex_flexibility_information_system_operator",
        "flex_market_operator",
        "flex_organisation",
        "flex_service_provider",
        "flex_system_operator",
        "flex_third_party"
      ]
    },
    "party_status": {
      "description": "The status of the party.",
      "format": "text",
      "type": "string",
      "default": "new",
      "enum": [
        "new",
        "active",
        "inactive",
        "suspended",
        "terminated"
      ]
    },
    "party_type": {
      "description": "The type of the party, e.g SystemOperator, ServiceProvider",
      "format": "text",
      "type": "string",
      "enum": [
        "balance_responsible_party",
        "end_user",
        "energy_supplier",
        "flexibility_information_system_operator",
        "market_operator",
        "organisation",
        "service_provider",
        "system_operator",
        "third_party"
      ]
    }
  }
}