View as Markdown
Expensify icon

Expensify ACTION

Export Report

Export Expensify reports to a file (csv, xls, xlsx, txt, pdf, json, xml). See the documentation
  • Action
  • Writes data
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Expensify account once, then configure and run Export Report from your backend or agent.

import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "expensify-export-report",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    expensify: { authProvisionId: "apn_xxxxxxx" },
    reportIds: ["Report IDs"],
    startDate: "Start Date",
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Export Report inputs
Property Type Description
reportIds Report IDs string[]
The IDs of the reports to be exported. Required if startDate or approvedAfter are not specified.
Optional
startDate Start Date string
The start date of the report. Format: YYYY-MM-DD. Required if reportIds or approvedAfter are not specified.
Optional
endDate End Date string
The end date of the report. Format: YYYY-MM-DD. Conditionally required, if either startDate or approvedAfter is more than one year ago.
Optional
approvedAfter Approved After string
Filters out all reports approved before the given date, whichever occurred last (inclusive). Required if reportIds or startDate are not specified
Optional
fileExtension File Extension string
The format of the generated file. xlsx, xls, and pdf work on their own. csv, txt, json, and xml require a Template Path (a Freemarker template file in /tmp) — if you don't have one, choose xlsx.
Required
markedAsExported Marked as Exported Label (Filter) string
Filters out reports that have already been exported with that label
Optional
reportStates Report States string[]
Only the reports matching the specified status(es) will be exported
Optional
employeeEmail Employee Email string
Export reports for the specified employee email
Optional
policyIds Policy IDs string[]
The IDs of the policies to filter by. Run List Policies first to obtain valid IDs.
Optional Dynamic
fileBaseName File Base Name string
The base name of the file to be exported
Optional
includeFullPageReceiptsPdf Include Full Page Receipts PDF boolean
Specifies whether generated PDFs should include full page receipts. This parameter is used only if fileExtension contains pdf.
Optional
emailRecipients Email Recipients string[]
People to email at the end of the export
Optional
markAsExported Mark as Exported string
Mark the reports as exported with the given label
Optional
templatePath Template Path string
The path in the /tmp directory to the template to use for the export. Required if fileExtension is csv, txt, json, or xml.
Optional
limit Limit string
Maximum number of reports to export
Optional
test Test Mode boolean
If set to true, actions defined in onFinish (i.e. email, markAsExported) will not be executed
Optional
syncDir SyncDir dir
Required

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
expensify-export-report
Version
0.0.4
App
Expensify
Authentication
API key
Read-only
No
Destructive
No
Open world
Yes