> ## 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 element

> Adds one element to an existing document. The element type is chosen with the `Type`
field, which can be one of five values:

- **SigningField** - marks where a signature must be placed. Signing fields are always
  mandatory.
- **TextBoxField** - a text input the end user can fill in. May carry a prefilled
  default value and may be mandatory or optional.
- **CheckBoxField** - a checkbox the end user can toggle. May be checked by default and
  may be mandatory or optional.
- **RadioGroup** - a group of radio buttons (the individual buttons are the group's
  `Options`). May have a button selected by default and may be mandatory or optional.
- **ComboBoxField** - a dropdown the end user picks an option from, optionally allowing
  a custom typed value. Available as of NSEV v8.5.

An element is positioned in one of the ways described on the placement schemas: with an
explicit `Location` and `Dimensions`, with a text `Marker`, or with a `FieldId` that
references an existing form field in the uploaded document. A signing field signed only
with the server signing method can also be created invisible, with no position at all.
An element can instead be created from an existing unplaced element by supplying its
`UnplacedElementId`.

Keep the number of signing fields per document within the recommended
maximum of 25: exceeding it does not fail the request, but raises a warning on
the package.

When the request references a marker or an existing form field (`Marker` or `FieldId`),
it is recommended to add the element at document-upload time: after a document
conversion the referenced marker or field may no longer exist.



## OpenAPI

