> ## Documentation Index
> Fetch the complete documentation index at: https://developers.gonitro.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Create package

> Creates a package and, optionally, everything it contains in a single request.

A package is the central object in NSEV: a container for one or more
documents that are sent for signing, together with the stakeholders and actors
who act on them.

There are two ways to create a package:

- **Build it up incrementally.** In its simplest form this call needs only the
  package `Name` and the `Initiator`. The package is created empty (status
  `Draft`) and you add documents, elements, stakeholders, actors and process
  steps afterwards with their respective calls.
- **Super call.** Define every object in one request, mimicking the "Instant
  Package" behaviour of API v3: create the package, add documents, elements,
  stakeholders, actors and the process all at once. (Not applicable when
  creating from a template.)

When building a super call with multiple documents, you have not yet received
the document IDs, so elements reference their target document by position
using `DocumentIndex` (0 = first document in the call, 1 = second, and so on).

**Creating from a template.** Pass a `TemplateCode` to create a package that
is pre-populated from a saved template. When a template code is used, the only
other mandatory parameter is `Initiator`; `Name`, `ExternalReference` and
`ProofCorrelationId` are optional, and all other package settings are taken
from the template (any values you pass for them are overwritten by the
template).

**Size limitations**

- A package must not exceed 150 MB.
- A package must not contain more than 15 documents, and each document must
  not exceed 30 MB.
- An `.xml` file must not contain more than 2 million characters, and a
  package must not contain more than 15 `.xml` files.
- Large files may affect signing performance depending on the signer's
  internet connection.

API requests never trigger a callback; callbacks fire only on end-user
actions in the Portal or Signer application.



## OpenAPI

````yaml /nsev/api-reference/openapi.yaml post /packages
openapi: 3.0.0
info:
  title: NSEV WebPortal API
  version: 4.0.0
  contact:
    name: NSEV Support Team
    url: https://connectivegroup.my.site.com/s/contactsupport?language=en_US
  description: >
    **Nitro Sign Enterprise Verified (NSEV) WebPortal API Version 4**


    A comprehensive digital signing API that enables secure document signing
    workflows.

    This API provides endpoints for managing packages, documents, elements,
    stakeholders, 

    and signing processes within the NSEV platform.


    ## Authentication


    This API supports multiple authentication methods:


    ### Basic Authentication

    Traditional HTTP Basic Authentication using username and password.


    ### OAuth 2.0


    **Client Credentials Flow (Machine-to-Machine)**

    - Full API access including administrative endpoints

    - Ideal for server-to-server integrations


    **Authorization Code Flow (User-based)**

    - Limited API access excluding administrative endpoints

    - Ideal for user-facing applications

    - Supports delegated user access scenarios


    ## API Variants


    This specification is available in two variants:

    - **Full API**: Complete API with all endpoints (BasicAuth + OAuth2 M2M)

    - **User API**: Limited API excluding admin endpoints (OAuth2 user-based
    only)


    Administrative endpoints (`/poisonqueue`, `/absenceperiods`, `/auditproofs`)
    are 

    restricted to machine-to-machine authentication only.
        
    ## Versioning


    This API follows semantic versioning principles. Major version changes may
    introduce

    breaking changes, while minor and patch versions maintain backwards
    compatibility.
