Paperless NGX icon

Paperless NGX

Interact with the Paperless NGX API

Overview

The node integrates with the Paperless NGX API to manage correspondents, which are entities used to automatically assign documents based on matching criteria. Specifically, the "Update Correspondent" operation allows users to modify an existing correspondent's details such as name, matching rules, ownership, and permissions.

This node is beneficial in document management workflows where automatic classification or assignment of documents to specific correspondents is required. For example, when new documents arrive, they can be automatically linked to a correspondent based on content matching, streamlining organization and retrieval.

Practical examples:

  • Updating a correspondent’s name or matching string after organizational changes.
  • Changing the matching algorithm to improve document assignment accuracy.
  • Adjusting ownership or access permissions for correspondents to reflect team changes.

Properties

Name Meaning
Note (globalPermissionsNote) Informational notice that owner and permissions fields accept numeric IDs. Users should retrieve available User and Group IDs via separate API calls or nodes.
Name (name) The name of the correspondent. This is a required field when updating a correspondent.
Match (match) A string pattern that Paperless NGX will try to match against document contents to automatically assign this correspondent.
Matching Algorithm (matchingAlgorithm) The algorithm used to match documents to this correspondent. Options include: None, Any (match any word), All (match all words), Literal (exact string), Regular Expression, Fuzzy Match, Auto (automatic selection).
Case Insensitive (isInsensitive) Boolean flag indicating whether the matching should ignore case differences.
Owner User ID (owner) Numeric user ID to set as the owner of this correspondent.
Set Permissions (setPermissions) JSON object defining view and change permissions for users and groups. Format: {"view":{"users":[],"groups":[]},"change":{"users":[],"groups":[]}}.
Note (permissionsNote) Informational notice reminding users to use Users and Groups endpoints to look up IDs for owner and permissions. No create/update/delete operations for users/groups are provided by this node.
Correspondent ID (id) The unique numeric ID of the correspondent to update. This is a required field.

Output

The node outputs JSON data representing the updated correspondent object as returned by the Paperless NGX API. This typically includes fields such as the correspondent's ID, name, matching criteria, matching algorithm, ownership, and permissions.

No binary data output is produced by this operation.

Dependencies

  • Requires an active connection to a Paperless NGX instance via its REST API.
  • An API authentication token or key credential must be configured in n8n to authorize requests.
  • Users and Groups must be managed separately; their IDs are needed for setting ownership and permissions but are not created or modified by this node.

Troubleshooting

  • Common issues:

    • Providing invalid or non-existent correspondent ID will result in errors.
    • Incorrectly formatted permissions JSON may cause request failures.
    • Using user or group IDs that do not exist or lack proper access rights can lead to permission errors.
    • Mismatch between the matching algorithm and the match string format (e.g., using regex algorithm with an invalid regex) may cause unexpected behavior.
  • Error messages:

    • 404 Not Found: The specified correspondent ID does not exist.
    • 400 Bad Request: Invalid input data, such as malformed JSON in permissions or missing required fields.
    • 401 Unauthorized: API credentials are missing or invalid.
  • Resolutions:

    • Verify the correspondent ID exists before attempting update.
    • Validate JSON syntax for permissions.
    • Ensure API credentials are correctly configured and have sufficient permissions.
    • Test matching strings and algorithms independently to confirm correctness.

Links and References

Discussion