> ## 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 the package audit trail

> Retrieves a package's audit trail as structured JSON - a list of events
that occurred during the package's lifecycle, together with package and
document information. The audit trail is available for a package in any
status.

Because the audit trail is built from the retained audit log, it can still
be retrieved after the package itself has been deleted. In that case the
response is reconstructed from the log events alone, so some package and
document fields (for example `Status`, `Name` and the document page and
signed-field counts) may be absent.

To download the signed PDF representation of the audit trail, use
`GET /packages/{packageId}/audittrail/{culture}`.



## OpenAPI

````yaml /nsev/api-reference/openapi.yaml get /packages/{packageId}/audittrail
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}/audittrail:
    get:
      tags:
        - AuditTrails
      summary: Get the package audit trail
      description: >-
        Retrieves a package's audit trail as structured JSON - a list of events

        that occurred during the package's lifecycle, together with package and

        document information. The audit trail is available for a package in any

        status.


        Because the audit trail is built from the retained audit log, it can
        still

        be retrieved after the package itself has been deleted. In that case the

        response is reconstructed from the log events alone, so some package and

        document fields (for example `Status`, `Name` and the document page and

        signed-field counts) may be absent.


        To download the signed PDF representation of the audit trail, use

        `GET /packages/{packageId}/audittrail/{culture}`.
      operationId: getAuditTrailJson
      parameters:
        - $ref: '#/components/parameters/packageIdPathParam'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuditTrailResponse'
              examples:
                audit-events:
                  summary: The audit events
                  value:
                    RequestedOn: '2025-02-27T09:09:46Z'
                    PackageInfo:
                      Id: 00000000-0000-0000-0000-000000000000
                      Name: example package
                      CreatedOn: '2025-01-14T13:24:49Z'
                      Initiator: hello@world.invalid
                      Status: Draft
                      Documents:
                        - Id: 00000000-0000-0000-0000-000000000000
                          Name: example document
                          PagesCount: 10
                          SignedFieldsCount: 4
                    Events:
                      - Id: 00000000-0000-0000-0000-000000000000
                        CreatedOn: '2024-08-14T13:24:49Z'
                        IpAddress: 127.1.0.0
                        Type: SignActionCompleted
                        User: hello@world.invalid
                        PackageDetail:
                          ApiSource: Unknown
                          TemplateCode: '00001'
                          Documents:
                            - Id: 00000000-0000-0000-0000-000000000000
                              Name: example document
                              PagesCount: 10
                              SignedFieldsCount: 4
                        ActionDetail:
                          ActorId: 00000000-0000-0000-0000-000000000000
                          PersonId: 00000000-0000-0000-0000-000000000000
                          EmailAddress: hello@world.invalid
                          Documents:
                            - Id: 00000000-0000-0000-0000-000000000000
                              Name: example document
                          SigningMethods:
                            - Name: MailOtp:MailOtp
                              KeyPair: MyKeyPair
        '401':
          $ref: '#/components/responses/UnAuthorized'
        '404':
          $ref: '#/components/responses/NotFound.Package'
