> ## Documentation Index
> Fetch the complete documentation index at: https://klef.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Expensify User Provisioning & Deprovisioning

> Automate Expensify user provisioning and deprovisioning from your HRIS. Klef creates, updates, and deactivates accounts when HR makes a change.

![](https://mintcdn.com/klef/O1Sswmcb_uCGkmIf/images/connectors/expensify.svg?fit=max\&auto=format\&n=O1Sswmcb_uCGkmIf\&q=85\&s=f927710a88902abeb8f03b399d01c583)

# Expensify

## Connection

### Setup

Klef reaches one Expensify workspace, which Expensify calls a policy, with API credentials an admin of that workspace makes.

**Step 1**

Signed in to Expensify as an admin of the workspace, open [the integrations page](https://www.expensify.com/tools/integrations/) and make credentials. Copy the **partnerUserID** and **partnerUserSecret**, which Expensify shows only once.

**Step 2**

Open the workspace's settings and copy its ID, the 16-character code in the page's address.

**Step 3**

Enter all three in Klef. Add a connection per workspace Klef manages.

Expensify lets these credentials make 20 requests a minute, so Klef works through large changes slowly.

### Settings

| Setting | Required | Description |
| - | - | - |
| Workspace ID | Yes | ID of the Expensify workspace, which Expensify calls a policy, from its settings page. |
| Partner user ID | Yes | The partnerUserID Expensify shows when you make API credentials as an admin of the workspace. |
| Partner user secret | Yes | The partnerUserSecret shown beside it. |

## expensify.member

### Fields

| Field | Type | Required | Description |
| - | - | - | - |
| `email` | string | Yes | Address Expensify invites to the workspace. Never changed once the account exists. |
| `employeeId` | string | Yes | The worker's constant ID, which Expensify uses to notice an email address change, and shows as Custom Field 1. Never changed once the account exists. |
| `role` | enum | | Role in the workspace. Defaults to user. Expensify never demotes the workspace's owner or the account the connector acts as. Values: `user` (User), `auditor` (Auditor), `admin` (Admin). |
| `manager` (Approver) | link to `member` | | Who the member submits reports to, set from the worker's manager. A member whose manager is not in the workspace submits to its owner. |
| `status` | enum | | Whether the person can sign in, the account is kept switched off, or the account is gone. Values: `enabled` (Enabled), `removed` (Removed). |

### Default Account Matching Rules

When Klef [adopts](https://klef.ai/docs/adoption.md) an account that already exists in Expensify, it works out whose it is by trying these in order. A connection can override them.

| Account field | Worker field |
| - | - |
| `email` | `worker.business_email` |

## Examples

### Expensify members

Adds each worker to Expensify with their manager as approver, and removes them when they leave.

```hcl theme={null}
stage active {
  target expensify.member {
    email      = worker.business_email
    employeeId = worker.employee_id
    manager    = worker.manager
    role       = "user"
    status     = enabled
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.