{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/esendex/main/json-schema/esendex-api-response-of-user-credential-schema.json",
  "title": "ApiResponseOfUserCredential",
  "x-generated": "2026-10-14",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/esendex-openapi.json#/components/schemas/ApiResponseOfUserCredential",
  "allOf": [
    {
      "$ref": "#/$defs/ApiResponse"
    },
    {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "data": {
          "nullable": true,
          "oneOf": [
            {
              "$ref": "#/$defs/UserCredential"
            }
          ]
        }
      }
    }
  ],
  "$defs": {
    "ApiResponse": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "errors": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/ErrorDto"
          }
        }
      }
    },
    "CredentialAccount": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "accountReference": {
          "type": "string"
        },
        "legacyAccountReference": {
          "type": "string"
        }
      }
    },
    "ErrorDto": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "errorCode": {
          "type": "string"
        },
        "errorMessage": {
          "type": "string"
        },
        "metadata": {
          "type": [
            "object",
            "null"
          ],
          "additionalProperties": {}
        }
      }
    },
    "UserCredential": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "credentialId": {
          "type": "string",
          "format": "guid"
        },
        "userName": {
          "type": "string"
        },
        "platform": {
          "type": "string"
        },
        "accounts": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CredentialAccount"
          }
        },
        "tenantCode": {
          "type": "string"
        },
        "userId": {
          "type": "string"
        },
        "upgradeDate": {
          "type": "string",
          "format": "date-time"
        },
        "upgradeEnabled": {
          "type": "boolean"
        }
      }
    }
  }
}