Skip to main content

Brex

Brex is a modern financial technology platform that provides integrated corporate cards, expense management, travel booking, and payment solutions for businesses, offering streamlined financial operations with advanced analytics and automation capabilities.

Brex icon

Power end-to-end data operations for your Brex API with Nexla. Our bi-directional Brex connector is purpose-built for Brex, making it simple to ingest data, sync it across systems, and deliver it anywhere — all with no coding required. Nexla turns API-sourced data into ready-to-use, reusable data products and makes it easy to send data to Brex or any other destination. With comprehensive monitoring, lineage tracking, and access controls, Nexla keeps your Brex workflows fast, secure, and fully governed.

Features

Type: API

SourceDestination

  • Seamless API Integration: Connect to any endpoint as source or destination without coding, with automatic data product creation
  • Visual Composition & Chaining: Build complex integrations using visual templates, chain API calls, and compose workflows with data validation and filtering
  • API Proxy: Expose curated slices of your data securely with a secure and customizable API proxy that validates and transforms data on the fly
  • Request optimization with intelligent batching, retry, and caching to minimize API calls and costs

Prerequisites

Before creating a Brex credential, you need to register an OAuth 2.0 application in your Brex account and obtain the Client ID and Client Secret. Brex uses OAuth 2.0 with 3-legged authentication (authorization code flow) to securely authenticate API requests.

To set up OAuth 2.0 authentication for Brex:

  1. Create an OAuth Application: Log in to your Brex account and navigate to the Developer Console or API settings section to create a new OAuth application.

  2. Obtain Client Credentials: After creating the OAuth application, you will receive a Client ID and Client Secret. These credentials are used to authenticate with the Brex API.

  3. Configure Redirect URI: Ensure your OAuth application is configured with the appropriate redirect URI for Nexla's OAuth flow.

  4. Select Access Scopes: Determine which access scopes your application needs based on the Brex API endpoints you plan to use. The default scope is users, but you may need additional scopes depending on your use case.

The OAuth 2.0 authorization URL and token URL are pre-configured by Nexla and do not require manual entry. Nexla automatically handles the OAuth 2.0 authorization code flow, including the authorization redirect, token exchange, and token refresh.

Alternatively, Brex supports authentication with a user token generated from your Brex dashboard (Settings > Developer > Create Token). When creating the token, select the users.readonly, departments.readonly, locations.readonly, and referrals scopes required for the endpoints you plan to use.

For detailed information about Brex OAuth 2.0 setup, application registration, and available scopes, refer to the Brex API authentication documentation.

Authenticate

Credentials required

Authenticate using OAuth 2.0 with Brex API for secure access to user, department, location, and referral data

FieldRequiredSecretDescription
Client IDYesYesBrex Client ID
Access ScopeNoNoBrex Access Scope
Client SecretNoYesBrex Client Secret for Token URL

Create a credential in Nexla

  1. After selecting the data source/destination type, click the Add Credential tile to open the Add New Credential overlay.

New Credential Overlay – Brex

