# Send Paige documents to Laserfiche with Power Automate

Build the Power Automate flow that watches Paige's SFTP export folder, reads each document's field values, and imports the PDF into Laserfiche Cloud through the Laserfiche API with its template assigned and fields filled — using a service principal, exactly as Laserfiche's own low-code guide describes.

Product: paige · Audience: integrator · Time: 1.5 hours · Last verified: 2026-09-05

Canonical: https://help.ademero.com/paige/integrations/send-paige-documents-to-laserfiche-with-power-automate

**At the end of this guide, every document Paige finishes is imported into your Laserfiche Cloud repository within minutes — in the folder you choose, with its template assigned and its fields filled from Paige's values — by a Power Automate flow that calls the Laserfiche API the way Laserfiche's own low-code guide shows.**

There is no Laserfiche connector in Power Automate; the flow uses the built-in **HTTP** action against the Laserfiche Repository API. It's two calls: get a token, then import. The rest of the flow is the usual Paige pattern: *SFTP trigger → keep only the data file → Parse JSON → get the PDF → import.*

## Step 1 — Point Paige at your SFTP server

1. In Paige, open **Settings** (the gear at the bottom of the left menu — administrators only), pick the scan job, and choose **Export**.
2. Click the **FTP** card. Enter the **FTP Address**, **Port** `22`, **Username**, **Password**, and in **FTP Folder Path** a folder for this scan job, such as `/paige/invoices`.
3. Click **Test Connection**. **What you should see:** `FTP connection successful!` Connect — `Connected to FTP Server!` and a green **Connected** label.
4. Turn on **Enable Auto Export**. Under **Auto Export Settings**, switch on **Only documents having a document type**, set **Auto Field Entry Complete** to **Yes**, and set **Human Reviewed** to **Reviewed** if a person checks documents in Paige first. Click **Save**.

Open port 22 on your firewall to Paige's address ranges — [Outbound IP ranges for firewall allow-lists](/paige/document-processing/outbound-ip-ranges-for-firewall-allow-lists).

## Step 2 — Give the flow an identity in Laserfiche

Laserfiche wants integrations to act as a **service principal** (an unlicensed, non-human user) through a **service app**.