servers:
  - url: '{baseUrl}/esig/webportalapi/v4'
    variables:
      baseUrl:
        default: https://your-tenant.sign.gonitro.com
        description: >-
          Your tenant-specific base URL, including scheme and host (e.g.
          https://acme.sign.gonitro.com). Each NSEV customer has a unique URL.
          Replace this with yours before sending a request. The esig path
          segment is required - the Web Application Firewall routes requests on
          it.
security:
  - basicAuth: []
  - bearerAuth: []
tags:
  - name: Configuration
    description: |
      Endpoints for retrieving system configuration settings,
      contact groups, templates and signing methods.
  - name: Packages
    description: |
      Core endpoints for creating, managing, and tracking packages
      throughout their lifecycle.
  - name: Documents
    description: |
      Endpoints for adding, removing, and managing documents within packages.
      Handles document upload, processing, and metadata management.
  - name: Elements
    description: |
      Endpoints for managing elements (fields) within documents,
      including signatures and other form elements.
  - name: Stakeholders
    description: |
      Endpoints for managing stakeholders (recipients)
      associated with packages and their roles in the package workflow.
  - name: Actors
    description: |
      Endpoints for managing individual actors within stakeholders,
      including their contact information and role preferences:
      Approver, FormFiller, Signer or Receiver
  - name: Process
    description: |
      Endpoints for managing the package process workflow, including
      process steps, parallel actions, and workflow orchestration.
  - name: AuditTrails
    description: |
      Modern endpoints for retrieving comprehensive audit trails as signed PDFs,
      verifying the integrity of audit trail data and retrieving audit events.
  - name: BulkActions
    description: |
      Endpoints for performing and managing bulk actions on multiple packages.
  - name: Users
    description: |
      Endpoints for managing user accounts, including user invitations.
  - name: AbsencePeriods
    description: |
      Administrative endpoints for managing user absence periods and
      delegation settings during out-of-office scenarios.

      **Access Level**: Machine-to-machine only (administrative access required)
paths:
  /packages:
    post:
      tags:
        - Packages
      summary: Create package
      description: >-
        Creates a package and, optionally, everything it contains in a single
        request.


        A package is the central object in NSEV: a container for one or more

        documents that are sent for signing, together with the stakeholders and
        actors

        who act on them.


        There are two ways to create a package:


        - **Build it up incrementally.** In its simplest form this call needs
        only the
          package `Name` and the `Initiator`. The package is created empty (status
          `Draft`) and you add documents, elements, stakeholders, actors and process
          steps afterwards with their respective calls.
        - **Super call.** Define every object in one request, mimicking the
        "Instant
          Package" behaviour of API v3: create the package, add documents, elements,
          stakeholders, actors and the process all at once. (Not applicable when
          creating from a template.)

        When building a super call with multiple documents, you have not yet
        received

        the document IDs, so elements reference their target document by
        position

        using `DocumentIndex` (0 = first document in the call, 1 = second, and
        so on).


        **Creating from a template.** Pass a `TemplateCode` to create a package
        that

        is pre-populated from a saved template. When a template code is used,
        the only

        other mandatory parameter is `Initiator`; `Name`, `ExternalReference`
        and

        `ProofCorrelationId` are optional, and all other package settings are
        taken

        from the template (any values you pass for them are overwritten by the

        template).


        **Size limitations**


        - A package must not exceed 150 MB.

        - A package must not contain more than 15 documents, and each document
        must
          not exceed 30 MB.
        - An `.xml` file must not contain more than 2 million characters, and a
          package must not contain more than 15 `.xml` files.
        - Large files may affect signing performance depending on the signer's
          internet connection.

        API requests never trigger a callback; callbacks fire only on end-user

        actions in the Portal or Signer application.
      operationId: createPackage
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreatePackage'
            examples:
              minimal:
                summary: Minimal package (name + initiator)
                value:
                  Name: My first package
                  Initiator: hello@world.test
              super-call:
                summary: >-
                  Super call - package, documents, stakeholders, actors and
                  elements in one request
                value:
                  Name: <string>
                  Initiator: <email>
                  Status: pending
                  ExpiryDate: <date-time>
                  DefaultLegalNotice:
                    Name: <string>
                  Documents:
                    - Name: <string>
                      Language: en
                      ExternalReference: <string>
                      DocumentOptions:
                        TargetType: application/pdf
                        PdfOptions:
                          TargetFormat: pdfa1a
                        Base64data: <string>
                        ContentType: application/pdf
                  Stakeholders:
                    - Type: person
                      Language: en
                      FirstName: <string>
                      LastName: <string>
                      EmailAddress: <email>
                      BirthDate: <date>
                      PhoneNumber: <string>
                      AdditionalProperties:
                        BeId: <string>
                        BeLawyer: <string>
                      Actors:
                        - Type: signer
                          ProcessStep: 0
                          Elements:
                            - Type: signingField
                              DocumentIndex: 0
                              signingMethods:
                                - name: Manual:handwritten
                                  keypair: <string>
                              Location:
                                Page: 2
                                Top: 200
                                Left: 200
                              Dimensions:
                                Width: 200
                                Height: 200
                    - Type: group
                      GroupName: <string>
                      Members:
                        - Language: en
                          FirstName: <string>
                          LastName: <string>
                          EmailAddress: <email>
                          BirthDate: <date>
                        - Language: en
                          FirstName: <string>
                          LastName: <string>
                          EmailAddress: <email>
                          BirthDate: <date>
                      Actors:
                        - Type: signer
                          ProcessStep: 1
                          Elements:
                            - Type: signingField
                              DocumentIndex: 1
                              signingMethods:
                                - name: Manual:handwritten
                                  keypair: <string>
                              Location:
                                Page: 2
                                Top: 200
                                Left: 200
                              Dimensions:
                                Width: 200
                                Height: 200
                  ThemeCode: string
                  CallBackUrl: https://callback.test
                  NotificationCallBackUrl: https://notifications.test
                  DefaultRedirectUrl: <string>
                  F2fRedirectUrl: <string>
                  IsUnsignedContentDownloadable: true
                  IsReassignEnabled: false
                  ExternalReference: myFirstPackage
                  ActionUrlExpirationPeriodInDays: 7
                  ProofCorrelationId: <string>
                  AddInitiatorAsReceiver: false
                  MustBeArchived: true
                  ArchiveAuditProofs: false
                  ArchiveAuditTrail: false
                  AutomaticReminder:
                    IsSendAutomaticRemindersEnabled: true
                    DaysBeforeFirstReminder: 2
                    IsRepeatRemindersEnabled: true
                    RepeatReminders: 3
                  ExpirationReminder:
                    IsSendExpirationRemindersEnabled: true
                    DaysBeforeExpirationReminder: 2
                  OtpAuthenticationSetting:
                    IsSmsOtpAuthenticationEnabled: false
                    IsMailOtpAuthenticationEnabled: true
              from-template:
                summary: Create package from a template
                value:
                  Name: <string>
                  Initiator: <email>
                  TemplateCode: <string>
                  ExternalReference: <string>
                  SingleMarkerMatchPerElement: <boolean>
      responses:
        '201':
          $ref: '#/components/responses/PackageCreated'
        '400':
          $ref: '#/components/responses/ValidationFailed'
        '401':
          $ref: '#/components/responses/UnAuthorized'
        '409':
          description: The package could not be created.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Error'
components:
  schemas:
    CreatePackage:
      oneOf:
        - type: object
          title: Create package
          description: Request for creating a package
          additionalProperties: false
          required:
            - Name
            - Initiator
          properties:
            Name:
              $ref: '#/components/schemas/Package.Name'
            Initiator:
              $ref: '#/components/schemas/Package.Initiator'
            Status:
              type: string
              description: >-
                Status the package will have once created. By default a package
                is created

                in `Draft`. Set `Pending` to send it for signing immediately.
              default: Draft
              enum:
                - Draft
                - Pending
            DocumentGroupCode:
              $ref: '#/components/schemas/Package.DocumentGroupCode'
            ExpiryDate:
              allOf:
                - $ref: '#/components/schemas/ExpiryDate'
                - description: >-
                    Date and time when the package (and every document in it)
                    expires and

                    can no longer be form filled, approved or signed. ISO 8601
                    date-time.
            Documents:
              type: array
              items:
                $ref: '#/components/schemas/CreateDocumentWithBase64Document'
            Stakeholders:
              type: array
              items:
                $ref: '#/components/schemas/CreatePackage.Stakeholder'
            DefaultLegalNotice:
              allOf:
                - $ref: '#/components/schemas/CreateLegalNotice'
                - type: object
                  description: >-
                    The default legal notice that will be added to a signer when
                    none was specified
            ThemeCode:
              type: string
              description: >-
                Theme code applied to the package's look and feel. When omitted,
                the theme

                configured at environment level in the Config Index - or at
                document-group

                level if applicable - is used.
            CallBackUrl:
              type: string
              format: url
              description: >-
                Absolute URL, without query parameters, that NSEV calls with an

                HTTP POST whenever the package's status changes, so an external
                system can

                react. Callbacks fire on end-user actions such as: a user
                changing the

                package from Draft to Pending or revoking it in the Document
                Portal,

                confirming in a drag-and-drop editor, a signer completing all
                their fields

                or rejecting, all signers signing, an approver approving, form
                fillers

                completing fields, or the system setting the package to Failed.
                API

                requests never trigger a callback.


                The POST body is `application/json` containing `packageId` and

                `packageStatus`, e.g.

                `{"packageId":"d2912916-c555-47af-b666-1e8cf2eb9dfa","packageStatus":"Finished"}`.

                If the external system needs more information it can issue a Get
                package by

                ID call. The callback has a 100-second timeout: if your service
                does not

                respond in time, NSEV forces the timeout and finishes the flow
                as if

                it had received `200 OK`, so respond as quickly as possible and
                run any

                follow-up work asynchronously. On error, NSEV retries the
                callback

                3 times over 3 retry cycles by default (configurable by
                administrators).
            NotificationCallBackUrl:
              type: string
              format: url
              description: >-
                URL called each time a signer requests a new signing URL. NSEV
                uses

                one-time signing URLs, so a link expires once clicked and a new
                one must be

                requested; when set, this URL lets a remote service decide what
                to do

                instead of sending the usual email.


                The remote service is called once per user action (no retry
                unless the end

                user requests another notification) with an `application/json`
                POST body

                containing `packageId`, `actorId`, `language` and
                `notificationTypeKey`.

                Current `notificationTypeKey` values are `SendActionUrl` (the
                single-use

                action link was already used and a new one was requested) and

                `SendDownloadUrl` (the single-use download link was already used
                and a new

                one was requested); ignore other values without erroring, as the
                list may

                grow. NSEV waits for the service to finish before returning
                control

                to the end user, so it must respond within seconds. This is
                separate from

                `SuppressNotifications`. On error, NSEV retries 3 times over 3
                retry

                cycles by default.
            DefaultRedirectUrl:
              type: string
              format: url
              description: >
                Default url to which stakeholders will be redirected after
                completing their actions.

                Set on package submit, when actor has no RedirectUrl.
            F2fRedirectUrl:
              type: string
              format: url
              description: >-
                Absolute URL, without query parameters, that the end user is
                redirected to

                after signing or rejecting all fields face to face in the
                Document Portal.

                Do not confuse this with a regular redirect URL - it applies
                only to

                face-to-face signing.


                NSEV appends `SessionID` (the package signing session, i.e. the

                package ID), `Status` (`FINISHED`, `REJECTED` or `INVALIDTOKEN`)
                and

                `PackageExternalReference` (the package's `ExternalReference`).
                Because the

                redirect happens client-side the end user can counterfeit it, so
                verify the

                outcome through a second secure channel (the callback URL) or by
                checking

                session state, then confirm with a Get package status call.


                During asynchronous signing, configuring an F2fRedirectUrl
                removes the

                Close button (which would otherwise let the signer leave while
                signing

                continues in the background); signers instead see a message that
                they will

                be redirected.
            IsUnsignedContentDownloadable:
              type: boolean
              nullable: true
              description: >-
                Whether an actor can download the package from the WYSIWYS (What
                You See Is

                What You Sign) page before form filling, approving, signing or
                rejecting -

                for example to print and read it on paper. When omitted, the
                value of the

                Config Index setting `IsDownloadUnsignedFilesEnabled`
                (Customization

                Settings) is used.
            IsReassignEnabled:
              type: boolean
              nullable: true
              description: >-
                Whether a stakeholder may reassign their action to another
                party. When

                omitted, the value of the Config Index setting
                `IsReassignEnabled`

                (Customization Settings) is used.
            ExternalReference:
              $ref: '#/components/schemas/ExternalReference'
            ActionUrlExpirationPeriodInDays:
              type: integer
              nullable: true
              minimum: 1
              description: >-
                Number of days after which unused action URLs expire. When
                omitted, the

                value is taken from the Config Index setting
                `IsActionUrlExpirationEnabled`

                (Customization Settings). The maximum equals the number of days
                left until

                9999-12-31.
            ProofCorrelationId:
              $ref: '#/components/schemas/ProofCorrelationId'
            AddInitiatorAsReceiver:
              type: boolean
              nullable: true
              description: >-
                Whether the initiator is added as a receiver of the package
                automatically,

                so you do not have to add them with a Create actor call.
                Overrides the environment-level

                `IsAddInitiatorAsReceiverEnabled` setting; when that setting is
                already

                true, every initiator is added as receiver and passing this is
                unnecessary.
            MustBeArchived:
              type: boolean
              nullable: true
              description: >-
                Whether the package is sent to the external archive when it
                reaches the

                Finished status. Ignored when archiving

                is not configured at environment level; when archiving is
                configured, every

                package is archived by default, so passing this is unnecessary.
            ArchiveAuditProofs:
              type: boolean
              nullable: true
              description: >-
                Whether the audit proofs are sent to the external archive when
                the package

                is Finished. Ignored when archiving is

                not configured or audit proofs are disabled in the audit tools
                or archive

                settings.
            ArchiveAuditTrail:
              type: boolean
              nullable: true
              description: >-
                Whether the audit trail is sent to the external archive when the
                package is

                Finished. Ignored when archiving is not

                configured or the audit trail is disabled in the audit tools or
                archive

                settings.
            AutomaticReminder:
              $ref: '#/components/schemas/ExternalApiPackageAutomaticReminder'
            ExpirationReminder:
              $ref: '#/components/schemas/ExternalApiPackageExpirationReminder'
            OtpAuthenticationSetting:
              $ref: '#/components/schemas/ExternalOtpAuthenticationSetting'
        - type: object
          title: Create package from template
          description: Request for creating a package from the templates
          additionalProperties: false
          properties:
            Name:
              $ref: '#/components/schemas/Package.Name'
            Initiator:
              $ref: '#/components/schemas/Package.Initiator'
            TemplateCode:
              $ref: '#/components/schemas/Package.TemplateCode'
            ExternalReference:
              $ref: '#/components/schemas/ExternalReference'
            ProofCorrelationId:
              $ref: '#/components/schemas/ProofCorrelationId'
            SingleMarkerMatchPerElement:
              type: boolean
              nullable: true
              description: >
                Controls the lifecycle of unplaced elements identified by
                document markers. Defaults to 'false'.
                  - 'false' (or 'null'): Allows an element definition to be matched by markers in multiple documents; cleanup of remaining unplaced elements is deferred.
                  - 'true': Each element definition can only be matched by one marker during document confirmation; the definition is removed after being placed.
      example:
        Name: example pending package
        Initiator: hello@world.test
        Status: pending
        ExpiryDate: '2020-01-17T12:33:47.923Z'
        DefaultLegalNotice:
          Name: LegalNotice1
        Documents:
          - Name: my first document
            Language: en
            ExternalReference: doc0
            DocumentOptions:
              TargetType: application/pdf
              PdfOptions:
                TargetFormat: pdfa1a
              Base64data: string
              ContentType: application/pdf
          - Name: my second document
            Language: en
            ExternalReference: doc1
            DocumentOptions:
              TargetType: application/pdf
              Base64data: string
              ContentType: application/pdf
        Stakeholders:
          - Type: person
            Language: en
            FirstName: John
            LastName: Doe
            EmailAddress: john@doe.test
            BirthDate: '1990-01-16'
            PhoneNumber: +32xxxxxxxxx
            AdditionalProperties:
              BeId: '12345678900'
              BeLawyer: b459d74c-1f90-4d63-9f4a-6de9cead8c5e
            Actors:
              - Type: signer
                ProcessStep: 0
                Elements:
                  - Type: signingField
                    DocumentIndex: 0
                    Location:
                      Page: 2
                      Top: 200
                      Left: 200
                    Dimensions:
                      Width: 200
                      Height: 200
                    SigningMethods:
                      - Manual:Handwritten
                      - Name: SMSCode:SmsOtp
                        KeyPair: Custom keypair
          - Type: group
            GroupName: Great mates
            Members:
              - Language: en
                FirstName: John
                LastName: Doe
                EmailAddress: john@doe.test
                BirthDate: '1990-01-16'
              - Language: en
                FirstName: Zu
                LastName: Li
                EmailAddress: zu@li.test
                BirthDate: '1991-03-14'
            Actors:
              - Type: signer
                ProcessStep: 1
                Elements:
                  - Type: signingField
                    DocumentIndex: 1
                    Location:
                      Page: 2
                      Top: 200
                      Left: 200
                    Dimensions:
                      Width: 200
                      Height: 200
        ThemeCode: string
        CallBackUrl: https://callback.test
        NotificationCallBackUrl: https://notifications.test
        IsUnsignedContentDownloadable: true
        ExternalReference: myFirstPackage
        MustBeArchived: true
        ArchiveAuditProofs: false
        ArchiveAuditTrail: false
        AutomaticReminder:
          IsSendAutomaticRemindersEnabled: true
          DaysBeforeFirstReminder: 5
          IsRepeatRemindersEnabled: true
          RepeatReminders: 5
        ExpirationReminder:
          IsSendExpirationRemindersEnabled: true
          DaysBeforeExpirationReminder: 5
        OtpAuthenticationSetting:
          IsSmsOtpAuthenticationEnabled: false
          IsMailOtpAuthenticationEnabled: false
    Error:
      title: Error
      type: object
      description: Something that went wrong
      example:
        ErrorCode: Something.WentWrong
        ErrorMessage: Something went wrong
      properties:
        ErrorCode:
          type: string
          description: >-
            An error code of something that went wrong, in the form of
            'Subject.Error:value'
        ErrorMessage:
          type: string
          description: A human-readable explanation of what went wrong
    Package.Name:
      type: string
      description: >-
        Name of the package. It is shown in the NSEV WebPortal and used as the

        file name when the package is downloaded as a `.zip` file, so do not add
        a file

        extension.


        Avoid forbidden file-name characters - slash (`/`), backslash (`\`),
        question

        mark (`?`), percent (`%`), asterisk (`*`), colon (`:`), pipe (`|`),
        single

        quote, double quote (`"`), less-than (`<`) and greater-than (`>`) - and

        HTML-sensitive characters such as ampersand (`&`) and apostrophe. This
        list is

        not exhaustive. When using itsme signing, use only characters supported
        by

        ISO 8859-15; some software-generated characters such as curly
        apostrophes and

        long dashes are not supported.
      nullable: false
      minLength: 1
      maxLength: 150
      example: example package
    Package.Initiator:
      allOf:
        - $ref: '#/components/schemas/EmailAddress'
        - description: Email address of a known user of the webSigner portal
    Package.DocumentGroupCode:
      type: string
      description: >-
        Identifier of the document group the package is uploaded to. By default
        an

        initiator uploads to their personal "My Documents" folder, which cannot
        be

        shared. An NSEV admin can configure additional document groups so users

        can collaborate on each other's packages. To use "My Documents", omit
        this

        parameter or pass `00001`; to use a specific group, pass its document
        group

        code. Use the Get document groups call to discover the configured codes.
    ExpiryDate:
      type: string
      format: date-time
      description: When the resource will expire
    CreateDocumentWithBase64Document:
      allOf:
        - $ref: '#/components/schemas/CreateDocument'
        - type: object
          required:
            - DocumentOptions
          properties:
            DocumentOptions:
              allOf:
                - $ref: '#/components/schemas/CreateDocument.DocumentOptions'
                - $ref: '#/components/schemas/CreateDocument.Base64Document'
                - required:
                    - ContentType
                  properties:
                    ContentType:
                      allOf:
                        - $ref: '#/components/schemas/MediaType'
                        - enum:
                            - application/pdf
                            - application/xml
                            - application/msword
                            - >-
                              application/vnd.openxmlformats-officedocument.wordprocessingml.document
                            - text/plain
            RepresentationOptions:
              allOf:
                - $ref: '#/components/schemas/CreateDocument.Base64Document'
                - required:
                    - ContentType
                  properties:
                    ContentType:
                      allOf:
                        - $ref: '#/components/schemas/MediaType'
                        - enum:
                            - application/pdf
    CreatePackage.Stakeholder:
      allOf:
        - oneOf:
            - $ref: '#/components/schemas/CreatePersonStakeholder'
            - $ref: '#/components/schemas/CreateGroupStakeholder'
            - $ref: '#/components/schemas/CreateContactGroupStakeholder'
          discriminator:
            propertyName: Type
            mapping:
              Person:
                $ref: '#/components/schemas/CreatePersonStakeholder'
              Group:
                $ref: '#/components/schemas/CreateGroupStakeholder'
              ContactGroup:
                $ref: '#/components/schemas/CreateContactGroupStakeholder'
        - properties:
            actors:
              type: array
              description: The actions to be performed ( a list of actors )
              items:
                $ref: '#/components/schemas/CreatePackage.Actor'
    CreateLegalNotice:
      oneOf:
        - $ref: '#/components/schemas/LegalNotice'
        - type: object
          title: Named legal notice from Config Index
          properties:
            Name:
              description: >-
                The name of a legal notice configured in the Config Index (for
                example `LegalNotice1`),

                whose text is also set there. The language the notice is
                displayed in depends on the

                language of the document. Use either `Name` or `Text`, not both.
              type: string
              maxLength: 20
              example: LegalNotice1
    ExternalReference:
      type: string
      maxLength: 256
      description: >-
        External reference to this resource set by the calling application. NSEV

        does not use this value itself. When filtering packages, this matches
        the

        package-level external reference only, not document or field references.
    ProofCorrelationId:
      type: string
      deprecated: true
      description: Id for correlating with other resources in the proofs system
    ExternalApiPackageAutomaticReminder:
      description: >-
        Contains information about automatic reminder settings for the package
        which will be created. Please note that values are taken from
        configuration defaults for the response, if object is empty.
      properties:
        IsSendAutomaticRemindersEnabled:
          type: boolean
          nullable: true
        DaysBeforeFirstReminder:
          type: integer
          nullable: true
          minimum: 1
        IsRepeatRemindersEnabled:
          type: boolean
          nullable: true
        RepeatReminders:
          type: integer
          nullable: true
          minimum: 1
    ExternalApiPackageExpirationReminder:
      description: >-
        Contains information about expiration reminder settings for the package
        which will be created. Please note that values are taken from
        configuration defaults for the response, if object is empty.
      properties:
        IsSendExpirationRemindersEnabled:
          type: boolean
          nullable: true
        DaysBeforeExpirationReminder:
          type: integer
          nullable: true
          minimum: 1
    ExternalOtpAuthenticationSetting:
      description: Contains settings for the package OTP authentication
      properties:
        IsSmsOtpAuthenticationEnabled:
          type: boolean
          nullable: true
        IsMailOtpAuthenticationEnabled:
          type: boolean
          nullable: true
    Package.TemplateCode:
      type: string
      description: >-
        Identifier of the template the package is created from. The package
        inherits

        everything defined in the template; you can still add or change
        information

        with additional API calls. When a template code is used, the only other

        mandatory parameter is `Initiator`; `Name`, `ExternalReference` and

        `ProofCorrelationId` are optional and all other settings are taken from
        the

        template.
    PackageCreatedSync:
      type: object
      description: Response model for a created package
      additionalProperties: false
      properties:
        Id:
          $ref: '#/components/schemas/Package.Id'
        Name:
          $ref: '#/components/schemas/Package.Name'
        Status:
          $ref: '#/components/schemas/Package.Status'
        CreationDate:
          $ref: '#/components/schemas/CreationDate'
        ExpiryDate:
          $ref: '#/components/schemas/ExpiryDate'
        RevocationDate:
          $ref: '#/components/schemas/RevocationDate'
        Initiator:
          $ref: '#/components/schemas/Package.Initiator'
        UnplacedElements:
          type: array
          description: This package's elements that aren't placed aynywhere yet
          items:
            $ref: '#/components/schemas/Element'
        Documents:
          type: array
          description: This package's documents
          items:
            $ref: '#/components/schemas/DocumentCreatedSync'
        Stakeholders:
          type: array
          description: This package's stakeholders
          items:
            $ref: '#/components/schemas/Stakeholder'
        DefaultLegalNotice:
          allOf:
            - $ref: '#/components/schemas/LegalNotice'
            - type: object
              description: The default legal notice that will be added to a signing field
        ExternalReference:
          $ref: '#/components/schemas/ExternalReference'
        DocumentGroupCode:
          $ref: '#/components/schemas/Package.DocumentGroupCode'
        ThemeCode:
          type: string
          description: identifier of the theme this package has
        CallBackUrl:
          type: string
          format: url
          description: >-
            url that will be called each time a signature has been put on the
            document
        NotificationCallBackUrl:
          type: string
          format: url
          description: url that will be called when the signer requests a new signing url
        F2fSigningUrl:
          type: string
          format: url
          description: >-
            Link to the package which allows to start a face to face signing
            session
        PreviewUrl:
          type: string
          format: url
          description: Link to the package which allows only a preview of documents
        DefaultRedirectUrl:
          type: string
          format: url
          description: >
            Default url to which stakeholders will be redirected after
            completing their actions.

            Set on package submit, when actor has no RedirectUrl.
        F2fRedirectUrl:
          type: string
          format: url
          description: >
            Url to which the end user is redirected after all fields have been
            signed with ‘face to face’ signing.
        IsUnsignedContentDownloadable:
          type: boolean
          description: >
            Whether a signer can download the unsigned content of this package
            or not

            Default when not specified is taken from config ( Customization
            Settings > IsDownloadUnsignedFilesEnabled )
        IsReassignEnabled:
          type: boolean
          description: >
            Whether a stakeholder can reassign his/her action ( actor ) to
            another party.  

            Default when not specified is taken from config ( Customization
            Settings > IsReassignEnabled )
        ActionUrlExpirationPeriodInDays:
          type: integer
          nullable: true
          minimum: 1
          description: >
            This parameter determines after how many days the action URLs must
            expire when they are not used.

            When no value is entered, this parameter takes its value from the
            Config Index setting IsActionUrlExpirationEnabled

            under Customization Settings. 

            The maximum value equals the number of days left until 9999-12-31.
        ProofCorrelationId:
          $ref: '#/components/schemas/ProofCorrelationId'
        AddInitiatorAsReceiver:
          type: boolean
          nullable: true
          description: >
            If true, adds the initiator as a receiver on submit.   This property
            is only available on draft packages.
        MustBeArchived:
          type: boolean
          nullable: false
          description: >-
            If true, the package will be sent to the external archive when
            status is FINISHED.
        ArchiveAuditProofs:
          type: boolean
          nullable: false
          description: >-
            If true, the audit proofs will be sent to the external archive when
            package status is FINISHED.
        ArchiveAuditTrail:
          type: boolean
          nullable: false
          description: >-
            If true, the audit trail will be sent to the external archive when
            package status is FINISHED.
        Warnings:
          type: array
          items:
            $ref: '#/components/schemas/Warning'
        AutomaticReminder:
          $ref: '#/components/schemas/AutomaticReminder'
        ExpirationReminder:
          $ref: '#/components/schemas/ExpirationReminder'
        OtpAuthenticationSetting:
          $ref: '#/components/schemas/OtpAuthenticationSetting'
    Warning:
      oneOf:
        - $ref: '#/components/schemas/ProcessWarning'
        - $ref: '#/components/schemas/PackageWarning'
        - $ref: '#/components/schemas/DocumentWarning'
      discriminator:
        propertyName: ResourceType
        mapping:
          process:
            $ref: '#/components/schemas/ProcessWarning'
          package:
            $ref: '#/components/schemas/PackageWarning'
          document:
            $ref: '#/components/schemas/DocumentWarning'
    ValidationError:
      title: Validation error
      allOf:
        - $ref: '#/components/schemas/Error'
        - description: Request failed validation
          example:
            ErrorCode: Name.MinimumLength:6
            ErrorMessage: The minimum length for a name is 6
    EmailAddress:
      title: Email address
      type: string
      format: email
      example: hello@world.test
    CreateDocument:
      type: object
      description: Parameters for creating a document
      additionalProperties: false
      required:
        - Name
        - Language
      properties:
        Name:
          type: string
          description: >-
            Name of the document, displayed in the WebPortal. Do not include a
            file extension.

            The name must not contain special characters such as slash,
            backslash, question

            mark, percent, asterisk, colon, pipe, single quote, double quote,
            less-than or

            greater-than. When itsme is used as a signing method, restrict the
            name to

            characters supported by ISO 8859-15; some software-generated
            characters such as

            curly apostrophes and long dashes are not supported.
          minLength: 1
          maxLength: 150
        Language:
          allOf:
            - $ref: '#/components/schemas/Language'
            - description: >-
                Language used in signature texts and in legal notices when an
                actor's

                LegalNoticeCode is set. Supported values: en, nl, de, fr, es,
                da, nb, sv, fi, lv,

                pl, hu, it, pt, ro.
        IsOptional:
          type: boolean
          default: false
          description: >-
            Determines whether the document is optional. Default value is false.
            When set to

            true, actors may choose not to form fill/sign the document.
        ExternalReference:
          $ref: '#/components/schemas/ExternalReference'
        Elements:
          type: array
          description: >-
            A list of elements (that aren't linked to an actor at once) on the
            created document
          items:
            $ref: '#/components/schemas/CreateElement'
        ProofCorrelationId:
          type: string
          deprecated: true
          description: >-
            Id for correlating this document with other resources in the proofs
            system
    CreateDocument.DocumentOptions:
      type: object
      allOf:
        - properties:
            TargetType:
              type: string
              description: >-
                The media type the document will be converted to. Only takes
                effect when the

                server is configured for document conversion.
              enum:
                - application/pdf
                - application/xml
            PdfOptions:
              type: object
              description: >-
                Optional PDF conversion and validation parameters. Only applies
                when the target

                type is application/pdf.
              properties:
                TargetFormat:
                  type: string
                  description: >-
                    The targetFormat defines if an extra conversion needs to be
                    done
                  enum:
                    - pdf
                    - pdfa1a
                    - pdfa2a
                  example: pdfa1a
                PdfErrorHandling:
                  type: string
                  description: How to deal with PDFs containing minor flaws
                  enum:
                    - Ignore
                    - DetectWarn
                    - DetectFail
                    - DetectFixWarn
                    - DetectFixFail
        - $ref: '#/components/schemas/DocumentActions'
    CreateDocument.Base64Document:
      type: object
      description: Contains a document's base64 data and media type
      additionalProperties: false
      required:
        - Base64data
      properties:
        Base64data:
          type: string
          description: Attached document
          format: base64
          nullable: false
          minLength: 1
          maxLength: 200000000
    MediaType:
      nullable: false
      type: string
      format: mediaType
      description: The media type of a file
      example: application/pdf
    CreatePersonStakeholder:
      title: Person stakeholder
      allOf:
        - $ref: '#/components/schemas/CreateStakeholderBase'
        - type: object
          required:
            - Language
            - LastName
            - EmailAddress
          properties:
            Type:
              enum:
                - Person
            Language:
              $ref: '#/components/schemas/Language'
            FirstName:
              $ref: '#/components/schemas/Stakeholder.FirstName'
            LastName:
              $ref: '#/components/schemas/Stakeholder.LastName'
            EmailAddress:
              $ref: '#/components/schemas/EmailAddress'
            BirthDate:
              type: string
              format: date
              description: >-
                Date of birth in YYYY-MM-DD format. Activating mandated signer
                validation in

                the configuration may make this parameter effectively required.
            PhoneNumber:
              $ref: '#/components/schemas/PhoneNumber'
            AdditionalProperties:
              $ref: '#/components/schemas/AdditionalProperties'
    CreateGroupStakeholder:
      title: Group stakeholder
      allOf:
        - $ref: '#/components/schemas/CreateStakeholderBase'
        - type: object
          additionalProperties: false
          description: Parameters for creating a group stakeholder
          required:
            - GroupName
            - Members
          properties:
            Type:
              enum:
                - Group
            GroupName:
              type: string
              maxLength: 128
              description: Name of the group.
            Members:
              type: array
              description: Members of the group
              items:
                $ref: '#/components/schemas/CreateGroupMember'
    CreateContactGroupStakeholder:
      title: Contact group stakeholder
      allOf:
        - $ref: '#/components/schemas/CreateStakeholderBase'
        - type: object
          description: Parameters for creating a contactGroup stakeholder
          required:
            - ContactGroupCode
          properties:
            Type:
              enum:
                - ContactGroup
            ContactGroupCode:
              type: string
              description: |-
                Code generated when the contact group was created in the NSEV
                WebPortal.
    CreatePackage.Actor:
      oneOf:
        - allOf:
            - $ref: '#/components/schemas/CreatePackage.ActorBase'
            - type: object
              title: Signer
              description: Signs one or more signing fields
              properties:
                Type:
                  enum:
                    - Signer
                Elements:
                  type: array
                  description: The actor's elements
                  items:
                    allOf:
                      - $ref: '#/components/schemas/CreateSigningField'
                      - title: New signing field on a document
                        properties:
                          DocumentIndex:
                            type: integer
                            minimum: 0
                            description: >-
                              this element will be placed on document with given
                              index in passed documents
                RedirectUrl:
                  type: string
                  format: url
                  description: >
                    Url to which the stakeholder is redirected after completing
                    this action
                RedirectType:
                  type: string
                  enum:
                    - AfterSession
                    - Immediately
                    - AfterDelay
                    - AfterCompletion
                  description: >
                    When stakeholder gets redirected after completing this
                    action
                      * AfterSession - Redirect after signing session is ended, but before package is completed (only important for last signer).
                      * Immediately - Redirect as soon as possible.
                      * AfterDelay - Redirect after some delay (defined on frontend).
                      * AfterCompletion - Redirect after the package is completed.

                    Only valid together with RedirectUrl - the API rejects
                    RedirectType without it.
                BackButtonUrl:
                  type: string
                  format: url
                  description: >-
                    URL to which the end user is sent after pressing close
                    session button
                  example: https://homepage.example.test
        - allOf:
            - $ref: '#/components/schemas/CreatePackage.ActorBase'
            - type: object
              title: Receiver
              description: Can download a copy of the fully signed document
              properties:
                Type:
                  enum:
                    - Receiver
        - allOf:
            - $ref: '#/components/schemas/CreatePackage.ActorBase'
            - type: object
              title: Approver
              description: Determines whether a document is fit for signing
              properties:
                Type:
                  enum:
                    - Approver
                RedirectUrl:
                  type: string
                  format: url
                  description: >
                    Url to which the stakeholder is redirected after completing
                    this action
                BackButtonUrl:
                  type: string
                  format: url
                  description: >-
                    URL to which the end user is sent after pressing close
                    session button
                  example: https://homepage.example.test
        - allOf:
            - $ref: '#/components/schemas/CreatePackage.ActorBase'
            - type: object
              title: Form filler
              description: Completes form fields on a document
              properties:
                Type:
                  enum:
                    - FormFiller
                Elements:
                  type: array
                  description: The actor's elements
                  items:
                    oneOf:
                      - allOf:
                          - $ref: '#/components/schemas/CreateCheckBoxField'
                          - title: New check box field on a document
                            properties:
                              DocumentIndex:
                                type: integer
                                minimum: 0
                                description: >-
                                  this element will be placed on document with
                                  given index in passed documents
                      - allOf:
                          - $ref: '#/components/schemas/CreateTextBoxField'
                          - title: New text box field on a document
                            properties:
                              DocumentIndex:
                                type: integer
                                minimum: 0
                                description: >-
                                  this element will be placed on document with
                                  given index in passed documents
                      - allOf:
                          - $ref: '#/components/schemas/CreateRadioGroup'
                          - title: New radio group on a document
                            properties:
                              DocumentIndex:
                                type: integer
                                minimum: 0
                                description: >-
                                  this element will be placed on document with
                                  given index in passed documents
                RedirectUrl:
                  type: string
                  format: url
                  description: >
                    Url to which the stakeholder is redirected after completing
                    this action
                RedirectType:
                  type: string
                  enum:
                    - AfterSession
                    - Immediately
                    - AfterDelay
                    - AfterCompletion
                  description: >
                    When stakeholder gets redirected after completing this
                    action
                      * afterSession - Redirect after signing session is ended, but before package is completed (only important for last signer).
                      * immediately - Redirect as soon as possible.
                      * afterDelay - Redirect after some delay (defined on frontend).
                      * afterCompletion - Redirect after the package is completed.

                    Only valid together with RedirectUrl - the API rejects
                    RedirectType without it.
                BackButtonUrl:
                  type: string
                  format: url
                  description: >-
                    URL to which the end user is sent after pressing close
                    session button
                  example: https://homepage.example.test
    LegalNotice:
      title: Custom legal notice text
      type: object
      properties:
        Text:
          description: >-
            A custom legal notice the signer must retype before placing their
            signature. Use this

            when the notice is not one of the named notices configured in the
            Config Index. Write

            it in the same language as the package's documents. Legal notices
            are case-sensitive.
          type: string
          maxLength: 1000
          example: Read and approved
    Package.Id:
      allOf:
        - $ref: '#/components/schemas/Guid'
        - type: string
          description: A package's unique identifier
    Package.Status:
      type: string
      description: The status of a package
      enum:
        - Draft
        - Pending
        - InProgress
        - Ending
        - Finished
        - Archived
        - Rejected
        - Revoked
        - Expired
        - Failed
        - Processing
        - ProcessingFailed
    CreationDate:
      type: string
      format: date-time
      description: When the resource was created
    RevocationDate:
      type: string
      format: date-time
      nullable: true
      description: >-
        Date and time in UTC when the package got revoked. Will only be present
        for packages that are revoked.
    Element:
      oneOf:
        - $ref: '#/components/schemas/SigningField'
        - $ref: '#/components/schemas/CheckBoxField'
        - $ref: '#/components/schemas/TextBoxField'
        - $ref: '#/components/schemas/RadioGroup'
      discriminator:
        propertyName: Type
        mapping:
          SigningField:
            $ref: '#/components/schemas/SigningField'
          CheckBoxField:
            $ref: '#/components/schemas/CheckBoxField'
          TextBoxField:
            $ref: '#/components/schemas/TextBoxField'
          RadioGroup:
            $ref: '#/components/schemas/RadioGroup'
    DocumentCreatedSync:
      type: object
      description: A single document
      additionalProperties: false
      properties:
        Id:
          $ref: '#/components/schemas/Document.Id'
        PackageId:
          $ref: '#/components/schemas/Package.Id'
        Name:
          $ref: '#/components/schemas/Document.Name'
        CreationDate:
          $ref: '#/components/schemas/CreationDate'
        MediaType:
          allOf:
            - $ref: '#/components/schemas/MediaType'
            - enum:
                - application/pdf
                - application/xml
        Language:
          $ref: '#/components/schemas/Language'
        Status:
          $ref: '#/components/schemas/Document.Status'
        Elements:
          type: array
          description: The document's elements
          items:
            $ref: '#/components/schemas/Element'
        ExternalReference:
          $ref: '#/components/schemas/ExternalReference'
        ProofCorrelationId:
          $ref: '#/components/schemas/ProofCorrelationId'
        OrderIndex:
          $ref: '#/components/schemas/Document.OrderIndex'
    Stakeholder:
      oneOf:
        - $ref: '#/components/schemas/UndecidedStakeholder'
        - $ref: '#/components/schemas/PersonStakeholder'
        - $ref: '#/components/schemas/GroupStakeholder'
        - $ref: '#/components/schemas/ContactGroupStakeholder'
      discriminator:
        propertyName: Type
        mapping:
          Undecided:
            $ref: '#/components/schemas/UndecidedStakeholder'
          Person:
            $ref: '#/components/schemas/PersonStakeholder'
          Group:
            $ref: '#/components/schemas/GroupStakeholder'
          ContactGroup:
            $ref: '#/components/schemas/ContactGroupStakeholder'
    AutomaticReminder:
      description: >-
        Contains information about a package's automatic reminder settings.
        Please note that values are taken from configuration defaults, if
        request object is empty.
      properties:
        IsSendAutomaticRemindersEnabled:
          type: boolean
        DaysBeforeFirstReminder:
          type: integer
          minimum: 1
        IsRepeatRemindersEnabled:
          type: boolean
        RepeatReminders:
          type: integer
          minimum: 1
    ExpirationReminder:
      description: >-
        Contains information about a package's expiration reminder settings.
        Please note that values are taken from configuration defaults, if
        request object is empty.
      properties:
        IsSendExpirationRemindersEnabled:
          type: boolean
        DaysBeforeExpirationReminder:
          type: integer
          minimum: 1
    OtpAuthenticationSetting:
      description: Contains settings for the package OTP authentication
      properties:
        IsSmsOtpAuthenticationEnabled:
          type: boolean
          nullable: false
        IsMailOtpAuthenticationEnabled:
          type: boolean
          nullable: false
    ProcessWarning:
      title: Process warning
      allOf:
        - $ref: '#/components/schemas/WarningBase'
        - type: object
          description: >
            A warning about the process of a package.  

            E.g. group members that don't have the necessary data to sign with a
            signing method
          properties:
            Stakeholder:
              type: object
              description: The stakeholder involved
              properties:
                Id:
                  $ref: '#/components/schemas/Stakeholder.Id'
                ExternalReference:
                  $ref: '#/components/schemas/ExternalReference'
            Actor:
              description: The actor involved
              properties:
                Id:
                  $ref: '#/components/schemas/Actor.Id'
      example:
        ResourceType: process
        Code: ContactGroup.SomeMissingPhoneNumbers
        Message: >-
          Some of the group members don't have a phone number required for
          [SmsOTP] signing type.
        Stakeholder:
          Id: 82c6b4f4-70fe-4fff-b176-6df0f4e79293
          ExternalReference: userXYZ
        Actor:
          Id: 73462bf5-8430-411d-befb-b35c92f35e10
    PackageWarning:
      title: Package warning
      allOf:
        - $ref: '#/components/schemas/WarningBase'
        - type: object
          description: |
            A warning about the package.  
            E.g. the package size exceeded the recommended limit.
      example:
        ResourceType: package
        Code: Package.RecommendedMaxSize:150
        Message: Recommended size of the package is 150 MB
    DocumentWarning:
      title: Document warning
      allOf:
        - $ref: '#/components/schemas/WarningBase'
        - type: object
          description: |
            A warning about the document of a package. 
            E.g. the document size exceeded the recommended limit.
          properties:
            Document:
              type: object
              description: The document involved
              properties:
                Id:
                  $ref: '#/components/schemas/Document.Id'
                ExternalReference:
                  $ref: '#/components/schemas/ExternalReference'
      example:
        ResourceType: document
        Code: Document.RecommendedMaxSize:100
        Message: Recommended maximum document size is 100 MB.
        Document:
          Id: 02caccbb-91b4-4e7a-902a-0e0cfc9cf134
          ExternalReference: doc1
    Language:
      type: string
      format: languageCode
      description: A country's 2 letter ISO code (ISO 639-1)
      example: en
    CreateElement:
      oneOf:
        - $ref: '#/components/schemas/CreateElementFromUnplacedElement'
        - $ref: '#/components/schemas/CreateSigningField'
        - $ref: '#/components/schemas/CreateCheckBoxField'
        - $ref: '#/components/schemas/CreateTextBoxField'
        - $ref: '#/components/schemas/CreateRadioGroup'
      discriminator:
        propertyName: Type
        mapping:
          SigningField:
            $ref: '#/components/schemas/CreateSigningField'
          CheckBoxField:
            $ref: '#/components/schemas/CreateCheckBoxField'
          TextBoxField:
            $ref: '#/components/schemas/CreateTextBoxField'
          RadioGroup:
            $ref: '#/components/schemas/CreateRadioGroup'
      example:
        Type: signingField
        Location:
          Page: 2
          Top: 200
          Left: 200
        Dimensions:
          Width: 200
          Height: 200
    DocumentActions:
      type: object
      description: >-
        Document actions to be performed on Draft document with IsActionNeeded
        flag set to true.
      properties:
        KeepSignatures:
          type: boolean
          description: >-
            When true, existing signatures detected in the document are applied
            to the document

            file. Default is false. Cannot be true at the same time as
            KeepFormFields.
          default: false
        KeepSigningFields:
          type: boolean
          description: >-
            When true, detected signing field markers are converted to actual
            signing fields.

            Default is false.
          default: false
        KeepFormFields:
          type: boolean
          description: >-
            When true, detected form field markers are converted to actual form
            fields.

            Default is false. Cannot be true at the same time as KeepSignatures.
          default: false
    CreateStakeholderBase:
      type: object
      description: Parameters for creating a stakeholder
      additionalProperties: false
      required:
        - Type
      properties:
        Type:
          $ref: '#/components/schemas/Stakeholder.Type'
        ExternalReference:
          $ref: '#/components/schemas/ExternalReference'
    Stakeholder.FirstName:
      type: string
      maxLength: 150
      description: First name of the stakeholder
    Stakeholder.LastName:
      type: string
      maxLength: 150
      description: Last name of the stakeholder
    PhoneNumber:
      type: string
      example: +32xxxxxxxxx
      description: >-
        Phone number used to receive an SMS OTP. Always include the country code
        (for

        example +32xxxxxxxxx); use a leading plus sign rather than "00" as the

        international dialing prefix, and never include spaces.
    AdditionalProperties:
      type: object
      description: >-
        Additional stakeholder properties configured in the Contact Properties
        Settings of

        the configuration - any extra stakeholder information the administrator
        requires

        (for example maiden name or nationality). Two properties are configured
        by default

        in every environment: **BeId** (the stakeholder's national security
        number) and

        **BeLawyer** (their lawyer ID). When a mandated signing rule is applied
        to a

        property, that property becomes mandatory and its value is checked
        against the

        data extracted from the signing certificate or returned by the signing
        service; a

        match is required for the stakeholder to be mandated to sign. Use Get
        signing

        methods to see which additional properties are mandatory for each
        signing method.
      additionalProperties:
        type: object
      example:
        BeId: '12345678900'
        BeLawyer: b459d74c-1f90-4d63-9f4a-6de9cead8c5e
    CreateGroupMember:
      type: object
      description: A member of a group stakeholder
      required:
        - Language
        - LastName
        - EmailAddress
      properties:
        Language:
          $ref: '#/components/schemas/Language'
        FirstName:
          $ref: '#/components/schemas/Stakeholder.FirstName'
        LastName:
          $ref: '#/components/schemas/Stakeholder.LastName'
        EmailAddress:
          $ref: '#/components/schemas/EmailAddress'
        BirthDate:
          type: string
          format: date
          description: Date of birth in YYYY-MM-DD format.
        PhoneNumber:
          $ref: '#/components/schemas/PhoneNumber'
        ExternalReference:
          $ref: '#/components/schemas/ExternalReference'
        AdditionalProperties:
          $ref: '#/components/schemas/AdditionalProperties'
    CreatePackage.ActorBase:
      type: object
      properties:
        Type:
          $ref: '#/components/schemas/Actor.Type'
        SuppressNotifications:
          type: boolean
          default: false
          description: suppress the notifications for this actor
        ProcessStep:
          type: integer
          description: >
            Created actor will be placed in given processStep.  

            **_Note_:** _all_ approvers have to come in the first step, all
            receivers in the last. With no other actor types in those groups.
          minimum: 0
    CreateSigningField:
      title: Signing field
      allOf:
        - $ref: '#/components/schemas/CreateElementBase'
        - type: object
          description: Parameters for creating a signing field
          properties:
            Type:
              enum:
                - SigningField
            SigningMethods:
              type: array
              items:
                $ref: '#/components/schemas/SigningMethodWithKeyPair'
              description: >-
                The signing methods that may be used to sign this signing field.
                Always supply an

                array, even for a single method. Each entry is an object with a
                `Name` and an optional

                `KeyPair`; a bare signing-method name string is also accepted as
                shorthand for `{ "Name": "<method>" }`.
            LegalNotice:
              allOf:
                - $ref: '#/components/schemas/CreateLegalNotice'
              description: >-
                An optional legal notice added to the signing field: text the
                signer must retype

                before signing. Supply either a custom `Text` or the `Name` of a
                notice configured

                in the Config Index. When using a long legal notice, size the
                signing field

                accordingly - a small field with a long notice can shrink the
                font until the text

                is unreadable.
    CreateCheckBoxField:
      title: Check box field
      allOf:
        - $ref: '#/components/schemas/CreateFormFieldBase'
        - type: object
          description: Parameters for creating a check box field
          properties:
            Type:
              enum:
                - CheckBoxField
            DefaultValue:
              type: boolean
              default: false
              description: >-
                Whether the checkbox is checked by default. The end user can
                still change it. When

                the document already contains a prefilled form field, leave this
                false to avoid

                overwriting the existing value. Defaults to false.
    CreateTextBoxField:
      title: Text box field
      allOf:
        - $ref: '#/components/schemas/CreateFormFieldBase'
        - type: object
          description: Parameters for creating a text box field
          properties:
            Type:
              enum:
                - TextBoxField
            DefaultValue:
              type: string
              description: >-
                A value prefilled into the text box, which the end user can
                change. When the document

                already contains a prefilled form field, leave this null to
                avoid overwriting the

                existing value.
            IsMultiline:
              type: boolean
              default: false
              description: >-
                Whether the text box accepts multiple lines. When true, the text
                box is scrollable.

                Defaults to false.
            CharLimit:
              type: integer
              nullable: true
              description: >-
                The maximum number of characters that may be entered in the text
                box.
    CreateRadioGroup:
      title: Radio group
      type: object
      description: >
        Parameters for creating a radio button group. Place the group in **one**
        of two ways:


        - **By coordinates** - supply `Options`, each button positioned by its
        own `Location` and `Dimensions`.

        - **On an existing PDF field** - supply `FieldId`.


        Do not combine the two. A radio group cannot be placed with a text
        marker. For the full

        rules see the [Field positioning
        guide](/nsev/build/guides/field-positioning).
      additionalProperties: false
      properties:
        Type:
          type: string
          description: the type of element
          enum:
            - RadioGroup
        ExternalReference:
          $ref: '#/components/schemas/ExternalReference'
        Name:
          type: string
          description: >-
            The name of the radio group. Must be unique per document. Do not use
            `Name` when

            referencing an existing radio group with `FieldId`.
        Label:
          type: string
          description: The label or alternative name of the form field
        ToolTipLabel:
          type: string
          description: The tool tip label of the form field
        IsRequired:
          type: boolean
          default: false
          description: >-
            Whether the radio group is mandatory. When true, the end user must
            select an option.

            When the document already contains a prefilled form field, leave
            this null to avoid

            overwriting the original value. Defaults to false.
        Options:
          type: array
          description: >-
            The radio buttons in the group, each positioned by its own
            `Location` and `Dimensions`.

            Supply these to place the group by coordinates; omit when using
            `FieldId`.
          items:
            $ref: '#/components/schemas/CreateRadioOption'
        FieldId:
          type: string
          description: >-
            The name of an existing input field on the document. Supply this to
            place the group on

            an existing PDF field; omit when supplying `Options`. Recommended to
            do this at document

            upload time, because after a document conversion the field with this
            identifier may no longer

            exist.
    Guid:
      title: GUID
      type: string
      description: A globally unique identifier
      format: guid
      example: 00000000-0000-0000-0000-000000000000
    SigningField:
      title: Signing field
      allOf:
        - $ref: '#/components/schemas/ElementBase'
        - type: object
          description: A field that can be signed by an actor
          properties:
            Location:
              $ref: '#/components/schemas/Element.Location'
            UsedSigningMethod:
              type: string
              description: The signingmethod that was used to sign this signingfield
            SigningMethods:
              type: array
              items:
                $ref: '#/components/schemas/SigningMethod'
            KeyPairMappings:
              type: array
              items:
                $ref: '#/components/schemas/KeyPairMapping'
            LegalNotice:
              $ref: '#/components/schemas/LegalNotice'
            Dimensions:
              $ref: '#/components/schemas/Element.Dimensions'
    CheckBoxField:
      title: Check box field
      allOf:
        - $ref: '#/components/schemas/ElementBase'
        - $ref: '#/components/schemas/FormFieldBase'
        - type: object
          description: Parameters for creating a check box field
          properties:
            Location:
              $ref: '#/components/schemas/Element.Location'
            Dimensions:
              $ref: '#/components/schemas/Element.Dimensions'
            DefaultValue:
              type: boolean
              description: Is the check box field checked by default
            Checked:
              type: boolean
              description: The value of the completed check box field
    TextBoxField:
      title: Text box field
      allOf:
        - $ref: '#/components/schemas/ElementBase'
        - $ref: '#/components/schemas/FormFieldBase'
        - type: object
          description: Parameters for creating a text box field
          properties:
            Location:
              $ref: '#/components/schemas/Element.Location'
            Dimensions:
              $ref: '#/components/schemas/Element.Dimensions'
            DefaultValue:
              type: string
              description: The template for default value of the text box
            IsMultiline:
              type: boolean
              description: Defines if the text box field should be multiline
            CharLimit:
              type: integer
              nullable: true
              description: Limits the number of characters on the text box field
            Value:
              type: string
              description: The value of the completed text box field
    RadioGroup:
      title: Radio group
      allOf:
        - $ref: '#/components/schemas/ElementBase'
        - $ref: '#/components/schemas/FormFieldBase'
        - type: object
          description: Parameters for creating a radio button group
          properties:
            Selected:
              type: string
              description: The name of selected option
            Options:
              type: array
              description: The radio button group Options
              items:
                $ref: '#/components/schemas/RadioOption'
    Document.Id:
      allOf:
        - $ref: '#/components/schemas/Guid'
        - type: string
          description: A document's unique identifier
    Document.Name:
      type: string
      nullable: false
      description: Name of the document
      minLength: 1
      maxLength: 150
      example: example document
    Document.Status:
      type: string
      description: The status of a document
      enum:
        - Draft
        - Pending
        - InProgress
        - Ending
        - Finished
        - Rejected
        - Revoked
        - Expired
        - Failed
        - Processing
        - ProcessingFailed
    Document.OrderIndex:
      type: integer
      description: The Order Index of the document.
    UndecidedStakeholder:
      title: Undecided stakeholder
      allOf:
        - $ref: '#/components/schemas/StakeholderBase'
        - type: object
          description: Unspecified stakeholder
          required:
            - Type
          properties:
            Type:
              type: string
              description: The type of stakeholder
              nullable: false
              enum:
                - Undecided
    PersonStakeholder:
      title: Person stakeholder
      allOf:
        - $ref: '#/components/schemas/StakeholderBase'
        - type: object
          description: A single individual
          required:
            - Language
            - LastName
            - EmailAddress
          properties:
            Type:
              type: string
              description: The type of stakeholder
              nullable: false
              enum:
                - Person
            Language:
              $ref: '#/components/schemas/Language'
            FirstName:
              $ref: '#/components/schemas/Stakeholder.FirstName'
            LastName:
              $ref: '#/components/schemas/Stakeholder.LastName'
            EmailAddress:
              $ref: '#/components/schemas/EmailAddress'
            PhoneNumber:
              $ref: '#/components/schemas/PhoneNumber'
            BirthDate:
              type: string
              format: date
            AdditionalProperties:
              $ref: '#/components/schemas/AdditionalProperties'
            Substitutes:
              type: array
              description: Active substitutes of the person
              items:
                $ref: '#/components/schemas/StakeholderSubstitute'
      example:
        Id: 00000000-0000-0000-0000-000000000000
        PackageId: 00000000-0000-0000-0000-000000000000
        Type: person
        Actors:
          - Id: 00000000-0000-0000-0000-000000000000
            Type: signer
            Status: available
            Links:
              - https://dothething.test
          - Id: 00000000-0000-0000-0000-000000000000
            Type: signer
            Status: unavailable
          - Id: 00000000-0000-0000-0000-000000000000
            Type: signer
            Status: skipped
        ExternalReference: string
        Language: en
        FirstName: string
        LastName: string
        EmailAddress: hello@world.test
        BirthDate: '2020-01-22'
    GroupStakeholder:
      title: Group stakeholder
      allOf:
        - $ref: '#/components/schemas/StakeholderBase'
        - type: object
          description: >-
            a group of people where a single member will have to perform an
            action
          properties:
            Type:
              type: string
              description: The type of stakeholder
              nullable: false
              enum:
                - Group
            GroupName:
              type: string
              maxLength: 128
              description: Name of the group
            Members:
              type: array
              description: Members of the group
              items:
                $ref: '#/components/schemas/GroupMember'
      example:
        Id: 00000000-0000-0000-0000-000000000000
        PackageId: 00000000-0000-0000-0000-000000000000
        Type: group
        Actors:
          - Id: 00000000-0000-0000-0000-000000000000
            Type: signer
            Status: available
            MemberLinks:
              - Email: zu@li.test
                Link: https://dothething.test
              - Email: john@doe.test
                Link: https://alsocompleteyouraction.test
        GroupName: Group123
        Members:
          - Language: en
            FirstName: John
            LastName: Doe
            EmailAddress: john@doe.test
            BirthDate: '1990-01-16'
          - Language: en
            FirstName: Zu
            LastName: Li
            EmailAddress: zu@li.test
            BirthDate: '1991-03-14'
    ContactGroupStakeholder:
      title: Contact group stakeholder
      allOf:
        - $ref: '#/components/schemas/StakeholderBase'
        - type: object
          description: >-
            A contact group defined in NSEV where a single member will have to
            perform an action, is converted to 'group' when the package is
            submitted
          properties:
            Type:
              type: string
              description: The type of stakeholder
              nullable: false
              enum:
                - ContactGroup
            ContactGroupCode:
              type: string
              description: an NSEV contactgroup identifier
            Members:
              description: The members of the referenced contact group
              type: array
              items:
                $ref: '#/components/schemas/GroupMember'
      example:
        Id: 00000000-0000-0000-0000-000000000000
        PackageId: 00000000-0000-0000-0000-000000000000
        Type: contactGroup
        ContactGroupCode: '00002'
        Actors:
          - Id: 00000000-0000-0000-0000-000000000000
            Type: signer
            Status: available
            MemberLinks:
              - Email: john@doe.test
                Link: https://alsocompleteyouraction.test
              - Email: zu@li.test
                Link: https://dothething.test
        ExternalReference: string
        Members:
          - Language: en
            FirstName: John
            LastName: Doe
            EmailAddress: john@doe.test
            BirthDate: '1990-01-16'
          - Language: en
            FirstName: Zu
            LastName: Li
            EmailAddress: zu@li.test
            BirthDate: '1991-03-14'
    WarningBase:
      type: object
      description: |
        A notice of a possible problem so it can be resolved or prevented
      properties:
        ResourceType:
          type: string
          description: The subject of the warning
          enum:
            - process
            - package
            - document
            - archiving
        Code:
          type: string
        Message:
          type: string
    Stakeholder.Id:
      allOf:
        - $ref: '#/components/schemas/Guid'
        - type: string
          description: A stakeholder's unique identifier
    Actor.Id:
      allOf:
        - $ref: '#/components/schemas/Guid'
        - type: string
          description: This actor's unique identifier
    CreateElementFromUnplacedElement:
      title: Place an unplaced element
      type: object
      description: >
        Parameters for placing an existing unplaced element, identified by
        `UnplacedElementId`.

        Choose **one** placement method and supply only its fields:


        - **Explicit coordinates** - supply `Location` and `Dimensions`.

        - **Text marker** - supply `Marker` (a code embedded in the document
        text).

        - **Radio group** - supply `Options`, each button positioned by its own
        `Location` and `Dimensions`
          (used when the unplaced element is a radio group, instead of `Location`/`Marker`).

        Do not combine methods. For the full rules and marker formats see the

        [Field positioning guide](/nsev/build/guides/field-positioning).
      additionalProperties: false
      required:
        - UnplacedElementId
      properties:
        UnplacedElementId:
          $ref: '#/components/schemas/Element.Id'
        ExternalReference:
          $ref: '#/components/schemas/ExternalReference'
        Location:
          allOf:
            - $ref: '#/components/schemas/Element.Location'
            - description: >-
                Explicit placement. Supply together with `Dimensions`. Omit when
                using `Marker` or `Options`.
        Dimensions:
          allOf:
            - $ref: '#/components/schemas/Element.Dimensions'
            - description: >-
                Size in points. Supply together with `Location`. Omit when using
                `Marker` or `Options`.
        Marker:
          description: >-
            A piece of text inside the document where an element must be. It
            encodes the location

            and dimensions of the element. Omit when using
            `Location`/`Dimensions` or `Options`. Recommended

            to embed at document-upload time, because after document conversion
            the marker may no longer

            be present. Its format depends on the element type:


            - **SigningField** - a `#`-prefixed text marker `#id_height_width#`
            (for example `#SIG01_50_120#`), or a `#`-prefixed PDF field id `#id`
            that names an existing signature field.

            - **Form fields** (TextBoxField, CheckBoxField) - an `@`-prefixed
            text marker `@id_height_width#`, with `@id_TB_height_width#` for a
            text box and `@id_CB_height_width#` for a check box, or a
            `@`-prefixed PDF field id `@id` that names an existing form field.

            - **RadioGroup** cannot be placed with a text marker; use Options
            instead.


            See the [Field positioning
            guide](/nsev/build/guides/field-positioning).
          type: string
          pattern: >-
            ^[#@][a-zA-Z]+(?:\d*\.)?\d+(?:_(?:TB_|CB_)?(?:\d*\.)?\d+_(?:\d*\.)?\d+#)?$
        Options:
          description: >-
            Radio-group buttons, each with a `Name`, `Location` and
            `Dimensions`. Supply this only

            when the unplaced element is a radio group; omit when using
            `Location`/`Dimensions` or `Marker`.
          type: array
          items:
            type: object
            properties:
              Name:
                type: string
                description: The name of the unplaced option
              Location:
                $ref: '#/components/schemas/Element.Location'
              Dimensions:
                $ref: '#/components/schemas/Element.Dimensions'
    Stakeholder.Type:
      type: string
      description: >-
        The type of stakeholder, and the discriminator across the stakeholder
        variants.


        - **Person** - a single individual; only that person can act.

        - **Group** - a group of people defined inline; any member may act on
        behalf of
          the group, and once one member acts the others cannot.
        - **ContactGroup** - references a contact group created in the WebPortal
        by its
          code; behaves like a group. Exists only while the package is in draft and is
          converted to **Group** when the package moves to pending.
        - **Undecided** - the implicit stakeholder a package starts with before
        any
          stakeholder has been assigned; it cannot be deleted.
      nullable: false
      enum:
        - Undecided
        - Person
        - Group
        - ContactGroup
    Actor.Type:
      type: string
      description: >-
        The type of action an actor performs on a package, and the discriminator
        across

        the actor variants.


        - **FormFiller** - fills TextBoxField, CheckBoxField and RadioGroup
        elements; does
          not sign or approve. Must be placed in the first process step.
        - **Approver** - approves a document as fit for signing, before any
        signer acts.
          Must be placed in the first process step (may share it with FormFillers).
        - **Signer** - signs one or more signing fields.

        - **Receiver** - receives a copy of the fully signed document; takes no
        action and
          must be placed in the last process step.
      enum:
        - Signer
        - Receiver
        - Approver
        - FormFiller
    CreateElementBase:
      type: object
      description: >
        Parameters common to every created element, including where it is
        placed. Choose **one**

        placement method and supply only its fields:


        - **Explicit coordinates** - supply `Location` and `Dimensions`.

        - **Text marker** - supply `Marker` (a code embedded in the document
        text).

        - **Existing PDF form field** - supply `FieldId`.


        Do not combine methods. Radio groups are placed per-option (see
        `CreateRadioGroup`), and a

        server-signed signing field may be created invisible with none of these.
        For the full rules,

        marker formats and per-type minimum dimensions, see the

        [Field positioning guide](/nsev/build/guides/field-positioning).
      additionalProperties: false
      required:
        - Type
      properties:
        Type:
          type: string
          description: the type of element
          enum:
            - SigningField
            - CheckBoxField
            - TextBoxField
            - RadioGroup
        ExternalReference:
          $ref: '#/components/schemas/ExternalReference'
        Location:
          allOf:
            - $ref: '#/components/schemas/Element.Location'
            - description: >-
                Explicit placement. Supply together with `Dimensions`. Omit when
                using `Marker` or `FieldId`.
        Dimensions:
          allOf:
            - $ref: '#/components/schemas/Element.Dimensions'
            - description: >-
                Size in points. Supply together with `Location`. Omit when using
                `Marker` or `FieldId`.
        Marker:
          type: string
          pattern: >-
            ^[#@][a-zA-Z]+(?:\d*\.)?\d+(?:_(?:TB_|CB_)?(?:\d*\.)?\d+_(?:\d*\.)?\d+#)?$
          description: >-
            A piece of text inside the document marking where the element must
            be placed; it encodes the element's location and dimensions. Omit
            when using `Location`/`Dimensions` or `FieldId`. Recommended to
            embed at document-upload time, because after document conversion the
            marker may no longer be present. The format depends on the element
            type:


            - **SigningField** - a `#`-prefixed text marker `#id_height_width#`
            (for example `#SIG01_50_120#`), or a `#`-prefixed PDF field id `#id`
            that names an existing signature field.

            - **Form fields** (TextBoxField, CheckBoxField) - an `@`-prefixed
            text marker `@id_height_width#`, with `@id_TB_height_width#` for a
            text box and `@id_CB_height_width#` for a check box, or a
            `@`-prefixed PDF field id `@id` that names an existing form field.

            - **RadioGroup** cannot be placed with a text marker; use Options
            instead.


            See the [Field positioning
            guide](/nsev/build/guides/field-positioning).
        FieldId:
          type: string
          description: >-
            The name of an existing form field in the uploaded document to
            attach this element to; must be unique within the document. Omit
            when using `Location`/`Dimensions` or `Marker`. Recommended to do
            this at document-upload time, because after document conversion the
            field may no longer exist.
    SigningMethodWithKeyPair:
      title: Signing method with key pair
      type: object
      required:
        - Name
      properties:
        Name:
          description: The name of an NSEV signing method
          type: string
          example: MailOtp:MailOtp
        KeyPair:
          description: >-
            the name of the keypair to be used for signing, the default keypair
            will be used when null
          type: string
          example: MyKeyPair
    CreateFormFieldBase:
      allOf:
        - $ref: '#/components/schemas/CreateElementBase'
        - type: object
          description: Parameters for creating a form field element
          additionalProperties: false
          properties:
            Name:
              type: string
              description: >-
                The name of the form field. Must be unique per document. Only
                use `Name` when placing

                the field by explicit location and dimensions or by marker; do
                not use it when

                referencing an existing form field with `FieldId`.
            Label:
              type: string
              description: The label or alternative name of the form field.
            ToolTipLabel:
              type: string
              description: >-
                The text shown as a tooltip when the user hovers over the form
                field. When the

                document already contains a prefilled form field with a tooltip,
                leave this null to

                avoid overwriting the original value.
            IsRequired:
              type: boolean
              default: false
              description: >-
                Whether the form field is mandatory. When true, the end user
                must complete it. When

                the document already contains a prefilled form field, leave this
                null to avoid

                overwriting the original value. Defaults to false.
    CreateRadioOption:
      allOf:
        - type: object
          description: Parameters for creating a radio button option
          properties:
            Name:
              type: string
              description: The name (choice value) of the radio button.
            Label:
              type: string
              description: The label or alternative name of the radio button.
            IsSelected:
              type: boolean
              description: Whether this radio button is selected by default.
            Location:
              $ref: '#/components/schemas/Element.Location'
            Dimensions:
              $ref: '#/components/schemas/Element.Dimensions'
    ElementBase:
      type: object
      description: An element on a document, e.g. a signing field
      required:
        - Type
      properties:
        Id:
          $ref: '#/components/schemas/Element.Id'
        ActorId:
          allOf:
            - $ref: '#/components/schemas/Actor.Id'
            - nullable: true
              description: Is null when no actor has been assigned to this field yet
              type: string
        Type:
          $ref: '#/components/schemas/Element.Type'
        Status:
          $ref: '#/components/schemas/Element.Status'
        ExternalReference:
          $ref: '#/components/schemas/ExternalReference'
        CompletedDate:
          type: string
          format: dateTime
    Element.Location:
      type: object
      description: where an element is placed
      required:
        - Page
        - Left
        - Top
      properties:
        Page:
          type: integer
          description: >-
            The page of the document the element is placed on. Pages are
            1-based: 1 is the first page; 0 must not be used. To count from the
            end, use negative integers: -1 is the last page, -2 the
            second-to-last, and so on.
        Top:
          type: number
          format: float
          minimum: 0
          description: how far from the top edge of the document this is placed
        Left:
          type: number
          format: float
          minimum: 0
          description: how far from the left edge of the document this is placed
      example:
        Page: 2
        Top: 200
        Left: 200
    SigningMethod:
      title: Signing method name
      type: string
      description: An NSEV signing method
      example: manual
    KeyPairMapping:
      type: object
      description: >-
        A mapping between signing method and the keypair to be used for signing
        with this method. If a signing method is not mentioned in this list,
        then the default keypair will be used when signing
      properties:
        SigningMethodName:
          description: The name of an NSEV signing method
          type: string
          example: MailOtp:MailOtp
        KeyPair:
          description: >-
            The name of the keypair that is used for signing if the
            corresponding signing method is chosen
          type: string
          example: MyKeyPair
    Element.Dimensions:
      title: Element dimensions
      type: object
      description: >
        The size of an element in points. The minimum width and height depend on
        the element

        type - a signing field must be at least 50 × 30, other elements at least
        10 × 10.

        See the [Field positioning guide](/nsev/build/guides/field-positioning).
      required:
        - Width
        - Height
      properties:
        Width:
          type: number
          format: float
          description: width of the element
          maximum: 999999
        Height:
          type: number
          format: float
          description: height of the element
          maximum: 999999
      example:
        Width: 200
        Height: 200
    FormFieldBase:
      type: object
      description: A form field that can be completed by an actor
      properties:
        Name:
          type: string
          description: The name of the form field
        Label:
          type: string
          description: The label or alternative name of the form field
        ToolTipLabel:
          type: string
          description: The tool tip label of the form field
        IsRequired:
          type: boolean
          description: Is the form field required
    RadioOption:
      allOf:
        - type: object
          description: Parameters for creating a radio button option
          properties:
            Name:
              type: string
              description: The name/choice of the option
            Label:
              type: string
              description: The label or alternative name of the option
            IsSelected:
              type: boolean
              description: Is the option pre-selected
            Location:
              $ref: '#/components/schemas/Element.Location'
            Dimensions:
              $ref: '#/components/schemas/Element.Dimensions'
    StakeholderBase:
      type: object
      description: A person or group with an interest in a package
      additionalProperties: false
      required:
        - Type
      properties:
        Id:
          $ref: '#/components/schemas/Stakeholder.Id'
        PackageId:
          $ref: '#/components/schemas/Package.Id'
        Type:
          $ref: '#/components/schemas/Stakeholder.Type'
        Actors:
          type: array
          description: The actions to be performed
          items:
            $ref: '#/components/schemas/Actor'
        ExternalReference:
          $ref: '#/components/schemas/ExternalReference'
    StakeholderSubstitute:
      required:
        - Language
        - LastName
        - EmailAddress
      allOf:
        - $ref: '#/components/schemas/Person'
        - $ref: '#/components/schemas/Substitute.AllowedToReassign'
        - type: object
          properties:
            Actor:
              $ref: '#/components/schemas/SubstituteActor'
    GroupMember:
      required:
        - Language
        - LastName
        - EmailAddress
      properties:
        Language:
          $ref: '#/components/schemas/Language'
        FirstName:
          type: string
          maxLength: 150
        LastName:
          type: string
          maxLength: 150
        EmailAddress:
          $ref: '#/components/schemas/EmailAddress'
        BirthDate:
          type: string
          format: date
        PhoneNumber:
          $ref: '#/components/schemas/PhoneNumber'
        ExternalReference:
          $ref: '#/components/schemas/ExternalReference'
        AdditionalProperties:
          $ref: '#/components/schemas/AdditionalProperties'
        Substitutes:
          type: array
          description: Active substitutes of the group member
          items:
            $ref: '#/components/schemas/StakeholderSubstitute'
    Element.Id:
      allOf:
        - $ref: '#/components/schemas/Guid'
        - type: string
          description: An element's unique identifier
    Element.Type:
      type: string
      description: >-
        the type of element ( the discriminator of the different types of
        elements, for the moment there's just one! )
      nullable: false
      enum:
        - SigningField
        - TextBoxField
        - CheckBoxField
        - RadioGroup
    Element.Status:
      type: string
      description: The status of a document element
      enum:
        - Pending
        - InProgress
        - Rejected
        - Failed
        - Finished
        - Refused
    Actor:
      oneOf:
        - $ref: '#/components/schemas/SignerActor'
        - $ref: '#/components/schemas/ReceiverActor'
        - $ref: '#/components/schemas/ApproverActor'
        - $ref: '#/components/schemas/FormFillerActor'
      discriminator:
        propertyName: Type
        mapping:
          Signer:
            $ref: '#/components/schemas/SignerActor'
          Receiver:
            $ref: '#/components/schemas/ReceiverActor'
          Approver:
            $ref: '#/components/schemas/ApproverActor'
          FormFiller:
            $ref: '#/components/schemas/FormFillerActor'
      example:
        Type: signer
        Status: available
        Elements:
          - Id: 00000000-0000-0000-0000-000000000000
            Type: signingField
            Location:
              Page: 2
              Top: 250
              Left: 250
            Dimensions:
              Width: 230
              Height: 230
    Person:
      type: object
      description: A person
      required:
        - Language
        - LastName
        - EmailAddress
      properties:
        Language:
          allOf:
            - $ref: '#/components/schemas/Language'
            - description: The person's language
        Title:
          type: string
          maxLength: 100
          description: The person's title
          example: Ms.
        FirstName:
          type: string
          maxLength: 150
          description: The person's first name
          example: Jane
        LastName:
          type: string
          maxLength: 150
          description: The person's last name
          example: Doe
        EmailAddress:
          allOf:
            - $ref: '#/components/schemas/EmailAddress'
            - description: The person's email address
        PhoneNumber:
          allOf:
            - $ref: '#/components/schemas/PhoneNumber'
            - description: The person's phone number
            - example: +1 202-918-2132
        BirthDate:
          type: string
          format: date
        ExternalReference:
          allOf:
            - $ref: '#/components/schemas/ExternalReference'
            - description: The person's external reference
            - example: Client_XYZ_Account_Manager
        AdditionalProperties:
          allOf:
            - $ref: '#/components/schemas/AdditionalProperties'
            - description: The person's additional properties
    Substitute.AllowedToReassign:
      type: object
      properties:
        AllowedToReassign:
          type: boolean
          description: >-
            Indicates whether the substitute is allowed to reassign the actor to
            another party
    SubstituteActor:
      properties:
        Id:
          $ref: '#/components/schemas/Actor.Id'
        Type:
          $ref: '#/components/schemas/Actor.Type'
    SignerActor:
      title: Signer
      allOf:
        - $ref: '#/components/schemas/ActorBase'
        - type: object
          description: Signs one or more signing fields
          properties:
            Type:
              enum:
                - Signer
            Result:
              $ref: '#/components/schemas/SignerActorResult'
            Elements:
              type: array
              description: The actor's elements
              items:
                oneOf:
                  - $ref: '#/components/schemas/SigningField'
            RedirectUrl:
              type: string
              format: url
              description: >
                Url to which the stakeholder is redirected after completing this
                action
            RedirectType:
              type: string
              enum:
                - AfterSession
                - Immediately
                - AfterDelay
                - AfterCompletion
              description: >
                When stakeholder gets redirected after completing this action
                  * afterSession - Redirect after signing session is ended, but before package is completed (only important for last signer).
                  * immediately - Redirect as soon as possible.
                  * afterDelay - Redirect after some delay (defined on frontend).
                  * afterCompletion - Redirect after the package is completed.

                Only valid together with RedirectUrl - the API rejects
                RedirectType without it.
            BackButtonUrl:
              type: string
              format: url
              description: >-
                URL to which the end user is sent after pressing close session
                button
              example: https://homepage.example.test
    ReceiverActor:
      title: Receiver
      allOf:
        - $ref: '#/components/schemas/ActorBase'
        - type: object
          description: Can download a copy of the fully signed document
          properties:
            Type:
              enum:
                - Receiver
    ApproverActor:
      title: Approver
      allOf:
        - $ref: '#/components/schemas/ActorBase'
        - type: object
          description: Determines whether a document is fit for signing
          properties:
            Type:
              enum:
                - Approver
            RedirectUrl:
              type: string
              format: url
              description: >
                Url to which the stakeholder is redirected after completing this
                action, always as soon as possible
            BackButtonUrl:
              type: string
              format: url
              description: >-
                URL to which the end user is sent after pressing close session
                button
              example: https://homepage.example.test
            Result:
              $ref: '#/components/schemas/ApproverActorResult'
    FormFillerActor:
      title: Form filler
      allOf:
        - $ref: '#/components/schemas/ActorBase'
        - type: object
          description: Completes one or more form fields
          properties:
            Type:
              enum:
                - FormFiller
            Elements:
              type: array
              description: The actor's elements
              items:
                oneOf:
                  - $ref: '#/components/schemas/CheckBoxField'
                  - $ref: '#/components/schemas/TextBoxField'
                  - $ref: '#/components/schemas/RadioGroup'
            RedirectUrl:
              type: string
              format: url
              description: >
                Url to which the stakeholder is redirected after completing this
                action
            RedirectType:
              type: string
              enum:
                - AfterSession
                - Immediately
                - AfterDelay
                - AfterCompletion
              description: >
                When stakeholder gets redirected after completing this action
                  * afterSession - Redirect after signing session is ended, but before package is completed (only important for last signer).
                  * immediately - Redirect as soon as possible.
                  * afterDelay - Redirect after some delay (defined on frontend).
                  * afterCompletion - Redirect after the package is completed.

                Only valid together with RedirectUrl - the API rejects
                RedirectType without it.
            BackButtonUrl:
              type: string
              format: url
              description: >-
                URL to which the end user is sent after pressing close session
                button
              example: https://homepage.example.test
            Result:
              $ref: '#/components/schemas/FormFillerActorResult'
    ActorBase:
      allOf:
        - type: object
          description: An action to be performed
          additionalProperties: false
          properties:
            Id:
              $ref: '#/components/schemas/Actor.Id'
            Type:
              $ref: '#/components/schemas/Actor.Type'
            Status:
              $ref: '#/components/schemas/Actor.Status'
            SuppressNotifications:
              type: boolean
              default: false
              description: suppress the notifications for this actor
        - type: object
          properties:
            ActionUrls:
              type: array
              items:
                type: object
                description: links to interact with the package for this stakeholder
                properties:
                  Email:
                    type: string
                    format: email
                    description: >-
                      email address of the person stakeholder that will have to
                      perform this action
                  Url:
                    type: string
                    format: url
                    description: >-
                      link to interact with the package for this person
                      stakeholder
                  Type:
                    type: string
                    description: Type of action url
                    enum:
                      - Approver
                      - FormFiller
                      - Signer
                      - Preview
                      - Download
                      - Archive
        - type: object
          properties:
            Links:
              type: array
              description: Only present when the actor's stakeholder is a person.
              items:
                type: string
                format: url
                description: links to interact with the package for this person stakeholder
            MemberLinks:
              type: array
              description: >-
                Only present when the actor's stakeholder is a group or contact
                group.
              items:
                type: object
                description: links to interact with the package for this group stakeholder
                properties:
                  Email:
                    type: string
                    format: email
                    description: >-
                      email address of the member that will have to perform this
                      action
                  Link:
                    type: string
                    format: url
                    description: >-
                      link to interact with the package for this stakeholder
                      member
    SignerActorResult:
      allOf:
        - $ref: '#/components/schemas/ActorResult'
        - type: object
          properties:
            RejectReason:
              type: string
              description: why a signer rejected signing
    ApproverActorResult:
      allOf:
        - $ref: '#/components/schemas/ActorResult'
        - type: object
          properties:
            RejectReason:
              type: string
              description: why an approver rejected the package
    FormFillerActorResult:
      allOf:
        - $ref: '#/components/schemas/ActorResult'
        - type: object
          properties:
            RejectReason:
              type: string
              description: why a form filler rejected the package
    Actor.Status:
      type: string
      description: >-
        The status of an actor's action.


        - **Draft** - the package is still in draft; the action is not yet
        active.

        - **Waiting** - the action is waiting for an earlier process step to
        complete.

        - **Available** - the action is ready to be performed.

        - **InProgress** - the action is being performed.

        - **Failed** - the action failed.

        - **Finished** - the action was completed.

        - **Rejected** - the actor rejected the document.

        - **Skipped** - the action was skipped (for example via skip
        approvers/signers).
      enum:
        - Draft
        - Waiting
        - Available
        - InProgress
        - Failed
        - Finished
        - Rejected
        - Skipped
    ActorResult:
      type: object
      description: The result of a completed action
      properties:
        CompletedBy:
          type: object
          properties:
            Email:
              type: string
              format: email
              example: john@doe.test
            VerifiedName:
              type: string
              nullable: true
              example: John Doe
              description: >-
                The name of a person taken from third party authentication
                services.
        CompletedDate:
          type: string
          format: dateTime
  responses:
    PackageCreated:
      description: Package was created
      headers:
        Location:
          description: Location of the newly created package
          schema:
            type: string
            format: url
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/PackageCreatedSync'
              - type: object
                properties:
                  Warnings:
                    type: array
                    description: Warnings raised while creating the package
                    items:
                      $ref: '#/components/schemas/Warning'
          examples:
            existing:
              summary: Package was created
              value:
                Id: CD758AE3-5382-48B2-A4F3-DD76C7200EE0
                Name: example pending package
                Initiator: hello@world.test
                Status: pending
                ExpiryDate: '2020-01-17T12:33:47.923Z'
                DefaultLegalNotice:
                  Name: LegalNotice1
                Documents:
                  - Id: 1E501B99-9F0F-4F12-9AD9-6C737C6394E8
                    Name: my first document
                    Language: en
                    ExternalReference: doc0
                    ProofCorrelationId: correlation identifier
                    DocumentOptions:
                      TargetType: application/pdf
                      PdfOptions:
                        TargetFormat: pdfa1a
                      Base64data: string
                      ContentType: application/pdf
                  - Id: 1BAE1A85-BF29-426C-A9B6-D7BD330CF4CD
                    Name: my second document
                    Language: en
                    ExternalReference: doc1
                    DocumentOptions:
                      TargetType: application/pdf
                      Base64data: string
                      ContentType: application/pdf
                stakeholders:
                  - Id: C2CEBEEF-A9BB-4BF8-9FD9-7F78EBC80CC2
                    Type: person
                    Language: en
                    FirstName: John
                    LastName: Doe
                    EmailAddress: john@doe.test
                    BirthDate: '1990-01-16'
                    PhoneNumber: +32xxxxxxxxx
                    AdditionalProperties:
                      BeId: '12345678900'
                      BeLawyer: b459d74c-1f90-4d63-9f4a-6de9cead8c5e
                    Actors:
                      - Id: 5D197888-8660-4374-BB42-102A4F6E35C4
                        Type: signer
                        ProcessStep: 0
                        Elements:
                          - Id: F77A4B19-ADEB-495B-A098-1E99DB0E42FD
                            Type: signingField
                            DocumentIndex: 0
                            Location:
                              Page: 2
                              Top: 200
                              Left: 200
                            Dimensions:
                              Width: 200
                              Height: 200
                            SigningMethods:
                              - Manual:Handwritten
                              - SMSCode:SmsOtp
                            KeyPairMappings:
                              - SigningMethodName: SMSCode:SmsOtp
                                KeyPair: Custom keypair
                        Links:
                          - >-
                            https://api.example.test/signinit?packageSignId=cd758ae3-5382-48b2-a4f3-dd76c7200ee0&token=123
                  - Id: 57274DC0-2B9F-4A1E-B9FD-CFD1C1893683
                    Type: group
                    GroupName: Great mates
                    Members:
                      - Id: 750FC8F4-00D0-4247-AA5A-9323A1E1F740
                        Language: en
                        FirstName: John
                        LastName: Doe
                        EmailAddress: john@doe.test
                        BirthDate: '1990-01-16'
                      - Id: BE89E158-4278-41E7-BF33-7EE6F8B2ECFB
                        Language: en
                        FirstName: Zu
                        LastName: Li
                        EmailAddress: zu@li.test
                        BirthDate: '1991-03-14'
                    Actors:
                      - Id: F62C2D0D-42E2-48E9-BA4B-C9825290C474
                        Type: signer
                        ProcessStep: 1
                        Elements:
                          - Id: E62DB347-5ED1-48DA-91A3-90A660AA18CC
                            Type: signingField
                            DocumentIndex: 1
                            Location:
                              Page: 2
                              Top: 200
                              Left: 200
                            Dimensions:
                              Width: 200
                              Height: 200
                        Links:
                          - >-
                            https://api.example.test/signinit?packageSignId=cd758ae3-5382-48b2-a4f3-dd76c7200ee0&token=321
                ThemeCode: string
                CallBackUrl: https://callback.test
                NotificationCallBackUrl: https://notifications.test
                IsUnsignedContentDownloadable: true
                ExternalReference: myFirstPackage
                MustBeArchived: true
                ArchiveAuditProofs: false
                ArchiveAuditTrail: false
                AutomaticReminder:
                  IsSendAutomaticRemindersEnabled: true
                  DaysBeforeFirstReminder: 5
                  IsRepeatRemindersEnabled: true
                  RepeatReminders: 5
                ExpirationReminder:
                  IsSendExpirationRemindersEnabled: true
                  DaysBeforeExpirationReminder: 5
                OtpAuthenticationSetting:
                  IsSmsOtpAuthenticationEnabled: false
                  IsMailOtpAuthenticationEnabled: false
            package-created:
              summary: Package was created
              value:
                Id: CD758AE3-5382-48B2-A4F3-DD76C7200EE0
                Name: example pending package
                Initiator: hello@world.test
                Status: pending
                ExpiryDate: '2020-01-17T12:33:47.923Z'
                DefaultLegalNotice:
                  Name: LegalNotice1
                Documents:
                  - Id: 1E501B99-9F0F-4F12-9AD9-6C737C6394E8
                    Name: my first document
                    Language: en
                    ExternalReference: doc0
                    ProofCorrelationId: correlation identifier
                    DocumentOptions:
                      TargetType: application/pdf
                      PdfOptions:
                        TargetFormat: pdfa1a
                      Base64data: string
                      ContentType: application/pdf
                  - Id: 1BAE1A85-BF29-426C-A9B6-D7BD330CF4CD
                    Name: my second document
                    Language: en
                    ExternalReference: doc1
                    DocumentOptions:
                      TargetType: application/pdf
                      Base64data: string
                      ContentType: application/pdf
                stakeholders:
                  - Id: C2CEBEEF-A9BB-4BF8-9FD9-7F78EBC80CC2
                    Type: person
                    Language: en
                    FirstName: John
                    LastName: Doe
                    EmailAddress: john@doe.test
                    BirthDate: '1990-01-16'
                    PhoneNumber: +32xxxxxxxxx
                    AdditionalProperties:
                      BeId: '12345678900'
                      BeLawyer: b459d74c-1f90-4d63-9f4a-6de9cead8c5e
                    Actors:
                      - Id: 5D197888-8660-4374-BB42-102A4F6E35C4
                        Type: signer
                        ProcessStep: 0
                        Elements:
                          - Id: F77A4B19-ADEB-495B-A098-1E99DB0E42FD
                            Type: signingField
                            DocumentIndex: 0
                            Location:
                              Page: 2
                              Top: 200
                              Left: 200
                            Dimensions:
                              Width: 200
                              Height: 200
                            SigningMethods:
                              - Manual:Handwritten
                              - SMSCode:SmsOtp
                            KeyPairMappings:
                              - SigningMethodName: SMSCode:SmsOtp
                                KeyPair: Custom keypair
                        Links:
                          - >-
                            https://api.example.test/signinit?packageSignId=cd758ae3-5382-48b2-a4f3-dd76c7200ee0&token=123
                  - Id: 57274DC0-2B9F-4A1E-B9FD-CFD1C1893683
                    Type: group
                    GroupName: Great mates
                    Members:
                      - Id: 750FC8F4-00D0-4247-AA5A-9323A1E1F740
                        Language: en
                        FirstName: John
                        LastName: Doe
                        EmailAddress: john@doe.test
                        BirthDate: '1990-01-16'
                      - Id: BE89E158-4278-41E7-BF33-7EE6F8B2ECFB
                        Language: en
                        FirstName: Zu
                        LastName: Li
                        EmailAddress: zu@li.test
                        BirthDate: '1991-03-14'
                    Actors:
                      - Id: F62C2D0D-42E2-48E9-BA4B-C9825290C474
                        Type: signer
                        ProcessStep: 1
                        Elements:
                          - Id: E62DB347-5ED1-48DA-91A3-90A660AA18CC
                            Type: signingField
                            DocumentIndex: 1
                            Location:
                              Page: 2
                              Top: 200
                              Left: 200
                            Dimensions:
                              Width: 200
                              Height: 200
                        Links:
                          - >-
                            https://api.example.test/signinit?packageSignId=cd758ae3-5382-48b2-a4f3-dd76c7200ee0&token=321
                ThemeCode: string
                CallBackUrl: https://callback.test
                NotificationCallBackUrl: https://notifications.test
                IsUnsignedContentDownloadable: true
                ExternalReference: myFirstPackage
                MustBeArchived: true
                ArchiveAuditProofs: false
                ArchiveAuditTrail: false
                AutomaticReminder:
                  IsSendAutomaticRemindersEnabled: true
                  DaysBeforeFirstReminder: 5
                  IsRepeatRemindersEnabled: true
                  RepeatReminders: 5
                ExpirationReminder:
                  IsSendExpirationRemindersEnabled: true
                  DaysBeforeExpirationReminder: 5
                OtpAuthenticationSetting:
                  IsSmsOtpAuthenticationEnabled: false
                  IsMailOtpAuthenticationEnabled: false
    ValidationFailed:
      description: Request failed validation
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/ValidationError'
    UnAuthorized:
      description: Caller is unauthorized to perform this operation
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >
        Bearer token authentication using JSON Web Tokens (JWT) or opaque
        tokens.


        **Usage**: Send the access token in the Authorization header:

        ```

        Authorization: Bearer <access_token>

        ```

````