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

# Get document

> Retrieves a single document from a package by its document ID.



## OpenAPI

````yaml /nsev/api-reference/openapi.yaml get /packages/{packageId}/documents/{documentId}
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}:
    parameters:
      - $ref: '#/components/parameters/documentIdPathParam'
      - $ref: '#/components/parameters/packageIdPathParam'
    get:
      tags:
        - Documents
      summary: Get document
      description: Retrieves a single document from a package by its document ID.
      operationId: getDocument
      responses:
        '200':
          description: document was found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Document'
        '400':
          $ref: '#/components/responses/ValidationFailed'
        '401':
          $ref: '#/components/responses/UnAuthorized'
        '404':
          description: Target package or document could not be found
          content:
            application/json:
              schema:
                type: array
                items:
                  oneOf:
                    - $ref: '#/components/schemas/PackageNotFoundError'
                    - $ref: '#/components/schemas/DocumentNotFoundError'
components:
  parameters:
    documentIdPathParam:
      name: documentId
      in: path
      required: true
      description: The target document's unique identifier
      schema:
        $ref: '#/components/schemas/Document.Id'
    packageIdPathParam:
      name: packageId
      in: path
      required: true
      description: The target package's unique identifier
      schema:
        $ref: '#/components/schemas/Package.Id'
  schemas:
    Document:
      allOf:
        - $ref: '#/components/schemas/DocumentCreatedSync'
        - type: object
      properties:
        IsActionNeeded:
          type: boolean
          description: >-
            Indicates that the document is not fully processed and user must
            take an action to keep/remove signatures/markers. (presented only
            for draft packages if true)
        ErrorCode:
          type: string
          description: >-
            The code of error occured during async document uploading.
            (presented only for processingFailed document)
        HasSignatures:
          type: boolean
          description: >-
            If present, the document data contains signatures. (Returns only for
            document with IsActionNeeded)
        HasSigningFields:
          type: boolean
          description: >-
            If present, the document data contains signing field markers.
            (Returns only for document with IsActionNeeded)
        HasFormFields:
          type: boolean
          description: >-
            If present, the document data contains form field markers. (Returns
            only for document with IsActionNeeded)
    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
    Document.Id:
      allOf:
        - $ref: '#/components/schemas/Guid'
        - type: string
          description: A document's unique identifier
    Package.Id:
      allOf:
        - $ref: '#/components/schemas/Guid'
        - type: string
          description: A package's unique identifier
    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'
    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
    Document.Name:
      type: string
      nullable: false
      description: Name of the document
      minLength: 1
      maxLength: 150
      example: example document
    CreationDate:
      type: string
      format: date-time
      description: When the resource was created
    MediaType:
      nullable: false
      type: string
      format: mediaType
      description: The media type of a file
      example: application/pdf
    Language:
      type: string
      format: languageCode
      description: A country's 2 letter ISO code (ISO 639-1)
      example: en
    Document.Status:
      type: string
      description: The status of a document
      enum:
        - Draft
        - Pending
        - InProgress
        - Ending
        - Finished
        - Rejected
        - Revoked
        - Expired
        - Failed
        - Processing
        - ProcessingFailed
    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'
    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
    Document.OrderIndex:
      type: integer
      description: The Order Index of the document.
    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
    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'
    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
    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
    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'
    Element.Id:
      allOf:
        - $ref: '#/components/schemas/Guid'
        - type: string
          description: An element's unique identifier
    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 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
  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>

        ```

````