components:
  parameters:
    packageIdPathParam:
      name: packageId
      in: path
      required: true
      description: The target package's unique identifier
      schema:
        $ref: '#/components/schemas/Package.Id'
  schemas:
    AuditTrailResponse:
      type: object
      properties:
        RequestedOn:
          type: string
          description: Date of request for this audit trail.
          format: date-time
          example: '2024-08-27T09:09:46Z'
        PackageInfo:
          type: object
          properties:
            Id:
              $ref: '#/components/schemas/Package.Id'
            Name:
              $ref: '#/components/schemas/Package.Name'
            CreatedOn:
              type: string
              description: Date of package creation
              format: date-time
              example: '2024-08-14T13:24:49Z'
            Initiator:
              $ref: '#/components/schemas/Package.Initiator'
            Status:
              $ref: '#/components/schemas/Package.Status'
            Documents:
              type: array
              items:
                $ref: '#/components/schemas/AuditTrailPackageDocument'
        Events:
          type: array
          description: A list of events that occured during the lifecycle of the package
          items:
            type: object
            properties:
              Id:
                allOf:
                  - $ref: '#/components/schemas/Guid'
                  - type: string
                    description: Unique identifier of an event
              CreatedOn:
                type: string
                description: Date of event creation
                format: date-time
                example: '2024-08-14T13:24:49Z'
              IpAddress:
                type: string
                description: The ip address of the user that made the event happen
                example: 127.1.0.0
              Type:
                $ref: '#/components/schemas/AuditEventType'
              User:
                allOf:
                  - $ref: '#/components/schemas/EmailAddress'
                  - type: string
                    description: >-
                      The email address of the logged in application user that
                      made the event happen
                    nullable: true
              PackageDetail:
                $ref: '#/components/schemas/PackageAuditDetail'
              ActionDetail:
                $ref: '#/components/schemas/ActionAuditDetail'
    Package.Id:
      allOf:
        - $ref: '#/components/schemas/Guid'
        - type: string
          description: A package's unique identifier
    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.Status:
      type: string
      description: The status of a package
      enum:
        - Draft
        - Pending
        - InProgress
        - Ending
        - Finished
        - Archived
        - Rejected
        - Revoked
        - Expired
        - Failed
        - Processing
        - ProcessingFailed
    AuditTrailPackageDocument:
      type: object
      properties:
        Id:
          allOf:
            - $ref: '#/components/schemas/Guid'
            - type: string
              description: A document's unique identifier
              nullable: true
        Name:
          $ref: '#/components/schemas/Document.Name'
        PagesCount:
          type: integer
          example: 10
          nullable: true
        SignedFieldsCount:
          type: integer
          description: |
            The number of signed fields on the document.
          example: 4
          nullable: true
    Guid:
      title: GUID
      type: string
      description: A globally unique identifier
      format: guid
      example: 00000000-0000-0000-0000-000000000000
    AuditEventType:
      type: string
      nullable: false
      description: >
        Unique name defining the event type. The list is not exhaustive and
        subject to extension.
      example: SignActionCompleted
      enum:
        - PackageCreated
        - PackageSubmitted
        - PackageDeleted
        - PackageExpired
        - PackageExtended
        - PackageRevoked
        - PackageFinished
        - PackageRejected
        - PackageSentToReceiver
        - PackageApprovalEnded
        - PackageEnded
        - PackageActionInvitationSent
        - PackageActionReminderSent
        - PackageViewedByPerson
        - UnsignedPackageDownloadedByAnonymous
        - UnsignedPackageDownloadedByPerson
        - DocumentsRefusedBySigner
        - FormFieldsRefused
        - MailOtpAuthenticationCodeSent
        - MailOtpAuthenticationSuccessful
        - SmsOtpAuthenticationCodeSent
        - SmsOtpAuthenticationSuccessful
        - PhoneNumberVerified
        - SmsOtpSent
        - MailVerified
        - MailOtpSent
        - PackageActionRejected
        - PackageActionInProgress
        - PackageActionFailed
        - ApproveActionCompleted
        - FormFillActionCompleted
        - SignActionCompleted
        - PackageActionReassigned
        - PackageActionReassignedByUser
        - DocumentDownloadedByAnonymous
        - DocumentDownloadedByPerson
        - DocumentDownloadedByUser
        - PackageDownloadedByAnonymous
        - PackageDownloadedByPerson
        - PackageDownloadedByUser
    EmailAddress:
      title: Email address
      type: string
      format: email
      example: hello@world.test
    PackageAuditDetail:
      type: object
      description: >
        Additional information about the package that is relevant for the
        package events: Not empty for events that affect the package itself.
      properties:
        ApiSource:
          type: string
          nullable: true
          description: >
            The source of the API that initiated the event. Not empty for
            `PackageSubmitted`, `PackageDeleted`, `PackageCreated`,
            `PackageRevoked` events.
          enum:
            - Unknown
            - PortalApi
            - WebPortalApiV3
            - WebPortalApiV4
        TemplateCode:
          type: string
          nullable: true
          description: >
            Identifier of the template from which the package was created. Not
            empty when `PackageCreated` event indicates the package was created
            from a template.
        Documents:
          type: array
          description: |
            State of documents at time of the event.
          items:
            $ref: '#/components/schemas/AuditTrailPackageDocument'
    ActionAuditDetail:
      type: object
      description: >
        Additional information about the actor that is relevant for the action
        events: Not empty for events that affect an actor itself.
      properties:
        ActorId:
          allOf:
            - $ref: '#/components/schemas/Guid'
            - type: string
              description: An actor's (action) unique identifier
              nullable: false
        PersonId:
          allOf:
            - $ref: '#/components/schemas/Guid'
            - type: string
              description: A person's (stakeholder) unique identifier
              nullable: true
        EmailAddress:
          allOf:
            - $ref: '#/components/schemas/EmailAddress'
            - type: string
              description: The person's email address
              nullable: true
        Documents:
          type: array
          description: >
            Affected documents during an action (Approved, FormFilled or
            Signed).
          items:
            $ref: '#/components/schemas/AuditTrailActionDocument'
        SigningMethods:
          type: array
          description: |
            Used signing methods for a `SignActionCompleted` event.
          items:
            $ref: '#/components/schemas/SigningMethodWithKeyPair'
    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
    Document.Name:
      type: string
      nullable: false
      description: Name of the document
      minLength: 1
      maxLength: 150
      example: example document
    AuditTrailActionDocument:
      type: object
      properties:
        Id:
          allOf:
            - $ref: '#/components/schemas/Guid'
            - type: string
              description: A document's unique identifier
              nullable: true
        Name:
          $ref: '#/components/schemas/Document.Name'
    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
    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
    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
  responses:
    UnAuthorized:
      description: Caller is unauthorized to perform this operation
    NotFound.Package:
      description: Package could not be found
      content:
        application/json:
          schema:
            type: array
            items:
              $ref: '#/components/schemas/PackageNotFoundError'
  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>

        ```

````