{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/daon/json-schema/daon-process-token-schema.json",
  "title": "ProcessToken",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/daon-process-tokens-api-openapi.yml#/components/schemas/ProcessToken",
  "type": "object",
  "properties": {
    "createdDtm": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "lastUpdatedDtm": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "createdBy": {
      "type": "string",
      "readOnly": true
    },
    "lastUpdatedBy": {
      "type": "string",
      "readOnly": true
    },
    "id": {
      "type": "string",
      "readOnly": true
    },
    "tenantId": {
      "type": "string",
      "readOnly": true
    },
    "name": {
      "type": "string",
      "maxLength": 50,
      "minLength": 0
    },
    "description": {
      "type": "string",
      "maxLength": 2000,
      "minLength": 0
    },
    "processDefnName": {
      "type": "string",
      "description": "Process Definition Name. When creating a process token either the Process Definition Tag or the Process Definition Name & Version should be supplied.",
      "maxLength": 50,
      "minLength": 0
    },
    "processDefnVersion": {
      "type": "integer",
      "format": "int32",
      "description": "Process Definition Version. When creating a process token either the Process Definition Tag or the Process Definition Name & Version should be supplied."
    },
    "processDefnTag": {
      "type": "string",
      "description": "Process Definition Tag. When creating a process token either the Process Definition Tag or the Process Definition Name & Version should be supplied. Using a tag is a more flexible approach - it allows a Process Token to be refer to a newer version of a Process Definition if the tag is moved from one version to another."
    },
    "uiUrl": {
      "type": "string",
      "maxLength": 500,
      "minLength": 0
    },
    "status": {
      "type": "string",
      "enum": [
        "ACTIVE",
        "INACTIVE"
      ]
    },
    "type": {
      "type": "string",
      "enum": [
        "UNLIMITED",
        "MULTI_USE_COUNT_LIMITED",
        "MULTI_USE_TIME_LIMITED"
      ]
    },
    "notBeforeDtm": {
      "type": "string",
      "format": "date-time"
    },
    "notAfterDtm": {
      "type": "string",
      "format": "date-time"
    },
    "maxCount": {
      "type": "integer",
      "format": "int32"
    },
    "counter": {
      "type": "integer",
      "format": "int32",
      "readOnly": true
    },
    "maxProcessDuration": {
      "type": "string",
      "deprecated": true,
      "description": "This field is deprecated and will be removed in future versions. Deprecated since Aug 2025."
    },
    "forTest": {
      "type": "boolean",
      "deprecated": true
    },
    "parameters": {
      "type": "object",
      "additionalProperties": {}
    },
    "processInstanceParameters": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ProcessInstanceParameterConstraint"
      }
    },
    "processInstanceInit": {
      "$ref": "#/$defs/ProcessInstanceInitParams"
    },
    "startProcessAddress": {
      "type": "string",
      "readOnly": true
    }
  },
  "required": [
    "name",
    "status",
    "type"
  ],
  "$defs": {
    "DocumentUpload": {
      "type": "object",
      "properties": {
        "documentFormat": {
          "type": "string",
          "description": "Document Format",
          "enum": [
            "PDF"
          ],
          "minLength": 1,
          "readOnly": true
        },
        "documentCaptureKey": {
          "type": "string",
          "description": "The document capture key",
          "readOnly": true
        },
        "pageCaptureKey": {
          "type": "string",
          "description": "The document page capture key",
          "readOnly": true
        },
        "uploadUrl": {
          "type": "string",
          "description": "The location to which the document should be uploaded",
          "readOnly": true
        },
        "uploadHeaders": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "The upload headers that must be set when uploading the document",
          "readOnly": true
        }
      },
      "required": [
        "documentFormat"
      ]
    },
    "ExternalSources": {
      "type": "object",
      "properties": {
        "faceUploads": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/Upload"
          },
          "description": "External Face Uploads. This is a map based on a face key and the upload.",
          "readOnly": true
        },
        "documentUploads": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/DocumentUpload"
          },
          "description": "External Document Uploads. This is a map based on a doc key and the upload.",
          "readOnly": true
        }
      }
    },
    "ProcessInstanceInitParams": {
      "type": "object",
      "properties": {
        "externalSources": {
          "$ref": "#/$defs/ExternalSources"
        }
      }
    },
    "ProcessInstanceParameterConstraint": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1
        },
        "mandatory": {
          "type": "boolean"
        },
        "minimumLength": {
          "type": "integer",
          "format": "int32"
        },
        "maximumLength": {
          "type": "integer",
          "format": "int32"
        },
        "pattern": {
          "type": "string"
        },
        "default": {
          "type": "string",
          "description": "Default value for the parameter (currently only string values are supported)"
        }
      },
      "required": [
        "name"
      ]
    },
    "Upload": {
      "type": "object",
      "properties": {
        "imageFormat": {
          "type": "string",
          "description": "Image Format",
          "enum": [
            "JPEG"
          ],
          "minLength": 1,
          "readOnly": true
        },
        "captureKey": {
          "type": "string",
          "description": "The image capture key",
          "readOnly": true
        },
        "uploadUrl": {
          "type": "string",
          "description": "The location to which the face image should be uploaded",
          "readOnly": true
        },
        "uploadHeaders": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "The upload headers that must be set when uploading the images",
          "readOnly": true
        }
      },
      "required": [
        "imageFormat"
      ]
    }
  }
}