1. **Create the service principal.** In Laserfiche Cloud's **Account Administration**, open the **Users** tab and, under **Service Principals**, click **Add Service Principal**. Give it a username and display name, grant it access to the repository (a group with import rights on the destination folder is the tidy way), and click **Create**.
2. **Create a service app.** In the **Developer Console**, click **New**, choose the **Service** app type, and on **App Configuration** select the service principal you just made. Save. Under **Authentication**, in **OAuth 2.0 Scopes**, allow `repository.Read repository.Write`.
3. **Generate the credential the flow will use.** In the same app, generate a long-lasting **authorization key** (Laserfiche's Option 2 for service apps; it lets the flow request tokens with a plain Bearer header instead of signing a JWT). Copy it — it's shown once. Store it in the flow as a secured input, never in plain text.
4. Note your **repository ID** (visible in the repository's URL and in Account Administration) and the **entry ID** of the destination folder (open the folder in the web client; the ID is in the URL).

## Step 3 — Build the flow

Create an **Automated cloud flow**.

1. **Trigger — SFTP - SSH: When a file is added or modified.** Connection: **Host server address**, **User name**, **Password**, **Port number** `22`. **Folder:** the scan job's folder. **Include file content** on.

2. **Condition:** *File name* **ends with** `.json`. Steps 3–6 go in **If yes**.

3. **Parse JSON.** Content: the trigger's *File content*; schema generated from a real `.json` via **Use sample payload to generate schema**.

4. **SFTP - SSH: Get file content using path.** Path: the folder plus the parsed `pdf_file`.

5. **HTTP — get a token.** Name the action `Get Laserfiche Access Token`.
   - **Method:** POST. **URI:** `https://signin.laserfiche.com/oauth/token` (use `signin.laserfiche.ca` or `signin.eu.laserfiche.com` if your account is hosted there).
   - **Headers:** `Authorization: Bearer <your authorization key>` and `Content-Type: application/x-www-form-urlencoded`.
   - **Body:** `grant_type=client_credentials&scope=repository.ReadWrite`.
   - Turn on **Secure Inputs** in the action's settings so the key doesn't appear in run history.

6. **HTTP — import the document.**
   - **Method:** POST. **URI:** `https://api.laserfiche.com/repository/v2/Repositories/<repositoryId>/Entries/<folderEntryId>/Folder/Import`
   - **Headers:** `Authorization: Bearer @{body('Get_Laserfiche_Access_Token')['access_token']}` and a `Content-Type: multipart/form-data; boundary=...` header that matches the body.
   - **Body:** a multipart body with two parts — the PDF from step 4 as the file part (binary), and a JSON part named `request`:
   
     ```json
     {
       "name": "@{body('Parse_JSON')?['fields']?['Invoice Number']} - @{body('Parse_JSON')?['fields']?['Vendor Name']}",
       "autoRename": true,
       "metadata": {
         "templateName": "Vendor Invoice",
         "fields": [
           { "name": "Vendor",         "values": ["@{body('Parse_JSON')?['fields']?['Vendor Name']}"] },
           { "name": "Invoice Number", "values": ["@{body('Parse_JSON')?['fields']?['Invoice Number']}"] },
           { "name": "Invoice Date",   "values": ["@{body('Parse_JSON')?['fields']?['Invoice Date']}"] },
           { "name": "Amount",         "values": ["@{body('Parse_JSON')?['fields']?['Total']}"] }
         ]
       }
     }
     ```
   
     `templateName` and each field `name` must match the Laserfiche template and its field names exactly. `autoRename` keeps a duplicate name from failing the import. Laserfiche's low-code guide shows the exact multipart layout Power Automate accepts — build yours from that example.
   
   **What you should see when you test:** HTTP `201 Created`, and a response whose `documentLink` points at the new entry. Field errors, if any, come back inside the response rather than as a failed request, so check it.

7. **Save.** **What you should see:** the flow checker reports no errors.

> **NOTE:** Laserfiche date and number fields are particular about format. Paige exports values as text exactly as they appear on the page; convert with `formatDateTime()` and `float(replace(...))` in the expressions above when the template field isn't text.

## Step 4 — Test it

1. Process one document through the scan job in Paige (review it if you required review) and wait for the export.
2. Open the flow's **28-day run history**. **What you should see:** one successful run; the import action returned `201`.
3. In the Laserfiche web client, open the destination folder. **What you should see:** the document with the template assigned and the fields filled. Open it — the text is selectable.

## When it doesn't work

| Symptom | Where to look |
| --- | --- |
| Token request returns `401` | The authorization key is wrong or was revoked, or the scope isn't allowed on the app. |
| Import returns `401` or `403` | The service principal lacks rights on the folder, or the token expired between steps (they're short-lived; request a fresh one each run, as the flow does). |
| Import returns `400` | The multipart body isn't formed as the API expects, or the JSON `request` part is invalid. Compare against Laserfiche's low-code example. |
| Document arrives without fields | A field name doesn't match the template, or a value failed the field's type. Read the operations summary in the `201` response. |
| The flow never runs | Wrong SFTP folder, or a subfolder. Files over 50 MB are skipped by this trigger. |
| Nothing arrives from Paige | Auto-export criteria aren't met, or the document was processed before you enabled auto export. Export once from the **Documents** page with **Export** and tick **FTP**. |

If the Paige side is the problem, contact Ademero support with the scan job name and the message from **Test Connection**.

## What's next

- [Connect Paige to Laserfiche](https://help.ademero.com/paige/integrations/connect-paige-to-laserfiche)
- [Connect Paige to any app with Zapier, Make, or Power Automate](https://help.ademero.com/paige/integrations/connect-paige-to-any-app-with-zapier-make-or-power-automate)
