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

# Connect File bucket / SFTP to Watchdog

> Connect File bucket / SFTP to Watchdog and grant access to invoices and documents.

Connect an SFTP server to import invoice files from a folder. This integration is called **File bucket / SFTP** in Watchdog.

## Before you begin

Ask the SFTP server administrator for:

| Detail                  | Description                                               |
| ----------------------- | --------------------------------------------------------- |
| Host and Port           | Server address and port, usually port `22`                |
| Username                | A user with read access to the invoice folder             |
| Password or Private key | The user's password or private key                        |
| Base path               | The folder containing the invoice files                   |
| Host key fingerprint    | The server key's SHA256 fingerprint, such as `SHA256:...` |

If the private key is password-protected, you also need its passphrase.

## Connect in Watchdog

1. Open **Integrations → File bucket / SFTP** and add a connection.
2. Enter the server address, credentials, folder, and fingerprint.
3. Optionally use **Prefix** to limit the search to a subfolder, such as `incoming/2026`.
4. Select **Test Connection**, check the files shown, and save the connection.
5. Optionally set file filters under **Settings** before starting synchronization.

The test shows a sample of files and indicates whether the list is complete. A sample count is not necessarily the total number of files in the folder.

### Choose which files to import

File filters use patterns, also called globs. They match the file path relative to **Base path**, even when you have set a **Prefix**.

| Pattern             | Includes                                   |
| ------------------- | ------------------------------------------ |
| `2026/*.pdf`        | PDF files directly in the `2026` folder    |
| `incoming/**/*.xml` | XML files in `incoming` and its subfolders |
| `docs/INV-?.pdf`    | Files such as `docs/INV-1.pdf`             |

Separate multiple patterns with commas or new lines. A file is included if at least one pattern matches. Leave the field empty to include all files found under the selected folder and prefix.

<Warning>
  Each file path is treated as a separate invoice. Use a folder where each invoice appears once. If
  you receive PDF and XML copies of the same invoice, choose which files to import. Files larger
  than 50 MB cannot be downloaded.
</Warning>

## For the SFTP administrator

* Give the user permission to list and read files, without permission to write, move, or delete them.
* Supply the server key's OpenSSH SHA256 fingerprint. Watchdog rejects the connection if the key does not match.
* For key-based sign-in, paste the full private key, including the `BEGIN` and `END` lines.
* Make files available only after the upload is complete, for example by renaming them after upload.
* Update the file's modification time (`mtime`) when replacing its contents. Watchdog detects changes using file size and modification time.

Watchdog does not delete an imported invoice when its file is later removed from the SFTP server.

## If the test finds no files

Check the folder, prefix, file filters, and the user's read access. For a server-key mismatch, ask the administrator to confirm the correct fingerprint before changing it in Watchdog.
