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)curl -X POST https://api.pipedream.com/v1/connect/{project_id}/actions/run \
-H "Content-Type: application/json" \
-H "X-PD-Environment: production" \
-H "Authorization: Bearer {access_token}" \
-d '{
"external_user_id": "{external_user_id}",
"id": "expensify-export-report",
"configured_props": {
"expensify": { "authProvisionId": "apn_xxxxxxx" },
"reportIds": ["Report IDs"],
"startDate": "Start Date"
}
}'// accessToken: mint a short-lived token with the Connect SDK — see the MCP guide
const transport = new StreamableHTTPClientTransport(
new URL("https://remote.mcp.pipedream.net/v3"),
{
requestInit: {
headers: {
Authorization: `Bearer ${accessToken}`,
"x-pd-project-id": "{project_id}",
"x-pd-environment": "production",
"x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
"x-pd-app-slug": "expensify",
},
},
},
)
const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)
const { tools } = await mcp.listTools()
// listTools() hands your model this tool's input schema, so it can
// fill the arguments itself:
const result = await mcp.callTool({
name: "expensify-export-report",
arguments: {
reportIds: ["Report IDs"],
startDate: "Start Date",
},
})SCHEMA
Inputs
Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.
| 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
- Source
- View on GitHub ↗