View as Markdown
Expensify icon

Expensify ACTION

Create Report

Creates a new report with transactions in a user's account. See docs here
  • Action
  • Writes data
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Expensify account once, then configure and run Create 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-create-report",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    expensify: { authProvisionId: "apn_xxxxxxx" },
    employeeEmail: "Employee Email",
    policyId: "Policy ID",
  },
})

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.

Create Report inputs
Property Type Description
employeeEmail Employee Email string
The report will be created in this account.
Required
policyId Policy ID string
The ID of the policy. Run List Policies first to obtain valid IDs.
Optional
reportTitle Report Title string
The title of the report that will be created.
Required
expenses Expenses string[]

The report's expense line items, as an array of strings where each array element is a JSON string describing one expense (do NOT pass raw JSON objects — each item must be a JSON-encoded string).

Each expense has these required fields:

  • date: the expense date (format yyyy-mm-dd)
  • currency: three-letter currency code (e.g. "USD", "EUR", "CAD")
  • merchant: the merchant name
  • amount: the amount in integer cents (e.g. 2500 = $25.00)

Example (array of two JSON strings):

[
  "{\"date\":\"2024-01-15\",\"currency\":\"USD\",\"merchant\":\"Hotel ABC\",\"amount\":15000}",
  "{\"date\":\"2024-01-16\",\"currency\":\"USD\",\"merchant\":\"Restaurant XYZ\",\"amount\":5000}"
]
Required
reportFields Report Fields object

Custom fields for the report as a JSON object. Use this to set values for custom report fields in your Expensify policy.

  • Key format: Field names should have all non-alphanumerical characters replaced with underscores (_)
  • Value format: String values for the corresponding field

Example:

{
  "reason_of_trip": "Business meetings with clients",
  "employees": "3",
  "department": "Sales",
  "project_code": "PROJ_2024_001"
}
Optional

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-create-report
Version
0.0.5
App
Expensify
Authentication
API key
Read-only
No
Destructive
No
Open world
Yes