Skip to main content

Classify Document - Document Classification for Zapier

PDF4me Classify Document classifies PDF documents based on expressions (regular expressions or JavaScript) that you define on dev.pdf4me.com. You create document classes with search patterns—e.g. pdf4me_invoice with regex invoice(.*)—and when a PDF is sent to the action, PDF4me matches the document content against your rules and returns the Class Name. Use the Class Name in Filters, Paths, or follow-up actions to route, rename, or process documents by type.

Important: Classification rules are defined and stored in your PDF4me account. Create your classes first at Classify Document, then use the action in Zapier. For full setup, see Set Up Classify Document.

Authenticating Your API Request

To access the PDF4me Web API through Zapier, every request must include proper authentication credentials. Authentication ensures secure communication and validates your identity as an authorized user.

Key Features

  • Expression-Based Classification: Define document classes with Regular Expression or JavaScript on dev.pdf4me.com
  • Class Name Output: Returns the matched class (e.g. pdf4me_invoice, Invoice) for routing and filtering
  • Custom Rules: Match document content with regex patterns (e.g. invoice(.*), Invoice\s*#\s*Pdf4me-\d{6}-\d{5})
  • Workflow Integration: Use Class Name in Filters, Paths, Upload File, Google Sheets, Airtable, and 6,000+ Zapier apps
  • One Credit per Classification: Each Classify Document run uses 1 credit
Classify Document: Class Name, expression type (Regular Expression), regex invoice(.*)

Parameters

Important: Parameters marked with an asterisk (*) are required. Map values from your trigger or previous Zap steps.

ParameterTypeDescriptionExample
File*FileThe PDF file to classify. Map from your trigger (e.g. 1. File from New File in Folder)1. File
File NameStringName of the PDF file (e.g. base name + extension). Map 1. File Name + 1. File Ext from the triggerdocument.pdf

Class setup: Create classes at Classify Document. Add a class (e.g. pdf4me_invoice) with a regex (e.g. invoice(.*)). Save Changes so Zapier can use them.

Zapier Classify Document action: File, File Name parameters

Output

Classify Document returns the Class Name that matched your PDF based on your classification rules. It does not return or modify the PDF file. Use the file from your trigger or previous step if you need to pass the PDF onward.

ParameterTypeDescription
Class NamesStringThe matched class (e.g. pdf4me_invoice, Invoice). Use in Filters, Paths, or the next action
Trace IdStringUnique trace identifier for tracking and debugging

Example: If your PDF matches the pdf4me_invoice class, the output includes 2. Class Names = pdf4me_invoice. Use this in a Filter (only continue if Class Names = invoice), in Paths to branch your Zap, or in Upload File to name files by class.

:::tip How Classify Document Works

  1. Create classes on dev.pdf4me.com: Go to Classify Document, click Edit, add classes with Class Name and Regular Expression (or JavaScript). Example: pdf4me_invoice with invoice(.*). Click Save Changes.
  2. Map File and File Name in Zapier: The action takes File (required) and File Name (optional) from your trigger or previous step.
  3. Use Class Name in the next step: Route with Filters or Paths, rename files, or map to spreadsheets and databases.

For detailed setup, see Set Up Classify Document. :::

Workflow Examples

Route Invoices vs Contracts to Different Folders

Complete Workflow Steps:

  1. Trigger: New File in Folder (Dropbox, Google Drive, SharePoint)
  2. Classify Document: Map 1. File and 1. File Name + 1. File Ext; action returns 2. Class Names
  3. Paths (or Filter): If 2. Class Names = invoice, run path A; if contract, run path B
  4. Upload File (path A): Save to /Accounting/Invoices/; (path B) save to /Legal/Contracts/

Business Benefits:

  • Automates document sorting by type using your regex/JavaScript rules
  • Routes documents to the right folder without manual review
  • Works with any classes you define (invoices, contracts, receipts, forms, etc.)

Industry Use Cases & Applications

  • Invoice Routing: Route invoices by class (e.g. regex matching "invoice") to AP workflow
  • Receipt Processing: Identify receipts for expense management using expression patterns
  • Document Sorting: Organize financial documents by type using your classification rules

Step-by-step guides to classify and route documents by type:

Get Help