# Linking Brex as a source - Docs

![](https://res.cloudinary.com/dmukukwp6/image/upload/texture_tan_9608fcca70)

![](https://res.cloudinary.com/dmukukwp6/image/upload/texture_tan_dark_a92b0e022d)

Let AI connect your sources for you

Skip the manual setup — run this in your project and the wizard auto-detects your databases and APIs and connects them to PostHog.

`npx @posthog/wizard warehouse`

[Learn more](/wizard.md)

![PostHog Wizard hedgehog](https://res.cloudinary.com/dmukukwp6/image/upload/wizard_3f8bb7a240.png)

**Alpha release**

This source is currently in **alpha**. The interface and available tables may change.

The Brex connector syncs your spend data – card and cash transactions, expenses, users, departments, locations, vendors, and budgets – into PostHog.

## Adding a data source

1.  Go to the [sources tab](https://app.posthog.com/data-management/sources) of the data pipeline section in PostHog.
2.  Click **\+ New source** and then click **Link** next to Brex.
3.  Next, you need an API user token from Brex. In your [Brex dashboard](https://dashboard.brex.com/settings/developer) under **Settings** > **Developer**, create a new token. Grant read access to the scopes for the data you want to sync: Transactions and Accounts, Expenses, Team, Payments, and Budgets.
4.  Back in PostHog, enter your token in the **API user token** field and click **Next**.
5.  Select the tables you want to sync, set the sync method and frequency, then click **Import**.

Once the syncs are complete, you can start using Brex data in PostHog.

**Token expiration**

Brex API user tokens expire after 90 days without API activity. If your syncs start failing with authentication errors, generate a new token in your Brex dashboard and reconnect the source.

## Available tables

| Table | Description | Sync method |
| --- | --- | --- |
| card_transactions | Card transactions on your primary card account | Incremental |
| cash_transactions | Cash transactions across all cash accounts | Incremental |
| expenses | Expenses submitted in Brex | Incremental |
| users | Users in your Brex account | Full refresh |
| departments | Departments in your organization | Full refresh |
| locations | Locations in your organization | Full refresh |
| vendors | Vendors in your Brex account | Full refresh |
| budgets | Budgets configured in Brex | Full refresh |

**Incremental** tables sync only new or updated records on each run. **Full refresh** tables reload all data on each sync.

## Configuration

| Option | Type | Required |
| --- | --- | --- |
| API user token | password | Yes |

## Supported tables

| Table | Description | Sync method | Incremental field | Primary key |
| --- | --- | --- | --- | --- |
| card_transactions | A transaction on a Brex card — a purchase, refund, or other movement on the primary card account. | Incremental, Full refresh | posted_at_date | — |
| cash_transactions | A transaction on a Brex cash account — a deposit, withdrawal, or transfer. | Incremental, Full refresh | posted_at_date | — |
| expenses | An expense in Brex — a recorded spend item with receipts, status, and accounting details. | Incremental, Full refresh | updated_at | — |
| users | A user (employee) in the Brex account. | Full refresh | — | — |
| departments | A department defined in the Brex account for organizing users and budgets. | Full refresh | — | — |
| locations | A physical location defined in the Brex account for organizing users and budgets. | Full refresh | — | — |
| vendors | A vendor (payee) configured in Brex for bill payments. | Full refresh | — | — |
| budgets | A budget in Brex that controls and tracks spend for a group or purpose. | Full refresh | — | — |

### Community questions

Ask a question

### Was this page useful?

HelpfulCould be better