{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/signicat/main/json-schema/signicat-session-data-dto-schema.json",
  "title": "SessionDataDto",
  "description": "Session information to be returned to user",
  "x-generated": "2026-10-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/signicat-eid-hub-openapi.yml#/components/schemas/SessionDataDto",
  "required": [
    "accountId",
    "flow",
    "requestedAttributes"
  ],
  "type": "object",
  "properties": {
    "id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Session identifier (Globally unique)."
    },
    "accountId": {
      "minLength": 1,
      "type": "string",
      "description": "The specified account ID used for the session."
    },
    "authenticationUrl": {
      "type": [
        "string",
        "null"
      ],
      "description": "The URL which you should direct your end-user to for performing the authentication.",
      "format": "uri"
    },
    "statusUrl": {
      "type": [
        "string",
        "null"
      ],
      "description": "The URL that allows to check the authentication status.",
      "format": "uri"
    },
    "status": {
      "enum": [
        "CREATED",
        "SUCCESS",
        "ERROR",
        "ABORT",
        "CANCELLED",
        "WAITING_FOR_USER",
        "EXPIRED",
        "INVALID"
      ],
      "type": [
        "string",
        "null"
      ],
      "description": "The current status of the session."
    },
    "statusDetail": {
      "type": [
        "string",
        "null"
      ],
      "description": "The status detail if the response is an error."
    },
    "provider": {
      "type": [
        "string",
        "null"
      ],
      "description": "The IdP which was used by the end-user to authenticate."
    },
    "subject": {
      "$ref": "#/$defs/Subject"
    },
    "callbackUrls": {
      "$ref": "#/$defs/CallbackUrls"
    },
    "idpData": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": "string"
      },
      "description": "The idp data."
    },
    "environment": {
      "$ref": "#/$defs/SessionEnvironment"
    },
    "error": {
      "$ref": "#/$defs/BrokerResponseErrorDetails"
    },
    "messageTransportProperties": {
      "$ref": "#/$defs/MessageTransportProperties"
    },
    "tags": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      },
      "description": "A set of support optional tags to group and filter webhooks."
    },
    "paymentPrefillData": {
      "$ref": "#/$defs/PaymentPrefillData"
    },
    "loa": {
      "type": [
        "string",
        "null"
      ],
      "description": "The Level of Assurance used in the authentication."
    },
    "risk": {
      "$ref": "#/$defs/RiskData"
    },
    "allowedProviders": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      },
      "description": "A list of Identity Providers (IdPs) that can be used for authentication.\nIf not specified, the end-user will be able to choose from all IdPs associated with your Signicat account.\nThe maximum length for each Provider is 30."
    },
    "language": {
      "type": [
        "string",
        "null"
      ],
      "description": "The desired language for the UI. Expected format ISO 639-1.\nIf the requested language is not available, it will automatically default to English (en).\nSome IdPs may have a different fallback language due to regional considerations."
    },
    "flow": {
      "enum": [
        "headless",
        "redirect",
        "embedded"
      ],
      "type": "string",
      "description": "The selected flow used for this specific authentication session.\nTo learn more about using the ```headless``` flow with Swedish BankID, please refer to <a href=\"/identity-methods/sbid/integration-guide/auth-rest-api/headless/\">this example</a>."
    },
    "themeId": {
      "maxLength": 10,
      "minLength": 0,
      "type": [
        "string",
        "null"
      ],
      "description": "The themeId you want to use for this specific authentication session.\nIf not specified, the default theme for your account will be used."
    },
    "requestedAttributes": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "The attributes you wish to get back from the authentication of the end-user.\nTo find a list of which attributes can be requested, please see documentation for that specific ID method which\ncan be found on <a href=\"https://developer.signicat.com/identity-methods/\">https://developer.signicat.com/identity-methods/</a>.\n\nDefaults to empty."
    },
    "externalReference": {
      "maxLength": 100,
      "minLength": 0,
      "type": [
        "string",
        "null"
      ],
      "description": "An external reference for you, will be returned as a URL parameter on callbackUrls."
    },
    "usageReference": {
      "type": [
        "string",
        "null"
      ],
      "description": "An usage external reference for you to group your billing."
    },
    "sessionLifetime": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Lifetime of session in seconds (Default is 1200 seconds). It has a soft-minimum value of 300 seconds, which means if the value set is\nless then 300, it will be automatically set to 300 seconds.",
      "format": "int32"
    },
    "requestDomain": {
      "type": [
        "string",
        "null"
      ],
      "description": "This specifies the domain you want to use for this specific session.\nThe domain will be visible in the end-user's browser.\nThis domain needs to be correctly configured on your account!"
    },
    "expiresAt": {
      "type": [
        "string",
        "null"
      ],
      "description": "DateTime calculated field expiry of session.",
      "format": "date-time"
    }
  },
  "additionalProperties": false,
  "$defs": {
    "BrokerResponseErrorDetails": {
      "type": "object",
      "properties": {
        "type": {
          "type": [
            "string",
            "null"
          ],
          "description": "The error type."
        },
        "title": {
          "type": [
            "string",
            "null"
          ],
          "description": "The error title."
        },
        "detail": {
          "type": [
            "string",
            "null"
          ],
          "description": "The error detail."
        },
        "code": {
          "type": [
            "string",
            "null"
          ],
          "description": "The error code."
        }
      },
      "additionalProperties": false
    },
    "CallbackUrls": {
      "required": [
        "abort",
        "error",
        "success"
      ],
      "type": "object",
      "properties": {
        "success": {
          "type": "string",
          "description": "Specifies the URL to redirect in case of success.\nIf it is not a sandbox request needs to be https.",
          "format": "uri"
        },
        "abort": {
          "type": "string",
          "description": "Specifies the URL to redirect in case of abortion.\nIf it is not a sandbox request needs to be https.",
          "format": "uri"
        },
        "error": {
          "type": "string",
          "description": "Specifies the URL to redirect in case of error.\nIf it is not a sandbox request needs to be https.",
          "format": "uri"
        }
      },
      "additionalProperties": false,
      "description": "Specifies the different urls to callback to."
    },
    "Frequency": {
      "type": "object",
      "properties": {
        "observed": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        },
        "total": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32"
        }
      },
      "additionalProperties": false
    },
    "MessageTransportProperties": {
      "type": "object",
      "properties": {
        "messageLevelEncryption": {
          "type": [
            "string",
            "null"
          ]
        },
        "requireHsmSigning": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "Nin": {
      "type": "object",
      "properties": {
        "value": {
          "type": [
            "string",
            "null"
          ]
        },
        "issuingCountry": {
          "type": [
            "string",
            "null"
          ]
        },
        "type": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "PaymentAttribute": {
      "type": "object",
      "properties": {
        "name": {
          "type": [
            "string",
            "null"
          ]
        },
        "value": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "PaymentItem": {
      "type": "object",
      "properties": {
        "reference": {
          "type": [
            "string",
            "null"
          ]
        },
        "amount": {
          "type": [
            "string",
            "null"
          ]
        },
        "currency": {
          "type": [
            "string",
            "null"
          ]
        },
        "receiver": {
          "type": [
            "string",
            "null"
          ]
        },
        "attributes": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/PaymentAttribute"
          }
        }
      },
      "additionalProperties": false
    },
    "PaymentPrefillData": {
      "type": "object",
      "properties": {
        "reference": {
          "type": [
            "string",
            "null"
          ]
        },
        "payments": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/PaymentItem"
          }
        }
      },
      "additionalProperties": false
    },
    "RiskData": {
      "type": "object",
      "properties": {
        "facts": {
          "type": [
            "array",
            "null"
          ],
          "items": {
            "$ref": "#/$defs/RiskFacts"
          }
        },
        "thirdPartyEvaluation": {
          "$ref": "#/$defs/RiskEvaluation"
        },
        "selfEvaluation": {
          "$ref": "#/$defs/RiskEvaluation"
        }
      },
      "additionalProperties": false
    },
    "RiskEvaluation": {
      "type": "object",
      "properties": {
        "riskValue": {
          "type": [
            "string",
            "null"
          ]
        },
        "source": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "RiskFacts": {
      "type": "object",
      "properties": {
        "factType": {
          "type": [
            "string",
            "null"
          ]
        },
        "observedValue": {
          "nullable": true
        },
        "valueFrequency": {
          "$ref": "#/$defs/Frequency"
        },
        "source": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "SessionEnvironment": {
      "type": "object",
      "properties": {
        "ipAddress": {
          "type": [
            "string",
            "null"
          ],
          "description": "The IpAddress of the end user."
        },
        "userAgent": {
          "type": [
            "string",
            "null"
          ],
          "description": "The request user agent."
        }
      },
      "additionalProperties": false
    },
    "Subject": {
      "type": "object",
      "properties": {
        "id": {
          "type": [
            "string",
            "null"
          ],
          "description": "The identifier of the subject."
        },
        "idpId": {
          "type": [
            "string",
            "null"
          ],
          "description": "The idp identifier of the subject."
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "description": "The full name of the subject."
        },
        "firstName": {
          "type": [
            "string",
            "null"
          ],
          "description": "The first name of the subject."
        },
        "middleName": {
          "type": [
            "string",
            "null"
          ],
          "description": "The middle name of the subject."
        },
        "lastName": {
          "type": [
            "string",
            "null"
          ],
          "description": "The last name of the subject."
        },
        "dateOfBirth": {
          "type": [
            "string",
            "null"
          ],
          "description": "The date of birth of the subject."
        },
        "nin": {
          "$ref": "#/$defs/Nin"
        },
        "email": {
          "type": [
            "string",
            "null"
          ],
          "description": "The Email of the subject."
        },
        "attribute_1": {
          "description": "Example idp attribute"
        },
        "attribute_2": {
          "description": "Example idp attribute"
        }
      },
      "additionalProperties": false,
      "description": "The session's subject."
    }
  }
}