````yaml /nsev/api-reference/openapi.yaml post /packages/{packageId}/documents/{documentId}/elements
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/{packageId}/documents/{documentId}/elements:
    parameters:
      - $ref: '#/components/parameters/packageIdPathParam'
      - $ref: '#/components/parameters/documentIdPathParam'
    post:
      tags:
        - Elements
      summary: Create element
      description: >-
        Adds one element to an existing document. The element type is chosen
        with the `Type`

        field, which can be one of five values:


        - **SigningField** - marks where a signature must be placed. Signing
        fields are always
          mandatory.
        - **TextBoxField** - a text input the end user can fill in. May carry a
        prefilled
          default value and may be mandatory or optional.
        - **CheckBoxField** - a checkbox the end user can toggle. May be checked
        by default and
          may be mandatory or optional.
        - **RadioGroup** - a group of radio buttons (the individual buttons are
        the group's
          `Options`). May have a button selected by default and may be mandatory or optional.
        - **ComboBoxField** - a dropdown the end user picks an option from,
        optionally allowing
          a custom typed value. Available as of NSEV v8.5.

        An element is positioned in one of the ways described on the placement
        schemas: with an

        explicit `Location` and `Dimensions`, with a text `Marker`, or with a
        `FieldId` that

        references an existing form field in the uploaded document. A signing
        field signed only

        with the server signing method can also be created invisible, with no
        position at all.

        An element can instead be created from an existing unplaced element by
        supplying its

        `UnplacedElementId`.


        Keep the number of signing fields per document within the recommended

        maximum of 25: exceeding it does not fail the request, but raises a
        warning on

        the package.


        When the request references a marker or an existing form field (`Marker`
        or `FieldId`),

        it is recommended to add the element at document-upload time: after a
        document

        conversion the referenced marker or field may no longer exist.
      operationId: createElement
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateElement'
            examples:
              signingfield-coordinates:
                summary: SigningField with explicit location and dimensions
                value:
                  Type: SigningField
                  ExternalReference: Signature1
                  SigningMethods:
                    - manual
                  LegalNotice:
                    Text: Read and approved
                  Location:
                    Page: 2
                    Top: 200
                    Left: 200
                  Dimensions:
                    Width: 200
                    Height: 200
              textboxfield-marker:
                summary: TextBoxField placed on a text marker
                value:
                  Type: TextBoxField
                  Name: Textbox1
                  Label: textBoxLabel
                  ToolTipLabel: Enter text here
                  IsRequired: false
                  DefaultValue: Hello
                  IsMultiline: true
                  CharLimit: 100
                  Marker: '@TXT01'
              checkboxfield-coordinates:
                summary: CheckBoxField with explicit location and dimensions
                value:
                  Type: CheckBoxField
                  Name: Checkbox10
                  ToolTipLabel: Optional
                  IsRequired: false
                  DefaultValue: false
                  Location:
                    Page: 1
                    Top: 230
                    Left: 300
                  Dimensions:
                    Width: 12
                    Height: 12
              radiogroup-coordinates:
                summary: RadioGroup with options at explicit locations
                value:
                  Type: RadioGroup
                  Name: Radio group
                  ToolTipLabel: Make a choice
                  IsRequired: true
                  Options:
                    - Name: one
                      Label: RadioGroup one label
                      IsSelected: true
                      Location:
                        Page: 1
                        Top: 700
                        Left: 10
                      Dimensions:
                        Width: 18
                        Height: 18
                    - Name: two
                      Label: RadioGroup two label
                      IsSelected: false
                      Location:
                        Page: 1
                        Top: 700
                        Left: 30
                      Dimensions:
                        Width: 18
                        Height: 18
                    - Name: three
                      Label: RadioGroup three label
                      IsSelected: false
                      Location:
                        Page: 1
                        Top: 700
                        Left: 50
                      Dimensions:
                        Width: 18
                        Height: 18
              comboboxfield-coordinates:
                summary: >-
                  ComboBoxField with explicit location and dimensions (NSEV
                  v8.5+)
                value:
                  Type: ComboBoxField
                  Name: Dropdown1
                  Label: Select a country
                  ToolTipLabel: Pick your country
                  IsRequired: true
                  Options:
                    - DisplayLabel: United States
                      ExportValue: US
                    - DisplayLabel: United Kingdom
                      ExportValue: UK
                  AllowCustomInput: false
                  DefaultValue: US
                  Location:
                    Page: 1
                    Top: 400
                    Left: 100
                  Dimensions:
                    Width: 150
                    Height: 20
              fieldid:
                summary: Convert an existing PDF form field into a signing field
                value:
                  Type: SigningField
                  SigningMethods:
                    - manual
                  FieldId: Signature_es_:signer1
      responses:
        '201':
          description: New element was created
          headers:
            Location:
              description: Location of the newly created element
              schema:
                type: string
                format: url
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Element'
              example:
                Type: signingField
                SigningMethods:
                  - manual
                  - beid
                LegalNotice:
                  Text: read and approved
                Location:
                  Page: 2
                  Top: 200
                  Left: 200
                Dimensions:
                  Width: 200
                  Height: 200
        '400':
          $ref: '#/components/responses/ValidationFailed'
        '401':
          $ref: '#/components/responses/UnAuthorized'
        '404':
          description: Target package or document with id could not be found
          content:
            application/json:
              schema:
                type: array
                items:
                  oneOf:
                    - $ref: '#/components/schemas/PackageNotFoundError'
                    - $ref: '#/components/schemas/DocumentNotFoundError'
        '409':
          description: element could not be added
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/Error'
components:
  parameters:
    packageIdPathParam:
      name: packageId
      in: path
      required: true
      description: The target package's unique identifier
      schema:
        $ref: '#/components/schemas/Package.Id'
    documentIdPathParam:
      name: documentId
      in: path
      required: true
      description: The target document's unique identifier
      schema:
        $ref: '#/components/schemas/Document.Id'
  schemas:
    CreateElement:
      oneOf:
        - $ref: '#/components/schemas/CreateElementFromUnplacedElement'
        - $ref: '#/components/schemas/CreateSigningField'
        - $ref: '#/components/schemas/CreateCheckBoxField'
        - $ref: '#/components/schemas/CreateTextBoxField'
        - $ref: '#/components/schemas/CreateRadioGroup'
        - $ref: '#/components/schemas/CreateComboBoxField'
      discriminator:
        propertyName: Type
        mapping:
          SigningField:
            $ref: '#/components/schemas/CreateSigningField'
          CheckBoxField:
            $ref: '#/components/schemas/CreateCheckBoxField'
          TextBoxField:
            $ref: '#/components/schemas/CreateTextBoxField'
          RadioGroup:
            $ref: '#/components/schemas/CreateRadioGroup'
          ComboBoxField:
            $ref: '#/components/schemas/CreateComboBoxField'
      example:
        Type: signingField
        Location:
          Page: 2
          Top: 200
          Left: 200
        Dimensions:
          Width: 200
          Height: 200
    Element:
      oneOf:
        - $ref: '#/components/schemas/SigningField'
        - $ref: '#/components/schemas/CheckBoxField'
        - $ref: '#/components/schemas/TextBoxField'
        - $ref: '#/components/schemas/RadioGroup'
        - $ref: '#/components/schemas/ComboBoxField'
      discriminator:
        propertyName: Type
        mapping:
          SigningField:
            $ref: '#/components/schemas/SigningField'
          CheckBoxField:
            $ref: '#/components/schemas/CheckBoxField'
          TextBoxField:
            $ref: '#/components/schemas/TextBoxField'
          RadioGroup:
            $ref: '#/components/schemas/RadioGroup'
          ComboBoxField:
            $ref: '#/components/schemas/ComboBoxField'
    PackageNotFoundError:
      title: Package not found
      allOf:
        - $ref: '#/components/schemas/NotFoundError'
      example:
        ErrorCode: Package.NotFound:00000000-0000-0000-0000-000000000000
        ErrorMessage: >-
          The package with id '00000000-0000-0000-0000-000000000000' could not
          be found
    DocumentNotFoundError:
      title: Document not found
      allOf:
        - $ref: '#/components/schemas/NotFoundError'
      example:
        ErrorCode: Document.NotFound:00000000-0000-0000-0000-000000000000
        ErrorMessage: >-
          The document with id '00000000-0000-0000-0000-000000000000' could not
          be found
    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.Id:
      allOf:
        - $ref: '#/components/schemas/Guid'
        - type: string
          description: A package's unique identifier
    Document.Id:
      allOf:
        - $ref: '#/components/schemas/Guid'
        - type: string
          description: A document'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, ComboBoxField) - an
            `@`-prefixed text marker `@id_height_width#`, with
            `@id_TB_height_width#` for a text box, `@id_CB_height_width#` for a
            check box and `@id_DD_height_width#` for a combo box (NSEV v8.5+),
            or a `@`-prefixed PDF field id `@id` that names an existing form
            field. When placing an unplaced **combo box**, only the
            combo-box-specific `@id_DD_height_width#` form is accepted - the
            generic `@id_height_width#` marker is rejected for this element
            type.

            - **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_|DD_)?(?:\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'
    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>" }`.

                When omitted, the package's `DefaultSigningMethods` (NSEV v8.5+)
                are applied to the field.
            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.
            InputType:
              $ref: '#/components/schemas/InputType'
    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.
    CreateComboBoxField:
      title: Combo box field
      allOf:
        - $ref: '#/components/schemas/CreateFormFieldBase'
        - type: object
          description: >
            Available as of NSEV v8.5.

            Parameters for creating a combo box (dropdown) field. When `FieldId`
            references an

            existing combo box in the PDF, the options come from that PDF field
            and `Options`

            must not be provided; otherwise `Options` is required.
          properties:
            Type:
              enum:
                - ComboBoxField
            Options:
              type: array
              description: >-
                The combo box options. Required unless `FieldId` is set, in
                which case the options come

                from the PDF field and this must not be provided. Option values
                (the `ExportValue`, or the

                `DisplayLabel` when no `ExportValue` is set) must be unique
                within the field.
              items:
                $ref: '#/components/schemas/ComboBoxOption'
              minItems: 1
              maxItems: 100
            AllowCustomInput:
              type: boolean
              default: false
              description: >-
                Whether the end user can type a custom value instead of
                selecting one of the options. Defaults to false.
            DefaultValue:
              type: string
              maxLength: 2048
              description: >-
                The value selected by default, which the end user can change.
                When `Options` are supplied,

                it must match the `ExportValue` (or the `DisplayLabel` when no
                `ExportValue` is set) of one

                of them, even when `AllowCustomInput` is true - and because
                option values are capped at 256

                characters, the effective maximum length is 256. When `FieldId`
                is set, the value is applied

                to the PDF-sourced options as-is; when omitted, the PDF field's
                own default is kept.
    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
            InputType:
              $ref: '#/components/schemas/InputType'
            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'
    ComboBoxField:
      title: Combo box field
      allOf:
        - $ref: '#/components/schemas/ElementBase'
        - $ref: '#/components/schemas/FormFieldBase'
        - type: object
          description: |
            Available as of NSEV v8.5.
            A combo box (dropdown) field.
          properties:
            Location:
              $ref: '#/components/schemas/Element.Location'
            Dimensions:
              $ref: '#/components/schemas/Element.Dimensions'
            Options:
              type: array
              description: The combo box options
              items:
                $ref: '#/components/schemas/ComboBoxOptionResult'
            AllowCustomInput:
              type: boolean
              description: >-
                Whether the end user can type a custom value instead of
                selecting one of the options
            IsOverridable:
              type: boolean
              description: >-
                Whether the options can be modified. False when they are sourced
                from an existing PDF form

                field - via `FieldId` or a `@id` PDF-field marker; true for
                fields created with request-supplied

                options.
            Value:
              type: string
              description: The value of the completed combo box field
            DefaultValue:
              type: string
              description: The export value selected by default
    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
    NotFoundError:
      title: Not found
      allOf:
        - $ref: '#/components/schemas/Error'
        - description: The resource could not be found
      example:
        ErrorCode: Document.NotFound:00000000-0000-0000-0000-000000000000
        ErrorMessage: >-
          The document with id '00000000-0000-0000-0000-000000000000' could not
          be found
    Guid:
      title: GUID
      type: string
      description: A globally unique identifier
      format: guid
      example: 00000000-0000-0000-0000-000000000000
    Element.Id:
      allOf:
        - $ref: '#/components/schemas/Guid'
        - type: string
          description: An element's unique identifier
    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.
    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
    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
    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
            - ComboBoxField
        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_|DD_)?(?:\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, ComboBoxField) - an
            `@`-prefixed text marker `@id_height_width#`, with
            `@id_TB_height_width#` for a text box, `@id_CB_height_width#` for a
            check box and `@id_DD_height_width#` for a combo box (NSEV v8.5+),
            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
      description: >-
        A signing method, optionally pinned to a key pair. In requests, a bare
        signing-method name

        string is also accepted anywhere this object is expected, as shorthand
        for `{ "Name": "<method>" }`.

        Responses always return the object form.
      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
    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
    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.
    InputType:
      title: Text box input type
      type: string
      description: >
        Available as of NSEV v8.5.

        A hint for how the text box is rendered. Defaults to `Text` when
        omitted. The hint does not

        constrain `DefaultValue`, `IsMultiline` or `CharLimit` - the API applies
        no format

        validation based on it.
      enum:
        - Text
        - Date
        - Time
        - DateTime
        - Number
    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'
    ComboBoxOption:
      title: Combo box option
      type: object
      description: >
        Available as of NSEV v8.5.

        A combo box option: the label shown to the end user and the value stored
        when it is selected.
      required:
        - DisplayLabel
      properties:
        DisplayLabel:
          type: string
          description: The display label shown to the end user
          maxLength: 256
        ExportValue:
          type: string
          description: >-
            The value stored when this option is selected. When omitted, the
            `DisplayLabel` is used as the value.
          maxLength: 256
    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
    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
    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
    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'
    ComboBoxOptionResult:
      title: Combo box option (result)
      type: object
      description: |
        Available as of NSEV v8.5.
        A combo box option in a response.
      properties:
        DisplayLabel:
          type: string
          description: The display label shown to the end user
        ExportValue:
          type: string
          description: The value stored when this option is selected
    Actor.Id:
      allOf:
        - $ref: '#/components/schemas/Guid'
        - type: string
          description: This actor's unique identifier
    Element.Type:
      type: string
      description: |
        The type of element - the discriminator across the element variants.
        The `ComboBoxField` value is available as of NSEV v8.5.
      nullable: false
      enum:
        - SigningField
        - TextBoxField
        - CheckBoxField
        - RadioGroup
        - ComboBoxField
    Element.Status:
      type: string
      description: The status of a document element
      enum:
        - Pending
        - InProgress
        - Rejected
        - Failed
        - Finished
        - Refused
  responses:
    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>

        ```

````