{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/the-things-network/json-schema/the-things-network-lorawanv3-contact-info-validation-schema.json",
  "title": "lorawanv3ContactInfoValidation",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/the-things-network-contactinforegistry-api-openapi.yml#/components/schemas/lorawanv3ContactInfoValidation",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "token": {
      "type": "string"
    },
    "entity": {
      "$ref": "#/$defs/v3EntityIdentifiers"
    },
    "contact_info": {
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "#/$defs/v3ContactInfo"
      }
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "lorawanv3GatewayIdentifiers": {
      "type": "object",
      "properties": {
        "gateway_id": {
          "type": "string"
        },
        "eui": {
          "type": "string",
          "format": "string",
          "description": "Secondary identifier, which can only be used in specific requests."
        }
      }
    },
    "v3ApplicationIdentifiers": {
      "type": "object",
      "properties": {
        "application_id": {
          "type": "string"
        }
      }
    },
    "v3ClientIdentifiers": {
      "type": "object",
      "properties": {
        "client_id": {
          "type": "string"
        }
      }
    },
    "v3ContactInfo": {
      "type": "object",
      "properties": {
        "contact_type": {
          "$ref": "#/$defs/v3ContactType"
        },
        "contact_method": {
          "$ref": "#/$defs/v3ContactMethod"
        },
        "value": {
          "type": "string"
        },
        "public": {
          "type": "boolean"
        },
        "validated_at": {
          "type": "string",
          "format": "date-time"
        }
      }
    },
    "v3ContactMethod": {
      "type": "string",
      "enum": [
        "CONTACT_METHOD_OTHER",
        "CONTACT_METHOD_EMAIL",
        "CONTACT_METHOD_PHONE"
      ],
      "default": "CONTACT_METHOD_OTHER"
    },
    "v3ContactType": {
      "type": "string",
      "enum": [
        "CONTACT_TYPE_OTHER",
        "CONTACT_TYPE_ABUSE",
        "CONTACT_TYPE_BILLING",
        "CONTACT_TYPE_TECHNICAL"
      ],
      "default": "CONTACT_TYPE_OTHER"
    },
    "v3EndDeviceIdentifiers": {
      "type": "object",
      "properties": {
        "device_id": {
          "type": "string"
        },
        "application_ids": {
          "$ref": "#/$defs/v3ApplicationIdentifiers"
        },
        "dev_eui": {
          "type": "string",
          "format": "string",
          "description": "The LoRaWAN DevEUI."
        },
        "join_eui": {
          "type": "string",
          "format": "string",
          "description": "The LoRaWAN JoinEUI (AppEUI until LoRaWAN 1.0.3 end devices)."
        },
        "dev_addr": {
          "type": "string",
          "format": "string",
          "description": "The LoRaWAN DevAddr."
        }
      }
    },
    "v3EntityIdentifiers": {
      "type": "object",
      "properties": {
        "application_ids": {
          "$ref": "#/$defs/v3ApplicationIdentifiers"
        },
        "client_ids": {
          "$ref": "#/$defs/v3ClientIdentifiers"
        },
        "device_ids": {
          "$ref": "#/$defs/v3EndDeviceIdentifiers"
        },
        "gateway_ids": {
          "$ref": "#/$defs/lorawanv3GatewayIdentifiers"
        },
        "organization_ids": {
          "$ref": "#/$defs/v3OrganizationIdentifiers"
        },
        "user_ids": {
          "$ref": "#/$defs/v3UserIdentifiers"
        }
      },
      "description": "EntityIdentifiers contains one of the possible entity identifiers."
    },
    "v3OrganizationIdentifiers": {
      "type": "object",
      "properties": {
        "organization_id": {
          "type": "string",
          "description": "This ID shares namespace with user IDs."
        }
      }
    },
    "v3UserIdentifiers": {
      "type": "object",
      "properties": {
        "user_id": {
          "type": "string",
          "description": "This ID shares namespace with organization IDs."
        },
        "email": {
          "type": "string",
          "description": "Secondary identifier, which can only be used in specific requests."
        }
      }
    }
  }
}