BrexCred.png
  1. Enter a name for the credential in the Credential Name field and a short, meaningful description in the Credential Description field.

  2. Enter your Brex OAuth Client ID in the Client ID field. This is the Client ID you obtained from your Brex OAuth application registration. The Client ID is used together with the Client Secret to authenticate and obtain OAuth 2.0 access tokens.

  3. Enter your Brex OAuth Client Secret in the Client Secret field. This is the Client Secret you obtained from your Brex OAuth application registration. The Client Secret is used together with the Client ID to securely authenticate and obtain OAuth 2.0 access tokens.

  4. Enter the access scope for your Brex application in the Access Scope field. This determines which Brex API resources your application can access. The default value is users if not specified. You may need additional scopes depending on the Brex API endpoints you plan to use.

    The Client ID and Client Secret are used for OAuth 2.0 authorization code flow authentication. The credentials are exchanged for an access token using the Brex token endpoint (https://accounts-api.brex.com/oauth2/default/v1/token). The access token is then used in the Authorization: Bearer {token} header for all API requests. Keep your Client Secret secure and do not share it publicly or commit it to version control systems. The OAuth 2.0 authorization URL (https://accounts-api.brex.com/oauth2/default/v1/authorize) and token URL are pre-configured and handled automatically by Nexla. For detailed information about Brex OAuth 2.0 authentication, available scopes, and API access, see the Brex API authentication documentation.

  5. When you create a Brex credential, Nexla will prompt you to authenticate with your Brex account. Follow the OAuth 2.0 authorization prompts to grant Nexla access to your Brex account resources.

    To authenticate with a user token instead of OAuth 2.0, select the User Token (Bearer Token) method and enter the token you generated from your Brex dashboard in the Brex User Token field.

  6. Click the Save button at the bottom of the overlay to save the configured credential. The newly added credential will now appear in a tile on the Authenticate screen during data source/destination creation.

Use as a data source

To create a new data flow, navigate to the Integrate section, and click the New Data Flow button. Select the Brex connector tile, then select the credential that will be used to connect to the Brex instance, and click Next; or, create a new Brex credential for use in this flow.

Endpoint templates

Nexla provides pre-built templates that can be used to rapidly configure data sources to ingest data from common Brex endpoints. Select the endpoint from which this source will fetch data from the Endpoint pulldown menu. Available endpoint templates are listed in the expandable boxes below.

List referrals

This endpoint retrieves a list of referrals created in your Brex account. Note that this endpoint does not include referrals that have expired. Use this endpoint when you need to access referral information for tracking, analysis, or reporting purposes.

  • This endpoint automatically retrieves all active referrals from your Brex account. No additional configuration is required beyond selecting this endpoint template.
  • The endpoint uses GET requests to https://platform.brexapis.com/v1/referrals. The endpoint URL is automatically constructed based on the Brex API base URL.
  • The endpoint uses token-based pagination, automatically fetching additional pages as needed using the next_cursor query parameter. When a response includes a next_cursor field, Nexla automatically includes it in the subsequent request to fetch the next page of results.
  • The endpoint will return all active referrals in your account. The response data is extracted from the items array in the API response ($.items[*]), with each referral record processed individually.

This endpoint supports pagination through the next_cursor token mechanism. When a response includes a next_cursor field, Nexla automatically includes it as the next_cursor query parameter in the subsequent request to fetch the next page of results. The endpoint uses token-based pagination (iteration.type: paging.next.token) through the next_cursor mechanism. The response data path is $.items[*], which extracts all items from the items array in the API response. Note that this endpoint does not include expired referrals. For detailed information about retrieving referrals, see the Brex API documentation.

List Users

This endpoint retrieves a list of all users in your Brex account. To find a user ID by email, you can filter using the email query parameter in manual configuration. Use this endpoint when you need to access user information for team management, access control, or user analysis.

  • This endpoint automatically retrieves all users from your Brex account. No additional configuration is required beyond selecting this endpoint template.
  • The endpoint uses GET requests to https://platform.brexapis.com/v2/users. The endpoint URL is automatically constructed based on the Brex API base URL.
  • The endpoint uses token-based pagination, automatically fetching additional pages as needed using the next_cursor query parameter. When a response includes a next_cursor field, Nexla automatically includes it in the subsequent request to fetch the next page of results.
  • The endpoint will return all users in your account. The response data is extracted from the items array in the API response ($.items[*]), with each user record processed individually.

This endpoint supports pagination through the next_cursor token mechanism. When a response includes a next_cursor field, Nexla automatically includes it as the next_cursor query parameter in the subsequent request to fetch the next page of results. The endpoint uses token-based pagination (iteration.type: paging.next.token) through the next_cursor mechanism. The response data path is $.items[*], which extracts all items from the items array in the API response. You can filter users by email address using the email query parameter in manual configuration. For detailed information about retrieving users, see the Brex API documentation.

Once the selected endpoint template has been configured, click the Test button to the right of the endpoint selection menu to retrieve a sample of the data that will be fetched. Sample data will be displayed in the Endpoint Test Result panel on the right, allowing you to verify that the source is configured correctly before saving.

Manual configuration

Brex data sources can also be manually configured to ingest data from any valid Brex API endpoint not covered by the pre-built templates, including chained API calls that fetch data from multiple endpoints or sources that require custom request parameters. Select the Advanced tab at the top of the configuration screen, and follow the instructions in Connect to Any API to configure the API method, endpoint URL, path to data, and other settings.

Brex API endpoints typically follow the pattern https://platform.brexapis.com/v{version}/{endpoint_path} and require Bearer token authentication in the Authorization header, which is handled automatically by your credential configuration. Brex API responses typically use an items array to contain the data, so set the path to data to $.items[*]. For detailed information about Brex API endpoints and available APIs, see the Brex API documentation.

Once all of the relevant settings have been configured, click the Create button in the upper right corner of the screen to save and create the new Brex data source. Nexla will now begin ingesting data from the configured endpoint and will organize any data that it finds into one or more Nexsets.

Use as a destination

Click the + icon on the Nexset that will be sent to the Brex destination, and select the Send to Destination option from the menu. Select the Brex connector from the list of available destination connectors, then select the credential that will be used to connect to the Brex organization, and click Next; or, create a new Brex credential for use in this flow.

Endpoint templates

Nexla provides pre-built templates that can be used to rapidly configure destinations to send data to common Brex endpoints. Select the endpoint to which data will be sent from the Endpoint pulldown menu. Then, click on the template in the list below to expand it, and follow the instructions to configure additional endpoint settings.

Creates a referral

This endpoint creates new referrals in your Brex account. The response will contain an identifier and a unique personalized link to an application flow. Use this endpoint when you need to create referral links for onboarding new customers or partners.

  • The endpoint uses POST requests to https://platform.brexapis.com/v1/referrals. The endpoint URL is automatically constructed based on the Brex API base URL.
  • The endpoint sends data from your Nexset as the request body in JSON format. Each record in your Nexset will be sent as a JSON object containing the referral data to create. The request body should follow the Brex API specification for creating referrals, including required fields and field names.
  • Batch mode is disabled by default for this endpoint. Each record in your Nexset will be sent as a separate API request to create a referral. If you need to create multiple referrals, you can send multiple records, but each will be processed as a separate request.

The request body must be properly formatted JSON that matches the Brex API specification for creating referrals. The endpoint requires Bearer token authentication in the Authorization header, which is handled automatically by your credential configuration. The Content-Type: application/json header is automatically included in requests. Batch mode is disabled by default (batch.mode: false), so each record will be sent as a separate request. The response will contain a referral identifier and a unique personalized link to an application flow. For detailed information about creating referrals, including required fields, field names, and request formats, see the Brex API documentation.

Invite user

This endpoint invites a new user as an employee in your Brex account. To update a user's role, you will need to use a different endpoint. Use this endpoint when you need to invite new team members or employees to your Brex account.

  • The endpoint uses POST requests to https://platform.brexapis.com/v2/users. The endpoint URL is automatically constructed based on the Brex API base URL.
  • The endpoint sends data from your Nexset as the request body in JSON format. Each record in your Nexset will be sent as a JSON object containing the user data to create. The request body should follow the Brex API specification for creating users, including required fields and field names.
  • Batch mode is disabled by default for this endpoint. Each record in your Nexset will be sent as a separate API request to invite a user. If you need to invite multiple users, you can send multiple records, but each will be processed as a separate request.

The request body must be properly formatted JSON that matches the Brex API specification for creating users. The endpoint requires Bearer token authentication in the Authorization header, which is handled automatically by your credential configuration. The Content-Type: application/json header is automatically included in requests. Batch mode is disabled by default (batch.mode: false), so each record will be sent as a separate request. To update a user's role after creation, you will need to use a different Brex API endpoint. For detailed information about inviting users, including required fields, field names, and request formats, see the Brex API documentation.

Manual configuration

Brex destinations can also be manually configured to send data to any valid Brex API endpoint not covered by the pre-built templates. Select the Advanced tab at the top of the configuration screen, and follow the instructions in Connect to Any API to configure the API method, data format, endpoint URL, request headers, and request body. Using manual configuration, you can also configure Nexla to automatically send the response received from the Brex API after each call to a new Nexla webhook data source.

The Brex API primarily uses POST requests with JSON request bodies. Brex API endpoints typically follow the pattern https://platform.brexapis.com/v{version}/{endpoint_path} and require Bearer token authentication in the Authorization header, which is handled automatically by your credential configuration; the Content-Type: application/json header is typically set automatically for JSON request bodies. You do not need to include any headers already present in the credentials. For detailed information about Brex API endpoints and available APIs, see the Brex API documentation.

Save & activate

Once all configuration steps have been completed, click the Save button to save your destination configuration. The destination will now be available in your data flow and will begin sending data to the Brex endpoint according to the configured settings.